<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>{:web=&gt;:wxianfeng}</title>
    <link>http://wxianfeng.com</link>
    <atom:link type="application/rss+xml" href="http://wxianfeng.com/articles.rss" rel="self"/>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>/dev/web/wxianfeng</description>
    <item>
      <title>&#40657;&#20013;&#20171; &#21271;&#20140;&#22307;&#20016;&#22320;&#20135;</title>
      <description>&lt;p&gt;&#26368;&#36817;&#26497;&#20854;&#19981;&#39034;,&#24515;&#24773;&#19981;&#22909;,iphone &#25163;&#26426;&#22312;&#21170;&#26494;&#19978;&#20844;&#20132;&#26102;&#25163;&#26426;&#34987;&#20599;&#20102;,&#28982;&#21518;&#21448;&#26159;&#31199;&#25151;,&#19968;&#22825;&#36824;&#27809;&#20303; &#23601;&#34987;&#39575;&#20102; 3500&#20803;&#65292;&#36825;&#23601;&#26159;&#21271;&#20140;&#22307;&#20016;&#22320;&#20135;!!!&lt;/p&gt;
&lt;p&gt;&#22312;&#32593;&#19978;&#38543;&#20415;&#25628;&#32034;&#19979;&#65292;&#21457;&#29616;&#36825;&#23478;&#20844;&#21496;&#30340;&#21475;&#30865;&#23454;&#22312;&#26159;&#24046;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.baidu.com/s?wd=%B1%B1%BE%A9%CA%A5%B7%E1%B5%D8%B2%FA&amp;rsv_bp=0&amp;rsv_spt=3&amp;inputT=7568&quot;&gt;&lt;span class=&quot;caps&quot;&gt;HERE&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#21465;&#36848;&#19979;&#20107;&#24773;&#32463;&#36807;:&lt;/p&gt;
&lt;p&gt;&#26159;&#22312; &#36214;&#38598;&#32593;&#19978; &#25214;&#30340;&#25151;&#23376; , &#22312;&#23433;&#36126;&#38376;&#22320;&#38081;&#31449;&#38468;&#36817;,&#24403;&#26102;&#21435;&#30475;&#30340;&#26102;&#20505; &#65292; &#30475;&#30528;&#25151;&#23376;&#19981;&#38169; &#65292; &#24456;&#22823;&#65292; &#20063;&#25402;&#26032;&#30340;&#25151;&#23376;&#65292;&#31199;&#20102;&#22235;&#38388;&#20013;&#30340;&#19968;&#38388;,&#24403;&#26102;&#23601;&#20132;&#20102;&#23450;&#37329;500&#65292;&#24403;&#26102;&#26159;&#21069;&#19968;&#21608;&#30340; &#26143;&#26399;&#20845;,&#23450;&#30340;&#26102;&#38388;&#26159; &#19979;&#21608;4&#20132;&#25151;&#31199;&lt;/p&gt;
&lt;p&gt;&#21608;&#22235;&#21040;&#20102; &#65292; &#20197;&#20026;&#26202;&#19978;&#19978;&#29677;&#65292; &#25152;&#20197;&#25105;&#30693;&#36947;&#21608;&#22235;&#26202;&#19978;&#25165;&#25171;&#30005;&#35805;&#36807;&#21435; &#65292; &#25171;&#36807;&#21435; &#35828;&#25105; &#36829;&#32422;&#65292; &#28982;&#21518;&#25171;&#30005;&#35805; &#32473;&#36825;&#20010;&#19994;&#21153;&#21592;&#32463;&#29702; &#32463;&#29702;&#21516;&#24847;&#20102;&#25105; &#21608;&#20845;&#36807;&#21435;&#20132;.&lt;/p&gt;
&lt;p&gt;&#21608;&#20845;&#21040;&#20102; &#65292; &#25105;&#36807;&#21435;&#20132;&#20102; &#20840;&#37096;&#30340; 3500 &#20803; &#65292; &#35201;&#38053;&#21273; &#65292; &#35828;&#22312;&#38376;&#19978;&#20102; &#65292; &#25105;&#21040;&#20102; &#31199;&#20303;&#22788; &#65292; &#27492;&#26102;&#25105;&#36824;&#27809;&#25644;&#36807;&#26469; &#65292; &#37324;&#38754;&#30340;&#19968;&#25143;&#31199;&#25143; &#21578;&#35785;&#25105;&#36825;&#37324;&#19981;&#33021;&#20303;&#20102; &#65292; &#35828;&#20182;&#20204;&#20063;&#37117;&#26377;&#25644;&#36208;&#20102; &#65292; &#25105;&#38382;&#20026;&#20160;&#20040;&#65292; &#20182;&#35828; &#25151;&#19996;&#19981;&#32473;&#20303;&#65292; &#19981;&#19968;&#20250;&#25151;&#19996;&#26524;&#30495;&#36807;&#26469;&#20102; &#12290;&#12290;&lt;/p&gt;
&lt;p&gt;&#25151;&#19996;&#19981;&#32473; &#25151;&#23376;&#37324;&#30340;&#20219;&#20309;&#31199;&#25143;&#20303;&#65292; &#20572;&#30005;&#65292; &#20572;&#27700;&#65292; &#20572;&#29123;&#27668; &#65292; &#36825;&#26159; &#24590;&#20040;&#22238;&#20107; &#65311;&#12290;&#12290; &#25151;&#19996;&#35828; &#22240;&#20026;&#20182;&#20204;&#21644; &#20013;&#20171;&#20063;&#21457;&#29983;&#20102; &#20914;&#31361;&#65292; &#20914;&#31361;&#30340;&#21407;&#22240;&#26159; &#65292; &#21407;&#26412;&#25151;&#23376;&#31199;&#32473;&#20013;&#20171; &#26159;&#19981;&#32473;&#25171;&#38548;&#26029;&#30340; &#65292; &#20294;&#26159;&#29616;&#22312;&#34987;&#20013;&#20171;&#25171;&#20102;&#38548;&#26029;&#65292; &#25152;&#20197;&#25151;&#19996;&#29983;&#27668;&#20102; &#12290; &#33267;&#20110;&#20107;&#24773;&#30495;&#20551; &#19981;&#24471;&#32780;&#30693;.&lt;/p&gt;
&lt;p&gt;&#27425;&#22825;&#65292;&#25105;&#21435;&#20013;&#20171;&#35201;&#25151;&#31199; &#65292; &#19968;&#36827;&#38376; &#25105;&#23601;&#35828;&#20182;&#20204;&#21643;&#39575; &#65292; &#22240;&#20026;&#22312;&#25105; &#20132;3500 &#20803;&#38065;&#20043;&#21069;&#65292; &#22240;&#20026;&#25151;&#19996;&#21644;&#20013;&#20171;&#24050;&#32463;&#21457;&#29983;&#20102; &#32416;&#32439;&#65292; &#20294;&#26159;&#20013;&#20171;&#36824;&#26159;&#25910;&#20102;&#25105;&#30340; 3500 &#20803;&#65292; &#25805;&#65292; &#36196;&#35064;&#35064;&#30340; &#21643;&#39575;&#21834;&lt;/p&gt;
&lt;p&gt;&#20132;&#28041;&#20102;&#20250; &#65292; &#20013;&#20171;&#27515;&#27963;&#19981;&#36864;&#38065;&#65292; &#35828;&#25105;&#36829;&#32422; &#65292; &#35201;&#25187;&#25105; &#25151;&#31199; * 2 = 2000&#20803;&#30340;&#38065;&#65292; &#25805;&#65292; &#25105;&#19968;&#22825;&#27809;&#20303;&#65292; &#20917;&#19988;&#20063;&#19981;&#35753;&#25105;&#20303;&#65292; &#24590;&#20040;&#23601;&#21464;&#25104;&#25105;&#36829;&#32422;&#20102;!!!&lt;/p&gt;
&lt;p&gt;&#20043;&#21518;&#25214;&#20102; &#24456;&#22810;&#32500;&#26435;&#36884;&#24452;&#65306;&lt;/p&gt;
&lt;p&gt;1&#12290;&#25253;&#20102;&#26696;&#65292; &#35686;&#23519;&#19981;&#31649;&#65292; &#35828;&#27809;&#25171;&#26550; &#65292; &#20182;&#31649;&#19981;&#30528; &#65292; &#20294;&#26159;&#35686;&#23519;&#32473;&#20102;&#25105;&#24314;&#35758; &#65292;&#28040;&#36153;&#32773;&#21327;&#20250;&#65292;&#27861;&#38498;&#36215;&#35785;&lt;br /&gt;
2&#12290;&#25171;&#20102;BTV &#26032;&#38395;&#28909;&#32447; &#65292; &#35828;&#35201;&#31561;&#19978;&#32423;&#23457;&#25209;&#65292;&#21518;&#26469;&#19968;&#30452;&#27809;&#28040;&#24687;&#65292;&#23457;&#25209;&#20320;&#22969;&#21834; &lt;br /&gt;
3&#65292;&#28040;&#36153;&#32773;&#21327;&#20250; &#65292; &#26143;&#26399;&#22825;&#21435;&#37027;&#22825; &#19981;&#19978;&#29677;&#65292; &#21608;&#19968;&#35831;&#20102;&#20551;&#29305;&#24847;&#21435;&#20102;&#36255; &#65292; &#32467;&#26524;&#21578;&#30693; &#65292; &#24403;&#22825;&#19981;&#19968;&#23450;&#33021;&#22788;&#29702;&#65292;&#22240;&#20026;&#20256;&#21796;&#37027;&#20010;&#20013;&#20171; &#65292; &#20013;&#20171;&#19981;&#36807;&#26469;&#20154; &#65292; &#27809;&#25240;&lt;br /&gt;
4&#65292;&#27861;&#38498;&#36215;&#35785;&#65292; &#21672;&#35810;&#20102;&#24459;&#24072;&#65292;&#36215;&#35785;&#24456;&#40635;&#28902;&#65292; &#31639;&#20102; &#65292;&#36825;&#28857;&#38065;&#19981;&#20540;&#24471;&#12290;&#12290;&#12290;&lt;/p&gt;
&lt;p&gt;&#26368;&#21518;&#36824;&#26159;&#20146;&#33258;&#19978;&#39532;&#65292; &#26368;&#21518;&#21644;&#37324;&#38754;&#19968;&#20010;&#19994;&#21153;&#21592;&#20877;&#19977;&#20132;&#28041;&#65292; &#36864;&#20102;&#25105; 2500 &#65292; &#25187;&#20102;&#25105; 1200 &#65292; &#20294;&#26159;&#19994;&#21153;&#21592;&#21435;&#36130;&#21153;&#32467;&#36134;&#30340;&#26102;&#20505;&#65292;&#31455;&#28982;&#25187;&#30340;&#19981;&#26159; 1200 &#65292; &#25187;&#20102; 1000 &#65292; &#22240;&#20026;&#19994;&#21153;&#21592;&#35753;&#25187;1000&#65292; &#19994;&#21153;&#21592; &#33258;&#30041; 200 &#65292; &#38752;&#65292; &#22810;&#40657;&#30340;&#20013;&#20171;&#21834; &#12290;&#12290;&#12290;&lt;/p&gt;
&lt;p&gt;&#24076;&#26395;&#30475;&#21040;&#36825;&#32534;&#25991;&#31456;&#30340;&#20154; &#65292; &#19968;&#23450;&#19981;&#33021;&#19978;&#20102; &#36825;&#23478;&#40657;&#20013;&#20171;&#30340;&#34507;&#65292;&#21592;&#24037;&#20840;&#37096;&#26159;&#19996;&#21271;&#20154;&#65292;&#25991;&#21270;&#20302;&#65292;&#32032;&#36136;&#24046;&#65292;&#20197;&#39575;&#20026;&#29983;&#65292;&#21512;&#21516;&#19978;&#38169;&#21035;&#23383;&#24456;&#22810;&#65292;&#20889;&#23383;&#20687;&#19977;&#23681;&#23567;&#23401;&#30340;&#23383;,&#24403;&#26102;&#26126;&#30830;&#36319;&#25105;&#35828; &#65292; &#25105;&#20204;&#23601;&#26159;&#19968;&#23478;&#40657;&#20013;&#20171;&#65292; &#20320;&#24819;&#24590;&#20040;&#30528;&#23601;&#24590;&#20040;&#30528;&#21543; &#65292; &#26377;&#20160;&#20040;&#25307;&#30340;&#35805;&#37117;&#20351;&#20986;&#26469;&#21543;&#65292;&#25105;&#26377;&#26538;&#30340;&#35805; &#65292; &#19968;&#23450;&#27609;&#20102;&#36825;&#33324;&#30044;&#29298;!!!&lt;/p&gt;
&lt;p&gt;&#20132;&#28041;&#30340;&#20960;&#22825;&#65292;&#25293;&#20102;&#20960;&#24352;&#35813;&#20013;&#20171;&#30340;&#29031;&#29255;&#65292;&#22823;&#23478;&#30475;&#20934;&#20102;:&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/12/30/beijing-shengfeng'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 30 Dec 2011 10:32:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:7159de0f-c5f2-470e-99ff-834ddc2eae74</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/12/30/beijing-shengfeng#comments</comments>
      <category>Life</category>
      <category>&#40657;&#20013;&#20171;</category>
      <category>&#22307;&#20016;&#22320;&#20135;</category>
      <category>&#21271;&#20140;</category>
      <category>&#31199;&#25151;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=223</trackback:ping>
      <link>http://wxianfeng.com/2011/12/30/beijing-shengfeng</link>
    </item>
    <item>
      <title>&#28216;&#29609; &#23487;&#36801;&#39558;&#39532;&#28246;&#22253;&#21338;&#22253;</title>
      <description>&lt;p&gt;2011&#22269;&#24198; &#28216;&#29609;&#32769;&#23478; &#39558;&#39532;&#28246; &#22253;&#21338;&#22253;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291610600/&quot; title=&quot;IMG_3801 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6230/6291610600_fed64bf5e3.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;IMG_3801&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#22823;&#40718;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291611234/&quot; title=&quot;IMG_3867 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6102/6291611234_0fc7f490bb.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;IMG_3867&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#33457;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291610468/&quot; title=&quot;IMG_3806 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6040/6291610468_6523077c1c.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;IMG_3806&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#21335;&#20140;&#23637;&#22253;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291090447/&quot; title=&quot;IMG_3933 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6223/6291090447_81212bbb04.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_3933&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#33457;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291606826/&quot; title=&quot;IMG_3652 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6220/6291606826_38af72c230.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_3652&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#39558;&#39532;&#28246;&#21608;&#36793;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291086519/&quot; title=&quot;IMG_0769 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6036/6291086519_5d1bc0df0f.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_0769&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#39558;&#39532;&#28246;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291089485/&quot; title=&quot;IMG_3926 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6059/6291089485_3e481eb34e.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_3926&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#22253;&#21338;&#22253;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291608842/&quot; title=&quot;IMG_3786 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6211/6291608842_416a3851b6.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_3786&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#26085;&#26412;&#27801;&#38613;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291088267/&quot; title=&quot;IMG_3737 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6092/6291088267_89f6f2d7cb.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_3737&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#39558;&#39532;&#28246;&#28216;&#33337;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/6291088069/&quot; title=&quot;IMG_3728 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6034/6291088069_fc67fe1883.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;IMG_3728&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#39558;&#39532;&#28246;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/sets/72157628003362738/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MORE&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/10/29/suqian'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 29 Oct 2011 09:33:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:92982e40-ae1e-4d31-91b8-664d7155bcd5</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/10/29/suqian#comments</comments>
      <category>Trip</category>
      <category>&#23487;&#36801;</category>
      <category>&#26053;&#28216;</category>
      <category>&#22253;&#21338;&#22253;</category>
      <category>&#39558;&#39532;&#28246;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=222</trackback:ping>
      <link>http://wxianfeng.com/2011/10/29/suqian</link>
    </item>
    <item>
      <title>passenger &#37096;&#32626;Rails&#39033;&#30446;&#21518;&#19981;&#20889;log</title>
      <description>&lt;p&gt;&#26368;&#36817;&#37096;&#32626;&#19968;&#20010;&#39033;&#30446;,&#37319;&#29992;&#30340;&#26159;centos +  nginx+ passenger&lt;/p&gt;
&lt;p&gt;&#21457;&#29616;rails project&#19981;&#25171;log, &#26159;&#25991;&#20214;&#26435;&#38480;&#38382;&#39064;&#65292;passenger &#35268;&#23450;&#25991;&#20214;&#26435;&#38480;&#19981;&#33021;&#26159;root &#65292;&#22914;&#26524;&#20320;&#37096;&#32626;&#22312;ubuntu&#23601;&#19981;&#20250;&#26377;&#36825;&#20010;&#38382;&#39064;&lt;/p&gt;
&lt;p&gt;passenger&#20856;&#22411;&#37096;&#32626;&#32467;&#26500;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;lecai-
       |-- current
       |-- releases
       |-- shared&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25226;&#26681;&#30446;&#24405;lecai&#30340;&#26435;&#38480;&#25913;&#20102;&#21363;&#21487;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;useradd deploy
&amp;gt;chown -&lt;span class=&quot;co&quot;&gt;R&lt;/span&gt; deploy&lt;span class=&quot;sy&quot;&gt;:deploy&lt;/span&gt; lecai&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/10/24/passenger-log'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 24 Oct 2011 13:15:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:4b1d5f38-72c9-4e1f-b557-fe5396dbae29</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/10/24/passenger-log#comments</comments>
      <category>Rails</category>
      <category>passenger</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=221</trackback:ping>
      <link>http://wxianfeng.com/2011/10/24/passenger-log</link>
    </item>
    <item>
      <title>Mac install phpmyadmin</title>
      <description>&lt;p&gt;&#29615;&#22659;:mac ox x lion&lt;/p&gt;
&lt;p&gt;&#21457;&#29616;&#27599;&#27425;&#23433;&#35013;phpmyadmin&#37117;&#29305;&#21035;&#22353;&#29241;,windows , ubuntu , centos,mac &#37117;&#19981;&#19968;&#26679;,&#36825;&#27425;&#26159;mac&#19978;&#23433;&#35013; phpmyadmin,&#20043;&#21069;&#30340;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://wxianfeng.com/2010/06/28/windows-install-phpmyadmin&quot;&gt;windows&lt;/a&gt; , &lt;a href=&quot;http://wxianfeng.com/2010/07/08/centos-5-5-php-phpmyadmin&quot;&gt;centos&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;apache,php &#40664;&#35748;&#26159;&#23433;&#35013;&#30340;&lt;/p&gt;
&lt;p&gt;1&#65292;&#39318;&#20808; &#36827;&#20837; &#31995;&#32479;&#20559;&#22909;&#35774;&#32622; -&#12299; &#20849;&#20139; -&#12299; web&#20849;&#20139; &#25171;&#24320;&lt;/p&gt;
&lt;p&gt;2&#65292;&#26597;&#30475;&#29256;&#26412;&#65306;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;localhost&lt;span class=&quot;sy&quot;&gt;:entos&lt;/span&gt; wangxianfeng&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; /usr/sbin/httpd -v
&lt;span class=&quot;co&quot;&gt;Server&lt;/span&gt; version: &lt;span class=&quot;co&quot;&gt;Apache&lt;/span&gt;/&lt;span class=&quot;fl&quot;&gt;2.2&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; (&lt;span class=&quot;co&quot;&gt;Unix&lt;/span&gt;)
&lt;span class=&quot;co&quot;&gt;Server&lt;/span&gt; built: &lt;span class=&quot;co&quot;&gt;Jun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;16&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2011&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;22&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;09&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;54&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25110;&#32773;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;sy&quot;&gt;:system&lt;/span&gt; wangxianfeng&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; apachectl -v
&lt;span class=&quot;co&quot;&gt;Server&lt;/span&gt; version: &lt;span class=&quot;co&quot;&gt;Apache&lt;/span&gt;/&lt;span class=&quot;fl&quot;&gt;2.2&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; (&lt;span class=&quot;co&quot;&gt;Unix&lt;/span&gt;)
&lt;span class=&quot;co&quot;&gt;Server&lt;/span&gt; built: &lt;span class=&quot;co&quot;&gt;Jun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;16&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2011&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;22&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;09&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;54&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26597;&#30475;php&#29256;&#26412;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;php -v&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3&#65292;&#24320;&#21551;apache&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;sudo apachectl stop | start | restart | status&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;4&#65292;&#19979;&#36733;phpmyadmin&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;http&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/www.phpmyadmin.net/home_page/downloads.php&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5&#65292;&#25226;&#19979;&#36733;&#30340;phpmyadmin &#25918;&#21040;&#33258;&#24049;&#30340;&#26576;&#20010;&#30446;&#24405;&#19979; &#65292;&#25105;&#30340;&#36335;&#24452;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/system/phpMyAdmin-&lt;span class=&quot;fl&quot;&gt;3.4&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;-all-languages&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;6,&#20462;&#25913;phpmyadmin&#37197;&#32622;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;cd &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/system/phpMyAdmin-&lt;span class=&quot;fl&quot;&gt;3.4&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;-all-languages

&amp;gt;cp config.sample.inc.hp config.inc.php

&amp;gt;vim config.inc.php
&lt;span class=&quot;gv&quot;&gt;$cfg&lt;/span&gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;blowfish_secret&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;TypeAnything_for_Secure&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;; &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;* YOU MUST FILL IN THIS FOR COOKIE AUTH! *&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;gv&quot;&gt;$cfg&lt;/span&gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Servers&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;][&lt;span class=&quot;gv&quot;&gt;$i&lt;/span&gt;][&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;auth_type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;;  &lt;span class=&quot;c&quot;&gt;# &#24310;&#38271;&#30331;&#24405;&#26102;&#38388;&lt;/span&gt;
&lt;span class=&quot;gv&quot;&gt;$cfg&lt;/span&gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Servers&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;][&lt;span class=&quot;gv&quot;&gt;$i&lt;/span&gt;][&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;127.0.0.1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# &#25226;localhost &#25913;&#20026; 127.0.0.1&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;7&#65292;&#25226;phpmyadmin link&#21040;webserver&#19978;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt; cd  &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Library&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;WebServer&lt;/span&gt;/&lt;span class=&quot;co&quot;&gt;Documents&lt;/span&gt;
&amp;gt;sudo ln -nfs &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/system/phpMyAdmin-&lt;span class=&quot;fl&quot;&gt;3.4&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;-all-languages &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Library&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;WebServer&lt;/span&gt;/&lt;span class=&quot;co&quot;&gt;Documents&lt;/span&gt;/phpmyadmin&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;8,&#24320;&#21551;apache load php&#27169;&#22359;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;vim &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;apache2/httpd.conf
&lt;span class=&quot;c&quot;&gt;# LoadModule php5_module libexec/apache2/libphp5.so &#25226;&#27880;&#37322;&#21435;&#25481;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;9,&#37325;&#21551;apache&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;sudo apachrctl restart&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;10,&#35775;&#38382;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;http&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/localhost/phpmyadmin &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/09/11/mac-install-phpmyadmin'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 11 Sep 2011 01:09:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:bede1f4b-20e6-4350-a3b3-82315f0e5a85</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/09/11/mac-install-phpmyadmin#comments</comments>
      <category>Mac</category>
      <category>mac</category>
      <category>phpmyadmin</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=219</trackback:ping>
      <link>http://wxianfeng.com/2011/09/11/mac-install-phpmyadmin</link>
    </item>
    <item>
      <title>homebrew install imagemagick</title>
      <description>&lt;p&gt;&#29615;&#22659;:mac os x lion &lt;br /&gt;
homebrew&#26159;&#29992;ruby&#20889;&#30340;&#33050;&#26412;&#65292;&#21457;&#29616;&#21644;rvm&#26497;&#20854;&#30456;&#20284;&lt;/p&gt;
&lt;p&gt;&#23433;&#35013; homebrew&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;bin/ruby -e &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(curl -fsSL https://raw.github.com/gist/323731)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#23433;&#35013;imagemagick&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;brew install imagemagick&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#23433;&#35013;&#21040;libtiff &#24211;&#26102; &#20986;&#38169;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;curl: (&lt;span class=&quot;i&quot;&gt;7&lt;/span&gt;) couldn&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;t connect to host
Error: Failure while executing: /usr/bin/curl -f#LA Homebrew&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(Ruby&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1.8.7-249;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Mac&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;OS&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;10.7.1) ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.5.zip -o /Users/wangxianfeng/Library/Caches/Homebrew/libtiff-3.9.5.zip&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;fixed &#65306;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;bin/curl http&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/download2.osgeo.org/libtiff/tiff-&lt;span class=&quot;fl&quot;&gt;3.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;5&lt;/span&gt;.zip -o ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Library&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;Caches&lt;/span&gt;/&lt;span class=&quot;co&quot;&gt;Homebrew&lt;/span&gt;/libtiff-&lt;span class=&quot;fl&quot;&gt;3.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;5&lt;/span&gt;.zip&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20877;&#27425;&#23433;&#35013;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;brew install imagemagick&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26368;&#21518;&#27979;&#35797;&#23433;&#35013;&#25104;&#21151;&#65306;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;sy&quot;&gt;:inono&lt;/span&gt; wangxianfeng&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; convert --version
&lt;span class=&quot;co&quot;&gt;Version&lt;/span&gt;: &lt;span class=&quot;co&quot;&gt;ImageMagick&lt;/span&gt; &lt;span class=&quot;fl&quot;&gt;6.7&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2011&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;09&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Q16&lt;/span&gt; http&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/www.imagemagick.org
&lt;span class=&quot;co&quot;&gt;Copyright&lt;/span&gt;: &lt;span class=&quot;co&quot;&gt;Copyright&lt;/span&gt; (&lt;span class=&quot;co&quot;&gt;C&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;1999&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;2011&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ImageMagick&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Studio&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;LLC&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Features&lt;/span&gt;: &lt;span class=&quot;co&quot;&gt;OpenMP&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21487;&#20197;&#26597;&#30475;&#20986;brew&#23433;&#35013;&#20102;&#19979;&#38754;&#30340;&#24211;&#65306;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;sy&quot;&gt;:inono&lt;/span&gt; wangxianfeng&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; brew list
imagemagick jasper jpeg libtiff little-cms&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;see:&lt;br /&gt;
&lt;a href=&quot;https://github.com/mxcl/homebrew/wiki/installation&quot;&gt;https://github.com/mxcl/homebrew/wiki/installation&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://github.com/mxcl/homebrew/pull/5168&quot;&gt;https://github.com/mxcl/homebrew/pull/5168&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/09/10/homebrew-install-imagemagick'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 10 Sep 2011 10:02:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:922e5e8e-aba7-4d46-8671-e3b56b3cc762</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/09/10/homebrew-install-imagemagick#comments</comments>
      <category>Ruby</category>
      <category>Mac</category>
      <category>ImageMagick</category>
      <category>homebrew</category>
      <category>mac</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=215</trackback:ping>
      <link>http://wxianfeng.com/2011/09/10/homebrew-install-imagemagick</link>
    </item>
    <item>
      <title>git &#22238;&#28378;&#29256;&#26412;</title>
      <description>&lt;p&gt;git &#29256;&#26412;&#20986;&#38169;&#20102;,&#22914;&#20309;&#22238;&#28378;&#21040;&#20043;&#21069;&#26576;&#19968;&#20010;&#29256;&#26412;,&#24605;&#36335;&#26159;&#26412;&#22320;&#22238;&#28378;&#21040;&#20043;&#21069;&#26576;&#20010;&#29256;&#26412;,&#28982;&#21518;&#25226;&#36828;&#31243;&#20998;&#25903;&#21024;&#38500;,&#28982;&#21518;&#20197;&#26412;&#22320;&#30340;&#22238;&#28378;&#29256;&#26412;&#37325;&#26032;&#24314;&#31435;&#20998;&#25903;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#&#26032;&#24314;old_master&#20998;&#25903;&#20570;&#22791;&#20221;   &lt;/span&gt;
&amp;gt;git branch old_master   

&lt;span class=&quot;c&quot;&gt;#push&#21040;&#36828;&#31243;   &lt;/span&gt;
&amp;gt;git push origin old_master&lt;span class=&quot;sy&quot;&gt;:old_master&lt;/span&gt;   

&lt;span class=&quot;c&quot;&gt;#&#26412;&#22320;&#20179;&#24211;&#22238;&#36864;&#21040;&#26576;&#20010;&#29256;&#26412;   &lt;/span&gt;
&amp;gt;git reset --hard baeertasdasdvf

&lt;span class=&quot;c&quot;&gt;#&#21024;&#38500;&#36828;&#31243;&#30340;master&#20998;&#25903;   &lt;/span&gt;
&amp;gt;git push origin &lt;span class=&quot;sy&quot;&gt;:master&lt;/span&gt;   

&lt;span class=&quot;c&quot;&gt;#&#37325;&#26032;&#21019;&#24314;master&#20998;&#25903;   &lt;/span&gt;
&amp;gt;git push origin master  

&lt;span class=&quot;c&quot;&gt;# &#37325;&#26032;clone&#20195;&#30721;&lt;/span&gt;
&amp;gt;git clone git&lt;span class=&quot;er&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;fl&quot;&gt;192.168&lt;/span&gt;.&lt;span class=&quot;fl&quot;&gt;10.201&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:xxx&lt;/span&gt;.git&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/08/21/git-reset'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 21 Aug 2011 12:28:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:e8da3eed-6bc4-4f3e-978d-68a869c5ea22</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/08/21/git-reset#comments</comments>
      <category>Git</category>
      <category>git</category>
      <category>reset</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=213</trackback:ping>
      <link>http://wxianfeng.com/2011/08/21/git-reset</link>
    </item>
    <item>
      <title>Apache &#37197;&#32622;&#22495;&#21517;</title>
      <description>&lt;p&gt;apache &#37197;&#32622;&#22495;&#21517;&lt;/p&gt;
&lt;p&gt;1,&#20351;&#29992;ServerAlias &#23454;&#29616;&#22810;&#22495;&#21517;&#29420;&#31435;&#35775;&#38382;&lt;br /&gt;
2,&#20351;&#29992;Rewrite &#23454;&#29616;&#22495;&#21517;&#36339;&#36716;&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/1109702.js?file=apache_rewrite.conf&quot;&gt;&lt;/script&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/08/04/apache-config-domain'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 04 Aug 2011 12:51:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:17b50da7-b355-4bca-9d49-ec518903a7a3</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/08/04/apache-config-domain#comments</comments>
      <category>Apache</category>
      <category>apache</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=212</trackback:ping>
      <link>http://wxianfeng.com/2011/08/04/apache-config-domain</link>
    </item>
    <item>
      <title>&#21271;&#20140; 798 Ruby/Rails &#27963;&#21160;</title>
      <description>&lt;p&gt;&#26102;&#38388;: 2011-07-24&lt;br /&gt;
&#25910;&#33719;:&lt;br /&gt;
&#21457;&#29616;&#21271;&#20140;ROR&#30340;&#20844;&#21496;&#19981;&#26159;&#19968;&#33324;&#30340;&#22810;,&#31614;&#21040;&#21333;&#19978;&#30475;&#21040;N&#22810;&#20844;&#21496;,&#25216;&#26415;&#19978;&#27809;&#26377;&#22826;&#22823;&#25910;&#33719;,&#37117;&#26159;&#20171;&#32461;&#24615;&#30340;,&#27809;&#26377;&#23454;&#25112;&#24615;&#30340;,&#20869;&#23481;&#20027;&#35201;&#28041;&#21450;:&lt;a href=&quot;http://www.mirah.org/&quot;&gt; mirah&lt;/a&gt; , &lt;a href=&quot;http://www.mongodb.org/&quot;&gt;Mongodb&lt;/a&gt;,&lt;a href=&quot;http://www.erlang.org/&quot;&gt;Erlang&lt;/a&gt;,&lt;a href=&quot;https://github.com/intridea/grape&quot;&gt;Grape&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#36827;&#31243;:&lt;a href=&quot;http://www.surveymonkey.com/s/MSY2L7T&quot;&gt;http://www.surveymonkey.com/s/MSY2L7T&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PS : 798 &#24456;&#22909;&#29609;,&#24456;&#26377;&#33402;&#26415;&#29305;&#33394;&lt;/p&gt;
&lt;p&gt;&#29616;&#22330;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989950472/&quot; title=&quot;093 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6144/5989950472_fe77d0a448.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;093&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;798 &#20837;&#21475;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989381139/&quot; title=&quot;059 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6029/5989381139_9298a6a324.jpg&quot; width=&quot;490&quot; height=&quot;368&quot; alt=&quot;059&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ruby&#27963;&#21160;&#22320;&#26041;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989380455/&quot; title=&quot;054 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6125/5989380455_197c74393f.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;054&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Rails rumble &#21019;&#22987;&#20154;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989937018/&quot; title=&quot;049 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6024/5989937018_7b34cdd3f3.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;049&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#29616;&#22330;job board&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989383239/&quot; title=&quot;067 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6021/5989383239_b1c660f65a.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;067&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#29616;&#22330;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989939694/&quot; title=&quot;061 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6003/5989939694_3460940edd.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;061&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#28165;&#19968;&#33394;&#32769;&#22806;,&#28165;&#19968;&#33394;Mac&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989938970/&quot; title=&quot;056 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6001/5989938970_e1375564c7.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;056&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#20171;&#32461;Mirah&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989935886/&quot; title=&quot;045 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6002/5989935886_b620c59554.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;045&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;798&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989946944/&quot; title=&quot;083 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6123/5989946944_5ea3dff6f1.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;083&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;798&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5989935278/&quot; title=&quot;043 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6147/5989935278_60f5315ab3.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;043&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;798&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/sets/72157627313072716/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MORE&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/07/30/beijing-798-ruby'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 30 Jul 2011 02:36:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:98cbd869-ca77-4b77-9da6-a2d4883f4f87</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/07/30/beijing-798-ruby#comments</comments>
      <category>Ruby</category>
      <category>&#21271;&#20140;</category>
      <category>798</category>
      <category>ruby</category>
      <category>rails</category>
      <category>&#27963;&#21160;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=211</trackback:ping>
      <link>http://wxianfeng.com/2011/07/30/beijing-798-ruby</link>
    </item>
    <item>
      <title>shell &#25991;&#20214; &#25554;&#20837;&#34892;</title>
      <description>&lt;p&gt;&#19968;&#20010;rails2.x &#30340;&#39033;&#30446;&#65292;&#38656;&#35201;&#36801;&#31227;&#21040;rails3.x , ruby 1.9.2&#30340;&#32534;&#30721;&#38382;&#39064;,&#38656;&#35201;&#22312;rb&#25991;&#20214;&#22836;&#28155;&#21152;&#25351;&#23450;&#32534;&#30721;, &#24120;&#35265;&#25351;&#23450;&#26041;&#24335;&#22914;&#19979;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#coding:utf-8&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#encoding:utf-8&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# -*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# -*- encoding: utf-8 -*-&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#37027;&#20040;&#22810;rb&#25991;&#20214;&#24635;&#19981;&#33021;&#19968;&#20010;&#19968;&#20010;&#21152;&#21543;,&#20889;&#20010;shell&#35299;&#20915;&#20043;!!!&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/1075384.js&quot;&gt; &lt;/script&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/07/11/shell-sed'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 11 Jul 2011 06:44:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:0dd86643-78f8-4136-b4a3-6ad002cabc95</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/07/11/shell-sed#comments</comments>
      <category>Shell</category>
      <category>shell</category>
      <category>sed</category>
      <category>ruby</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=209</trackback:ping>
      <link>http://wxianfeng.com/2011/07/11/shell-sed</link>
    </item>
    <item>
      <title>linux &#26681;&#25454;&#25991;&#20214;(&#25991;&#20214;&#22841;)&#21019;&#24314;&#26102;&#38388;&#21024;&#38500;</title>
      <description>&lt;p&gt;capistrano &#33258;&#21160;&#37096;&#32626;&#20135;&#29983;&#30340;releases&#19979;&#30340;&#29256;&#26412;&#22826;&#22810;&#20102;,&#27809;&#19968;&#27425;&#37117;&#26377;&#19968;&#20010;&#26032;&#30340;&#29256;&#26412;,&#36275;&#36275;&#26377;&#20102; 8G &#65292;&#25105;&#30340;VPS &#19968;&#20849;&#25165;16G &#65292; &#25226;&#20043;&#21069;&#32769;&#30340;&#29256;&#26412;&#21024;&#38500;&#20043;:&lt;/p&gt;
&lt;p&gt;capistrano&#20135;&#29983;&#30340;&#29256;&#26412;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;[root&lt;span class=&quot;iv&quot;&gt;@li165&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;150&lt;/span&gt; releases]&lt;span class=&quot;c&quot;&gt;# ll&lt;/span&gt;
total &lt;span class=&quot;i&quot;&gt;24&lt;/span&gt;
drwxrwxr-x &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Mar&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;31&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;20110310173127&lt;/span&gt;
drwxrwxr-x &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Mar&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;31&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;05&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;08&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;20110331090836&lt;/span&gt;
drwxrwxr-x &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Apr&lt;/span&gt;  &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;14&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;20110401141405&lt;/span&gt;
drwxrwxr-x &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Apr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;02&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;25&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;20110430062446&lt;/span&gt;
drwxrwxr-x &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;May&lt;/span&gt;  &lt;span class=&quot;i&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;07&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;20110509111749&lt;/span&gt;
drwxrwxr-x &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Jul&lt;/span&gt;  &lt;span class=&quot;i&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;20110706162030&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21024;&#38500;shell:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;find . -type d -name &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;  -ctime &lt;span class=&quot;i&quot;&gt;+120&lt;/span&gt;  -maxdepth &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; | xargs rm -rf

-ctime &lt;span class=&quot;i&quot;&gt;+120&lt;/span&gt; &#21019;&#24314;&#26102;&#38388;120 &#22825;&#21069;&#30340;

-maxdepth &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; &#19981;&#36882;&#24402;&#26597;&#25214; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/07/06/linux-rm'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 06 Jul 2011 12:57:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:506f2639-29c2-440b-bb8f-07aa9dc6bc0b</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/07/06/linux-rm#comments</comments>
      <category>Centos</category>
      <category>linux</category>
      <category>find</category>
      <category>rm</category>
      <category>ctime</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=208</trackback:ping>
      <link>http://wxianfeng.com/2011/07/06/linux-rm</link>
    </item>
    <item>
      <title>&#21271;&#20140;&#19990;&#36152;&#22825;&#38454;</title>
      <description>&lt;p&gt;&#30475;&#28857;:&#20122;&#27954;&#26368;&#22823;&#30340;LED&#23631;&#24149;&lt;/p&gt;
&lt;p&gt;&#21435;&#30340;&#26102;&#20505;&#24688;&#24039;&#30896;&#21040;&#30334;&#23041;&#22312;&#37027;&#25630;&#27963;&#21160;&lt;/p&gt;
&lt;p&gt;&#22320;&#29702;&#20301;&#32622;:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;425&quot; height=&quot;350&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;http://ditu.google.com/maps/ms?hl=zh-CN&amp;amp;brcurrent=3,0x35f1ace74bdf9bf9:0xb5e7099aab3991a6,0,0x35f1abee23736947:0xd7bb8b3026d0813a%3B5,0,0&amp;amp;ie=UTF8&amp;amp;msa=0&amp;amp;msid=216741652437008609130.0004a57c28bdcee31116b&amp;amp;ll=39.916467,116.451365&amp;amp;spn=0.052072,0.111494&amp;amp;iwloc=0004a57c28bf874796c83&amp;amp;output=embed&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&#22312;&#36739;&#22823;&#30340;&#22320;&#22270;&#20013;&#26597;&#30475;&lt;a href=&quot;http://ditu.google.com/maps/ms?hl=zh-CN&amp;amp;brcurrent=3,0x35f1ace74bdf9bf9:0xb5e7099aab3991a6,0,0x35f1abee23736947:0xd7bb8b3026d0813a%3B5,0,0&amp;amp;ie=UTF8&amp;amp;msa=0&amp;amp;msid=216741652437008609130.0004a57c28bdcee31116b&amp;amp;ll=39.916467,116.451365&amp;amp;spn=0.052072,0.111494&amp;amp;iwloc=0004a57c28bf874796c83&amp;amp;source=embed&quot; style=&quot;color:#0000FF;text-align:left&quot;&gt;&#25105;&#20445;&#23384;&#30340;&#22320;&#26041;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;&#19978;&#22270;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821135569/&quot; title=&quot;002 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2188/5821135569_5c148be952.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;002&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#20986;&#21457;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821137413/&quot; title=&quot;005 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3414/5821137413_6318c8598e.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;005&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#36229;&#22823;LED&#23631;&#24149;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821145559/&quot; title=&quot;018 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2165/5821145559_9dd39d13f2.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;018&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Jeep &#36710;&#22312;&#36825;&#25630;&#27963;&#21160;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821710964/&quot; title=&quot;021 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2168/5821710964_c060933f2c.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;021&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#19968;&#35282;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821169887/&quot; title=&quot;054 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5270/5821169887_3fbc89a3f9.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;054&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&#20027;&#25345;&#20154;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821167103/&quot; title=&quot;049 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2560/5821167103_b5f449c2af.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;049&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#24320;&#22330;&#33310;&#36424;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821723154/&quot; title=&quot;038 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2413/5821723154_dc2f6d0dbd.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;038&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#22825;&#24149;&#19978;&#31069;&#29983;&#26085;&#24555;&#20048;&#30340;,&#27714;&#23130;&#30340;&#21861;&#24456;&#22810; ,&#20294;&#26159;&#38656;&#35201;&#33457;&#38065;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821187597/&quot; title=&quot;082 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3587/5821187597_d2440a041a.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;082&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#30127;&#29378;&#30340;&#32769;&#22806;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821757632/&quot; title=&quot;092 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5034/5821757632_11af01b729.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;092&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#30127;&#29378;&#30340;&#32769;&#22806;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821764988/&quot; title=&quot;104 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3510/5821764988_779c9b7333.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;104&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#36817;&#36317;&#31163;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821251781/&quot; title=&quot;121 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3420/5821251781_3da8a360e8.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;121&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#21457;&#30701;&#20449;&#21040;&#22825;&#24149;&#19978;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821817076/&quot; title=&quot;123 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5150/5821817076_8803eb20c7.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;123&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#26032;&#21326;&#20070;&#24215;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821249175/&quot; title=&quot;118 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2321/5821249175_87fae73bd4.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;118&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#20081;&#25293;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5821256725/&quot; title=&quot;128 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2231/5821256725_c8f2d8a9c3.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;128&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#22812;&#26223;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/sets/72157626815600607/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MORE&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;VIDEO&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;embed src=&quot;http://player.youku.com/player.php/sid/XMjc1MzQyMjg4/v.swf&quot; quality=&quot;high&quot; width=&quot;480&quot; height=&quot;400&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;p&gt;blog &#20063;&#38656;&#35201;&#25171;&#25830;&#36793;&#29699;,&#25165;&#33021;&#22686;&#21152;&#27969;&#37327;!!! &lt;sup&gt;_&lt;/sup&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/06/12/bejing-the-place'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 12 Jun 2011 00:20:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:9b9dd5fb-f242-4ec5-98bb-2fdf1b46fbd6</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/06/12/bejing-the-place#comments</comments>
      <category>Trip</category>
      <category>&#21271;&#20140;&#19990;&#36152;&#22825;&#38454;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=207</trackback:ping>
      <link>http://wxianfeng.com/2011/06/12/bejing-the-place</link>
    </item>
    <item>
      <title>&#28216;&#29609; &#21271;&#20140;&#40555;&#23792;&#22269;&#23478;&#26862;&#26519;&#20844;&#22253;</title>
      <description>&lt;p&gt;&#22320;&#29702;&#20301;&#32622;:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;425&quot; height=&quot;350&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;http://ditu.google.cn/maps?hl=zh-CN&amp;amp;q=%E5%8C%97%E4%BA%AC%E9%B9%AB%E5%B3%B0&amp;amp;ie=UTF8&amp;amp;hq=%E9%B9%AB%E5%B3%B0&amp;amp;hnear=%E5%8C%97%E4%BA%AC&amp;amp;ll=40.060924,116.091408&amp;amp;spn=0.050711,0.111494&amp;amp;z=14&amp;amp;iwloc=A&amp;amp;brcurrent=3,0x35f05acfc08060cf:0xa892552a2d8b1b09,0,0x35f044f161e0fbd5:0x465ce85ee05be6b7%3B5,0,0&amp;amp;cid=5573495929607272788&amp;amp;output=embed&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a href=&quot;http://ditu.google.cn/maps?hl=zh-CN&amp;amp;q=%E5%8C%97%E4%BA%AC%E9%B9%AB%E5%B3%B0&amp;amp;ie=UTF8&amp;amp;hq=%E9%B9%AB%E5%B3%B0&amp;amp;hnear=%E5%8C%97%E4%BA%AC&amp;amp;ll=40.060924,116.091408&amp;amp;spn=0.050711,0.111494&amp;amp;z=14&amp;amp;iwloc=A&amp;amp;brcurrent=3,0x35f05acfc08060cf:0xa892552a2d8b1b09,0,0x35f044f161e0fbd5:0x465ce85ee05be6b7%3B5,0,0&amp;amp;cid=5573495929607272788&amp;amp;source=embed&quot; style=&quot;color:#0000FF;text-align:left&quot;&gt;&#26597;&#30475;&#22823;&#22270;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;&#19978;&#22270;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722682947/&quot; title=&quot;&#40555;&#23792; 105 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5042/5722682947_073baffa1d.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 105&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#20171;&#32461;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5723235558/&quot; title=&quot;&#40555;&#23792; 104 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5207/5723235558_897dedd367.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 104&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#26223;&#21306;&#29256;&#22270;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722667839/&quot; title=&quot;&#40555;&#23792; 098 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5178/5722667839_53695ef51f.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 098&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#20141;&#21488;&#27004;&#38401;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722656425/&quot; title=&quot;&#40555;&#23792; 093 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3293/5722656425_24fa5621a3.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;&#40555;&#23792; 093&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#26368;&#39640;&#22788; , &#26395;&#20140;&#22612;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722643385/&quot; title=&quot;&#40555;&#23792; 086 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2296/5722643385_6a8ec88771.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 086&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#40555;&#23792;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722635359/&quot; title=&quot;&#40555;&#23792; 081 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5255/5722635359_7a52773069.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 081&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#26395;&#26376;&#30707;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5723160804/&quot; title=&quot;&#40555;&#23792; 067 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3094/5723160804_7f89896cc6.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 067&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#28040;&#20538;&#23546;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722600379/&quot; title=&quot;&#40555;&#23792; 065 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2310/5722600379_ac0723b4de.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 065&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#23665;&#33050;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5723143540/&quot; title=&quot;&#40555;&#23792; 059 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2045/5723143540_188d39f871.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 059&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#40555;&#23792;&#22320;&#38663;&#21488;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5723169270/&quot; title=&quot;&#40555;&#23792; 070 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3078/5723169270_af53941fd8.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 070&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#23777;&#35895;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722618273/&quot; title=&quot;&#40555;&#23792; 072 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5015/5722618273_a01d08b96d.jpg&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&#40555;&#23792; 072&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#38463;&#24357;&#38464;&#20315;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/5722659937/&quot; title=&quot;&#40555;&#23792; 095 by wxianfeng, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3606/5722659937_8fde2925a8.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;&#40555;&#23792; 095&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#23665;&#36335;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/wxianfeng/sets/72157626602437601/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MORE&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/05/15/beijing-jiufeng'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 15 May 2011 14:04:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d487c8cc-ea9c-4b1b-a66d-527834e0034b</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/05/15/beijing-jiufeng#comments</comments>
      <category>Trip</category>
      <category>&#21271;&#20140;&#40555;&#23792;</category>
      <category>&#26053;&#28216;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=205</trackback:ping>
      <link>http://wxianfeng.com/2011/05/15/beijing-jiufeng</link>
    </item>
    <item>
      <title>rails &#26412;&#22320; production &#38745;&#24577;&#25991;&#20214;&#26080;&#27861;&#35775;&#38382;</title>
      <description>&lt;p&gt;&#29615;&#22659;:&lt;br /&gt;
rails3.0.6 + ruby 1.9.2&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://wxianfeng.com/2011/05/08/rails3-production-export&quot;&gt;&#21069;&#38754;&lt;/a&gt;&#35828;&#25105; &#26381;&#21153;&#22120;&#19978;&#25991;&#20214; &#23548;&#20986;&#26377;&#38382;&#39064; , &#24819;&#22312;&#26412;&#22320;&#27979;&#35797; &#65292; &#26412;&#22320;&#24320;&#21551;production &#65292; &#21457;&#29616;&#25152;&#26377;&#30340; &#38745;&#24577;&#25991;&#20214;&#37117;&#19981;&#26174;&#31034; &#65292; &#21407;&#26469;&#26159; rails production.rb &#37197;&#32622;&#20102; rails &#19981;&#22788;&#29702; &#38745;&#24577;&#25991;&#20214; &#65292; &#22312;&#29983;&#20135;&#29615;&#22659;&#20013;&#37117;&#20132;&#32473;&#20102; nginx &#31561;web server &#22788;&#29702;&#20102;&#12290;&#12290;&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;&#20320;&#26412;&#22320;&#27809;&#26377; nginx &#29615;&#22659; &#65292; &#30452;&#25509;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;rails s -e production &#36215;&#30340;&#35805; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#38656;&#35201; &#24320;&#21551; rails &#22788;&#29702;public &#19979;&#22788;&#29702;&#38745;&#24577;&#25991;&#20214;&#30340;&#21151;&#33021;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;c&quot;&gt;# production.rb&lt;/span&gt;
  config.serve_static_assets = &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25226; false &#25913;&#20026; true&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/05/08/rails3-production-assets'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 08 May 2011 07:21:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:4c77fb76-da68-4e46-bdfd-815dd4ee4cef</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/05/08/rails3-production-assets#comments</comments>
      <category>Rails</category>
      <category>rails3</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=204</trackback:ping>
      <link>http://wxianfeng.com/2011/05/08/rails3-production-assets</link>
    </item>
    <item>
      <title>Rails3 production &#19979;&#23548;&#20986;&#25991;&#20214;&#20026;&#31354;</title>
      <description>&lt;p&gt;&#29615;&#22659;:&lt;br /&gt;
ruby 1.9.2 + rails 3.0.6 + ubuntu 11.04 + centos 5.5&lt;/p&gt;
&lt;p&gt;&#26368;&#36817;&#19968;&#20010;&#39033;&#30446; &#22312;&#26412;&#22320;&#23548;&#20986; excel &#37117;&#27809;&#26377;&#38382;&#39064; &#65292;&#21487;&#26159;&#19978;&#20102;&#26381;&#21153;&#22120; &#23548;&#20986;&#20840;&#37096;&#26159; &#31354; 0 bytes , &#21407;&#26469;&#26159;&#22240;&#20026;&#25105;&#37096;&#32626;&#22312;nginx &#19978; &#65292;rails project &#38656;&#35201; &#37197;&#32622;&#20351;&#29992; nginx&#30340;send-file &#21151;&#33021; ,&lt;/p&gt;
&lt;p&gt;&#20462;&#25913;production.rb:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt; &lt;span class=&quot;c&quot;&gt;# For nginx:&lt;/span&gt;&lt;br /&gt;
  config.action_dispatch.x_sendfile_header = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;#8216;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;X-Accel-Redirect&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;#8217;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;prodcution.rb &#20013;&#40664;&#35748;&#30340; send_file &#37197;&#32622;&#20351;&#29992;&#30340;&#26159;apache ,lighttpd &#30340; &#37197;&#32622; &#65292; &#21363; X-Sendfile , nginx&#30340;&#35805;&#65292; &#38656;&#35201;&#20351;&#29992;&#19978;&#38754;&#37197;&#32622;&lt;/p&gt;
&lt;p&gt;&#36825;&#26679;&#23548;&#20986;&#23601;&#27809;&#26377;&#38382;&#39064;&#20102;!!&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/3724853/rails-sends-0-byte-files-using-send-file&quot;&gt;http://stackoverflow.com/questions/3724853/rails-sends-0-byte-files-using-send-file&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/05/08/rails3-production-export'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 08 May 2011 03:28:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:3560de43-49d6-4345-8dfa-4bc7930de97e</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/05/08/rails3-production-export#comments</comments>
      <category>Rails</category>
      <category>rails3</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=203</trackback:ping>
      <link>http://wxianfeng.com/2011/05/08/rails3-production-export</link>
    </item>
    <item>
      <title>&#20116;&#19968; &#23581;&#40092; ubuntu 11.04</title>
      <description>&lt;p&gt;&#20116;&#19968; &#27809;&#20107;&#20570; &#65292;ubuntu 11.04 &#20986;&#26469;&#20102;&#65292; &#31532;&#19968;&#26102;&#38388; &#20307;&#39564;&#20102; &#19979; &#65292; &#24635;&#20307;&#24863;&#35273;&#33391;&#22909;&#65292;&#21482;&#26159;&#23433;&#35013;&#21644;&#21551;&#21160;&#30340;&#26102;&#20505;&#23631;&#24149;&#19968;&#30452;&#22312;&#38378; &#65292; &#20272;&#35745;&#26159;&#26174;&#21345;&#36319;&#19981;&#19978; &#65292; &#19979;&#19968;&#27493;&#20934;&#22791;&#23433;&#35013;&#19968;&#20010;&#29420;&#31435;&#26174;&#21345;&#30475;&#30475;&#33021;&#19981;&#33021;&#35299;&#20915;&#24320;&#26426;&#38378;&#30340;&#38382;&#39064;,  &#20351;&#29992;&#30340;&#26159; Gnome 3 &#30340;&#30028;&#38754; &#65292; &#24456;&#28843; &#65292; &#19981;&#36807; &#30475;&#30528;&#20687;&#23398;&#20064;MAC&#30340;&#24863;&#35273; &#65292; &#24038;&#20391;DOCK &#65292; application &#32479;&#19968;&#25918;&#22312;&#19968;&#36215; &#65292;&#21457;&#29616;&#21644;&#20043;&#21069;&#30340; ubuntu &#25913;&#21464;&#24456;&#22823; , &#24456;&#20540;&#24471;&#19968;&#35797;&#65292; &#28155;&#21152;&#20102;N&#22810;&#26032;&#30340;&#24212;&#29992;  , ubuntu &#19981;&#24871;&#26159; &#26700;&#38754;&#29256;&#26368;&#25104;&#21151;&#30340; linux ,  &#19979;&#38754; &#20171;&#32461;&#23433;&#35013;&#36807;&#31243;:&lt;/p&gt;
&lt;p&gt;1,&#19979;&#36733; &lt;span class=&quot;caps&quot;&gt;ISO&lt;/span&gt; &#38236;&#20687;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://cdimage.ubuntu.com/daily-live/current/&quot;&gt;http://cdimage.ubuntu.com/daily-live/current/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2, &#21051;&#24405;&#31995;&#32479;&#30424;&lt;/p&gt;
&lt;p&gt;&#19979;&#36733; ultraISo &#36719;&#20214; , &#26681;&#25454;&#20320;&#30340;&#29256;&#26412;&#25214;&#27880;&#20876;&#30721; &#65292; &#32593;&#19978;&#19968;&#22823;&#22534;&lt;/p&gt;
&lt;p&gt;3&#65292;&#23433;&#35013;ubuntu 11.04&lt;/p&gt;
&lt;p&gt;&#25105;&#23433;&#35013;&#30340;&#26159;&#21452;&#31995;&#32479;&#65292; &#26412;&#33713;&#30005;&#33041; &#26377;&#19968;&#20010; &lt;span class=&quot;caps&quot;&gt;WIN&lt;/span&gt; 7 &#65292; &#23433;&#35013;&#30340;&#26102;&#20505; &#27880;&#24847;&#28857;&lt;/p&gt;
&lt;p&gt;&#20998;&#21306;&#30340;&#26102;&#20505; ubuntu &#38656;&#35201;&#20004;&#20010;&#20998;&#21306; &#65292; 1&#20010;&#20998;&#21306;&#26159; /  &#26681;&#30446;&#24405; &#65292; &#19968;&#20010;&#26159;swap&#20998;&#21306; &#65292; &#27880;&#24847; swap&#20998;&#21306;&#19968;&#33324;&#26159;&#20320;&#20869;&#23384;&#30340;&#19968;&#21322; &#65292; &#20320;&#30340;&#20869;&#23384;&#36234;&#22823;&#65292; swap&#21487;&#20197;&#35774;&#32622;&#36234;&#23567; &#65292; &#20363;&#22914;&#30340;&#20869;&#23384; &#26159; 4G&#30340; &#65292; &#25105;&#35774;&#32622;&#30340; swap &#20998;&#21306;&#26159; 2G &#22823;&#23567;&lt;/p&gt;
&lt;p&gt;&#21478;&#22806; &#36873;&#25321; ubuntu boot loader &#30340;&#26102;&#20505; &#65292; &#36873;&#25321; mbr &#30828;&#30424;&#27963;&#21160;&#21306; &#65292; &#21363;&#26174;&#31034;&#20026; /dev/sda &#30340;&#36335;&#24452;&#65292; &#27880;&#24847;&#19981;&#33021;&#23433;&#35013;&#22312; /dev/sda1 &#21518;&#38754;&#26377;&#25968;&#23383;&#30340;&#30424;&#19978; &#65292; &#19981;&#28982;&#20320;&#21551;&#21160; &#23558;&#20250;&#30475;&#19981;&#21040; ubuntu grub &#21551;&#21160;&#39033;&#65292; &#20250;&#30452;&#25509;&#36827;&#20837; win7&lt;/p&gt;
&lt;p&gt;4, &#23433;&#35013; &#20013;&#25991;&#21253;&lt;/p&gt;
&lt;p&gt;&#26368;&#21518;&#25104;&#21151;&#23433;&#35013;&#21518; &#65292; &#30001;&#20110;&#25105;&#36873;&#25321;&#30340;&#26159; english &#29256; &#65292; &#25152;&#20197; &#23433;&#35013;&#23436;&#21518;&#38656;&#35201; &#23433;&#35013; &#20013;&#25991;&#21253;,&#21487;&#20197;&#36827;&#20837; language support &#23433;&#35013; &#65292; &#23433;&#35013;&#23436;&#21518; &#65292; &#20013;&#25991;&#26174;&#31034; &#36755;&#20837;&#23601;&#37117;&#27809;&#26377;&#38382;&#39064;&#20102;&lt;/p&gt;
&lt;p&gt;5 , &#33267;&#27492;&#20320;&#30340;ubuntu 11.04 &#24050;&#32463;&#23433;&#35013;&#25104;&#21151;&#20102;&lt;/p&gt;
&lt;p&gt;&#26368;&#21518;&#30475;&#24352;&#25105;&#30340;&#25130;&#22270;:&lt;/p&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/gnome-shell1.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_gnome-shell1.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;UPDATE&lt;/span&gt;:&lt;br /&gt;
========================&lt;/p&gt;
&lt;p&gt;&#26368;&#36817;&#20351;&#29992;&#19979;&#26469; &#21457;&#29616;&#24456;&#19981;&#20064;&#24815; &#65292; &#26368;&#20027;&#35201;&#30340;&#26159; &#24213;&#37096;&#27809;&#26377;&#20219;&#21153;&#26639;&#65292; &#25152;&#20197;&#24320;&#26426;&#30340;&#26102;&#20505; &#37117;&#26159;&#36873;&#25321;&#30340; ubuntu classic &#36827;&#20837;&#30340; &#65292; &#36825;&#26679;&#23601;&#21487;&#20197;&#26174;&#31034;&#20026; ubuntu 10.10 &#26102;&#20505;&#37027;&#26679;&#30340;&#26700;&#38754;&#20102; &#65292; &#20010;&#20154; &#26356;&#20064;&#24815;&#19968;&#28857;&#65281;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.pinyinjoe.com/linux/ubuntu-11-chinese-setup.htm&quot;&gt;http://www.pinyinjoe.com/linux/ubuntu-11-chinese-setup.htm&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://hi.baidu.com/jiaodj/blog/item/2a5a91625bbdefc8e6113a52.html&quot;&gt;http://hi.baidu.com/jiaodj/blog/item/2a5a91625bbdefc8e6113a52.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://forum.ubuntu.org.cn/viewforum.php?f=139&quot;&gt;http://forum.ubuntu.org.cn/viewforum.php?f=139&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/05/01/ubuntu-11.04'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 01 May 2011 10:30:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:54613f19-3d7e-4321-bf84-3c9862a52f2e</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/05/01/ubuntu-11.04#comments</comments>
      <category>Ubuntu</category>
      <category>ubuntu</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=201</trackback:ping>
      <link>http://wxianfeng.com/2011/05/01/ubuntu-11.04</link>
    </item>
    <item>
      <title>Rails &#28145;&#20837;&#23398;&#20064; Migration  limit   </title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#19968;&#30452;&#20197;&#20026;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;add_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:age&lt;/span&gt;  ,  &lt;span class=&quot;sy&quot;&gt;:integer&lt;/span&gt;  , &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt;=&amp;gt; &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;  &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#22312;&#25968;&#25454;&#24211;&#37324;&#23545;&#24212;&#30340;&#31867;&#22411;&#26159;  int(4)&lt;/p&gt;
&lt;p&gt;&#20854;&#23454;&#26159;&#38169;&#35823;&#30340;!!!&lt;/p&gt;
&lt;p&gt;&#30475;&#19979; limit&#30340;&#35828;&#26126;&#25991;&#26723;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt; - &lt;span class=&quot;co&quot;&gt;Requests&lt;/span&gt; a maximum column length. &lt;span class=&quot;co&quot;&gt;This&lt;/span&gt; is number of characters &lt;span class=&quot;r&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;sy&quot;&gt;:string&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;sy&quot;&gt;:text&lt;/span&gt; columns &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; number of bytes &lt;span class=&quot;r&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;sy&quot;&gt;:binary&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;sy&quot;&gt;:integer&lt;/span&gt; columns.&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#23545;&#20110; string &#21644; text &#27604;&#36739;&#31616;&#21333;,&#20363;&#22914;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;add_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:string&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt;=&amp;gt; &lt;span class=&quot;i&quot;&gt;60&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#37027;&#20040;&#25968;&#25454;&#24211;&#20013;&#30340; &#31867;&#22411;&#23601;&#26159; varchar(60)&lt;/p&gt;
&lt;p&gt;&#23545;&#20110; binary &#21644; integer &#30340;&#23601;&#19981;&#19968;&#26679;&#20102;  , &#34920;&#31034;&#30340;&#26159;&#23383;&#33410;&#25968; , &#20294;&#26159; :limit =&amp;gt;11 &#19981;&#26159;&#34920;&#31034; 11&#20010;&#23383;&#33410;&#30340;&#25972;&#25968; , &#26159;4 &#20010;&#23383;&#33410;&#25972;&#25968;&lt;/p&gt;
&lt;p&gt;&#23545;&#24212;&#20851;&#31995;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt;          &lt;span class=&quot;co&quot;&gt;Numeric&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Type&lt;/span&gt;          &lt;span class=&quot;co&quot;&gt;Column&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Size&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;                      tinyint                  &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; byte
&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;                      smallint                  &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt; bytes
&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;                      mediumint             &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt; bytes
&lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;      int(&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;)                  &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt; bytes
&lt;span class=&quot;i&quot;&gt;5&lt;/span&gt; to &lt;span class=&quot;i&quot;&gt;8&lt;/span&gt;              bigint                  &lt;span class=&quot;i&quot;&gt;8&lt;/span&gt; bytes&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#32780;mysql&#30340;integer&#31867;&#22411;(&#20063;&#26159;int&#22411;) &#34920;&#31034;&#22823;&#23567;&#22914;&#19979;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://wxianfeng.com/files/snapshot10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&#35814;&#32454; &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;rails &#37324;&#30340;&#23454;&#29616;&#20195;&#30721;  &lt;a href=&quot;https://github.com/rails/rails/blob/dc88847e5ce392eed210b97525c14fca55852867/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#26680;&#24515;&#20195;&#30721;:&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
 # Maps logical Rails types to MySQL-specific data types.
      def type_to_sql(type, limit = nil, precision = nil, scale = nil)
        return super unless type.to_s == 'integer'

        case limit
        when 1; 'tinyint'
        when 2; 'smallint'
        when 3; 'mediumint'
        when nil, 4, 11; 'int(11)'  # compatibility with MySQL default
        when 5..8; 'bigint'
        else raise(ActiveRecordError, &quot;No integer type has byte size #{limit}&quot;)
        end
      end
&lt;/pre&gt;
&lt;p&gt;&#20174;&#19978;&#38754;&#20195;&#30721;&#21487;&#20197;&#30475;&#20986;&#65292; &#24403;limit &#20026; nil,4,11 &#30340;&#26102;&#20505; &#65292; mysql&#30340;&#31867;&#22411;&#23601;&#26159; int(11), &#20063;&#23601;&#26159;&#24120;&#22312; migration&#30475;&#21040;&#30340; integer , :limit=&amp;gt;11&lt;/p&gt;
&lt;p&gt;&#21478;&#22806;&#21487;&#20197;&#20174;&#24050;&#32463;&#26377;&#30340;&#34920;&#20013;&#24471;&#21040;&#23383;&#27573;&#30340;&#23383;&#33410;&#25968;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_column &lt;span class=&quot;sy&quot;&gt;:forms&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:int9&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:integer&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;
-- add_column(&lt;span class=&quot;sy&quot;&gt;:forms&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:int9&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:integer&lt;/span&gt;, {&lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;})
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;300.9&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ADD&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;int9&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; int(&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;)
   -&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.3012&lt;/span&gt;s
 =&amp;gt; &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;Form&lt;/span&gt;.reset_column_information
 =&amp;gt; &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;Form&lt;/span&gt;.columns_hash[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;int9&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;].limit 
 =&amp;gt; &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;Form&lt;/span&gt;.columns_hash[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;int9&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]
 =&amp;gt; &lt;span class=&quot;c&quot;&gt;#&amp;lt;ActiveRecord::ConnectionAdapters::Mysql2Column:0xb8407c8 @null=true, @sql_type=&amp;quot;int(11)&amp;quot;, @name=&amp;quot;int9&amp;quot;, @scale=nil, @precision=nil, @limit=4, @type=:integer, @default=nil, @primary=false&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#30475;&#21040;&#27809;,&#22312;&#36801;&#31227;&#30340;&#26102;&#20505; &#25351;&#23450; :limit =&amp;gt; 11 , &#20294;&#26159; &#36890;&#36807; columns_hash &#24471;&#21040;&#30340; limit &#30830;&#26159;4  , &#20063;&#23601;&#26159;&#35828; mysql &#30340; Column Size &#26159;4 bytes , &#22914;&#26524;&#25351;&#23450; :limit =&amp;gt; nil &#25110;&#32773; :limit=&amp;gt;4 &#24471;&#21040;&#30340; &#37117;&#26159; 4 bytes&lt;/p&gt;
&lt;p&gt;&#22240;&#20026; rails &#37324;&#38754; &#20027;&#38190;id &#40664;&#35748;&#26159;&#26377;&#31526;&#21495;&#30340; int(11) ,&#25152;&#20197; mysql&#30340;&#20027;&#38190;&#26368;&#22823;id &#26159; 2147483647 , &#22914;&#26524;&#25913;&#25104;&#26080;&#31526;&#21495;&#30340; &#26368;&#22823;&#21487;&#20197;&#21040; 4294967295&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ruby &#22914;&#20309;&#24471;&#21040; &#25972;&#25968;&#30340;&#23383;&#33410;&#25968;?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;size &#26041;&#27861;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;i&quot;&gt;10_000_000_000&lt;/span&gt;.size
 =&amp;gt; &lt;span class=&quot;i&quot;&gt;8&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;.size
 =&amp;gt; &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&#22914;&#20309;&#35753;&#25105;&#30340;integer&#31867;&#22411;&#30340;&#23383;&#27573;&#21464;&#25104;&#26080;&#31526;&#21495;&#30340;&#65311;&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_column &lt;span class=&quot;sy&quot;&gt;:forms&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:int8&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;integer unsigned&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
-- add_column(&lt;span class=&quot;sy&quot;&gt;:forms&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:int8&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;integer unsigned&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;297.4&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ADD&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;int8&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; integer unsigned
   -&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.2976&lt;/span&gt;s
 =&amp;gt; &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&#22914;&#20309;&#27491;&#30830; &#28155;&#21152;mysql&#20013;int(4)&#31867;&#22411;&#30340;&#23383;&#27573;?&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:number&lt;/span&gt; , &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;int(4)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
-- add_column(&lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:number&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;int(4)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;280.4&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ADD&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; int(&lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;)
   -&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.2808&lt;/span&gt;s&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26368;&#21518;&#30475;&#19979; migration &#31867;&#22411; &#23545;&#24212; &#25968;&#25454;&#24211;&#31867;&#22411;&#30340;&#20851;&#31995;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://wxianfeng.com/files/snapshot11.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.snowgiraffe.com/tech/366/rails-migrations-mysql-unsigned-integers-primary-keys-and-a-lot-of-fun-times/&quot;&gt;http://www.snowgiraffe.com/tech/366/rails-migrations-mysql-unsigned-integers-primary-keys-and-a-lot-of-fun-times/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://thewebfellas.com/blog/2008/6/2/unsigned-integers-for-mysql-on-rails&quot;&gt;http://thewebfellas.com/blog/2008/6/2/unsigned-integers-for-mysql-on-rails&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.kuqin.com/rubycndocument/man/built-in-class/class_object_numeric_integer.html&quot;&gt;http://www.kuqin.com/rubycndocument/man/built-in-class/class_object_numeric_integer.html&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/04/17/rails-limit'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 17 Apr 2011 05:09:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:bee4cc01-98f8-4d64-8b2b-cc1f5dcd872f</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/04/17/rails-limit#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=200</trackback:ping>
      <link>http://wxianfeng.com/2011/04/17/rails-limit</link>
    </item>
    <item>
      <title>Rails &#27880;&#24847;&#32034;&#24341; name</title>
      <description>&lt;p&gt;&#27979;&#35797;&#29615;&#22659;:rails 2.X + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#20170;&#22825;&#21457;&#29616; rails api&#19978;&#32034;&#24341;name&#30340;&#21629;&#21517;&#35268;&#21017;&#26159;&#38169;&#35823;&#30340;,&lt;a href=&quot;https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L299&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#27979;&#35797;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_index &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:email&lt;/span&gt;
-- add_index(&lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:email&lt;/span&gt;)
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.4&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SHOW&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;KEYS&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;367.1&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;index_users_on_email&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; (&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;)
   -&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.3680&lt;/span&gt;s&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25353;&#29031; &#25991;&#26723;&#19978;&#20889;&#30340;&#24212;&#35813;&#26159;  users_email ,&#20294;&#26159;&#23454;&#38469;&#19978;&#26159; index_users_on_email&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_index &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:unique&lt;/span&gt;=&amp;gt;&lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;
-- add_index(&lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;, {&lt;span class=&quot;sy&quot;&gt;:unique&lt;/span&gt;=&amp;gt;&lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;})
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.3&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SHOW&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;KEYS&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;340.4&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;UNIQUE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;index_users_on_name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; (&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;)
   -&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.3413&lt;/span&gt;s&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25353;&#29031;&#25991;&#26723;&#20889;&#30340;&#24212;&#35813;&#26159; users_name ,&#20294;&#26159;&#23454;&#38469;&#19978;&#26159; index_users_on_name&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_index &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; , [&lt;span class=&quot;sy&quot;&gt;:login&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;] 
-- add_index(&lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;, [&lt;span class=&quot;sy&quot;&gt;:login&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;])
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.3&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SHOW&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;KEYS&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;314.3&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;index_users_on_login_and_name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; (&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;)
   -&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.3152&lt;/span&gt;s&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25353;&#29031;&#25991;&#26723;&#19979;&#20889;&#30340;&#24212;&#35813;&#26159; users_login_name &#32780;&#23454;&#38469;&#26159; index_users_on_login_and_name&lt;/p&gt;
&lt;p&gt;&#20026;&#20160;&#20040; name &#22914;&#27492;&#37325;&#35201;,&#22240;&#20026; remove_index &#20063;&#26159;&#26681;&#25454;name &#26469;&#30340;&#65292;&#25152;&#20197; &#35268;&#21017;&#24517;&#39035;&#35760;&#20303;!&lt;/p&gt;
&lt;p&gt;&#20363;&#22914;&#25991;&#26723;&#19978;&#19968;&#20010;demo:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Remove the suppliers_name_index in the suppliers table.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#   remove_index :suppliers, :name&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20854;&#23454; &#26159;&#21024;&#38500; name &#20026; index_suppliers_on_name &#30340;&#32034;&#24341; ,&#32780;&#19981;&#26159;&#25991;&#26723;&#19978;&#35828;&#30340; suppliers_name_index&lt;/p&gt;
&lt;p&gt;&#25991;&#26723;&#19978;&#26159;&#38169;&#35823;&#30340;&#65292;&#20174; &#28304;&#30721;&#20013; &#20063;&#21487;&#20197;&#30475;&#20986;&#26469;&lt;/p&gt;
&lt;p&gt;idnex_name method &#28304;&#30721;:&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
 def index_name(table_name, options) #:nodoc:
        if Hash === options # legacy support
          if options[:column]
            &quot;index_#{table_name}_on_#{Array.wrap(options[:column]) * '_and_'}&quot; # HERE
          elsif options[:name]
            options[:name]
          else
            raise ArgumentError, &quot;You must specify the index name&quot;
          end
        else
          index_name(table_name, :column =&amp;gt; options)
        end
      end
&lt;/pre&gt;
&lt;p&gt;rails&#26597;&#30475; &#34920;&#30340;&#32034;&#24341;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.indexes(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# users &#26159;&#34920;&#21517;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/04/15/rails-index'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 15 Apr 2011 01:56:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:59ea13c0-f848-4874-b0a1-11c193549c9f</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/04/15/rails-index#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=199</trackback:ping>
      <link>http://wxianfeng.com/2011/04/15/rails-index</link>
    </item>
    <item>
      <title>ssh &#19981;&#36755;&#20837;&#23494;&#30721;&#36830;&#25509;&#26381;&#21153;&#22120;</title>
      <description>&lt;p&gt;&#29615;&#22659;:ubuntu10.10(client) + Centos 5.5 (server)&lt;/p&gt;
&lt;p&gt;&#27599;&#27425;ssh&#36830;&#25509;&#26381;&#21153;&#22120; &#65292;scp &#25335;&#36125;&#19996;&#35199;  &#65292; &#25110;&#32773;rsync&#21516;&#27493; &#65292;&#37117;&#35201;&#36755;&#20837;&#23494;&#30721;&#39564;&#35777;&#65292;&#24456;&#40635;&#28902;&#65292;&#25226;publickey&#20256;&#21040;server&#19978;&#30340; authorized_keys &#20013;&#21363;&#21487; &#65292;&#24314;&#31435;&#20449;&#20219;&#21518;&#23601;&#19981;&#38656;&#35201;&#36755;&#20837;&#23494;&#30721;&#20102;&lt;/p&gt;
&lt;p&gt;1,&#29983;&#25104;publickey&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;ssh-keygen -t rsa &lt;span class=&quot;c&quot;&gt;# &#25110;&#32773;&#29992; dsa &#21152;&#23494;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,&#19978;&#20256; publickey &#25991;&#20214;&#21040;server&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;scp  ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.ssh&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;i&lt;/span&gt;&lt;/span&gt;d_dsa.pub root&lt;span class=&quot;er&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;fl&quot;&gt;173.230&lt;/span&gt;.&lt;span class=&quot;fl&quot;&gt;155.150&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;/.ssh/authorized_keys &lt;span class=&quot;c&quot;&gt;# 173.230.155.150  &#25442;&#25104;&#20320;server&#30340;ip&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3,ok&#20102;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/04/15/ssh'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 15 Apr 2011 01:39:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:30280702-fc47-4558-a6d9-8d14a369bc55</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/04/15/ssh#comments</comments>
      <category>Centos</category>
      <category>ssh</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=198</trackback:ping>
      <link>http://wxianfeng.com/2011/04/15/ssh</link>
    </item>
    <item>
      <title>&#23567;&#24515; linode &#30340;&#27969;&#37327;</title>
      <description>&lt;p&gt;linode &#30495;&#26159;&#35753;&#20154;&#28779;&#22823;,&#27809;&#26377;&#20219;&#20309;&#36890;&#30693;&#30340;&#24773;&#20917;&#19979;&#65292;&#25187;&#38500;&#20102;&#25105;&#20449;&#29992;&#21345; 40 usd &#65292;&#20294;&#26159;&#20107;&#20986;&#26377;&#22240;&lt;/p&gt;
&lt;p&gt;&#22240;&#20026;&#25105;&#36229;&#36807;&#27599;&#20010;&#26376;200G&#27969;&#37327;&#20102;&#65292;&#21069;&#20960;&#22825;&#19968;&#30452;&#25910;&#21040; linode &#30340;&#25253;&#35686;&#37038;&#20214;&#65292;&#35828;&#25105;&#30340; &lt;span class=&quot;caps&quot;&gt;VPS&lt;/span&gt; &#27969;&#37327;&#27604;&#36739;&#22823; &#36229;&#36807;&#20102;&#20102; &#24179;&#22343; 5M/s, &#20294;&#26159;&#27809;&#26377;&#25552;&#31034;&#36229;&#27969;&#37327;&#30340;&#21518;&#26524;.  &#30475;&#30475;&#25105;&#30340; blog &#33021;&#27491;&#24120;&#35775;&#38382; &#65292;&#20063;&#23601;&#27809;&#31649;&#23427;&#65292;&#21518;&#26469;&#34987;&#25187;&#20102; 40 &#32654;&#20803;&#65292;&#30495;&#35753;&#20154;&#28779;&#22823;&#65292;FUCK LINODE&#65281;&#65292;&#36234;&#26469;&#36234;&#35752;&#21388;linode&#20102;&#65292;&#38543;&#20415;&#20030;&#20960;&#20010;&#20363;&#23376;:&lt;/p&gt;
&lt;p&gt;1,&#26102;&#24120;&#20250;&#20572;&#30005;&lt;br /&gt;
2&#65292;ip&#20598;&#23572;&#34987;&#21644;&#35856;&lt;br /&gt;
3&#65292;&#21518;&#21488; &#32463;&#24120;session error &#21644; &#30828;&#30424;&#20351;&#29992;&#37327; &#22987;&#32456;&#26174;&#31034;100%&lt;br /&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/linode.PNG&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_linode.PNG&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
4,&#65292;&#20215;&#26684; &#20559;&#36149;&lt;br /&gt;
5&#65292;&#36229;&#27969;&#37327; &#25187;&#36153;&#38750;&#24120;&#20005;&#37325;&lt;br /&gt;
6,&amp;#8230;.&lt;/p&gt;
&lt;p&gt;&#20026;&#20160;&#20040;&#27969;&#37327;&#36825;&#20040;&#22823;&#65292;&#36825;&#20010;&#21487;&#33021;&#26159;&#22823;&#23478;&#20851;&#24515;&#30340;&lt;/p&gt;
&lt;p&gt;&#25105;&#29992;iftop&#23454;&#26102;&#30417;&#25511;&#27969;&#37327;&#65292;&#21457;&#29616; &#19979;&#34892;&#27969;&#37327;&#26368;&#39640;&#36798;&#21040; 20M/s &#30830;&#23454;&#21523;&#20154;&#65292;&#19979;&#22270;&#65306;&lt;/p&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/snapshot7.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_snapshot7.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;linode &#21518;&#21488;&#20063;&#21487;&#20197;&#30475;&#20986;:&lt;/p&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/snapshot9.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_snapshot9.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&#30001;&#20110;&#20010;&#20154;&#36816;&#32500;&#32463;&#39564;&#26377;&#38480;&#65292;&#27809;&#21457;&#29616;&#20160;&#20040;&#65292;&#21482;&#21457;&#29616;&#20102; &#36830;&#21040;&#25105; 80 &#31471;&#21475;nginx &#19978;&#30340;ip&#25968;&#24456;&#22810;&#65292;&#19979;&#22270;&#65306;&lt;/p&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/snapshot8.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_snapshot8.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&#25105;&#25226;nginx &#37325;&#21551;&#20102; &#65292;&#37325;&#21551;&#21518; &#36824;&#26159;&#24456;&#22810; &#65292;&#27969;&#37327;&#20381;&#28982;&#24456;&#22823;&#65292;&#21518;&#26469;&#25105;&#27809;&#21150;&#27861;&#23601; &#20851;&#26426;&#20102; &#65292;&#38548;&#20102;&#19968;&#22825;&#21518; &#37325;&#21551;&#20102; &#26426;&#22120; &#65292;&#31995;&#32479;&#27491;&#24120;&#20102; &#12290;&#12290;&#12290;&#30446;&#21069;&#36824;&#26159;&#19981;&#30693;&#36947; &#35299;&#20915;&#21150;&#27861;&#65281;&lt;/p&gt;
&lt;p&gt;&#26368;&#21518;&#30475;&#19979;&#25105;&#36825;&#20004;&#22825;&#34987;&#25187;&#30340;&#38065;&#65292;&#20320;&#23601;&#30693;&#36947; &#36229;&#36807;&#27969;&#37327; &#26377;&#22810;&#20040; &#24808;&#20102;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://wxianfeng.com/files/snapshot12.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&#35753;&#20840;&#29699;&#20154; &#37117;&#26469; fuck linode&#21543;&#65281;&#25720;&#19979;&#38754;&#32593;&#22336;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://fucklinode.heroku.com&quot;&gt;fucklinode!!!&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/09/linode'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 09 Mar 2011 08:07:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8ba72f10-4122-4a6b-9661-d39031adbab4</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/09/linode#comments</comments>
      <category>Linode</category>
      <category>Linode</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=197</trackback:ping>
      <link>http://wxianfeng.com/2011/03/09/linode</link>
    </item>
    <item>
      <title>Heroku  Permission denied (publickey)</title>
      <description>&lt;p&gt;&#20170;&#22825; push project &#21040; heroku &#65292;&#21487;&#26159;&#24590;&#20040;&#37117;&#20986;&#29616;&#19979;&#38754;&#36825;&#20010;&#38169;&#35823;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Permission&lt;/span&gt; denied (publickey).
fatal: &lt;span class=&quot;co&quot;&gt;The&lt;/span&gt; remote &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt; hung up unexpectedly&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#19981;&#35299;&#65292;push &#21040;github &#23601;&#27809;&#26377;&#38382;&#39064;&#65292; &#32593;&#19978;&#25628;&#20102;&#19979; &#35828;&#26159; publickey &#38382;&#39064; &#65292; &#21487;&#26159;&#30475;&#20102; heroku &#19978; &#21644;&#26412;&#22320;&#30340; &#23601;&#26159;&#19968;&#26679;&#30340; &#12290;&#12290;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;usr/local/system/projects/git/fucklinode&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; heroku keys
=== &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; key &lt;span class=&quot;r&quot;&gt;for&lt;/span&gt; wang.fl1429&lt;span class=&quot;iv&quot;&gt;@gmail&lt;/span&gt;.com
ssh-dss &lt;span class=&quot;co&quot;&gt;AAAAB3NzaC&lt;/span&gt;...&lt;span class=&quot;co&quot;&gt;ZALatGdA&lt;/span&gt;== wang.fl1429&lt;span class=&quot;iv&quot;&gt;@gmail&lt;/span&gt;.com&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26412;&#22320;&#30340;&lt;/p&gt;
&lt;p&gt;~/.ssh/id_rsa.pub &#20063;&#26159;&#36825;&#20010;key&lt;/p&gt;
&lt;p&gt;&#22914;&#26524;&#21457;&#29616;&#19981;&#19968;&#26679;&#30340; &#21487;&#20197; &#28155;&#21152;&#19968;&#20010;&#26032;&#30340; key&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;heroku keys&lt;span class=&quot;sy&quot;&gt;:add&lt;/span&gt;  ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.ssh&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;i&lt;/span&gt;&lt;/span&gt;d_rsa.pub&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26356;&#22810;&#20851;&#20110;keys&#30340;&#21629;&#20196;&#21487;&#20197;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;heroku help&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#32487;&#32493;&#30740;&#31350;,&#21518;&#26469;&#21457;&#29616; heroku &#25214;&#30340; &#19981;&#26159; id_rsa.pub &#65292;&#32780;&#26159; id_dsa.pub ,&#36890;&#36807; ssh -v git@heroku.com &#26597;&#20986;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;ssh -v git&lt;span class=&quot;iv&quot;&gt;@heroku&lt;/span&gt;.com 
...
debug1: &lt;span class=&quot;co&quot;&gt;Trying&lt;/span&gt; private key: &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;wxianfeng/.ssh/id_dsa
...&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#22909; &#65292; &#37027;&#25105;&#23601;&#32473;&#20320;&#29983;&#25104; dsa &#21152;&#23494;&#30340;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;cd ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.ssh
&amp;gt;rm -rf  *
&amp;gt;ssh-keygen -C &amp;quot;wang.fl1429@gmail.com&amp;quot; -t dsa   # rsa &#21152;&#23494;&#30340; -t rsa &#21363;&#21487;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#19978;&#20256; key&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;heroku keys&lt;span class=&quot;sy&quot;&gt;:add&lt;/span&gt; ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.ssh&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;i&lt;/span&gt;&lt;/span&gt;d_dsa.pub&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20877;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;git push heroku master &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#23601;ok&#20102;&lt;/p&gt;
&lt;p&gt;&#25353;&#29031;&#23448;&#26041;&#30340;&#25945;&#31243; &#23601;&#24212;&#35813;&#26159; id_rsa.pub , &#20043;&#21069;&#20063;&#19968;&#30452;&#22909;&#22909;&#30340;,&#21487;&#26159; &#20170;&#22825; &#25214;&#30340;&#24590;&#20040;&#26159; id_dsa.pub &#21602; &#65292; &#22914;&#26524;&#20320;&#21516;&#26679;&#36935;&#21040;&#36825;&#20010;&#38382;&#39064;,&#30475;&#30475;&#26159;&#19981;&#26159; &#20063;&#26159;&#36825;&#37324;&#30340;&#38382;&#39064; &amp;#8230;.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/3481973/heroku-error-permission-denied-public-key&quot;&gt;http://stackoverflow.com/questions/3481973/heroku-error-permission-denied-public-key&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://devcenter.heroku.com/articles/quickstart&quot;&gt;http://devcenter.heroku.com/articles/quickstart&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://help.github.com/troubleshooting-ssh/&quot;&gt;http://help.github.com/troubleshooting-ssh/&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/08/heroku-permission-denied-publickey'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 08 Mar 2011 02:57:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:702bca92-d833-4552-9eeb-e2f6bf0e140f</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/08/heroku-permission-denied-publickey#comments</comments>
      <category>Heroku</category>
      <category>Heroku</category>
      <category>git</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=195</trackback:ping>
      <link>http://wxianfeng.com/2011/03/08/heroku-permission-denied-publickey</link>
    </item>
    <item>
      <title>&#20195;&#30721;&#25176;&#31649; bitbucket.org</title>
      <description>&lt;p&gt;&#24819;&#25226;&#20010;&#20154;&#30340;&#19968;&#20010;&#39033;&#30446;&#25918;&#21040; github&#19978;&#30340; &#65292;&#20294;&#26159;&#21457;&#29616;&#19981;&#33021;&#35774;&#32622;&#20026; private&#30340; &#65292; private &#26159;&#20184;&#36153;&#29992;&#25143; &#12290;&#12290;&#12290;&lt;/p&gt;
&lt;p&gt;&#20110;&#26159;&#25226;&#20195;&#30721; &#25176;&#31649;&#21040;&#20102; &lt;a href=&quot;https://bitbucket.org &quot;&gt;https://bitbucket.org &lt;/a&gt;&#65292;bitbucket.org &#20351;&#29992;&#30340;&#26159; hg &#29256;&#26412;&#25511;&#21046; &#65292;&#20063;&#21483; mercurial , &#21644; git &#24456;&#30456;&#20284; &#65292; &#20063;&#26159;&#20998;&#24067;&#24335;&#29256;&#26412;&#25511;&#21046;&#31995;&#32479; &#20851;&#38190;&#26159; &#21487;&#20197;&#35774;&#32622;&#20026; private &#30340; &#65292;&#24182;&#19988;free&#29992;&#25143; &#36824;&#21487;&#20197;&#26377;5&#20010;&#20154;&#30340;&#21327;&#21516;&#24320;&#21457;&lt;/p&gt;
&lt;p&gt;&#20351;&#29992;:&lt;/p&gt;
&lt;p&gt;0 , &#19978;&#20256; publickey&lt;/p&gt;
&lt;p&gt;1,config &#37197;&#32622;&#29992;&#25143;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;vim ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.hgrc
[ui]
username = wxianfeng &amp;lt;wang.fl1429@gmail.com&amp;gt;
verbose = True&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,init &#21021;&#22987;&#21270;&#39033;&#30446;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;cd project
&amp;gt;hg init&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3,add files &#28155;&#21152;&#25991;&#20214;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;hg add .&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;4,commit file to config  commit &#25991;&#20214; ,&#36825;&#26102;&#21482;&#26159;&#25918;&#21040;&#20102; config&#20013; &#65292;&#24182;&#27809;&#26377;&#21040;&#26381;&#21153;&#22120;&#19978;&#65292;&#21644; svn &#19981;&#19968;&#26679;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;hg commit -m &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;import project&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5,push &#19978;&#20256;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;hg push https&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/bitbucket.org/user/project&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.oschina.net/p/mercurial&quot;&gt;http://www.oschina.net/p/mercurial&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.infoq.com/cn/news/2010/10/atlassian-bitbucket&quot;&gt;http://www.infoq.com/cn/news/2010/10/atlassian-bitbucket&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/04/hg'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 04 Mar 2011 00:54:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8385c915-7a3d-40bd-bc1c-a155e9f68827</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/04/hg#comments</comments>
      <category>Hg</category>
      <category>hg</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=187</trackback:ping>
      <link>http://wxianfeng.com/2011/03/04/hg</link>
    </item>
    <item>
      <title>Linux &#26381;&#21153;&#22120;&#27969;&#37327;&#30417;&#25511;iftop</title>
      <description>&lt;p&gt;&#29615;&#22659;:centos5.5 + ubuntu 10.10&lt;/p&gt;
&lt;p&gt;&#26368;&#36817;&#25105;&#30340;VPS&#30340;&#27969;&#37327;&#36229;&#32423;&#22823;&#65292;&#24179;&#22343;&#36798;&#21040;&#20102; 5m/s , &#19981;&#30693;&#36947;&#24590;&#20040;&#22238;&#20107; &#65292;&#24590;&#20040;&#27969;&#37327;&#36825;&#20040;&#22823; &#65292;&#26368;&#21518;&#25214;&#21040;&#20102;&#19968;&#20010;&#19981;&#38169;&#30340;&#24037;&#20855;  iftop &#30417;&#25511;&#27969;&#37327;&lt;/p&gt;
&lt;p&gt;&#21644; top &#21629;&#20196;&#30456;&#20284;&#65292;&#24456;&#23454;&#29992;&#65292;&#24456;&#26041;&#20415;&lt;/p&gt;
&lt;p&gt;1,&#23433;&#35013;&lt;/p&gt;
&lt;p&gt;ubuntu:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;sudo  apt-get install iftop&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;centos:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;yum install flex byacc  libpcap ncurses ncurses-devel
wget ftp&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/fr2.rpmfind.net/linux/dag/redhat/el5/en/i386/dag/&lt;span class=&quot;co&quot;&gt;RPMS&lt;/span&gt;/iftop-&lt;span class=&quot;fl&quot;&gt;0.17&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;.el5.rf.i386.rpm
rpm -ivh iftop-&lt;span class=&quot;fl&quot;&gt;0.17&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;.el5.rf.i386.rpm&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,&#20351;&#29992;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;iftop&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3,&#26597;&#30475;&#24110;&#21161;&lt;/p&gt;
&lt;p&gt;iftop &#21518; ? &#26597;&#30475;&lt;/p&gt;
&lt;p&gt;4,&#25130;&#22270;&lt;br /&gt;
&lt;img src=&quot;http://www.ex-parrot.com/~pdw/iftop/iftop_normal.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&#26356;&#35814;&#32454;&#30340;&#25720;&#19979;&#38754;&#32593;&#22336;:&lt;br /&gt;
&lt;a href=&quot;http://www.vpser.net/manage/iftop.html&quot;&gt;http://www.vpser.net/manage/iftop.html&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/03/linux-iftop'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 03 Mar 2011 10:37:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:cd535925-780b-4dc7-9650-6297c16946c9</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/03/linux-iftop#comments</comments>
      <category>Software</category>
      <category>iftop</category>
      <category>software</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=185</trackback:ping>
      <link>http://wxianfeng.com/2011/03/03/linux-iftop</link>
    </item>
    <item>
      <title>rails3.1 &#26032;&#29305;&#24615;</title>
      <description>&lt;p&gt;&#30446;&#21069; rails&#30340;&#31283;&#23450;&#29256;&#26412;&#26159; rails3.0.5&#65292;&#20294;&#26159;rails3.1&#30340;&#26032;&#29305;&#24615;&#24050;&#32463;&#20986;&#26469;&#20102; &#65292; &#26469;&#30475;&#30475; &#12290;&#12290;&#12290;&lt;/p&gt;
&lt;p&gt;1,Scopes&lt;/p&gt;
&lt;p&gt;rails 3.0 &#25105;&#20204;&#20351;&#29992;scope&#65292;&#24120;&#36825;&#26679;&#20351;&#29992;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Product&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
  scope &lt;span class=&quot;sy&quot;&gt;:nokia&lt;/span&gt;, lambda {
    where(&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Nokia&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
  }
  scope &lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt;, lambda { |value|
    where(&lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt; =&amp;gt; value)
  }
  scope &lt;span class=&quot;sy&quot;&gt;:combined&lt;/span&gt;, lambda { |value|
    nokia.category(value)
  }
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;iv&quot;&gt;@nokia&lt;/span&gt; = &lt;span class=&quot;co&quot;&gt;Product&lt;/span&gt;.nokia.all &lt;span class=&quot;c&quot;&gt;# to get all the products with name Nokia&lt;/span&gt;
&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Product&lt;/span&gt;.category(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Mobile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).all &lt;span class=&quot;c&quot;&gt;# to get all the products with category Mobile&lt;/span&gt;
&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Product&lt;/span&gt;.nokia.category(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Mobile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).all &lt;span class=&quot;c&quot;&gt;#Combined : to get all the products with name = Nokia and category = Mobile&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21457;&#29616;scope &#21482;&#33021;&#20351;&#29992;&#22312;&#19968;&#20010;Class&#20013;&#65292;&#37027;&#20040;&#26377;&#22810;&#20010;Class &#24590;&#20040;&#21150;&#65292;rails 3.1 &#20320;&#21487;&#20197;&#21019;&#24314;&#19968;&#20010;&#31867; &#20316;&#20026; &#36890;&#29992;&#30340; filter&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Filter&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;Struct&lt;/span&gt;.new(&lt;span class=&quot;sy&quot;&gt;:klass&lt;/span&gt;)
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;call&lt;/span&gt;(*args); &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;NameFilter&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;call&lt;/span&gt;(*args)
    klass.where(&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; args.shift)
    &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;(*args)
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;CategoryFilter&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;call&lt;/span&gt;(category, *args)
    klass.where(&lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt; =&amp;gt; args.shift)
    &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;(*args)
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Product&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
  scope &lt;span class=&quot;sy&quot;&gt;:combined&lt;/span&gt;, &lt;span class=&quot;co&quot;&gt;Filter&lt;/span&gt;.new(&lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;).extend(&lt;span class=&quot;co&quot;&gt;CategoryFilter&lt;/span&gt;).extend(&lt;span class=&quot;co&quot;&gt;NameFilter&lt;/span&gt;)
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;User&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
  scope &lt;span class=&quot;sy&quot;&gt;:combined&lt;/span&gt;, &lt;span class=&quot;co&quot;&gt;Filter&lt;/span&gt;.new(&lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;).extend(&lt;span class=&quot;co&quot;&gt;CategoryFilter&lt;/span&gt;).extend(&lt;span class=&quot;co&quot;&gt;NameFilter&lt;/span&gt;)
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Product&lt;/span&gt;.combined(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Nokia&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Mobile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).all
&lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.combined(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;John&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Manager&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).all&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,Automatic Flushing&lt;/p&gt;
&lt;p&gt;Automatic Flushing &#26159;&#25913;&#21892;&#24615;&#33021;&#30340;&#19968;&#39033;&#25216;&#26415;&#65292;&#20363;&#22914; &#20043;&#21069;rails&#28210;&#26579;&#39029;&#38754;&#30340;&#26426;&#29702;&#26159;&#36825;&#26679;&#30340;&#65292;&#31532;&#19968;&#27493; rails &#29983;&#25104; &#38745;&#24577;&#39029;&#38754; &#65292;&#20363;&#22914;css&#65292;&#22270;&#29255;&#65292;js&#25991;&#20214; &#65292;&#39029;&#38754;html  &#65292;&#28982;&#21518;&#22312;&#19968;&#20010;&#19968;&#20010;&#30340;&#19979;&#36733;&lt;/p&gt;
&lt;p&gt;&#28155;&#21152;&#20102; Automatic Flushing &#36825;&#20010;&#25216;&#26415;&#21518; &#65292;&#23558;&#20250; &#22823;&#22823;&#25552;&#39640;&#24615;&#33021; &#65292; &#26381;&#21153;&#22120;&#31471;&#19968;&#36793; &#29983;&#25104;&#38745;&#24577;&#25991;&#20214; &#65292;&#27983;&#35272;&#22120;&#19968;&#36793;&#23601;&#19979;&#36733;&#20102; &#65292;&#25913;&#21892;&#20102;&#29992;&#25143;&#20307;&#39564; &#21644;&#24615;&#33021;&lt;/p&gt;
&lt;p&gt;3&#65292;css sprites(&#22270;&#29255;&#25340;&#21512;)&lt;/p&gt;
&lt;p&gt;rails 3.1 &#40664;&#35748;&#25903;&#25345; icons sprite &#65292; &#22810;&#20010;icon&#25918;&#22312;&#19968;&#24352;&#22270;&#29255;&#19978; &#65292;&#26174;&#31034;icon&#36890;&#36807;css&#26469;&#25511;&#21046;&#65292;&#36825;&#26679;&#26377;&#21033;&#20110;&#20943;&#23569;http&#35831;&#27714;&#25968;&lt;/p&gt;
&lt;p&gt;4&#65292;js&#65292;css&#25991;&#20214;&#21487;&#20197;&#25918;&#21040;views &#19979;&#38754;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#Preprocess:&lt;/span&gt;
app/views/js/item.js.erb
app/views/css/style.css.erb
&lt;span class=&quot;c&quot;&gt;#This code will be compiled to the files like this:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#Compiles:&lt;/span&gt;
public/application.js
public/style.css&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5&#65292;&#19968;&#20123;&#26087;&#30340;&#29992;&#27861;&#23558;&#19981;&#34987;&#25903;&#25345;&#65292;&#20363;&#22914; :conditions&lt;/p&gt;
&lt;p&gt;&#26087;&#30340;&#20889;&#27861;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;User&lt;/span&gt;
  scope &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; { &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;David&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; }
  scope &lt;span class=&quot;sy&quot;&gt;:age&lt;/span&gt;, lambda {|age| {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;age &amp;gt; ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, age] }}
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26032;&#30340;&#20889;&#27861;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;User&lt;/span&gt;
  scope &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;, where(&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;David&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
  scope &lt;span class=&quot;sy&quot;&gt;:age&lt;/span&gt;, lambda {|age| where(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;age &amp;gt; ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, age) }
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://hemju.com/2011/02/23/rails-3-1-release-rumors-and-news-about-features/&quot;&gt;http://hemju.com/2011/02/23/rails-3-1-release-rumors-and-news-about-features/&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/02/rails3-1'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 02 Mar 2011 10:59:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ef847244-cd98-41a2-b992-8c81bbfa359c</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/02/rails3-1#comments</comments>
      <category>Rails</category>
      <category>rails3.1</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=184</trackback:ping>
      <link>http://wxianfeng.com/2011/03/02/rails3-1</link>
    </item>
    <item>
      <title>Rails console &#27979;&#35797;&#36335;&#30001;</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;rails console &#29992;&#36215;&#26469;&#36824;&#26159;&#24456;&#29245;&#30340;,&#36335;&#30001;&#20063;&#21487;&#20197;&#22312;console&#19979;&#20351;&#29992; , &#29978;&#33267;&#21487;&#20197; get , post  , &#19979;&#38754;&#20171;&#32461;&#24815;&#29992;&#25163;&#27861;:&lt;/p&gt;
&lt;p&gt;1,rake &#26597;&#30475;routes&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;rake routes&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,console &#19979;&#26597;&#30475; routes&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;Rails.application.routes.routes # rails 2.x &#20351;&#29992; ActionController::Routing::Routes.routes &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3, &#26597;&#30475; root(routes)&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.root_path
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.root_url
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://www.example.com/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.host = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;www.wxianfeng.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;www.wxianfeng.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.root_url
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://www.wxianfeng.com/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;4,&#26597;&#30475;&#36164;&#28304; &#36335;&#30001;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt;   user = &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.first
  &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Load&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.3&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;.* &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;LIMIT&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;c&quot;&gt;#&amp;lt;User id: 1, login: &amp;quot;entos&amp;quot;, name: &amp;quot;&amp;quot;, email: &amp;quot;entos@entos.com&amp;quot;, crypted_password: &amp;quot;3dea29b4e40bc9a70bb63678678c5ff37fe49753&amp;quot;, salt: &amp;quot;2ec7e5db7f3ce5de61f1add8275b674dbd2770dc&amp;quot;, remember_token: nil, remember_token_expires_at: nil, activation_code: nil, activated_at: nil, status: 2, suspend_at: nil, avatar_id: nil, orgunit_id: nil, mobile_phone: nil, last_login_at: nil, language: nil, options: nil, created_at: &amp;quot;2011-03-01 07:42:37&amp;quot;, updated_at: &amp;quot;2011-03-01 07:42:37&amp;quot;&amp;gt; &lt;/span&gt;
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.user_path(user)
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users/1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.users_path
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.new_user_path
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users/new&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.edit_user_path(&lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt;=&amp;gt;user.id)
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users/1/edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.users_url
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://www.wxianfeng.com/users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5,&#19981;&#20351;&#29992;app&#35843;&#29992;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; include &lt;span class=&quot;co&quot;&gt;ActionController&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;UrlWriter&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; default_url_options[&lt;span class=&quot;sy&quot;&gt;:host&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wxianfeng.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wxianfeng.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; users_url
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://wxianfeng.com/users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;6,path &#21644; route Hash  &#20114;&#36716;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; r = &lt;span class=&quot;co&quot;&gt;Rails&lt;/span&gt;.application.routes
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; r.generate &lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:action&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/signup&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; r.generate &lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:action&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users/1/edit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; r.recognize_path &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users/index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; {&lt;span class=&quot;sy&quot;&gt;:action&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;} 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; r.recognize_path &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:method&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; {&lt;span class=&quot;sy&quot;&gt;:action&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;} &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;7,get ,post&lt;/p&gt;
&lt;p&gt;&#27169;&#25311;get&#35775;&#38382;&#39318;&#39029;&#65292;&#27809;&#30331;&#24405; &#28982;&#21518;&#36339;&#36716;&#21040;&#20102;/login &#65292; &#28982;&#21518; post &#25552;&#20132;&#30331;&#24405; &#25104;&#21151;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.class
 =&amp;gt; &lt;span class=&quot;co&quot;&gt;ActionDispatch&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Integration&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Session&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.get &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;i&quot;&gt;302&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.controller.params
 =&amp;gt; {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;controller&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;welcome&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;} 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.response.redirect_url
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://www.example.com/login&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; app.post &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/session&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; , {&lt;span class=&quot;sy&quot;&gt;:login&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;entos&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:password&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;netposa&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}
  &lt;span class=&quot;co&quot;&gt;SQL&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.3&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SHOW&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;TABLES&lt;/span&gt;
  &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Load&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.2&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;.* &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;WHERE&lt;/span&gt; (status = &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;) &lt;span class=&quot;co&quot;&gt;AND&lt;/span&gt; (&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;.`login&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; = 'entos') LIMIT 1
  SQL (0.1ms)  BEGIN
  User Load (0.3ms)  SELECT &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;users&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.* FROM &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;users&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; WHERE (&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;users&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;id&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; = 1) LIMIT 1
  SQL (0.0ms)  COMMIT
 =&amp;gt; 302 
ruby-1.9.2-p0 &amp;gt; app.controller.params
 =&amp;gt; {&amp;quot;login&amp;quot;=&amp;gt;&amp;quot;entos&amp;quot;, &amp;quot;password&amp;quot;=&amp;gt;&amp;quot;netposa&amp;quot;, &amp;quot;action&amp;quot;=&amp;gt;&amp;quot;create&amp;quot;, &amp;quot;controller&amp;quot;=&amp;gt;&amp;quot;sessions&amp;quot;} 
ruby-1.9.2-p0 &amp;gt; app.session[:user_id]
 =&amp;gt; 1 
ruby-1.9.2-p0 &amp;gt; app.cookies
 =&amp;gt; #&amp;lt;Rack::Test::CookieJar:0xb010120 @default_host=&amp;quot;www.example.com&amp;quot;, @cookies=[#&amp;lt;Rack::Test::Cookie:0x9b726f0 @default_host=&amp;quot;www.example.com&amp;quot;, @name_value_raw=&amp;quot;_ent_os_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMzM4ZTdhYzU4OTY3NDhmMmZmMGFhNDkyYTExZWVmOThJIgx1c2VyX2lkBjsARmkGSSIKZmxhc2gGOwBGSUM6JUFjdGlvbkRpc3BhdGNoOjpGbGFzaDo6Rmxhc2hIYXNoewY6C25vdGljZUkiG0xvZ2dlZCBpbiBzdWNjZXNzZnVsbHkGOwBUBjoKQHVzZWRvOghTZXQGOgpAaGFzaHsA--d8652cbfebcae436e64a824d7ac2f64a81aa6619&amp;quot;, @name=&amp;quot;_ent_os_session&amp;quot;, @value=&amp;quot;BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMzM4ZTdhYzU4OTY3NDhmMmZmMGFhNDkyYTExZWVmOThJIgx1c2VyX2lkBjsARmkGSSIKZmxhc2gGOwBGSUM6JUFjdGlvbkRpc3BhdGNoOjpGbGFzaDo6Rmxhc2hIYXNoewY6C25vdGljZUkiG0xvZ2dlZCBpbiBzdWNjZXNzZnVsbHkGOwBUBjoKQHVzZWRvOghTZXQGOgpAaGFzaHsA--d8652cbfebcae436e64a824d7ac2f64a81aa6619&amp;quot;, @options={&amp;quot;path&amp;quot;=&amp;gt;&amp;quot;/&amp;quot;, &amp;quot;HttpOnly&amp;quot;=&amp;gt;nil, &amp;quot;domain&amp;quot;=&amp;gt;&amp;quot;www.example.com&amp;quot;}&amp;gt;, #&amp;lt;Rack::Test::Cookie:0x9b826f4 @default_host=&amp;quot;www.example.com&amp;quot;, @name_value_raw=&amp;quot;auth_token=&amp;quot;, @name=&amp;quot;auth_token&amp;quot;, @value=&amp;quot;&amp;quot;, @options={&amp;quot;path&amp;quot;=&amp;gt;&amp;quot;/&amp;quot;, &amp;quot;domain&amp;quot;=&amp;gt;&amp;quot;www.example.com&amp;quot;}&amp;gt;]&amp;gt; 
ruby-1.9.2-p0 &amp;gt; app.response.redirect_url
 =&amp;gt; &amp;quot;http://www.example.com/&amp;quot; 
ruby-1.9.2-p0 &amp;gt; app.flash
 =&amp;gt; {:notice=&amp;gt;&amp;quot;Logged in successfully&amp;quot;} 
ruby-1.9.2-p0 &amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#29978;&#33267; &#20320;&#36824;&#21487;&#20197; ajax &#24322;&#27493;&#25552;&#20132;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;&amp;gt; app.xml_http_request &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/store/add_to_cart&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
=&amp;gt; &lt;span class=&quot;i&quot;&gt;200&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;8,&#20998;&#37197;&#19968;&#20010; &#23454;&#20363;&#21464;&#37327;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;app.assigns[:foo] = &amp;#8220;bar&amp;#8221;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://clarkware.com/blog/2006/04/04/running-your-rails-app-headless&quot;&gt;http://clarkware.com/blog/2006/04/04/running-your-rails-app-headless&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.zobie.com/2008/11/testing-routes-in-rails/&quot;&gt;http://blog.zobie.com/2008/11/testing-routes-in-rails/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://railstech.com/2010/06/routes-testing-in-rails/&quot;&gt;http://railstech.com/2010/06/routes-testing-in-rails/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://stuartsierra.com/2008/01/08/testing-named-routes-in-the-rails-console&quot;&gt;http://stuartsierra.com/2008/01/08/testing-named-routes-in-the-rails-console&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/02/rails-console-routes'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 02 Mar 2011 01:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2eee1f4e-715f-4577-a291-c21ab2134e2d</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/02/rails-console-routes#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <category>routes</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=183</trackback:ping>
      <link>http://wxianfeng.com/2011/03/02/rails-console-routes</link>
    </item>
    <item>
      <title>ruby yaml &#34920;&#31034;&#25968;&#32452;</title>
      <description>&lt;p&gt;yaml &#30340;&#35821;&#27861;&#30495;&#26159;&#21464;&#24577; , &#34920;&#31034;&#20010;&#25968;&#32452;&#36825;&#20040;&#40635;&#28902;, &#26356;&#22797;&#26434;&#30340;&#25968;&#25454;&#32467;&#26500; &#37027;&#19981;&#26159;&#26356;&#40635;&#28902; !!!&lt;/p&gt;
&lt;p&gt;yaml &#25991;&#20214;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html&lt;/span&gt;

one:
  name: &lt;span class=&quot;co&quot;&gt;MyString&lt;/span&gt;
  orgunit_id: &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
  inheritable: &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;
 &lt;span class=&quot;c&quot;&gt;# codes &#26159;yaml&#25968;&#32452;&#34920;&#31034;&#26041;&#27861;&lt;/span&gt;
 &lt;span class=&quot;c&quot;&gt;# &#32553;&#36827;&#21482;&#33021;&#26159;&#20004;&#20010;&#31354;&#26684;&#20026;&#19968;&#32423;&#65292;&#19981;&#33021;&#26159;&#20854;&#20182;&#23383;&#31526;&lt;/span&gt;
  codes: 
    - &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
    - a
    - &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;
    - b
    - &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;
    - c&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;ruby &#35299;&#26512;yaml:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt;   file =  &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;Rails&lt;/span&gt;.root&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/test/fixtures/enumerations.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/usr/local/system/projects/entos/ent_os/test/fixtures/enumerations.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;YAML&lt;/span&gt;.load &lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.read(file) 
 =&amp;gt; {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;one&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;{&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;MyString&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;orgunit_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;inheritable&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;codes&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]}} &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#19981;&#30693;&#36947;&#24590;&#20040;&#20889;&#30340;&#21487;&#20197; &#20351;&#29992; to_yaml &#26041;&#27861; &#30475;&#19968;&#19979;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;irb(main):&lt;span class=&quot;i&quot;&gt;001&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;&amp;gt; 
=&amp;gt; {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;one&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;{&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;MyString&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;inheritable&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;orgunit_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;codes&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]}}
irb(main):&lt;span class=&quot;i&quot;&gt;002&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;&amp;gt; require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;yaml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
=&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;
irb(main):&lt;span class=&quot;i&quot;&gt;003&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;&amp;gt; hsh.to_yaml
=&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;--- &lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;one: &lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  name: MyString&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  inheritable: false&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  orgunit_id: 1&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  codes: &lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  - 1&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  - a&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  - 2&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  - b&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  - 3&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;  - c&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21487;&#35835;&#24615; &#26356;&#22909;&#30340; &#20351;&#29992; y &#26041;&#27861;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; y hsh
--- 
one: 
  name: &lt;span class=&quot;co&quot;&gt;MyString&lt;/span&gt;
  orgunit_id: &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
  inheritable: &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;
  codes: 
  - &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
  - a
  - &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;
  - b
  - &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;
  - c
 =&amp;gt; &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/03/01/ruby-yaml'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 01 Mar 2011 08:24:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:163cced2-3baf-4eca-b51b-5601a844e591</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/03/01/ruby-yaml#comments</comments>
      <category>Ruby</category>
      <category>ruby</category>
      <category>yaml</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=182</trackback:ping>
      <link>http://wxianfeng.com/2011/03/01/ruby-yaml</link>
    </item>
    <item>
      <title>rails3 autoload_paths</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;rails3&#37324; autoload_paths &#21040;&#24213;&#26377;&#20160;&#20040;&#29992;,&#20160;&#20040;&#24773;&#20917;&#21152;&#21040; autoload_paths &#20013; &#65292;&#20160;&#20040;&#26102;&#20505;&#20351;&#29992;require? , rails 2.X &#37324;&#26159; load_paths , &#20363;&#22914; rails3&#37324;&#28155;&#21152; &#25991;&#20214;&#22841;&#21040; autoload_paths&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;config.autoload_paths += &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%W(&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;Rails&lt;/span&gt;.root&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/lib&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# &#19981;&#21253;&#25324;&#23376;&#25991;&#20214;&#22841;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#28982;&#21518;  &#20195;&#30721;&#37324;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;include &lt;span class=&quot;co&quot;&gt;AuthenticatedSystem&lt;/span&gt;  &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#23601;&#20250;&#20174; autoload_paths &#20013;&#23547;&#25214;  authenticated_system.rb , autoload_paths &#21644;java&#20013;&#30340;classpath&#31867;&#20284; &#12290;&#12290;&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;&#27809;&#26377;&#24517;&#35201;&#25226;&#25152;&#26377;&#39069;&#22806;&#30340; .rb &#25991;&#20214; &#37117;require &#19968;&#19979; &#65292; &#36825;&#26679;&#20250; &#24433;&#21709;&#21551;&#21160;&#26102;&#38388; &#65292; &#20294;&#26159;&#26377;&#20123;&#24773;&#20917;&#26159;&#24517;&#39035; require &#30340; ,&#20363;&#22914;&#25193;&#23637; String ,Array ,Hash &#31867;&#26102; &#23601;&#24517;&#39035;require &#20102;&lt;/p&gt;
&lt;p&gt;autoload_paths &#40664;&#35748;&#21152;&#21040;&#20102; $LOAD_PATH &#20840;&#23616;&#25968;&#32452;&#21464;&#37327;&#20013;  &#65292;&#25110;&#32773;&#20889;&#25104; $: , &#29992;&#26469;&#20445;&#23384; paths&lt;/p&gt;
&lt;p&gt;autoload_paths &#28304;&#30721; : &lt;a href=&quot;https://github.com/rails/rails/blob/master/railties/lib/rails/engine/configuration.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;see:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://errtheblog.com/posts/3-organize-your-models&quot;&gt;http://errtheblog.com/posts/3-organize-your-models&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/02/23/rails3-autoload_paths'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 23 Feb 2011 21:23:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1c3fec23-1b15-424e-9f5e-613a4821550a</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/02/23/rails3-autoload_paths#comments</comments>
      <category>Rails</category>
      <category>rails3</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=181</trackback:ping>
      <link>http://wxianfeng.com/2011/02/23/rails3-autoload_paths</link>
    </item>
    <item>
      <title>&#39033;&#30446;&#23547;&#20154;</title>
      <description>&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/200911111257908343.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/200911111257908343.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&#20844;&#21496;&#39033;&#30446;&#23547;&#20154;,&#32654;&#24037; + Ruby + Java + Flex + Javascript &#24037;&#31243;&#24072;&lt;/p&gt;
&lt;p&gt;&#25307;&#32856;&#24086;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://chinaonrails.com/topic/view/4746.html&quot;&gt;http://chinaonrails.com/topic/view/4746.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.oschina.net/bbs/thread/15953&quot;&gt;http://www.oschina.net/bbs/thread/15953&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/02/13/netposa-jobs'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 13 Feb 2011 22:19:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:56872a2e-e7ba-40ca-8def-ea3838d56390</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/02/13/netposa-jobs#comments</comments>
      <category>Ruby</category>
      <category>Netposa</category>
      <category>&#25307;&#32856;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=180</trackback:ping>
      <link>http://wxianfeng.com/2011/02/13/netposa-jobs</link>
    </item>
    <item>
      <title>&#20339;&#21360;&#32593; &#22312;&#32447;&#21517;&#29255;&#35774;&#35745;  </title>
      <description>&lt;p&gt;&#26379;&#21451;&#21483;&#25105;&#32473;&#20182;&#24324;&#20010;&#21517;&#29255;,&#29992;&#20102; coredraw &#19981;&#19987;&#19994;&#30340;&#35774;&#35745;&#20102; &#20960;&#20010; &#65292;&#23545;&#26041;&#37117;&#19981;&#28385;&#24847;&#65292; &#26368;&#21518; &#27809;&#36761;&#20102;&#65292;&#25214;&#21040;&#20102; &#19968;&#20010;&#22312;&#32447;&#35774;&#35745;&#21517;&#29255;&#30340;&#32593;&#31449; &#65292;&#29992;&#20102;&#19968;&#20010;&#27169;&#26495;&#65292;&#26368;&#21518;&#23545;&#26041;&#30427;&#26159;&#28385;&#24847;&#12290;&#12290;&#36825;&#20010;&#32593;&#31449;&#23601;&#26159; &#20339;&#21360;&#32593;&#65292;&#25903;&#25345;&#22312;&#32447;&#19979;&#21333; &#25171;&#21360;&#26381;&#21153;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.joyinker.com/&quot;&gt;&#20339;&#21360;&#32593;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#25105;&#22312;&#32447;&#35774;&#35745;&#30340; &#21517;&#29255;&#65306;&lt;/p&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/card3.PNG&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/card3.PNG&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/02/13/card'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 13 Feb 2011 07:28:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9a87de5f-9ace-4d1d-b7f6-e4b7a455ad5a</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/02/13/card#comments</comments>
      <category>Web2.0</category>
      <category>&#21517;&#29255;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=179</trackback:ping>
      <link>http://wxianfeng.com/2011/02/13/card</link>
    </item>
    <item>
      <title>rails params[:id] &#23454;&#29616;&#21407;&#29702;</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#25105;&#20204;&#30693;&#36947; params &#36820;&#22238;&#30340;&#26159;&#19968;&#20010; hash , &#20363;&#22914; {&amp;quot;id&amp;quot;=&amp;gt;1} ,&#37027;&#20026;&#20160;&#20040; params[:id] = 1 ,&#32780;&#19981;&#26159; nil &#21602; &#65311;&lt;br /&gt;
irb&#19979;&#27979;&#35797;&#19968;&#19979;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-1.9.2-p0 &amp;gt; h={&amp;quot;id&amp;quot;=&amp;gt;1}
 =&amp;gt; {&amp;quot;id&amp;quot;=&amp;gt;1} 
ruby-1.9.2-p0 &amp;gt; h[:id]
 =&amp;gt; nil &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#24102;&#30528;&#36825;&#20010;&#30097;&#38382;&#65292;&#35774;&#32622;&#26029;&#28857; &#65292;debug &#36827;rails &#28304;&#30721; &#65292; &#21457;&#29616;&#20102; &#21407;&#22240;&#65292;&lt;/p&gt;
&lt;p&gt;1&#65292;&#36319;&#21040;&#20102; params &#26041;&#27861;&#28304;&#30721;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;params&lt;/span&gt;&lt;br /&gt;
      &lt;span class=&quot;iv&quot;&gt;@_params&lt;/span&gt; ||= request.parameters&lt;br /&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;&#32473; @_params &#35774;&#32622;Watch , &#21457;&#29616;&#22914;&#19979; :&lt;br /&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/snapshot5.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_snapshot5.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&#21457;&#29616; @_params &#30340;class &#26159; ActiveSupport::HashWithIndifferentAccess&lt;br /&gt;
&#20063;&#23601;&#26159;&#35828;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;params.class &lt;span class=&quot;c&quot;&gt;# =&amp;gt; ActiveSupport::HashWithIndifferentAccess&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,&#32487;&#32493; F7 &#36319;&#36827;&#21435;&lt;/p&gt;
&lt;p&gt;&#36319;&#21040;&#20102;&lt;a href=&quot;https://github.com/rails/rails/blob/master/activesupport/lib/active_support/hash_with_indifferent_access.rb&quot;&gt;&#36825;&#20010;&#25991;&#20214;&lt;/a&gt; &#30340; default&#26041;&#27861;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
require 'active_support/core_ext/hash/keys'

# This class has dubious semantics and we only have it so that
# people can write params[:key] instead of params['key']
# and they get the same value for both keys.

module ActiveSupport
  class HashWithIndifferentAccess &amp;lt; Hash
    def extractable_options?
      true
    end

    def initialize(constructor = {})
      if constructor.is_a?(Hash)
        super()
        update(constructor)
      else
        super(constructor)
      end
    end

    def default(key = nil)
      if key.is_a?(Symbol) &amp;amp;&amp;amp; include?(key = key.to_s)
        self[key]
      else
        super
      end
    end

    def self.new_from_hash_copying_default(hash)
      ActiveSupport::HashWithIndifferentAccess.new(hash).tap do |new_hash|
        new_hash.default = hash.default
      end
    end

    alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
    alias_method :regular_update, :update unless method_defined?(:regular_update)

    # Assigns a new value to the hash:
    #
    #   hash = HashWithIndifferentAccess.new
    #   hash[:key] = &quot;value&quot;
    #
    def []=(key, value)
      regular_writer(convert_key(key), convert_value(value))
    end

    alias_method :store, :[]=

    # Updates the instantized hash with values from the second:
    #
    #   hash_1 = HashWithIndifferentAccess.new
    #   hash_1[:key] = &quot;value&quot;
    #
    #   hash_2 = HashWithIndifferentAccess.new
    #   hash_2[:key] = &quot;New Value!&quot;
    #
    #   hash_1.update(hash_2) # =&amp;gt; {&quot;key&quot;=&amp;gt;&quot;New Value!&quot;}
    #
    def update(other_hash)
      other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
      self
    end

    alias_method :merge!, :update

    # Checks the hash for a key matching the argument passed in:
    #
    #   hash = HashWithIndifferentAccess.new
    #   hash[&quot;key&quot;] = &quot;value&quot;
    #   hash.key? :key  # =&amp;gt; true
    #   hash.key? &quot;key&quot; # =&amp;gt; true
    #
    def key?(key)
      super(convert_key(key))
    end

    alias_method :include?, :key?
    alias_method :has_key?, :key?
    alias_method :member?, :key?

    # Fetches the value for the specified key, same as doing hash[key]
    def fetch(key, *extras)
      super(convert_key(key), *extras)
    end

    # Returns an array of the values at the specified indices:
    #
    #   hash = HashWithIndifferentAccess.new
    #   hash[:a] = &quot;x&quot;
    #   hash[:b] = &quot;y&quot;
    #   hash.values_at(&quot;a&quot;, &quot;b&quot;) # =&amp;gt; [&quot;x&quot;, &quot;y&quot;]
    #
    def values_at(*indices)
      indices.collect {|key| self[convert_key(key)]}
    end

    # Returns an exact copy of the hash.
    def dup
      HashWithIndifferentAccess.new(self)
    end

    # Merges the instantized and the specified hashes together, giving precedence to the values from the second hash
    # Does not overwrite the existing hash.
    def merge(hash)
      self.dup.update(hash)
    end

    # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
    # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a HashWithDifferentAccess.
    def reverse_merge(other_hash)
      super self.class.new_from_hash_copying_default(other_hash)
    end

    def reverse_merge!(other_hash)
      replace(reverse_merge( other_hash ))
    end

    # Removes a specified key from the hash.
    def delete(key)
      super(convert_key(key))
    end

    def stringify_keys!; self end
    def stringify_keys; dup end
    undef :symbolize_keys!
    def symbolize_keys; to_hash.symbolize_keys end
    def to_options!; self end

    # Convert to a Hash with String keys.
    def to_hash
      Hash.new(default).merge!(self)
    end

    protected
      def convert_key(key)
        key.kind_of?(Symbol) ? key.to_s : key
      end

      def convert_value(value)
        case value
        when Hash
          self.class.new_from_hash_copying_default(value)
        when Array
          value.collect { |e| e.is_a?(Hash) ? self.class.new_from_hash_copying_default(e) : e }
        else
          value
        end
      end
  end
end

HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess
&lt;/pre&gt;
&lt;p&gt;&#22909;&#20102; &#25152;&#26377; &#23454;&#29616;&#30340;&#21407;&#29702;&#37117;&#22312; &#36825;&#20010;&#25991;&#20214;&#37324;&#20102;,HashWithIndifferentAccess&#26159; Hash&#30340;&#23376;&#31867;,&#20854;&#20013;&#35206;&#30422;&#20102;default &#26041;&#27861;,Hash&#24403;&#25214;&#19981;&#21040; hash &#30340; key &#26102; &#20250;&#23547;&#25214;default&#20540;&#65292;&#21363;&#25191;&#34892; default &#26041;&#27861; , so &amp;#8230;.&lt;/p&gt;
&lt;p&gt;Hash#default &#29992;&#27861;demo:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; h={}
 =&amp;gt; {} 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; h.default=&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; 
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; h[&lt;span class=&quot;sy&quot;&gt;:a&lt;/span&gt;]
 =&amp;gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26680;&#24515;&#20195;&#30721;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;default&lt;/span&gt;(key = &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt;)&lt;br /&gt;
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; key.is_a?(&lt;span class=&quot;co&quot;&gt;Symbol&lt;/span&gt;) &amp;amp;&amp;amp; include?(key = key.to_s)&lt;br /&gt;
        &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;[key]&lt;br /&gt;
      &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
        &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;&lt;br /&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;&#24403;&#26159;symbol &#26102; &#36716;&#21270;&#20026; string , &#28982;&#21518; self[string_key]&lt;/p&gt;
&lt;p&gt;&#20030;&#19968;&#21453;&#19977;:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;MyHash&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;initialize&lt;/span&gt;(constructor = {})
    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; constructor.is_a?(&lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;)
      &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;()
      update(constructor) &lt;span class=&quot;c&quot;&gt;# Hash#update == Hash#merge!&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;(constructor)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;default&lt;/span&gt;(key = &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt;)
    p key &lt;span class=&quot;c&quot;&gt;#=&amp;gt; :id&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; key.is_a?(&lt;span class=&quot;co&quot;&gt;Symbol&lt;/span&gt;) &amp;amp;&amp;amp; include?(key = key.to_s) &lt;span class=&quot;c&quot;&gt;# Hash#include? = Hash#has_key? = Hash#member? = Hash#key?&lt;/span&gt;
      p key &lt;span class=&quot;c&quot;&gt;#=&amp;gt; &amp;quot;id&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;[key]
    &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;super&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

h = &lt;span class=&quot;co&quot;&gt;MyHash&lt;/span&gt;.new({&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;})
p h &lt;span class=&quot;c&quot;&gt;#=&amp;gt; {&amp;quot;id&amp;quot;=&amp;gt;1}&lt;/span&gt;
p h.class &lt;span class=&quot;c&quot;&gt;#=&amp;gt; MyHash&lt;/span&gt;
p h[&lt;span class=&quot;sy&quot;&gt;:id&lt;/span&gt;] &lt;span class=&quot;c&quot;&gt;#=&amp;gt; 1&lt;/span&gt;
p h[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;] &lt;span class=&quot;c&quot;&gt;#=&amp;gt; 1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://lukaszwrobel.pl/blog/ruby-hash-default-value&quot;&gt;http://lukaszwrobel.pl/blog/ruby-hash-default-value&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/02/11/rails-params-id'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 11 Feb 2011 00:36:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:02d091d1-06db-4fab-a55e-b5c27e11052f</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/02/11/rails-params-id#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=178</trackback:ping>
      <link>http://wxianfeng.com/2011/02/11/rails-params-id</link>
    </item>
    <item>
      <title>ruby rake tips</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rake 0.8.7 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#20170;&#22825;&#22312;&#20889; rake &#25991;&#20214; &#65292; &#25552;&#31034;&#25105;&#27809;&#25214;&#21040; model Class&#65292;&#38382;&#39064;&#22312;&#20110;&#25105;&#27809;&#21152; =&amp;gt; :environment , &#37027;&#20026;&#20160;&#20040;&#21152;&#19978;   =&amp;gt; :environment  &#23601;&#21487;&#20197;&#20102; , &#30740;&#31350;&#20102;&#19979;rake:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;task :test =&amp;gt; :environment do 
end&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20854;&#20013;&#21518;&#38754;&#30340;  :environment &#20063;&#26159; &#19968;&#20010; task &#65292; &#20063;&#23601;&#26159;&#35828;&#22312;&#25191;&#34892; test &#36825;&#20010; task &#20043;&#21069; &#20250;&#25191;&#34892;  :environment &#36825;&#20010; task&#65292;&#26377;&#28857;&#20687;rails controller &#20013;&#30340; before_filter ,&#37027;&#20040;  :environment &#36825;&#20010;task &#23450;&#20041;&#22312;&#20160;&#20040;&#22320;&#26041;&#65292;rails project&#20013;&#20063;&#27809;&#26377;&#21834; &#12290;&#12290;&#12290;&#65292;&#23450;&#20041;&#22312; rails &#28304;&#30721;&#20013;&#20102; &#65292;&#20320;&#22312; &#20320;&#30340;project&#19979;&#25191;&#34892; rake  environment  &#19981;&#20250;&#25253;&#38169;&#30340;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng@ubuntu:/usr/local/system/projects/entos/ent_os$ rake environment --trace 
(in /usr/local/system/projects/entos/ent_os)
** Invoke environment (first_time)
** Execute environment&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#19981;&#36807; &#20063;&#30475;&#19981;&#21040; &#36755;&#20986;&#20160;&#20040;&#20449;&#24687;&#65292;&#22240;&#20026;&#21482;&#26159;&#21152;&#36733;&#20102; &#36816;&#34892;&#29615;&#22659;&#32780;&#24050; ,&#37027;&#20040;&#20174;&#21738;&#37324;&#25191;&#34892;&#30340;&#65292;&#23450;&#20041;&#22312; project &#19979; Rakefile &#20013;&#20102;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'

EntOs::Application.load_tasks&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#32487;&#32493;&#36319;&#36394; load_tasks:&lt;/p&gt;
&lt;p&gt;&#26368;&#21518; &#25214;&#21040;&#20102; task environment&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;   &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;initialize_tasks&lt;/span&gt;&lt;br /&gt;
      require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails/tasks&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
      task &lt;span class=&quot;sy&quot;&gt;:environment&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;br /&gt;
        &lt;span class=&quot;gv&quot;&gt;$rails_rake_task&lt;/span&gt; = &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;br /&gt;
        require_environment!&lt;br /&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;&#20840;&#37096;&#25991;&#20214; &lt;a href=&quot;https://github.com/rails/rails/blob/v3.0.3/railties/lib/rails/application.rb#L212&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;&#21152;&#36733;&#20102; environment &#20063;&#23601;&#21487;&#20197; &#25214;&#21040; model Class &#20102;&lt;/p&gt;
&lt;p&gt;&#24635;&#32467;:&lt;/p&gt;
&lt;p&gt;1,rake &#21629;&#21517;&#26684;&#24335;&lt;/p&gt;
&lt;p&gt;rakefile, Rakefile, rakefile.rb, Rakefile.rb &#37117;&#21487;&#20197; &#65292;&#24120;&#29992; Rakefile&lt;/p&gt;
&lt;p&gt;&#21478;&#22806; rails &#20013;&#20351;&#29992;&#30340;&#35805;&#65292;&#36824;&#21487;&#20197; &#20351;&#29992; .rake &#21518;&#32512;&#30340;&#25991;&#20214;&lt;/p&gt;
&lt;p&gt;2,&#35774;&#32622;&#21629;&#21517;&#31354;&#38388;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;namespace &lt;span class=&quot;sy&quot;&gt;:test&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3,&#35774;&#32622;&#40664;&#35748;task&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;task &lt;span class=&quot;sy&quot;&gt;:default&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21487;&#20197;&#25351;&#23450;&#22810;&#20010; task,&#25191;&#34892; rake &#21518; &#65292;&#40664;&#35748;&#35843;&#29992;&#30340;&#26159; default task&lt;/p&gt;
&lt;p&gt;4&#65292;&#25351;&#23450;task&#25191;&#34892;&#39034;&#24207;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;task &lt;span class=&quot;sy&quot;&gt;:test&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:hello&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:world&lt;/span&gt;]&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5,&#26597;&#30475;rake &#20219;&#21153;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;rake -&lt;span class=&quot;co&quot;&gt;T&lt;/span&gt;  
rake --tasks
rake -&lt;span class=&quot;co&quot;&gt;T&lt;/span&gt; db: &lt;span class=&quot;c&quot;&gt;# &#26597;&#30475;db&#25171;&#22836;&#30340;task&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;6,&#36319;&#36394;task&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;rake test --trace &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26356;&#22810; options&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;usr/local/system/projects/entos/ent_os&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; rake -h
rake [-f rakefile] {options} targets...

&lt;span class=&quot;co&quot;&gt;Options&lt;/span&gt; are ...
    -&lt;span class=&quot;co&quot;&gt;C&lt;/span&gt;, --classic-namespace          &lt;span class=&quot;co&quot;&gt;Put&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Task&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;FileTask&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;in&lt;/span&gt; the top level namespace
    -&lt;span class=&quot;co&quot;&gt;D&lt;/span&gt;, --describe [&lt;span class=&quot;co&quot;&gt;PATTERN&lt;/span&gt;]         &lt;span class=&quot;co&quot;&gt;Describe&lt;/span&gt; the tasks (matching optional &lt;span class=&quot;co&quot;&gt;PATTERN&lt;/span&gt;), &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt; exit.
    -n, --dry-run                    &lt;span class=&quot;co&quot;&gt;Do&lt;/span&gt; a dry run without executing actions.
    -e, --execute &lt;span class=&quot;co&quot;&gt;CODE&lt;/span&gt;               &lt;span class=&quot;co&quot;&gt;Execute&lt;/span&gt; some &lt;span class=&quot;co&quot;&gt;Ruby&lt;/span&gt; code &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; exit.
    -p, --execute-print &lt;span class=&quot;co&quot;&gt;CODE&lt;/span&gt;         &lt;span class=&quot;co&quot;&gt;Execute&lt;/span&gt; some &lt;span class=&quot;co&quot;&gt;Ruby&lt;/span&gt; code, print the result, &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt; exit.
    -&lt;span class=&quot;co&quot;&gt;E&lt;/span&gt;, --execute-continue &lt;span class=&quot;co&quot;&gt;CODE&lt;/span&gt;      &lt;span class=&quot;co&quot;&gt;Execute&lt;/span&gt; some &lt;span class=&quot;co&quot;&gt;Ruby&lt;/span&gt; code, &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt; continue with normal task processing.
    -&lt;span class=&quot;co&quot;&gt;I&lt;/span&gt;, --libdir &lt;span class=&quot;co&quot;&gt;LIBDIR&lt;/span&gt;              &lt;span class=&quot;co&quot;&gt;Include&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;LIBDIR&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;in&lt;/span&gt; the search path &lt;span class=&quot;r&quot;&gt;for&lt;/span&gt; required modules.
    -&lt;span class=&quot;co&quot;&gt;P&lt;/span&gt;, --prereqs                    &lt;span class=&quot;co&quot;&gt;Display&lt;/span&gt; the tasks &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; dependencies, &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt; exit.
    -q, --quiet                      &lt;span class=&quot;co&quot;&gt;Do&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;not&lt;/span&gt; log messages to standard output.
    -f, --rakefile [&lt;span class=&quot;co&quot;&gt;FILE&lt;/span&gt;]            &lt;span class=&quot;co&quot;&gt;Use&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;FILE&lt;/span&gt; as the rakefile.
    -&lt;span class=&quot;co&quot;&gt;R&lt;/span&gt;, --rakelibdir &lt;span class=&quot;co&quot;&gt;RAKELIBDIR&lt;/span&gt;,     &lt;span class=&quot;co&quot;&gt;Auto&lt;/span&gt;-import any .rake files &lt;span class=&quot;r&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;RAKELIBDIR&lt;/span&gt;. (default is &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rakelib&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
        --rakelib
    -r, --require &lt;span class=&quot;co&quot;&gt;MODULE&lt;/span&gt;             &lt;span class=&quot;co&quot;&gt;Require&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;MODULE&lt;/span&gt; before executing rakefile.
        --rules                      &lt;span class=&quot;co&quot;&gt;Trace&lt;/span&gt; the rules resolution.
    -&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;, --no-search, --nosearch      &lt;span class=&quot;co&quot;&gt;Do&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;not&lt;/span&gt; search parent directories &lt;span class=&quot;r&quot;&gt;for&lt;/span&gt; the &lt;span class=&quot;co&quot;&gt;Rakefile&lt;/span&gt;.
    -s, --silent                     &lt;span class=&quot;co&quot;&gt;Like&lt;/span&gt; --quiet, but also suppresses the &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;in directory&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; announcement.
    -g, --system                     &lt;span class=&quot;co&quot;&gt;Using&lt;/span&gt; system wide (global) rakefiles (usually &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;~/.rake/*.rake&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).
    -&lt;span class=&quot;co&quot;&gt;G&lt;/span&gt;, --no-system, --nosystem      &lt;span class=&quot;co&quot;&gt;Use&lt;/span&gt; standard project &lt;span class=&quot;co&quot;&gt;Rakefile&lt;/span&gt; search paths, ignore system wide rakefiles.
    -&lt;span class=&quot;co&quot;&gt;T&lt;/span&gt;, --tasks [&lt;span class=&quot;co&quot;&gt;PATTERN&lt;/span&gt;]            &lt;span class=&quot;co&quot;&gt;Display&lt;/span&gt; the tasks (matching optional &lt;span class=&quot;co&quot;&gt;PATTERN&lt;/span&gt;) with descriptions, &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt; exit.
    -t, --trace                      &lt;span class=&quot;co&quot;&gt;Turn&lt;/span&gt; on invoke/execute tracing, enable full backtrace.
    -v, --verbose                    &lt;span class=&quot;co&quot;&gt;Log&lt;/span&gt; message to standard output.
    -&lt;span class=&quot;co&quot;&gt;V&lt;/span&gt;, --version                    &lt;span class=&quot;co&quot;&gt;Display&lt;/span&gt; the program version.
    -h, -&lt;span class=&quot;co&quot;&gt;H&lt;/span&gt;, --help                   &lt;span class=&quot;co&quot;&gt;Display&lt;/span&gt; this help message.
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;/test/rake&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cat &lt;span class=&quot;co&quot;&gt;Rakefile&lt;/span&gt; 
desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Default: test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
task &lt;span class=&quot;sy&quot;&gt;:default&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;r:test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]

namespace &lt;span class=&quot;sy&quot;&gt;:r&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; 
desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
task &lt;span class=&quot;sy&quot;&gt;:test&lt;/span&gt;  &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
        puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
task &lt;span class=&quot;sy&quot;&gt;:test1&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:test&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
        puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test3&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
task &lt;span class=&quot;sy&quot;&gt;:test3&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:test4&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
        puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;test3&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt; 
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://hi.baidu.com/%D0%C7203/blog/item/ebda2dd09f1d698ea1ec9c7a.html&quot;&gt;http://hi.baidu.com/%D0%C7203/blog/item/ebda2dd09f1d698ea1ec9c7a.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://guides.rubyonrails.org/command_line.html&quot;&gt;http://guides.rubyonrails.org/command_line.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://ericzouthoughts.wordpress.com/2009/06/20/execute-shell-command-in-ruby-rake-task/&quot;&gt;http://ericzouthoughts.wordpress.com/2009/06/20/execute-shell-command-in-ruby-rake-task/&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/26/ruby-rake-tips'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 26 Jan 2011 01:59:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:57c84d81-d428-473d-9854-4cac9bebc80d</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/26/ruby-rake-tips#comments</comments>
      <category>Ruby</category>
      <category>Rake</category>
      <category>ruby</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=177</trackback:ping>
      <link>http://wxianfeng.com/2011/01/26/ruby-rake-tips</link>
    </item>
    <item>
      <title>Javascript prototype &#23646;&#24615;</title>
      <description>&lt;p&gt;javascript &#21040;&#24213;&#26159;&#19968;&#20010;&#20160;&#20040;&#26679;&#30340;&#35821;&#35328;&#65292;&#21508;&#20154;&#35828;&#27861;&#19981;&#19968; &#65292;javascript &#20043;&#29238; &#35828; javascript &#22312;&#27169;&#33539; Java &#65292; javascript&#39640;&#32423;&#35821;&#35328;&#35774;&#35745; &#19968;&#20070;&#35828; javascript &#26159;&#38754;&#21521;&#23545;&#35937;&#65292;&#36807;&#31243;&#65292;&#20989;&#25968; &#19977;&#31181;&#20110;&#19968;&#20307;&#30340;&#35821;&#35328; &#65292; &#20063;&#26377;&#20154;&#35828; javascript &#26159; &#22522;&#20110;&#23545;&#35937;&#30340;&#35821;&#35328; &#65292;&#29978;&#33267;&#36824;&#26377;&#20154; &#35828;javascript&#37324;&#19968;&#20999;&#38754;&#21521;&#23545;&#35937;,&#25105;&#36824;&#35748;&#20026;javascript &#26159;&#21160;&#24577;&#35821;&#35328;&#20102;&#65292;&#22240;&#20026;javascript&#23545;&#35937;&#21487;&#20197;&#21160;&#24577;&#30340;&#28155;&#21152;&#23646;&#24615; &#65292;&#26041;&#27861;. &#27599;&#20010;&#20154;&#30340;&#35828;&#27861;&#37117;&#26377;&#33258;&#24049;&#30340;&#36947;&#29702;,&#19981;&#31649;&#24590;&#20040;&#35828;&#65292;,&#29702;&#35299; javascript &#23545;&#35937;prototype &#23646;&#24615;&#33267;&#20851;&#37325;&#35201;&lt;/p&gt;
&lt;p&gt;&#20854;&#23454;javascript &#26159;&#22522;&#20110;&#23545;&#35937;&#30340;&#35821;&#35328; &#65292; &#22914;&#26524;&#26159;&#38754;&#21521;&#23545;&#35937;&#30340;&#35805;&#65292;&#22522;&#26412;&#30340; &#31867; &#32487;&#25215; &#22810;&#24577; &#31561;&#31561;&#29305;&#24615;&#30340;&#37117;&#27809;&#26377; &#65292; javascript &#26159;&#22522;&#20110; prototype-base &#30340;&#35821;&#35328;&#65292;&#21363;&#22522;&#20110;&#21407;&#22411;&#30340;&#35821;&#35328;&#65292;&#23454;&#29616;&#32487;&#25215; == &#37117;&#38656;&#35201;&#20511;&#21161; prototype &#26469;&#23454;&#29616;,&lt;/p&gt;
&lt;p&gt;&#20026;&#20160;&#20040;&#35828;&#20102;&#37027;&#20040;&#22810; &#65292;&#22240;&#20026;&#26368;&#36817; &#36935;&#21040; &#19968;&#20010;&#38382;&#39064; &#65292; &#25152;&#20197; &#30740;&#31350;&#20102; &#19979; javascript prototype&lt;/p&gt;
&lt;p&gt;&#38382;&#39064;&#31616;&#21270;&#22914;&#19979;;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;Array.prototype.&lt;span class=&quot;fu&quot;&gt;add&lt;/span&gt; = &lt;span class=&quot;kw&quot;&gt;function&lt;/span&gt;(item) {
    &lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;.push(item);
}  
&lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; months = [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]
&lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; str = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;for&lt;/span&gt;( &lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;kw&quot;&gt;in&lt;/span&gt; months){
  str += months[i];
}
console.log(str);&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20320;&#35748;&#20026; &#19978;&#38754;&#36825;&#27573;&#20195;&#30721;&#30340;&#36755;&#20986;&#32467;&#26524;&#26159;&#20160;&#20040;&#65311;&lt;/p&gt;
&lt;p&gt;&#21018;&#24320;&#22987;&#25105;&#35748;&#20026;&#26159; str = 12 ,&#21487;&#26159;&#32467;&#26524;&#26159;&#38169;&#30340; &#65292;&#22914;&#26524;&#25226;&#25193;&#23637;&#30340; Array add&#26041;&#27861;&#21435;&#25481;&#23601;&#26159; 12 &#20102; &#65292; &#37027;&#20040;&#38382;&#39064;&#21040;&#24213;&#20986;&#22312;&#20160;&#20040;&#22320;&#26041;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;Array.prototype.&lt;span class=&quot;fu&quot;&gt;add&lt;/span&gt; = &lt;span class=&quot;kw&quot;&gt;function&lt;/span&gt;(item) {
    &lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;.push(item);
}  &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26159;&#32473;&#25968;&#32452;&#23545;&#35937;&#28155;&#21152;&#20102; add &#23646;&#24615;, &#21482;&#19981;&#36807;&#36825;&#20010; add &#23646;&#24615;&#23545;&#24212;&#19968;&#20010;&#20989;&#25968;(&#26041;&#27861;), &#32780;for .. in .. &#24490;&#29615;&#25968;&#32452;&#30340;&#35805;,&#20250;&#25226;&#23646;&#24615;&#20063;&#32473;&#24490;&#29615;&#20986;&#26469; &#12290;&#12290;&#12290;&#12290;&#25152;&#20197; &#26368;&#21518;&#32467;&#26524;&#26159;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;fl&quot;&gt;12f&lt;/span&gt;unction (item) { &lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;.push(item); }&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#27491;&#30830;&#30340;&#20889;&#27861;&#26159;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;Array.prototype.&lt;span class=&quot;fu&quot;&gt;add&lt;/span&gt; = &lt;span class=&quot;kw&quot;&gt;function&lt;/span&gt;(item) {
    &lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;.push(item);
}  
&lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; months = [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]
&lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; str = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;kw&quot;&gt;for&lt;/span&gt;( &lt;span class=&quot;kw&quot;&gt;var&lt;/span&gt; i =&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;,i&amp;lt;months.length,++i){
  str += months[i];
}
console.log(str);
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;length &#36820;&#22238;&#30340;&#26159;&#25968;&#32452;&#20803;&#32032;&#30340;&#38271;&#24230;,&#19981;&#21253;&#25324;&#23646;&#24615; ,&#25152;&#20197; &amp;#8230;&amp;#8230;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&#20854;&#23454; &#20027;&#35201; &#36824;&#26159;prototype &#38382;&#39064;&lt;/p&gt;
&lt;p&gt;prototype&#21040;&#24213;&#26159;&#20160;&#20040;?&lt;/p&gt;
&lt;p&gt;JavaScript &#20013;&#30340;&#27599;&#20010;&#23545;&#35937;&#37117;&#26377;&#19968;&#20010; prototype &#23646;&#24615;&#65292;&#25351;&#21521;&#21478;&#22806;&#19968;&#20010;&#23545;&#35937;&#12290;&#20351;&#29992;&#23545;&#35937;&#23383;&#38754;&#37327;&#21019;&#24314;&#30340;&#23545;&#35937;&#30340; prototype &#25351;&#21521;&#30340;&#26159;Object.prototype&#65292;&#22914;var obj = {&amp;quot;name&amp;quot; : &amp;quot;Alex&amp;quot;};&#20013;&#21019;&#24314;&#30340;&#23545;&#35937;obj&#30340; prototype &#25351;&#21521;&#30340;&#23601;&#26159;Object.prototype&#12290;&#32780;&#20351;&#29992; new &#25805;&#20316;&#31526;&#21019;&#24314;&#30340;&#23545;&#35937;&#30340; prototype &#25351;&#21521;&#30340;&#26159;&#20854;&#26500;&#36896;&#22120;&#30340; prototype &#12290;&#22914;var users = new Array();&#20013;&#21019;&#24314;&#30340;&#23545;&#35937;users&#30340; prototype &#25351;&#21521;&#30340;&#26159;Array.prototype&#12290;&#30001;&#20110;&#19968;&#20010;&#23545;&#35937; A &#30340; prototype &#25351;&#21521;&#30340;&#26159;&#21478;&#22806;&#19968;&#20010;&#23545;&#35937; B&#65292;&#32780;&#23545;&#35937; B &#33258;&#24049;&#30340; prototype &#21448;&#25351;&#21521;&#21478;&#22806;&#19968;&#20010;&#23545;&#35937; C&#65292;&#36825;&#26679;&#23601;&#24418;&#25104;&#20102;&#19968;&#20010;&#38142;&#26465;&#65292;&#31216;&#20026; prototype &#38142;&#12290;&#36825;&#20010;&#38142;&#26465;&#20250;&#19981;&#26029;&#32487;&#32493;&#65292;&#19968;&#30452;&#21040;Object.prototype&#12290;Object.prototype&#23545;&#35937;&#30340; prototype &#20540;&#20026; null&#65292;&#20174;&#32780;&#20351;&#24471;&#35813;&#38142;&#26465;&#32456;&#27490;&lt;/p&gt;
&lt;p&gt;&#19978;&#38754;&#36825;&#21477;&#35805; &#26159;&#20174; &lt;span class=&quot;caps&quot;&gt;IBM&lt;/span&gt; &#37027; copy &#26469;&#30340; &#65292; &#35299;&#37322;&#30340; &#24456;&#28165;&#26970;&amp;#8230;&lt;/p&gt;
&lt;p&gt;constructor&#23646;&#24615;&#24471;&#21040;&#20160;&#20040;?&lt;/p&gt;
&lt;p&gt;constructor &#23646;&#24615;&#24471;&#21040; &#35813;&#23545;&#35937;&#26159;&#36890;&#36807; &#21738;&#20010;&#26500;&#36896;&#20989;&#25968; &#26500;&#36896;&#20986;&#26469;&#30340;&#65292;&#21363;new&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;br /&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/snapshot4.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/snapshot4.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&#20174;&#19978;&#38754; &#21487;&#20197;&#30475;&#20986; Student &#30340;&#21407;&#22411;&#23545;&#35937;&#26159; Person , &#25152;&#20197; s &#20855;&#26377;&#20102; sex&#23646;&#24615; &#65292; &#20854;&#23454;&#36825;&#20010;&#20063;&#26159; javascript&#20013;&#32487;&#25215;&#30340; &#23454;&#29616;&#26041;&#27861; &#65292; Person&#30340;&#21407;&#22411;&#23545;&#35937;&#26159; Object , Object&#30340;&#21407;&#22411;&#23545;&#35937;&#26159; null &#36825;&#37324;&#21407;&#22411;&#36830;&#32456;&#27490;&lt;/p&gt;
&lt;p&gt;&#31034;&#24847;&#22270;:&lt;br /&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/prototype-chain.jpg&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/prototype-chain.jpg&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&#24403;&#28982; &#20851;&#20110; prototype &#30340;&#29992;&#27861;&#19981;&#20165;&#20165;&#36825;&#20123; &#12290;&#12290;&#20363;&#22914; javascript &#26694;&#26550; prototype.js &#23601;&#26159;&#22522;&#20110; javascript prototype &#23454;&#29616;&#30340;&#65292;&#37324;&#38754; &#25552;&#20379;&#20102; &#24456;&#22810; Array , String &#23545;&#35937;&#30340;&#24456;&#22909;&#29992;&#30340; &#24037;&#20855;&#26041;&#27861;&amp;#8230;.&lt;br /&gt;
 &#26356;&#22810;javascript prototype&#30340;&#23398;&#20064;&#65292; &#35831;&#26597;&#38405;&#20854;&#20182;&#36164;&#26009;.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/web/wa-lo-dojoajax1/&quot;&gt;http://www.ibm.com/developerworks/cn/web/wa-lo-dojoajax1/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.darkmi.com/blog/archives/981&quot;&gt;http://www.darkmi.com/blog/archives/981&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blabla.cn/js_examples/042_js_for_in.html&quot;&gt;http://www.blabla.cn/js_examples/042_js_for_in.html&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/21/javascript-prototype'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 21 Jan 2011 04:25:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:238950d8-aa12-48ac-91ce-4d4b638e2f58</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/21/javascript-prototype#comments</comments>
      <category>Javascript</category>
      <category>javascript</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=176</trackback:ping>
      <link>http://wxianfeng.com/2011/01/21/javascript-prototype</link>
    </item>
    <item>
      <title>Google &#26356;&#25442; CEO </title>
      <description>&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/1262078328aqel9BsG.jpg&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_1262078328aqel9BsG.jpg&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;google &#20170;&#26085; &#23459;&#24067;&#26356;&#25442;CEO &#65292; &#26045;&#23494;&#29305; &#23558;&#20110;&#26126;&#24180;4&#26376;&#20221; &#21368;&#20219; &lt;span class=&quot;caps&quot;&gt;CEO&lt;/span&gt; &#65292;3&#20010;&#21019;&#22987;&#20154; &#20043;&#19968; &#20329;&#22855; &#23558;&#20986;&#20219;CEO&#19968;&#32844;&#65292;&#25454;&#35828;&#26159;&#20026;&#20102; &#25269;&#25239; Twitter &#21644; Facebook&#30340; &#24378;&#21183;&amp;#8230;.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://tech.sina.com.cn/i/2011-01-21/05175115824.shtml&quot;&gt;http://tech.sina.com.cn/i/2011-01-21/05175115824.shtml&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/20/google-ceo'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 20 Jan 2011 22:12:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:fcfd7e94-914e-45c8-a328-228f9e7ff9fe</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/20/google-ceo#comments</comments>
      <category>Google</category>
      <category>Google</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=175</trackback:ping>
      <link>http://wxianfeng.com/2011/01/20/google-ceo</link>
    </item>
    <item>
      <title>ruby Object#tap and Object#returning</title>
      <description>&lt;p&gt;&#20170;&#22825;&#22312;rails&#20013;&#20351;&#29992; returning &#30340;&#26102;&#20505; log &#25171;&#20986;warning:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#returning has been deprecated in favor of Object#tap&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#29615;&#22659;&#26159; ruby 1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#20174;warn&#19978;&#30475;&#26159;returning&#19981;&#24314;&#35758;&#20351;&#29992;&#65292;&#24314;&#35758;&#20351;&#29992;tap&#26041;&#27861;,&#37027;&#20040;tap&#26041;&#27861;&#21644;returning&#26041;&#27861;&#26377;&#20160;&#20040;&#19981;&#21516;&lt;/p&gt;
&lt;p&gt;Object#tap &#26041;&#27861;&#26159; ruby1.8.7 &#20197;&#21518;&#21152;&#20837;&#30340;,Object#returning &#26041;&#27861;&#26159; rails&#28155;&#21152;&#30340;&lt;/p&gt;
&lt;p&gt;rails 3.0.3 returning &#28304;&#30721;:&lt;a href=&quot;https://github.com/rails/rails/blob/v3.0.3/activesupport/lib/active_support/core_ext/object/returning.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;rails 2.3.5 returning&#28304;&#30721;:&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
class Object
  # Returns +value+ after yielding +value+ to the block. This simplifies the
  # process of constructing an object, performing work on the object, and then
  # returning the object from a method. It is a Ruby-ized realization of the K
  # combinator, courtesy of Mikael Brockman.
  #
  # ==== Examples
  #
  #  # Without returning
  #  def foo
  #    values = []
  #    values &amp;lt;&amp;lt; &quot;bar&quot;
  #    values &amp;lt;&amp;lt; &quot;baz&quot;
  #    return values
  #  end
  #
  #  foo # =&amp;gt; ['bar', 'baz']
  #
  #  # returning with a local variable
  #  def foo
  #    returning values = [] do
  #      values &amp;lt;&amp;lt; 'bar'
  #      values &amp;lt;&amp;lt; 'baz'
  #    end
  #  end
  #
  #  foo # =&amp;gt; ['bar', 'baz']
  #  
  #  # returning with a block argument
  #  def foo
  #    returning [] do |values|
  #      values &amp;lt;&amp;lt; 'bar'
  #      values &amp;lt;&amp;lt; 'baz'
  #    end
  #  end
  #  
  #  foo # =&amp;gt; ['bar', 'baz']
  def returning(value)
    yield(value)
    value
  end

  # Yields &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; to the block, and then returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;.
  # The primary purpose of this method is to &quot;tap into&quot; a method chain,
  # in order to perform operations on intermediate results within the chain.
  #
  #   (1..10).tap { |x| puts &quot;original: #{x.inspect}&quot; }.to_a.
  #     tap    { |x| puts &quot;array: #{x.inspect}&quot; }.
  #     select { |x| x%2 == 0 }.
  #     tap    { |x| puts &quot;evens: #{x.inspect}&quot; }.
  #     map    { |x| x*x }.
  #     tap    { |x| puts &quot;squares: #{x.inspect}&quot; }
  def tap
    yield self
    self
  end unless Object.respond_to?(:tap)

  # An elegant way to factor duplication out of options passed to a series of
  # method calls. Each method called in the block, with the block variable as
  # the receiver, will have its options merged with the default +options+ hash
  # provided. Each method called on the block variable must take an options
  # hash as its final argument.
  # 
  #   with_options :order =&amp;gt; 'created_at', :class_name =&amp;gt; 'Comment' do |post|
  #     post.has_many :comments, :conditions =&amp;gt; ['approved = ?', true], :dependent =&amp;gt; :delete_all
  #     post.has_many :unapproved_comments, :conditions =&amp;gt; ['approved = ?', false]
  #     post.has_many :all_comments
  #   end
  #
  # Can also be used with an explicit receiver:
  #
  #   map.with_options :controller =&amp;gt; &quot;people&quot; do |people|
  #     people.connect &quot;/people&quot;,     :action =&amp;gt; &quot;index&quot;
  #     people.connect &quot;/people/:id&quot;, :action =&amp;gt; &quot;show&quot;
  #   end
  #
  def with_options(options)
    yield ActiveSupport::OptionMerger.new(self, options)
  end
  
  # A duck-type assistant method. For example, Active Support extends Date
  # to define an acts_like_date? method, and extends Time to define
  # acts_like_time?. As a result, we can do &quot;x.acts_like?(:time)&quot; and
  # &quot;x.acts_like?(:date)&quot; to do duck-type-safe comparisons, since classes that
  # we want to act like Time simply need to define an acts_like_time? method.
  def acts_like?(duck)
    respond_to? &quot;acts_like_#{duck}?&quot;
  end

end
&lt;/pre&gt;
&lt;p&gt;&#21487;&#20197;&#30475;&#21040; tap &#26041;&#27861;&#20063;&#23553;&#35013;&#20102;&#65292;&#20026;&#20102;&#38450;&#27490; ruby&#29256;&#26412;&#36807;&#20302; &#27809;&#26377;tap&#26041;&#27861;&#23601; &#28155;&#21152;Object#tap &#26041;&#27861;,tap &#21644; returning&#26412;&#36136;&#26159;&#19968;&#26679;&#30340;&#65292;&#20989;&#25968;&#20307;&#37117;&#26159;&#35843;&#29992;block&#38381;&#21253;,&#21482;&#19981;&#36807;returning&#38656;&#35201;&#20256;&#36882;&#19968;&#20010;&#21442;&#25968;&#32473;&#38381;&#21253;,&#26368;&#21518;&#36820;&#22238;&#30340;&#23601;&#26159;&#36825;&#20010;&#21442;&#25968;,&#32780; tap&#30452;&#25509;&#25805;&#20316;self&#25351;&#38024;,&#26368;&#21518;&#36820;&#22238;&#30340;&#20063;&#23601;&#26159;self&lt;/p&gt;
&lt;p&gt;&#21478;&#22806;&#26368;&#26032;rails&#28304;&#30721;(&amp;gt;rails3.0.3)&#24050;&#32463;&#27809;&#26377; returning&#26041;&#27861;&#20102;&#65292;&#25152;&#20197;&#20197;&#21518;&#26368;&#22909;&#37117;&#29992;tap&#26041;&#27861;&lt;/p&gt;
&lt;p&gt;DEMO1:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rubygems&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;active_support&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Object#tap &#26159;&amp;gt;ruby1.8.7 &#26377;&#30340;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Object#returning &#26159;Rails &#23553;&#35013;&#30340;&#26041;&#27861;, rails3.X &#24050;&#32463;&#19981;&#24314;&#35758;&#20351;&#29992;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Object#tap &#21487;&#20197;&#25903;&#25345;&#38142;&#24335;(chain)&#25805;&#20316;&lt;/span&gt;
(&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;..&lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;).tap {
  |x| puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;original: &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;x.inspect&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
}.to_a.tap {
  |x| puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;array: &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;x.inspect&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
}.select {|x| x%&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;==&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;}.tap {
  |x| puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;evens: &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;x.inspect&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
}.map {|x| x*x}.tap {
  |x| puts &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;squares: &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;x.inspect&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
}

&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;object_tap&lt;/span&gt;
  {}.tap &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |h| &lt;span class=&quot;c&quot;&gt;# =&amp;gt; Hash.new.tap&lt;/span&gt;
    h[&lt;span class=&quot;sy&quot;&gt;:a&lt;/span&gt;] = &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
    h[&lt;span class=&quot;sy&quot;&gt;:b&lt;/span&gt;] =&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

p object_tap &lt;span class=&quot;c&quot;&gt;# {:b=&amp;gt;2, :a=&amp;gt;1}&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;object_returning&lt;/span&gt;
  returning &lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;.new &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |h| &lt;span class=&quot;c&quot;&gt;# &#27880;&#24847;&#36825;&#37324;&#19981;&#33021;&#29992; {}  , &#25918;&#22312; returning &#26041;&#27861;&#21518;&#38754; &#24403;&#20316;&#25104; block&#38381;&#21253;&#20102;&lt;/span&gt;
    h[&lt;span class=&quot;sy&quot;&gt;:a&lt;/span&gt;] = &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
    h[&lt;span class=&quot;sy&quot;&gt;:b&lt;/span&gt;] = &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;  
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

p object_returning &lt;span class=&quot;c&quot;&gt;# {:b=&amp;gt;2, :a=&amp;gt;1}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;DEMO2:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rubygems&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;active_support&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Hash&lt;/span&gt;  
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;shift_value_tap_self&lt;/span&gt;
    &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.tap &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |h|
      h.each { |k,v| v.shift &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; v.is_a?(&lt;span class=&quot;co&quot;&gt;Array&lt;/span&gt;) }
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;shift_value_tap&lt;/span&gt;
    {}.tap &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |h|
      &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.each { |k,v|  v.is_a?(&lt;span class=&quot;co&quot;&gt;Array&lt;/span&gt;) ? h[k] = v.shift : h[k] = v } 
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;shift_value_returning&lt;/span&gt;
    returning &lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;.new &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |h|
      &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.each { |k,v|  v.is_a?(&lt;span class=&quot;co&quot;&gt;Array&lt;/span&gt;) ? h[k] = v.shift : h[k] = v } 
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;shift_value_returning_self&lt;/span&gt;
    returning &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |h|
      h.each { |k,v| v.shift &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; v.is_a?(&lt;span class=&quot;co&quot;&gt;Array&lt;/span&gt;) }
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

hsh = {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;fuck_china&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}
hsh1 = {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;fuck_china&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}
hsh2 = {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;fuck_china&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}
hsh3 = {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;],&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;fuck_china&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}
p hsh.shift_value_tap &lt;span class=&quot;c&quot;&gt;# {&amp;quot;a&amp;quot;=&amp;gt;1, &amp;quot;b&amp;quot;=&amp;gt;&amp;quot;g&amp;quot;, &amp;quot;c&amp;quot;=&amp;gt;&amp;quot;fuck_china&amp;quot;}&lt;/span&gt;
p hsh1.shift_value_returning &lt;span class=&quot;c&quot;&gt;# {&amp;quot;a&amp;quot;=&amp;gt;1, &amp;quot;b&amp;quot;=&amp;gt;&amp;quot;g&amp;quot;, &amp;quot;c&amp;quot;=&amp;gt;&amp;quot;fuck_china&amp;quot;}&lt;/span&gt;
p hsh2.shift_value_tap_self &lt;span class=&quot;c&quot;&gt;# {&amp;quot;a&amp;quot;=&amp;gt;[2, 3], &amp;quot;b&amp;quot;=&amp;gt;[&amp;quot;f&amp;quot;, &amp;quot;w&amp;quot;], &amp;quot;c&amp;quot;=&amp;gt;&amp;quot;fuck_china&amp;quot;}&lt;/span&gt;
p hsh3.shift_value_returning_self &lt;span class=&quot;c&quot;&gt;# {&amp;quot;a&amp;quot;=&amp;gt;[2, 3], &amp;quot;b&amp;quot;=&amp;gt;[&amp;quot;f&amp;quot;, &amp;quot;w&amp;quot;], &amp;quot;c&amp;quot;=&amp;gt;&amp;quot;fuck_china&amp;quot;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;br /&gt;
&lt;a href=&quot;http://blog.rubybestpractices.com/posts/gregory/011-tap-that-hash.html&quot;&gt;http://blog.rubybestpractices.com/posts/gregory/011-tap-that-hash.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.simonecarletti.com/blog/2010/09/rails-3-beware-the-tap-pattern/&quot;&gt;http://www.simonecarletti.com/blog/2010/09/rails-3-beware-the-tap-pattern/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://fuliang.javaeye.com/blog/857163&quot;&gt;http://fuliang.javaeye.com/blog/857163&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/19/ruby-object-tap-and-object-returning'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 19 Jan 2011 11:29:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ecacba6c-714d-4f43-a6f2-9b9218b81c4f</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/19/ruby-object-tap-and-object-returning#comments</comments>
      <category>Rails</category>
      <category>Ruby</category>
      <category>ruby1.9.2</category>
      <category>rails3.x</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=173</trackback:ping>
      <link>http://wxianfeng.com/2011/01/19/ruby-object-tap-and-object-returning</link>
    </item>
    <item>
      <title>ruby string to class</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2&lt;/p&gt;
&lt;p&gt;&#26377;&#36825;&#26679;&#19968;&#20010;&#38656;&#27714;&#65292; &#32473;&#20320; &#20219;&#24847;&#19968;&#20010;&#23383;&#31526;&#20018;&#65292;&#25226;&#23427;&#36716;&#21270;&#20026;&#31867;,&#32593;&#19978;&#22823;&#22810;&#25968;&#30340; &#35299;&#20915;&#21150;&#27861;&#26159; &#19979;&#38754;&#19977;&#31181;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Kernel&lt;/span&gt;.const_get(&lt;span class=&quot;sy&quot;&gt;:User&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# Object.const_get(:User)&lt;/span&gt;
eval(&#8217;User&#8217;)
&#8216;User&#8217;.constantize&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20294;&#26159;&#19978;&#38754;&#19977;&#31181;&#26041;&#27861;, &#36825;&#20010; User &#20107;&#20808;&#24517;&#39035;&#26159;&#21021;&#22987;&#21270;&#30340;,&#19981;&#28982;&#20250;&#25253;&#38169;&#65292;&#22914;&#19979;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_get(&lt;span class=&quot;sy&quot;&gt;:User&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# uninitialized constant User (NameError)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25152;&#20197;&#38656;&#35201;&#21152;&#20010;&#21028;&#26029; &#36825;&#20010; Class &#26377;&#27809;&#26377;&#21021;&#22987;&#21270;&#65292;&#27809;&#26377;&#30340;&#35805; &#20877;set &#19968;&#20010;Class&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails/all&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Kernel&lt;/span&gt;.const_missing(name)
  &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_set(name,&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt;.new)
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#p Kernel.const_get(&amp;quot;baoxiaos&amp;quot;.to_sym) # wrong constant name baoxiaos (NameError)&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Kernel&lt;/span&gt;.const_get(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;baoxiaos&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.classify.to_sym) &lt;span class=&quot;c&quot;&gt;# Baoxiao , const&#30340;&#39318;&#23383;&#27597;&#24517;&#39035;&#22823;&#20889;&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Kernel&lt;/span&gt;.constants &lt;span class=&quot;c&quot;&gt;# []&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.constants.include?(&lt;span class=&quot;sy&quot;&gt;:UBaoxiao&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# true&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21018;&#24320;&#22987;&#25226;&#36825;&#20010; const &#23450;&#20041;&#22312; Object &#37324;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails/all&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_missing(name)
  &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_set(name,&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt;.new)
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#p Object.const_get(&amp;quot;baoxiaos&amp;quot;.to_sym) # wrong constant name baoxiaos (NameError)&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_get(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;baoxiaos&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.classify.to_sym)&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21457;&#29616; &#29992;&#22312; rails &#20013;&#21518; , rails &#22788;&#22788;&#25253;&#38169;&#65292;&#21487;&#33021; &#24618;&#25105;&#37325;&#20889;&#20102; Object.const_missing &#23548;&#33268;&#30340; &amp;#8230;&amp;#8230;..&lt;/p&gt;
&lt;p&gt;&#19978;&#38754;&#26041;&#27861;&#30340;&#21407;&#29702;&#26159; &#24403;&#25214;&#19981;&#21040; const&#30340;&#26102;&#20505;  &#25191;&#34892;&#20102;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_set(name,&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt;.new)&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#37027;&#20040; name &#23601;&#21464;&#25104;&#26159; Class &#30340;&#23454;&#20363;&#20102; , &#20026;&#20160;&#20040;&#23450;&#20041;&#22312; Kernel &#20013;&#30340; const_missing &#65292;Object &#20063;&#21487;&#20197;&#35775;&#38382;&#21040;&#65292;&#38656;&#35201;&#27880;&#24847; Object,Kernel &#20043;&#38388;&#30340;&#20851;&#31995;,Object &#26159; inluce Kernel &#30340;,&#22914;&#19979;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Object&lt;/span&gt;
include &lt;span class=&quot;co&quot;&gt;Kernel&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://niczsoft.com/2010/01/string-to-class-in-ruby-on-rails/&quot;&gt;http://niczsoft.com/2010/01/string-to-class-in-ruby-on-rails/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.ruby-forum.com/topic/96222&quot;&gt;http://www.ruby-forum.com/topic/96222&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/17/rails-string-to-class'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 17 Jan 2011 04:53:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:deed033e-20a1-406d-934d-c47907d7a0b4</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/17/rails-string-to-class#comments</comments>
      <category>Ruby</category>
      <category>ruby</category>
      <category>Metaprogramming</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=170</trackback:ping>
      <link>http://wxianfeng.com/2011/01/17/rails-string-to-class</link>
    </item>
    <item>
      <title>Rails try method</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#25105;&#20204;&#32463;&#24120;&#20250;&#26377;&#36825;&#26679;&#30340;&#25805;&#20316;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.find_by_login(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wxianfeng&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)  &lt;span class=&quot;c&quot;&gt;# =&amp;gt;  nil &lt;/span&gt;
user.name &lt;span class=&quot;c&quot;&gt;# =&amp;gt; NoMethodError: undefined method `name' for nil:NilClass&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20551;&#22914; login &#20026; wxianfeng &#19981;&#23384;&#22312; &#65292;&#20250;&#25253;&#38169;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;NoMethodError&lt;/span&gt;: undefined method &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name' for nil:NilClass&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#37027;&#20040;&#24314;&#35758;&#20351;&#29992; try &#26041;&#27861;&#36991;&#20813;&#25253;&#38169;&#65292;try &#36820;&#22238;&#30340;&#26159; nil&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user.try(&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# =&amp;gt;nil &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20063;&#23601;&#30456;&#24403;&#20110;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt;.try(&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# =&amp;gt; nil&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#30475;&#19979;&#28304;&#30721;: &lt;a href=&quot;https://github.com/rails/rails/blob/v3.0.3/activesupport/lib/active_support/core_ext/object/try.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#20854;&#23454;&#23601;&#26159;&#35843;&#29992;&#20102; &lt;code&gt;__send__&lt;/code&gt;  &#26041;&#27861; , &lt;code&gt;__send__&lt;/code&gt; &#26041;&#27861; &#21644; send &#26041;&#27861;&#31561;&#20215; , &#21482;&#19981;&#36807;  &lt;code&gt;__send__&lt;/code&gt; &#26041;&#27861; &#20026;&#20102;&#38450;&#27490; &#26377;&#24050;&#32463;&#23384;&#22312;&#30340; send &#26041;&#27861; , nil &#30340;&#35805; &#35843;&#29992; NilClass &#30340; try &#26041;&#27861;&lt;/p&gt;
&lt;p&gt;&#21478;&#22806; &#21457;&#29616; github&#19978; try&#26041;&#27861;&#24050;&#32463;&#37325;&#26032;&#20889;&#20102; &#65292;&#22914;&#19979;: &lt;a href=&quot;https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/try.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
class Object
  # Invokes the method identified by the symbol +method+, passing it any arguments
  # and/or the block specified, just like the regular Ruby &amp;lt;tt&amp;gt;Object#send&amp;lt;/tt&amp;gt; does.
  #
  # *Unlike* that method however, a +NoMethodError+ exception will *not* be raised
  # and +nil+ will be returned instead, if the receiving object is a +nil+ object or NilClass.
  #
  # If try is called without a method to call, it will yield any given block with the object.
  #
  # ==== Examples
  #
  # Without try
  # @person &amp;amp;&amp;amp; @person.name
  # or
  # @person ? @person.name : nil
  #
  # With try
  # @person.try(:name)
  #
  # +try+ also accepts arguments and/or a block, for the method it is trying
  # Person.try(:find, 1)
  # @people.try(:collect) {|p| p.name}
  #
  # Without a method argument try will yield to the block unless the reciever is nil.
  # @person.try { |p| &quot;#{p.first_name} #{p.last_name}&quot; }
  #--
  # +try+ behaves like +Object#send+, unless called on +NilClass+.
  def try(*a, &amp;amp;b)
    if a.empty? &amp;amp;&amp;amp; block_given?
      yield self
    else
      __send__(*a, &amp;amp;b)
    end
  end
end

class NilClass #:nodoc:
  def try(*args)
    nil
  end
end
&lt;/pre&gt;
&lt;p&gt;&#20854;&#23454;&#21482;&#26159;&#21028;&#26029;&#20102;     if a.empty? &amp;amp;&amp;amp; block_given? &#36825;&#31181;&#24773;&#20917;  &#21017;&#30452;&#25509;&#25191;&#34892;block &#20869;&#23481;&#28982;&#21518;&#36820;&#22238;&#65292;&#25928;&#26524;&#19968;&#26679;&amp;#8230;..&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;active_support/core_ext/object/try&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Klass&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;send&lt;/span&gt;(*args)
    &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;helo &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + args.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;hello&lt;/span&gt;(*args)
    &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Hello &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + args.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;fu&quot;&gt;foobar&lt;/span&gt;(s)
     &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;s&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; foobar&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

k = &lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.new

&lt;span class=&quot;c&quot;&gt;# __send__ &#20026;&#20102;&#38450;&#27490;&#26377;&#26041;&#27861;&#21517;&#21483;send &#65292; &#24314;&#35758;&#29992; __send__&lt;/span&gt;
p k.__send__ &lt;span class=&quot;sy&quot;&gt;:hello&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;gentle&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;readers&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;#=&amp;gt; &amp;quot;Hello gentle readers&amp;quot; &lt;/span&gt;
p k.send &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;gentle&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;readers&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;#=&amp;gt; &amp;quot;Helo gentle readers&amp;quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Ruby &#37324;&#19968;&#20999;&#30342;&#26159;&#23545;&#35937;,&#31867;&#20063;&#26159;&#23545;&#35937;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Klass(&#31867;) &#26159; Class &#30340;&#23454;&#20363; , Class &#26159; Object &#30340;&#23454;&#20363; , &#37027;&#20040; Klass &#20063;&#23601;&#26159; Object &#30340;&#23454;&#20363; &#25152;&#20197; Klass &#21487;&#20197;&#35843;&#29992;try &#26041;&#27861;&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.try(&lt;span class=&quot;sy&quot;&gt;:foobar&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hey&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;hey foobar&amp;quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# k &#26159;Klass &#30340;&#23454;&#20363;,Klass &#30340;&#29238;&#31867;&#26159; Object , &#25152;&#20197; k &#21487;&#20197;&#35843;&#29992; try &#26041;&#27861;&lt;/span&gt;
p k.try(&lt;span class=&quot;sy&quot;&gt;:send&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;bla&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;bla&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;helo bla bla&amp;quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# class &#24471;&#21040;&#30340;&#26159; &#23454;&#20363;&#20851;&#31995;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# superclass &#24471;&#21040;&#30340;&#26159; &#32487;&#25215;&#20851;&#31995;&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.superclass &lt;span class=&quot;c&quot;&gt;# Object&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.class &lt;span class=&quot;c&quot;&gt;# Class&lt;/span&gt;
p k.class &lt;span class=&quot;c&quot;&gt;# Klass&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;hr/&gt;
&lt;p&gt;&#21478;&#22806; &#36825;&#26159; &#23545;&#35937;nil &#37027;&#22914;&#26524; &#27809;&#26377;&#37027;&#20010;&#23383;&#27573;&#20102; &#65292; &#23601;&#20250; &#25253; &#25214;&#19981;&#21040;&#26041;&#27861;&#30340;&#38169;&#35823;&lt;/p&gt;
&lt;p&gt;&#20363;&#22914;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; u=&lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.first
  &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Load&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;175.8&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;.* &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;LIMIT&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;c&quot;&gt;#&amp;lt;User id: 1, login: &amp;quot;entos&amp;quot;, name: &amp;quot;&amp;quot;, email: &amp;quot;entos@entos.com&amp;quot;, crypted_password: &amp;quot;557c88b0713f63397249f4198368e4a57d6d400f&amp;quot;, salt: &amp;quot;4e04ef1cf506595ac3edf6a249791c55995b0f8f&amp;quot;, remember_token: nil, remember_token_expires_at: nil, activation_code: nil, activated_at: nil, status: 2, suspend_at: nil, avatar_id: nil, orgunit_id: nil, mobile_phone: nil, last_login_at: nil, language: nil, options: nil, created_at: &amp;quot;2011-02-24 02:55:42&amp;quot;, updated_at: &amp;quot;2011-02-24 02:55:42&amp;quot;&amp;gt; &lt;/span&gt;
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; u.hi
&lt;span class=&quot;co&quot;&gt;NoMethodError&lt;/span&gt;: undefined method &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hi' for #&amp;lt;User:0x9fcfe00&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#24314;&#35758;&#21152;&#19978; respond_to? &#21028;&#26029;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; u.respond_to? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hi&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/14/rails-try-method'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 14 Jan 2011 03:20:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b39a3610-3823-44a2-abdb-b390225308bf</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/14/rails-try-method#comments</comments>
      <category>Rails</category>
      <category>ruby</category>
      <category>rails</category>
      <category>Metaprogramming</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=164</trackback:ping>
      <link>http://wxianfeng.com/2011/01/14/rails-try-method</link>
    </item>
    <item>
      <title>rails &#25511;&#21046;&#21488;&#36755;&#20986;sql</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#25105;&#20204;&#32463;&#24120;&#38656;&#35201;&#22312; rails console &#20013;&#36827;&#34892;Model&#30340;&#25805;&#20316;,&#24819;&#30475;&#25191;&#34892;&#30340;sql &#65292;&#24517;&#39035;&#21040; rails log &#20013;&#21435;&#26597;&#30475; &#65292; &#29616;&#22312; &#26377;&#19968;&#20010;&#26356;&#22909;&#30340;&#21150;&#27861;&#65292;&#30452;&#25509;&#36755;&#20986;&#21040; console &#20013;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&#22312;console &#36816;&#34892;&#19979;&#38754;&#36825;&#21477;&#35805;&#21363;&#21487;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;.logger = &lt;span class=&quot;co&quot;&gt;Logger&lt;/span&gt;.new(&lt;span class=&quot;co&quot;&gt;STDOUT&lt;/span&gt;)&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25110;&#32773; &#30452;&#25509;&#20889;&#21040; config/appliction.rb &#20013; &#65292;&#19979;&#27425;&#21551;&#21160;console&#30340;&#26102;&#20505; &#19981;&#38656;&#35201;&#22312;&#20889;&#19978;&#38754;&#35821;&#21477;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Rails&lt;/span&gt;.env == &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;development&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;.logger = &lt;span class=&quot;co&quot;&gt;Logger&lt;/span&gt;.new(&lt;span class=&quot;co&quot;&gt;STDOUT&lt;/span&gt;)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;usr/local/system/projects/entos/ent_os&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; rails  c 
&lt;span class=&quot;co&quot;&gt;Loading&lt;/span&gt; development environment (&lt;span class=&quot;co&quot;&gt;Rails&lt;/span&gt; &lt;span class=&quot;fl&quot;&gt;3.0&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;)
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;.logger = &lt;span class=&quot;co&quot;&gt;Logger&lt;/span&gt;.new(&lt;span class=&quot;co&quot;&gt;STDOUT&lt;/span&gt;)
 =&amp;gt; &lt;span class=&quot;c&quot;&gt;#&amp;lt;Logger:0xadc0730 @progname=nil, @level=0, @default_formatter=#&amp;lt;Logger::Formatter:0xadc071c @datetime_format=nil&amp;gt;, @formatter=nil, @logdev=#&amp;lt;Logger::LogDevice:0xadc06a4 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#&amp;lt;IO:&amp;lt;STDOUT&amp;gt;&amp;gt;, @mutex=#&amp;lt;Logger::LogDevice::LogDeviceMutex:0xadc0690 @mon_owner=nil, @mon_count=0, @mon_mutex=#&amp;lt;Mutex:0xadc0668&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;
ruby-&lt;span class=&quot;fl&quot;&gt;1.9&lt;/span&gt;.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;-p0 &amp;gt; &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.last 
  &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Load&lt;/span&gt; (&lt;span class=&quot;fl&quot;&gt;0.2&lt;/span&gt;ms)  &lt;span class=&quot;co&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;.* &lt;span class=&quot;co&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;BY&lt;/span&gt; users.id &lt;span class=&quot;co&quot;&gt;DESC&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;LIMIT&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
 =&amp;gt; &lt;span class=&quot;c&quot;&gt;#&amp;lt;User id: 15, login: &amp;quot;xxxxxx&amp;quot;, name: &amp;quot;&amp;quot;, email: &amp;quot;xx@zz.com&amp;quot;, crypted_password: &amp;quot;471f98733c6d2456df58a354feddcf7af22ea78e&amp;quot;, salt: &amp;quot;f03c284f91365a3eeb30a2898b79524694efdac5&amp;quot;, remember_token: nil, remember_token_expires_at: nil, activation_code: nil, activated_at: &amp;quot;2011-01-07 08:00:25&amp;quot;, status: 2, suspend_at: nil, avatar_id: nil, orgunit_id: nil, mobile_phone: nil, last_login_at: nil, language: nil, options: nil, created_at: &amp;quot;2011-01-07 08:00:17&amp;quot;, updated_at: &amp;quot;2011-01-07 08:00:25&amp;quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21478;&#22806; &#36824;&#21487;&#20197; &#20351;&#29992; hirb gem &#26469;&#35753;&#36755;&#20986;&#26684;&#24335;&#20197;&#34920;&#26684;&#25490;&#21015;&#65292;&#20010;&#20154;&#19981;&#26159;&#22826;&#21916;&#27426;&#65292;&#21407;&#26377;&#30340;&#26041;&#24335;&#21487;&#20197;&#30475;&#20986;&#25968;&#25454;&#30340;&#36820;&#22238;&#26684;&#24335;,&#26159;&#38598;&#21512;&#25968;&#32452; &#65292; &#36824;&#26159;&#21333;&#20010;&#23545;&#35937; &#19968;&#28165;&#20108;&#26970; &#12290;&#12290;&#12290;&#32780;hirb &#23601;&#27809;&#26377;&#20102;&lt;/p&gt;
&lt;p&gt;SEE&#65306;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://tuohuang.thoughtworkers.org/?p=114&quot;&gt;http://tuohuang.thoughtworkers.org/?p=114&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/13/rails-console-sql'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 13 Jan 2011 22:14:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ae222538-5a84-4a43-8edd-0d5affeb53f2</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/13/rails-console-sql#comments</comments>
      <category>Rails</category>
      <category>ruby</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=163</trackback:ping>
      <link>http://wxianfeng.com/2011/01/13/rails-console-sql</link>
    </item>
    <item>
      <title>Rails&#28304;&#30721; attr_internal </title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3 + ubuntu 10.10&lt;/p&gt;
&lt;p&gt;params&#22312;rails&#20013;&#24456;&#24120;&#29992;&#65292;&#29305;&#21035;&#22312;&#34920;&#21333;&#25552;&#20132;&#30340;&#26102;&#20505;,params &#20135;&#29983;&#30340;&#26159;&#19968;&#20010;Hash &#65292;&#37324;&#38754;&#26500;&#36896;&#36890;&#36807; form&#22495;&#30340;name&#26500;&#36896; ,&#20135;&#29983;&#19981;&#21516;&#30340; params &#20869;&#23481;,&#20170;&#22825; &#22312;&#30475;rails  params &#23454;&#29616;&#30340;&#26102;&#20505; &#21457;&#29616;&#36890;&#36807; attr_internal &#30340;&#26041;&#27861;&#23454;&#29616;,params&#26041;&#27861; &#30340;&#28304;&#30721;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;params&lt;/span&gt;
      &lt;span class=&quot;iv&quot;&gt;@_params&lt;/span&gt; ||= request.parameters
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21457;&#29616;&#20854;&#23454;&#26159;&#20174; request &#36825;&#20010;&#26041;&#27861;&#24471;&#21040;&#30340;,&#37027;&#20040;request&#26041;&#27861;&#21448;&#26159;&#24590;&#20040;&#23450;&#20041;&#30340;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;attr_internal &lt;span class=&quot;sy&quot;&gt;:headers&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:response&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:request&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#23601;&#26159; &#29992;&#20102; attr_internal &#26041;&#27861;&lt;/p&gt;
&lt;p&gt;&#30475;&#19979; &#25972;&#20010; metal.rb&#25991;&#20214;: &lt;a href=&quot;https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#21457;&#29616;&#20102; response,headers,session(&#20511;&#21161;delegate&#22996;&#27966;) ,status,params ==  &#37117;&#26159;&#36890;&#36807; attr_internal &#23454;&#29616;&#30340;,&#26469;&#30475;&#30475; attr_internal &#21040;&#24213;&#26159;&#20309;&#39035;&#20154;&#20063; &#65306;&lt;/p&gt;
&lt;p&gt;&#28304;&#30721;&#65306; &lt;a href=&quot;https://github.com/rails/rails/raw/master/activesupport/lib/active_support/core_ext/module/attr_internal.rb&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
class Module
  # Declares an attribute reader backed by an internally-named instance variable.
  def attr_internal_reader(*attrs)
    attrs.each do |attr|
      module_eval &quot;def #{attr}() #{attr_internal_ivar_name(attr)} end&quot;, __FILE__, __LINE__
    end
  end

  # Declares an attribute writer backed by an internally-named instance variable.
  def attr_internal_writer(*attrs)
    attrs.each do |attr|
      module_eval &quot;def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end&quot;, __FILE__, __LINE__
    end
  end

  # Declares an attribute reader and writer backed by an internally-named instance
  # variable.
  def attr_internal_accessor(*attrs)
    attr_internal_reader(*attrs)
    attr_internal_writer(*attrs)
  end

  alias_method :attr_internal, :attr_internal_accessor

  class &amp;lt;&amp;lt; self; attr_accessor :attr_internal_naming_format end
  self.attr_internal_naming_format = '@_%s'

  private
    def attr_internal_ivar_name(attr)
      Module.attr_internal_naming_format % attr
    end
end
&lt;/pre&gt;
&lt;p&gt;&#21457;&#29616;&#20854;&#23454;&#23601;&#26159;&#36890;&#36807; module_eval &#32473; &#23545;&#35937; &#28155;&#21152;&#20102; settet , getter &#26041;&#27861;&#32780;&#24050;,&#20294;&#26159;&#21629;&#21517;&#26684;&#24335;&#26159;&#36825;&#26679;&#30340;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.attr_internal_naming_format = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@_%s&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;active_support/core_ext/module/attr_internal&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Foo&lt;/span&gt;
  
  attr_accessor &lt;span class=&quot;sy&quot;&gt;:sex&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:birthday&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# attr_accessor ruby&#37324;&#23553;&#35013;&#30340;method&lt;/span&gt;
  attr_internal &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:city&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# attr_internal rails &#23553;&#35013;&#30340;&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;bar&lt;/span&gt;
    name &lt;span class=&quot;c&quot;&gt;# call getter method # =&amp;gt; @_name&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

f = &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;.new
f.name = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wxianfeng&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
p f.instance_variables &lt;span class=&quot;c&quot;&gt;# =&amp;gt; [:@_name]&lt;/span&gt;
p f.name &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;wxianfeng&amp;quot;&lt;/span&gt;
p f &lt;span class=&quot;c&quot;&gt;# =&amp;gt; #&amp;lt;Foo:0x8630e18 @_name=&amp;quot;wxianfeng&amp;quot;&amp;gt;&lt;/span&gt;
p f.bar &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;wxianfeng&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25152;&#20197; attr_internal &#21644; attr_accessor &#20854;&#23454;&#26159; &#31561;&#20215;&#30340;,&#21482;&#19981;&#36807; &#20174;&#23383;&#38754;&#24847;&#24605;&#19978;&#30475;&#26159;&#20869;&#37096;&#21464;&#37327;(&#38381;&#21253;&#21464;&#37327;&#30340;&#20889;&#27861;) &#65292;attr_internal &#24076;&#26395;&#20320; &#36890;&#36807;&#26041;&#27861;&#21517;&#26469;&#35843;&#29992;&#65292;&#19981;&#29992; @_%s &#36825;&#20010;&#20889;&#27861; &#26469;&#35843;&#29992;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&#25152;&#20197; &#20854;&#23454; &#19968;&#33324;&#25105;&#20204;&#22312; controller &#29992;&#30340; request &#26041;&#27861; &#20854;&#23454; &#21487;&#20197;&#30452;&#25509;&#36825;&#26679;&#20889;  @_request ,&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;request &lt;span class=&quot;c&quot;&gt;#=&amp;gt; @_request&lt;/span&gt;
params &lt;span class=&quot;c&quot;&gt;# =&amp;gt; @_request.parameters&lt;/span&gt;
params &lt;span class=&quot;c&quot;&gt;# =&amp;gt; @_params&lt;/span&gt;
headers &lt;span class=&quot;c&quot;&gt;#=&amp;gt; @_headers&lt;/span&gt;
status &lt;span class=&quot;c&quot;&gt;#=&amp;gt; @_status&lt;/span&gt;
.
&lt;span class=&quot;er&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;er&quot;&gt;.&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20294;&#26159;&#19968;&#33324; &#19981;&#24314;&#35758;&#36825;&#26679;&#20889;&lt;/p&gt;
&lt;p&gt;&#36824;&#21457;&#29616; &#36825;&#20123;&#21644; http&#30456;&#20851;&#30340;&#19996;&#35199;&#37117;&#23450;&#20041;&#22312; metal &#27169;&#22359;, metal &#26159; rails &#38142;&#25509; rack &#30340;&#20013;&#38388;&#20214;,&#28304;&#30721;&#20013;&#30340;&#35299;&#37322;:&lt;/p&gt;
&lt;p&gt;ActionController::Metal provides a way to get a valid Rack application from a controller.&lt;/p&gt;
&lt;p&gt;Rack &#26159;&#19968;&#20010; ruby&#23454;&#29616;&#30340;web server,&#23553;&#35013;&#20102; http&#30340;&#35831;&#27714;&#21644;&#21709;&#24212;&#31561;,&#20363;&#22914;  rails,sinatra == &#37117;&#26159;&#22312; rack &#22522;&#30784;&#19978;&#23454;&#29616;&#30340;&amp;#8230;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&#26377;&#26426;&#20250;&#24456;&#26377;&#24517;&#35201; &#28145;&#20837;&#23398;&#20064;&#19979;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://rubyonrailswin.wordpress.com/2007/03/07/actioncontroller-and-what-the-heck-is-attr_internal/&quot;&gt;http://rubyonrailswin.wordpress.com/2007/03/07/actioncontroller-and-what-the-heck-is-attr_internal/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.oschina.net/p/rack&quot;&gt;http://www.oschina.net/p/rack&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/11/rails-attr_internal'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 11 Jan 2011 02:34:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a8c32dab-5af6-481f-8550-7f20e6f61143</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/11/rails-attr_internal#comments</comments>
      <category>Rails</category>
      <category>ruby</category>
      <category>rails</category>
      <category>Metaprogramming</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=162</trackback:ping>
      <link>http://wxianfeng.com/2011/01/11/rails-attr_internal</link>
    </item>
    <item>
      <title>ruby instance_variables</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + ubuntu 10.10&lt;/p&gt;
&lt;p&gt;instance_variables &#24471;&#21040;&#24403;&#21069; &#23545;&#35937;&#24050;&#32463;&#24320;&#36767;&#20869;&#23384;&#31354;&#38388;&#30340;&#23454;&#20363;&#21464;&#37327;,&#30097;&#24785;&#22312;&#36825;&#37324;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Foo&lt;/span&gt;

  attr_accessor &lt;span class=&quot;sy&quot;&gt;:sex&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:birthday&lt;/span&gt;  

&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

p &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;.new.instance_variables &lt;span class=&quot;c&quot;&gt;# =&amp;gt; []&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21018;&#24320;&#22987;&#19981;&#29702;&#35299;,&#24590;&#20040;&#26159; &#31354;&amp;#8230;&amp;#8230;..&lt;/p&gt;
&lt;p&gt;&#21518;&#26469;&#24819;&#20102;&#24819;&#65292;&#22240;&#20026; ruby &#26159; &#21160;&#24577;&#30340;&#35299;&#37322;&#22411;&#30340;&#35821;&#35328;&#65292;&#22914;&#26524;&#27809;&#26377; &#32473;&#23454;&#20363;&#21464;&#37327;&#36171;&#20540; &#30340;&#35805;&#65292;&#26159;&#19981;&#20250;&#24320;&#36767;&#20869;&#23384;&#31354;&#38388;&#30340;&#65292;&#25152;&#20197; instance_variables &#21482;&#33021;&#24471;&#21040;&#24050;&#32463;&#24320;&#36767;&#20869;&#23384;&#31354;&#38388;&#30340; &#23454;&#20363;&#21464;&#37327;&#65292;&lt;br /&gt;
&#20294;&#26159;&#22914;&#26524;&#26159; &#32534;&#35793;&#22411;&#30340;&#38745;&#24577;&#35821;&#35328; &#21017;&#19981;&#28982;&#65292;&#20363;&#22914;java &#65292;&#23454;&#20363;&#21464;&#37327; &#22768;&#26126;&#20102; &#23601;&#20250;&#24320;&#36767;&#20869;&#23384;&#31354;&#38388;&#20102;&lt;/p&gt;
&lt;p&gt;DEMO1:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# ruby version : 1.9.2&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Foo&lt;/span&gt;

  attr_accessor &lt;span class=&quot;sy&quot;&gt;:sex&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:birthday&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# attr_accessor ruby&#37324;&#23553;&#35013;&#30340;method  &lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

p &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;.new.instance_variables &lt;span class=&quot;c&quot;&gt;# =&amp;gt; []&lt;/span&gt;

f = &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;.new
p f.sex &lt;span class=&quot;c&quot;&gt;#=&amp;gt; nil&lt;/span&gt;
f.sex = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;M&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; 
p f.instance_variables &lt;span class=&quot;c&quot;&gt;#=&amp;gt;  [:@sex]&lt;/span&gt;
p f.inspect &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;#&amp;lt;Foo:0x85ead8c @sex=\&amp;quot;M\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;

b = &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;.new
b.birthday = &lt;span class=&quot;pc&quot;&gt;nil&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# &#27880;&#24847;&#36171;&#20540;&#20026;nil,&#20063;&#24320;&#36767;&#20102;&#20869;&#23384;&#31354;&#38388;&lt;/span&gt;
p b.instance_variables &lt;span class=&quot;c&quot;&gt;# =&amp;gt; [:@birthday]&lt;/span&gt;
p b.inspect &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;#&amp;lt;Foo:0x9dca358 @birthday=nil&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;DEMO2:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Foo&lt;/span&gt;
  
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;initialize&lt;/span&gt;
    &lt;span class=&quot;iv&quot;&gt;@name&lt;/span&gt; = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wxianfeng&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;bar&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# =&amp;gt; as getter method&lt;/span&gt;
    &lt;span class=&quot;iv&quot;&gt;@name&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

f = &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;.new
p f.instance_variables &lt;span class=&quot;c&quot;&gt;#=&amp;gt; [:@name]&lt;/span&gt;
p f.inspect &lt;span class=&quot;c&quot;&gt;#=&amp;gt; &amp;quot;#&amp;lt;Foo:0x8aa7c08 @name=\&amp;quot;wxianfeng\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;
p f.name &lt;span class=&quot;c&quot;&gt;# =&amp;gt;  undefined method `name' for #&amp;lt;Foo:0x99adf7c @name=&amp;quot;wxianfeng&amp;quot;&amp;gt;&lt;/span&gt;
p f.bar &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;wxianfeng&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;ruby &#28304;&#30721;:&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
    # obj.instance_variables    =&amp;gt; array
    #
    #
    # Returns an array of instance variable names for the receiver. Note
    # that simply defining an accessor does not create the corresponding
    # instance variable.
    #
    #    class Fred
    #      attr_accessor :a1
    #      def initialize
    #        @iv = 3
    #      end
    #    end
    #    Fred.new.instance_variables   #=&amp;gt; [&quot;@iv&quot;]
    #
    #
    def instance_variables
      # This is just a stub for a builtin Ruby method.
      # See the top of this file for more info.
    end
&lt;/pre&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SEE&lt;/span&gt;:&lt;br /&gt;
&lt;a href=&quot;http://www.megasolutions.net/ruby/instance_variables-doesnt-return-unassigned-variables-68358.aspx&quot;&gt;http://www.megasolutions.net/ruby/instance_variables-doesnt-return-unassigned-variables-68358.aspx&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/11/ruby-instance_variables'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 11 Jan 2011 00:52:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:083f62e0-2f35-495a-8826-1f0675fa8cc0</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/11/ruby-instance_variables#comments</comments>
      <category>Ruby</category>
      <category>ruby</category>
      <category>Metaprogramming</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=159</trackback:ping>
      <link>http://wxianfeng.com/2011/01/11/ruby-instance_variables</link>
    </item>
    <item>
      <title>&#36148;&#24515;&#30340; google doodle &#31069;&#20320;&#29983;&#26085;&#24555;&#20048; </title>
      <description>&lt;p&gt;&#26089;&#19978;&#19978;&#29677; &#25171;&#24320; google &#21457;&#29616; doodle &#25442;&#20102; &#65292;&#40736;&#26631;&#25918;&#19978;&#21435; alt &#26174;&#31034;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&#29983;&#26085;&#24555;&#20048;,xianfeng!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21703;&#65292;&#24456;&#26834;!,&#25171;&#24320;google.com &#21516;&#26679; &#33521;&#25991;&#26174;&#31034;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&#8220;happy birthday ,xianfeng&#8221;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#28857;&#20987;&#22270;&#29255;&#38142;&#25509;&#21040;&#25105;&#30340; &lt;a href=&quot;http://www.google.com/profiles/Wang.FL1429&quot;&gt;google profiles&lt;/a&gt; &#19978;&#21435;&#20102;,&lt;/p&gt;
&lt;p&gt;&#30001;&#20110;&#25105;&#30340;profile &#35774;&#32622;&#25105;&#30340;birthday &#20026; 01&#26376;04&#26085;,&#25152;&#20197; &#20170;&#22825;&#25552;&#31034;&#20102;&lt;/p&gt;
&lt;p&gt;&#20197;&#21069; &#35980;&#20284;&#36824;&#27809; &#35265;&#21040;&#36807; &#65292; &#21457;&#29616;google &#24456;&#32454;&#24515;&#65292; &#24456;&#36148;&#24515;  &amp;#8230;&amp;#8230;&amp;#8230;., &#25130;&#22270;&#30041;&#24565;:&lt;/p&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/Screenshot.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_Screenshot.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;&quot; class=&quot;lightboxplugin&quot;&gt;&lt;a href=&quot;http://wxianfeng.com/files/Screenshot-1.png&quot; rel=&quot;lightbox&quot; title=&quot;&quot;&gt;&lt;img src=&quot;http://wxianfeng.com/files/middle_Screenshot-1.png&quot; alt=&quot;&quot; title=&quot;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2011/01/04/google-doodle'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 04 Jan 2011 05:23:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:465b3722-b3d8-495e-befa-c363607c96cd</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2011/01/04/google-doodle#comments</comments>
      <category>Google</category>
      <category>Google</category>
      <category>doodle</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=157</trackback:ping>
      <link>http://wxianfeng.com/2011/01/04/google-doodle</link>
    </item>
    <item>
      <title>ruby&#27491;&#21017;  \1 &#21644; $1 &#21306;&#21035; &#21644; &#32467;&#21512;gsub&#30340;&#29992;&#27861;</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9&lt;/p&gt;
&lt;p&gt;\1 &#21644; $1 &#22312;&#29992; ruby &#27491;&#21017;&#30340;&#26102;&#20505; &#32463;&#24120;&#20250;&#29992;&#21040; &#65292; &#37027;&#20040;&#26377;&#20160;&#20040;&#21306;&#21035;&#21602;&#65292;&#20170;&#22825; &#26469;&#26803;&#29702;&#19968;&#19979;:&lt;/p&gt;
&lt;p&gt;\1 : &#26159; &#21521;&#21518;&#24341;&#29992; &#65292; &#24120;&#20351;&#29992;&#22312; sub , gsub &#20013;&lt;br /&gt;
$1 : &#26159;  ruby &#37324;&#30340;&#20840;&#23616;&#21464;&#37327;&lt;/p&gt;
&lt;p&gt;&#30475;&#20960;&#20010;demo:&lt;/p&gt;
&lt;p&gt;demo:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab12cd12&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)cd(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)   &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;ab&amp;quot;&lt;/span&gt;

&#36825;&#20010;&#27491;&#21017;&#23601;&#30456;&#24403;&#20110; &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)cd12&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;  ,&#22240;&#20026; &lt;span class=&quot;er&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; &#24341;&#29992;&#30340;&#26159; &#21069;&#38754;&#30340; (&lt;span class=&quot;er&quot;&gt;\&lt;/span&gt;d+) ,&#32780;&#21069;&#38754;&#30340; (&lt;span class=&quot;er&quot;&gt;\&lt;/span&gt;d+) &#21305;&#37197;&#20986;&#26469;&#30340;&#32467;&#26524;&#26159;  &lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab12cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)  &lt;span class=&quot;c&quot;&gt;#  =&amp;gt; &amp;quot;ab3412cd&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;p &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab12cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# &amp;quot;ab3412cd&amp;quot;&lt;/span&gt;
p &lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# &amp;quot;12&amp;quot;&lt;/span&gt;
p &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab56cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;78&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# &amp;quot;ab7812cd&amp;quot; , &#36825;&#20010;&#26102;&#20505;&#30340; $1 &#20026; &#19978;&#38754;&#30340; 12&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;p &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab12cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# &amp;quot;ab3412cd&amp;quot;&lt;/span&gt;
p &lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# &amp;quot;12&amp;quot;&lt;/span&gt;
str = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab56cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |ele|
  &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;78&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# &#36825;&#37324;&#30340; $1 &#26159; 56&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
p str &lt;span class=&quot;c&quot;&gt;# &amp;quot;ab7856cd&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;p &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab56cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;78&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;c&quot;&gt;# &amp;quot;ab78cd&amp;quot; &#36825;&#37324;&#30340; $1 &#26159; nil&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;str = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ab56cd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |ele|
  &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;78&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

p str &lt;span class=&quot;c&quot;&gt;# &amp;quot;ab7856cd&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#24471;&#20986;&#32467;&#35770;:&lt;/p&gt;
&lt;p&gt;1,\1 &#21644; $1 &#26159;&#20004;&#20010; &#19981;&#21516;&#30340;&#29992;&#27861;&lt;br /&gt;
2,&#29305;&#21035;&#27880;&#24847; $1 &#22312; gsub&#20013; block &#20013;,&#21644; &#20889;&#22312;replacement &#20013; &#26159;&#19981;&#19968;&#26679;&#30340; &#65292; \1 &#29992;&#22312; replacement &#20013; ,$1 &#29992;&#22312; block &#20013;  &#65292;&#36825;&#20010;&#28304;&#30721;&#20013;&#24050;&#32463;&#35828;&#26126;&#20102;&lt;br /&gt;
3,\1 &#24517;&#39035;&#29992;&#21333;&#24341;&#21495;&lt;/p&gt;
&lt;p&gt;&#30475;&#19979;&#28304;&#30721;&#20013;&#30340;&#35299;&#37322;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#     str.gsub(pattern, replacement)       =&amp;gt; new_str&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#     str.gsub(pattern) {|match| block }   =&amp;gt; new_str&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# Returns a copy of &amp;lt;i&amp;gt;str&amp;lt;/i&amp;gt; with &amp;lt;em&amp;gt;all&amp;lt;/em&amp;gt; occurrences of &amp;lt;i&amp;gt;pattern&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# replaced with either &amp;lt;i&amp;gt;replacement&amp;lt;/i&amp;gt; or the value of the block. The&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# &amp;lt;i&amp;gt;pattern&amp;lt;/i&amp;gt; will typically be a &amp;lt;code&amp;gt;Regexp&amp;lt;/code&amp;gt;; if it is a&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt; then no regular expression metacharacters will be&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# interpreted (that is &amp;lt;code&amp;gt;/\d/&amp;lt;/code&amp;gt; will match a digit, but&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# &amp;lt;code&amp;gt;'\d'&amp;lt;/code&amp;gt; will match a backslash followed by a 'd').&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# If a string is used as the replacement, special variables from the match&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# (such as &amp;lt;code&amp;gt;$&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$1&amp;lt;/code&amp;gt;) cannot be substituted into it,&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# as substitution into the string occurs before the pattern match&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# starts. However, the sequences &amp;lt;code&amp;gt;\1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;\2&amp;lt;/code&amp;gt;, and so on&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# may be used to interpolate successive groups in the match.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# In the block form, the current match string is passed in as a parameter, and&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# variables such as &amp;lt;code&amp;gt;$1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$`&amp;lt;/code&amp;gt;,&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# &amp;lt;code&amp;gt;$&amp;amp;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;$'&amp;lt;/code&amp;gt; will be set appropriately. The value&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# returned by the block will be substituted for the match on each call.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# The result inherits any tainting in the original string or any supplied&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# replacement string.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#    &amp;quot;hello&amp;quot;.gsub(/[aeiou]/, '*')              #=&amp;gt; &amp;quot;h*ll*&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#    &amp;quot;hello&amp;quot;.gsub(/([aeiou])/, '&amp;lt;\1&amp;gt;')         #=&amp;gt; &amp;quot;h&amp;lt;e&amp;gt;ll&amp;lt;o&amp;gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#    &amp;quot;hello&amp;quot;.gsub(/./) {|s| s[0].to_s + ' '}   #=&amp;gt; &amp;quot;104 101 108 108 111 &amp;quot;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;gsub&lt;/span&gt;(pattern, replacement)
    &lt;span class=&quot;c&quot;&gt;# This is just a stub for a builtin Ruby method.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# See the top of this file for more info.&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;replacement &#26102;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt; &lt;span class=&quot;c&quot;&gt;# If a string is used as the replacement, special variables from the match&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# (such as &amp;lt;code&amp;gt;$&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$1&amp;lt;/code&amp;gt;) cannot be substituted into it,&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# as substitution into the string occurs before the pattern match&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# starts. However, the sequences &amp;lt;code&amp;gt;\1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;\2&amp;lt;/code&amp;gt;, and so on&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# may be used to interpolate successive groups in the match.&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;block &#26102;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt; &lt;span class=&quot;c&quot;&gt;# In the block form, the current match string is passed in as a parameter, and&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# variables such as &amp;lt;code&amp;gt;$1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$`&amp;lt;/code&amp;gt;,&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# &amp;lt;code&amp;gt;$&amp;amp;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;$&amp;#8217;&amp;lt;/code&amp;gt; will be set appropriately. The value&lt;/span&gt;&lt;br /&gt;
  &lt;span class=&quot;c&quot;&gt;# returned by the block will be substituted for the match on each call.&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/288573/1-and-1-in-ruby&quot;&gt;http://stackoverflow.com/questions/288573/1-and-1-in-ruby&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/28/ruby-regexp'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 28 Dec 2010 03:47:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:dc587f45-9152-49ec-b544-a25af8938f46</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/28/ruby-regexp#comments</comments>
      <category>Ruby</category>
      <category>ruby</category>
      <category>regexp</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=155</trackback:ping>
      <link>http://wxianfeng.com/2010/12/28/ruby-regexp</link>
    </item>
    <item>
      <title>&#35895;&#27468;&#22320;&#22270; &#21487;&#33021;&#31163;&#25105;&#20204;&#32780;&#21435;</title>
      <description>&lt;p&gt;&#20170;&#22825; &#26089;&#19978;&#19978;&#29677; &#20570;&#20844;&#20132; &#65292; &#30475;&#21040; &lt;span class=&quot;caps&quot;&gt;CCAV&lt;/span&gt; &#31227;&#21160;&#30005;&#35270;&#26032;&#38395;&#25773; &#65292; &#35895;&#27468;&#21487;&#33021;&#34987;&#28165;&#20986;&#20013;&#22269; &#65292; &#21049;&#37027; &#22909;&#22855;&#65292; &#20160;&#20040;&#26102;&#20505;&#30340;&#20107;&#65292;&#21040;&#20844;&#21496; g &#20043; &#65292; &#26524;&#19981;&#20854;&#28982;&#65281;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.google.com.hk/search?hl=zh-cn&amp;biw=1296&amp;bih=607&amp;q=%E6%B5%8B%E7%BB%98%E5%B1%80%20%E8%B0%B7%E6%AD%8C%E5%9C%B0%E5%9B%BE&amp;um=1&amp;ie=UTF-8&amp;tbo=u&amp;tbs=nws:1&amp;source=og&amp;sa=N&amp;tab=wn&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#21710;&#65292; &#20160;&#20040;&#19990;&#36947;&#65292; &#24868;&#24594;&#20013;&#65374; &#65292; &#36807;&#28608;&#30340;&#35328;&#35770; &#25105;&#23601;&#19981;&#35828;&#20102;&lt;/p&gt;
&lt;p&gt;&#20026;&#20160;&#20040;&#65311;&lt;/p&gt;
&lt;p&gt;&#22240;&#20026; &#27979;&#32472;&#23616; &#20986;&#20102; &#20010;&#20160;&#20040; &#30772; &lt;a href=&quot;http://www.tianditu.cn/&quot;&gt;&#22825;&#22320;&#22270;&lt;/a&gt; &#65292; &#25152;&#20197; &amp;#8230;&amp;#8230;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/28/google-map'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 28 Dec 2010 01:15:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:88721b1f-eaf7-41f5-a014-891677889c07</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/28/google-map#comments</comments>
      <category>Google</category>
      <category>Google</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=154</trackback:ping>
      <link>http://wxianfeng.com/2010/12/28/google-map</link>
    </item>
    <item>
      <title>windows &#19979; git + heroku &#37096;&#32626;&#24212;&#29992;  </title>
      <description>&lt;p&gt;&#29615;&#22659;:windows 7 + git + heroku + github&lt;/p&gt;
&lt;p&gt;windows &#19979;&#21516;&#26679;&#21487;&#20197;&#21033;&#29992;git&#29256;&#26412;&#25511;&#21046;&#65292;github.com &#26159;&#19968;&#20010;&#24456;&#22909;&#30340;&#20998;&#24067;&#24335; &#20195;&#30721;&#20179;&#24211;&#65292;heruku &#21487;&#20197;&#20813;&#36153;&#30340; &#37096;&#32626; ruby on rails &#24212;&#29992; &#65292; &#21703;&#22622; &#12290;&#12290; &#12290; &#22810;&#20040;&#29245;&#30340;&#19968;&#20214;&#20107;,&#24320;&#22987;~&#65281;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&#19978;&#20256;&#20195;&#30721;&#21040; github.com &#19978;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1,windows &#19979;&#20511;&#21161; msysgit &#26469;&#20351;&#29992; git&#30340; &#65292;&#19979;&#36733;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/msysgit/downloads/list&quot;&gt;http://code.google.com/p/msysgit/downloads/list&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#24314;&#35758;&#19979;&#36733; portable(&#21487;&#25658;&#24102;) &#29256;&#26412;,&#26080;&#38656;&#23433;&#35013;&#12290;&lt;/p&gt;
&lt;p&gt;2,&#25171;&#24320; git-bash.bat &#25991;&#20214;,&#25171;&#24320;&#21518;&#23601;&#21644; linux &#19978;&#24046;&#19981;&#22810; &#20840;&#37096;&#19968;&#26679;&#30340; &#21629;&#20196;&#20102;&lt;/p&gt;
&lt;p&gt;3,&#20840;&#23616;&#37197;&#32622;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;git config --global user.name &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wxianfeng&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; 
git config --global user.email wang.fl1429&lt;span class=&quot;iv&quot;&gt;@gmail&lt;/span&gt;.com &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;4,&#36827;&#20837;&#26412;&#22320;project&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;cd &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;e # &#36827;&#20837; E &#30424;
cd rails3_demo_app  # project root&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5,&#21040;github.cm &#26032;&#24314;&#19968;&#20010; repo &#20026; rails3_demo_app&lt;/p&gt;
&lt;p&gt;6,&#28155;&#21152; &#26412;&#22320;&#25991;&#20214; &#21040; git &#29256;&#26412;&#20449;&#24687;&#20013;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;git init 
git add .
git commit -am &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;import project&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; 
git remote add origin git&lt;span class=&quot;iv&quot;&gt;@github&lt;/span&gt;.com&lt;span class=&quot;sy&quot;&gt;:wxianfeng&lt;/span&gt;/rails3_demo_app.git &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#33267;&#27492; git &#29256;&#26412; &#20449;&#24687;&#28155;&#21152;&#23436;&#25104;&lt;/p&gt;
&lt;p&gt;7,&#28155;&#21152;&#35748;&#35777;&#20449;&#24687;,&#20026; &#25552;&#20132;&#20195;&#30721;&#20570;&#35748;&#35777;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;ssh-keygen -&lt;span class=&quot;co&quot;&gt;C&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wang.fl1429@gmail.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; -t rsa&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#36755;&#20837;&#23494;&#30721;&#30340;&#35805;&#65292;&#27599;&#27425;&#25552;&#20132;&#20195;&#30721;&#20250;&#35753;&#20320;&#36755;&#23494;&#30721; &#65292; &#19968;&#36335; enter &#30340;&#35805; &#65292;&#21017;&#27809;&#26377;&#23494;&#30721;&lt;/p&gt;
&lt;p&gt;&#25214;&#21040;&#21018;&#25165;&#29983;&#25104;&#30340;&#23494;&#38053;&#65288;id_rsa.pub&#65289;&#25991;&#20214;&#24182;&#29992;&#25991;&#26412;&#32534;&#36753;&#22120;&#25171;&#24320;&#65292;&#28982;&#21518;&#22797;&#21046;&#37324;&#38754;&#30340;&#20869;&#23481;&#12290;&#25509;&#30528;&#36716;&#21040;github&#31449;&#28857;&#39033;&#30446;admin&#35774;&#32622;&#65292;&#25214;&#21040;&#8221;Deploy keys&#8220;&#36873;&#39033;&#21518;&#28857;&#20987;&#8221;add another deploy key&#8220;&#24182;&#23558;&#21018;&#25165;&#22797;&#21046;&#30340;&#20869;&#23481;&#40655;&#36148;&#20445;&#23384;&#12290;&lt;/p&gt;
&lt;p&gt;8,&#27979;&#35797;&#26159;&#21542;&#39564;&#35777;&#36890;&#36807;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;SSH&lt;/span&gt; -v git&lt;span class=&quot;iv&quot;&gt;@github&lt;/span&gt;.com&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;9,&#25552;&#20132;(&lt;span class=&quot;caps&quot;&gt;PUSH&lt;/span&gt;)&#20195;&#30721;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;git push origin master &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;ok,&#20320;&#30340;&#20195;&#30721;&#24050;&#32463;push &#21040;github &#20102;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/wxianfeng/rails3_demo_app&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#25552;&#31034;&#65306;&#22312; msysgit  bash &#19979; &#26597;&#30475;&#30446;&#24405;&#19979;&#25991;&#20214; &#29992; ls &#21629;&#20196;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&#25226;&#36825;&#20010;project&#37096;&#32626;&#21040;heroku.com&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1,&#23433;&#35013; heroku gem&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;gem install heroku --no-ri --no-rdoc   &lt;span class=&quot;c&quot;&gt;# &#32570;&#20160;&#20040;&#35013;&#20160;&#20040;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2,&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt; heroku create rails3-demo-app   &lt;span class=&quot;c&quot;&gt;# heroku &#20250;&#20026;&#20320;&#29983;&#25104;&#19968;&#20010; rails3-demo-app.heroku.com &#30340;&#32593;&#22336; ,&#27880;&#24847; name &#19981;&#33021;&#29992; _&lt;/span&gt;&lt;br /&gt;
 git push heroku master&lt;br /&gt;
 heroku rake db&lt;span class=&quot;sy&quot;&gt;:migrate&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;ok,&#20320;&#30340;&#24212;&#29992;&#24050;&#32463;&#21487;&#20197;&#35775;&#38382;&#20102;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://rails3-demo-app.heroku.com&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&#27880;&#24847;:&#22312;&#37096;&#32626; &#24037;&#31243;&#21040; heroku&#30340;&#26102;&#20505; &#65292;&#19981;&#38656;&#35201; git init &#20102; &#65292;&#22240;&#20026; &#24037;&#31243;&#24050;&#32463; &#22312; git &#29256;&#26412;&#20449;&#24687;&#37324;&#20102; &#65292;&#25105;&#20204;&#21482;&#38656;&#35201;    git push heroku master &#21363;&#21487;  &#65292; &#20197;&#19978;&#27493;&#39588;&#30340;&#25805;&#20316; &#20381;&#28982;&#36824;&#26159;&#22312; msysgit bash&#19979;&lt;/p&gt;
&lt;p&gt;&#37325;&#21629;&#21517;heroku  app name ,&#21363; app &#22312;heroku&#30340; url&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;heroku rename newname&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#36825;&#26679;&#21407;&#26469;&#30340;&#22320;&#22336;&#23601;&#24212;&#35813;&#21464;&#25104;&#36825;&#26679;&#20102;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;newname.heroku.com&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;see:&lt;br /&gt;
&lt;a href=&quot;http://hi.baidu.com/mcspring/blog/item/171b1e38986d39fab211c71b.html&quot;&gt;http://hi.baidu.com/mcspring/blog/item/171b1e38986d39fab211c71b.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://docs.heroku.com/quickstart&quot;&gt;http://docs.heroku.com/quickstart&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://docs.heroku.com/renaming-apps&quot;&gt;http://docs.heroku.com/renaming-apps&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blessdyb.javaeye.com/blog/781837&quot;&gt;http://blessdyb.javaeye.com/blog/781837&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://devcenter.heroku.com/articles/quickstart&quot;&gt;http://devcenter.heroku.com/articles/quickstart&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/24/heroku-git'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 24 Dec 2010 13:53:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1f975388-a0e8-4279-a3b6-4f0f621cc59c</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/24/heroku-git#comments</comments>
      <category>Git</category>
      <category>git</category>
      <category>github</category>
      <category>Heroku</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=152</trackback:ping>
      <link>http://wxianfeng.com/2010/12/24/heroku-git</link>
    </item>
    <item>
      <title>ubuntu &#24320;&#26426;&#33258;&#21551;&#21160;&#26381;&#21153; &#21644; GUI &#36719;&#20214;</title>
      <description>&lt;p&gt;&#29615;&#22659;:ubuntu  10.10&lt;/p&gt;
&lt;p&gt;&#27599;&#22825;&#19978;&#29677;&#30340;&#31532;&#19968;&#20214;&#20107;&#23601;&#26159;&#24320;&#30005;&#33041; &#65292; &#24320;&#19968;&#20123;&#24037;&#20316;&#19978;&#24517;&#39035;&#29992;&#30340;&#36719;&#20214; &#25110;&#32773;&#19968;&#20123;&#26381;&#21153; &#65292; &#27599;&#22825; &#37117;&#35201;&#21160;&#20320;&#30340;&#40736;&#26631; &#21435;&#25171;&#24320; &#24212;&#29992;&#31243;&#24207; &#25110;&#32773; &#22312;terminal &#19978;&#25970;&#21629;&#20196;&#21551;&#21160; &#26381;&#21153;&#65292;&#36825;&#26679; &#26410;&#20813; &#22826;&#40635;&#28902;&#20102; &#65292;&#19968;&#28857;&#20063;&#19981; &lt;span class=&quot;caps&quot;&gt;DRY&lt;/span&gt;   &#65292; &#37027;&#23601; &#25226;&#20320;&#27599;&#22825;&#24517;&#22791;&#30340; &#26381;&#21153; &#65292; &#37117;&#25918;&#22312; rc.local &#20013; &#65292; &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt; &#36719;&#20214;&#25918;&#21040; startup applications &#20013; &#38543;&#30528; &#24320;&#26426;&#19968;&#36215;&#21551;&#21160;&#21543;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&#24320;&#26426; &#33258;&#21551;&#21160;&#26381;&#21153;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1,&#25226;&#20320;&#38656;&#35201; &#21551;&#21160;&#30340; &#31243;&#24207;&#37117;&#25918;&#21040; /etc/rc.local &#20013;&#65292;&#27880;&#24847;&#20889;&#21040; exit 0 &#21069;&#38754;&lt;/p&gt;
&lt;p&gt;2,&#40664;&#35748; ubuntu &#30340; shell &#26159; dash ,&#25454;&#35828; &#26159;&#20026;&#20102; &#25552;&#39640; &#24320;&#26426;&#36895;&#24230;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ls -l &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;s&lt;/span&gt;&lt;/span&gt;h
lrwxrwxrwx &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; /bin/sh -&amp;gt; dash&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20294;&#26159; dash &#26159;&#19968;&#20010; &#23545;&#33050;&#26412; &#20860;&#23481;&#24615; &#21644; &#23481;&#38169;&#24615; &#38750;&#24120;&#24046;&#30340; shell,,&#20462;&#25913; rc.local &#29992; bash &#26469;&#25191;&#34892;&#19981;&#35201;&#20351;&#29992; dash&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;dt&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25913;&#20026;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;dt&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25110;&#32773;&#30452;&#25509;&#20462;&#25913; ubuntu &#40664;&#35748;shell&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ll &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;s&lt;/span&gt;&lt;/span&gt;h
lrwxrwxrwx &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; /bin/sh -&amp;gt; dash*
wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; sudo dpkg-reconfigure dash &lt;span class=&quot;c&quot;&gt;# &#36873;&#25321; NO&lt;/span&gt;
wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ll &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;s&lt;/span&gt;&lt;/span&gt;h
lrwxrwxrwx &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;37&lt;/span&gt; /bin/sh -&amp;gt; bash*&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3,&#26381;&#21153; &#26080;&#27861; &#24320;&#21551; daemon&#65288;&#23432;&#25252;&#36827;&#31243;&#65289; &#30340; &#29992; nohup &#21551;&#21160; ,&#20363;&#22914; mongodb&lt;/p&gt;
&lt;p&gt;4,&#30830;&#20445; &#25991;&#20214;&#30340;&#25191;&#34892;&#26435;&#38480; &#30331;&#24405;&#30340;&#26222;&#36890;&#29992;&#25143;&#21487;&#20197;&#20351;&#29992; &#65292; &#40664;&#35748; ubuntu &#30331;&#24405; &#26159;&#38750; root &#36134;&#25143;&lt;/p&gt;
&lt;p&gt;&#20462;&#25913;&#21069;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ll &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local
-rwxr-xr-x &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;736&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;09&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;35&lt;/span&gt; /etc/rc.local*&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20462;&#25913;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; sudo chgrp -&lt;span class=&quot;co&quot;&gt;R&lt;/span&gt; wxianfeng &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local
wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; sudo chown -&lt;span class=&quot;co&quot;&gt;R&lt;/span&gt; wxianfeng &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local &lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20462;&#25913;&#21518;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ll &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local
-rwxr-xr-x &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; wxianfeng wxianfeng &lt;span class=&quot;i&quot;&gt;736&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;09&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;35&lt;/span&gt; /etc/rc.local*&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;5,&#25226; rc.local &#20013;&#30340; &#31532;&#19968;&#34892; -e &#32473;&#21435;&#25481;&lt;/p&gt;
&lt;p&gt;-e &#21442;&#25968; &#26159; &#33050;&#26412;&#36935;&#21040; &#38169;&#35823; &#23601;&#36864;&#20986; ,  &#36825;&#20010; &#24456;&#19981;&#22909;  , &#21487;&#20197; man sh &#30475;&#19979; -e &#21442;&#25968;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;gt;man sh
-e errexit       &lt;span class=&quot;co&quot;&gt;If&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;not&lt;/span&gt; interactive, exit immediately &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; any untested command fails.  &lt;span class=&quot;co&quot;&gt;The&lt;/span&gt; exit status of a command is considered to be explicitly tested &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; the
                            command is used to control an &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt;, elif, &lt;span class=&quot;r&quot;&gt;while&lt;/span&gt;, &lt;span class=&quot;r&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;until&lt;/span&gt;; &lt;span class=&quot;r&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; the command is the left hand operand of an &#8220;&amp;amp;&amp;amp;&#8221; &lt;span class=&quot;r&quot;&gt;or&lt;/span&gt; &#8220;||&#8221; operator.&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;6,&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cat &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local 
&lt;span class=&quot;dt&quot;&gt;#!/bin/bash &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# rc.local&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# This script is executed at the end of each multiuser runlevel.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Make sure that the script will &amp;quot;exit 0&amp;quot; on success or any other&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# value on error.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# In order to enable or disable this script just change the execution&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# bits.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# By default this script does nothing.&lt;/span&gt;

&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;ini&lt;/span&gt;&lt;/span&gt;t.d/mysql start &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160; mysql&lt;/span&gt;
exit &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#35828;&#20102; &#37027;&#20040;&#22810; &#65292; &#35828;&#19979; rc.local &#30340; &#21551;&#21160;&#21407;&#29702;:&lt;/p&gt;
&lt;p&gt;ubuntu &#30340;&#24320;&#26426;&#30340;&#26102;&#20505; &#20250;&#26681;&#25454;&#24403;&#21069;&#30340; &#36816;&#34892;&#32423;&#21035; &#21363; runlevel&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; runlevel
&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21487;&#20197;&#30475;&#20986;&#26159;2  ,&#28982;&#21518; &#36890;&#36807; runlevel &#25191;&#34892; /etc/rc*.d &#19979;&#30340; &#25152;&#26377;&#25991;&#20214; ,&#36825;&#37324;&#21363; rc2.d&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ll &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc2.d/
total &lt;span class=&quot;i&quot;&gt;20&lt;/span&gt;
drwxr-xr-x   &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt; root root  &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;06&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;30&lt;/span&gt; ./
drwxr-xr-x &lt;span class=&quot;i&quot;&gt;141&lt;/span&gt; root root &lt;span class=&quot;i&quot;&gt;12288&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;04&lt;/span&gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;
-rw-r--r--   1 root root   677 2010-09-25 02:16 README
lrwxrwxrwx   1 root root    20 2010-11-12 19:12 S20fancontrol -&amp;gt; ..&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;ini&lt;/span&gt;&lt;/span&gt;t.d/fancontrol*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S20kerneloops&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;kerneloops*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;27&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S20speech&lt;/span&gt;-dispatcher -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;s&lt;/span&gt;&lt;/span&gt;peech-dispatcher*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;06&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S20virtualbox&lt;/span&gt;-ose -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;virtualbox-ose*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S25bluetooth&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;bluetooth*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S50pulseaudio&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;pulseaudio*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S50rsync&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rsync*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S50saned&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;s&lt;/span&gt;&lt;/span&gt;aned*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S70dns&lt;/span&gt;-clean -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;dns-clean*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S70pppd&lt;/span&gt;-dns -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;pppd-dns*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;14&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S75sudo&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;su&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S90binfmt&lt;/span&gt;-support -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;binfmt-support*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;17&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;13&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;45&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S91apache2&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;apache2*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;22&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S99acpi&lt;/span&gt;-support -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;acpi-support*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;21&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S99grub&lt;/span&gt;-common -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;grub-common*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S99ondemand&lt;/span&gt; -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;on&lt;/span&gt;&lt;/span&gt;demand*
lrwxrwxrwx   &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; root root    &lt;span class=&quot;i&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;19&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;S99rc&lt;/span&gt;.local -&amp;gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;init.d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local*&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21487;&#20197; &#30475;&#21040; S99rc.local &#36719;&#38142;&#25509; &#20174; /etc/init.d/rc.local &#36807;&#26469;&#30340; ,&#25171;&#24320; &#30475;&#30475; ,&#36825;&#37324;&#26377; &#35843;&#29992; /etc/rc.local &#30340;&#25991;&#20214; &#65292;/etc/rc.local &#20063;&#23601;&#26159; &#20174;&#36825;&#37324;&#21551;&#21160;&#30340;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cat &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;ini&lt;/span&gt;&lt;/span&gt;t.d/rc.local 
&lt;span class=&quot;dt&quot;&gt;#! /bin/sh&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;### BEGIN INIT INFO&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Provides:          rc.local&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Required-Start:    $remote_fs $syslog $all&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Required-Stop:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Default-Start:     2 3 4 5&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Default-Stop:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Short-Description: Run /etc/rc.local if it exist&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;### END INIT INFO&lt;/span&gt;


&lt;span class=&quot;co&quot;&gt;PATH&lt;/span&gt;=&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sbin:&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;us&lt;/span&gt;&lt;/span&gt;r/sbin&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;bin&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;usr/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

do_start() {
        &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [ -x &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local ]; &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;
                [ &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$VERBOSE&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; != no ] &amp;amp;&amp;amp; log_begin_msg &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Running local boot scripts (/etc/rc.local)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;rc.local
                &lt;span class=&quot;co&quot;&gt;ES&lt;/span&gt;=&lt;span class=&quot;gv&quot;&gt;$?&lt;/span&gt;
                [ &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$VERBOSE&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; != no ] &amp;amp;&amp;amp; log_end_msg &lt;span class=&quot;gv&quot;&gt;$ES&lt;/span&gt;
                &lt;span class=&quot;r&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;gv&quot;&gt;$ES&lt;/span&gt;
        fi
}

&lt;span class=&quot;r&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;in&lt;/span&gt;
    start)
        do_start
        ;;
    restart|reload|force-reload)
        echo &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Error: argument '$1' not supported&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &amp;gt;&amp;amp;&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;
        exit &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;
        ;;
    stop)
        ;;
    *)
        echo &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Usage: $0 start|stop&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &amp;gt;&amp;amp;&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;
        exit &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;
        ;;
esac&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&#24320;&#26426; &#21551;&#21160; &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt; &#36719;&#20214;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&#19978;&#38754; &#26159; &#24320;&#26426; &#21551;&#21160;&#19968;&#20123;&#26381;&#21153; ,&#20363;&#22914; mysql ,apache &#21861;&#30340; &#65292;&#20294;&#26159; &#24320;&#26426;&#21551;&#21160;&#19968;&#20123;&#36719;&#20214; &#24590;&#20040;&#21150;,&#20363;&#22914; netbeans , eclipse &#31561;&lt;/p&gt;
&lt;p&gt;ubuntu &#24050;&#32463; &#32473;&#20102;&#25105;&#20204; gui&#30340;&#37197;&#32622;&#24037;&#20855;&lt;/p&gt;
&lt;p&gt;system &amp;#8594; prefences &amp;#8594; start applications&lt;/p&gt;
&lt;p&gt;&#25226;&#25152;&#26377;&#21551;&#21160;&#30340; &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt; &#36719;&#20214; &#25918;&#21040;&#19968;&#20010; shell &#37324;&#65292;&#28982;&#21518; &#28155;&#21152; &#21551;&#21160;&#36825;&#20010;shell &#21363;&#21487;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cat &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/system/shell/autostart.sh 
&lt;span class=&quot;dt&quot;&gt;#!/bin/sh &lt;/span&gt;

nohup &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/system/netbeans6_9/bin/netbeans --locale zh_CN.&lt;span class=&quot;co&quot;&gt;UTF&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;8&lt;/span&gt;  &amp;amp; &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160;netbeans &lt;/span&gt;
nohup firefox &amp;amp; &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160; firefox &#21487;&#20197; &#40664;&#35748;&#24320;&#21551;&#19968;&#20010;&#32593;&#39029; firefox wxianfeng.com&lt;/span&gt;
nohup &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;opt&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;google/chrome/google-chrome &amp;amp; &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160; chrome&lt;/span&gt;
nohup guake &amp;amp; &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160;guake&lt;/span&gt;
nohup emesene &amp;amp; &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160; emesene &#65288;ubuntu MSN&#23458;&#25143;&#31471;&#65289;&lt;/span&gt;
nohup empathy &amp;amp; &lt;span class=&quot;c&quot;&gt;# &#21551;&#21160; empathy (&#30331;&#24405;gtalk&#20043;&#29992;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#28155;&#21152; &#36807;&#21518; &#20854;&#23454; &#26159;&#22312; ~/.config/autostart &#30446;&#24405;&#19979; &#24314;&#31435;&#20102;&#19968;&#20010;&#26032;&#30340;.desktop&#21551;&#21160;&#25991;&#20214;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;cd ~&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.config&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;autostart/
wxianfeng&lt;span class=&quot;iv&quot;&gt;@ubuntu&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:~&lt;/span&gt;/.config/autostart&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ll
total &lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;
drwx------  &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt; wxianfeng wxianfeng &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;03&lt;/span&gt; ./
drwxr-xr-x &lt;span class=&quot;i&quot;&gt;18&lt;/span&gt; wxianfeng wxianfeng &lt;span class=&quot;i&quot;&gt;4096&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2010&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;12&lt;/span&gt;-&lt;span class=&quot;i&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;:&lt;span class=&quot;i&quot;&gt;03&lt;/span&gt; ..&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;
-rw-r--r--  1 wxianfeng wxianfeng  266 2010-12-24 11:03 autostart.sh.desktop
wxianfeng@ubuntu:~&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;.config/autostart&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cat autostart.sh.desktop 

[&lt;span class=&quot;co&quot;&gt;Desktop&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Entry&lt;/span&gt;]
&lt;span class=&quot;co&quot;&gt;Type&lt;/span&gt;=&lt;span class=&quot;co&quot;&gt;Application&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Exec&lt;/span&gt;=&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/system/shell/autostart.sh
&lt;span class=&quot;co&quot;&gt;Hidden&lt;/span&gt;=&lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;NoDisplay&lt;/span&gt;=&lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;co&quot;&gt;GNOME&lt;/span&gt;-&lt;span class=&quot;co&quot;&gt;Autostart&lt;/span&gt;-enabled=&lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Name&lt;/span&gt;[en_US]=autostart_shell
&lt;span class=&quot;co&quot;&gt;Name&lt;/span&gt;=autostart_shell
&lt;span class=&quot;co&quot;&gt;Comment&lt;/span&gt;[en_US]=start &lt;span class=&quot;co&quot;&gt;GUI&lt;/span&gt; software &lt;span class=&quot;r&quot;&gt;when&lt;/span&gt; boot
&lt;span class=&quot;co&quot;&gt;Comment&lt;/span&gt;=start &lt;span class=&quot;co&quot;&gt;GUI&lt;/span&gt; software &lt;span class=&quot;r&quot;&gt;when&lt;/span&gt; boot&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20063;&#23601;&#26159;&#35828; &#36825;&#20010;&#25991;&#20214; &#20320;&#21487;&#20197; &#25163;&#21160;&#24314;&#31435; , &#20174;&#37324;&#38754;&#21487;&#20197;&#30475;&#20986;  &#25105;&#24320;&#26426;&#21551;&#21160;&#30340; shell &#33050;&#26412; &#36335;&#24452;&#22312;  /usr/local/system/shell/autostart.sh&lt;/p&gt;
&lt;p&gt;&#27880;&#24847;&#28857;:&lt;/p&gt;
&lt;p&gt;&#21018;&#24320;&#22987; &#25105;&#24819;&#25226;&#25105;&#30340; gui &#36719;&#20214; &#21551;&#21160;&#20063;&#25918;&#21040;rc.local &#20013; ,&#36825;&#20010; &#26159;&#19981;&#20801;&#35768;&#30340; ,rc.local &#21482;&#33021;&#21551;&#21160;&#26381;&#21153;,&#19981;&#33021;&#21551;&#21160; &#22270;&#24418;&#30028;&#38754;&#30340; &#31243;&#24207;&lt;/p&gt;
&lt;p&gt;see:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.bettershop.com.cn/bbs/read.php?tid-1029.html&quot;&gt;http://www.bettershop.com.cn/bbs/read.php?tid-1029.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.163.com/lgh_2002/blog/static/44017526201032803748503/&quot;&gt;http://blog.163.com/lgh_2002/blog/static/44017526201032803748503/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.ihacklog.com/linux/tips-linux/fcitx-autostart-via-rc-local.html&quot;&gt;http://www.ihacklog.com/linux/tips-linux/fcitx-autostart-via-rc-local.html&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/22/ubuntu-rc-local'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 22 Dec 2010 21:30:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9ad52839-41b8-4180-a3e2-1f22ebcaef32</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/22/ubuntu-rc-local#comments</comments>
      <category>Ubuntu</category>
      <category>ubuntu</category>
      <category>rc.local</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=147</trackback:ping>
      <link>http://wxianfeng.com/2010/12/22/ubuntu-rc-local</link>
    </item>
    <item>
      <title>mysql &#32452;&#21512;&#32034;&#24341; &#38271;&#24230;&#38480;&#21046;</title>
      <description>&lt;p&gt;&#29615;&#22659;:ubuntu 10.10 + mysql 5.1 + rails 3.0.3 + ruby 1.9.2&lt;/p&gt;
&lt;p&gt;&#20170;&#22825;&#21019;&#24314;&#32452;&#21512;&#32034;&#24341;&#26102;&#65292;&#36935;&#21040;&#19979;&#38754;&#30340;&#38169;&#35823;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Mysql2&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Error&lt;/span&gt;: &lt;span class=&quot;co&quot;&gt;Specified&lt;/span&gt; key was too long; max key length is &lt;span class=&quot;i&quot;&gt;1000&lt;/span&gt; bytes: &lt;span class=&quot;co&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;UNIQUE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;unique_users_name_password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt; (&lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#38382;&#39064;&#37325;&#29616;:&lt;/p&gt;
&lt;p&gt;&#34920;&#32467;&#26500;:(&#25968;&#25454;&#24211;,&#34920;,&#23383;&#27573;&#37117;&#26159;utf-8 &#32534;&#30721;,myisam&#24341;&#25806;)&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;users:
name: varchar(&lt;span class=&quot;i&quot;&gt;255&lt;/span&gt;)
password: varchar(&lt;span class=&quot;i&quot;&gt;255&lt;/span&gt;)&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Rails&#21019;&#24314;&#32034;&#24341;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;add_index &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; , [&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;,&lt;span class=&quot;sy&quot;&gt;:password&lt;/span&gt;] , &lt;span class=&quot;sy&quot;&gt;:unique&lt;/span&gt;=&amp;gt;&lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;unique_users_name_password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# mysql &#21807;&#19968;&#32034;&#24341;&#21487;&#20197;&#25351;&#23450;&#22810;&#20010;&#23383;&#27573;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25191;&#34892;&#23601; Error &#20102; ,&lt;/p&gt;
&lt;p&gt;Google &#21518; &#65292;&#24471;&#21040;&#26159; myisam &#34920;&#32452;&#21512;&#32034;&#24341; &#26377;&#38271;&#24230;&#38480;&#21046; , &#24635;&#38271;&#24230;&#19981;&#33021; &#36229;&#36807; 1000 bytes&lt;/p&gt;
&lt;p&gt;&#35745;&#31639;&#19979;&#19978;&#38754;&#30340; &#24635;&#38271;&#24230;(bytes)&lt;br /&gt;
utf8 &#32534;&#30721; : 1 char = 3 bytes&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;i&quot;&gt;255&lt;/span&gt; * &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt; + &lt;span class=&quot;i&quot;&gt;255&lt;/span&gt; * &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt; =  &lt;span class=&quot;i&quot;&gt;1530&lt;/span&gt; bytes&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#26524;&#28982;&#22823;&#20110;1000 &#20102; ,&#20462;&#25913; name &#30340;&#23383;&#27573;&#38271;&#24230;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;change_column &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt; ,&lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:string&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt; =&amp;gt; &lt;span class=&quot;i&quot;&gt;100&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20877;&#24314;&#32034;&#24341; &#23601; ok&#20102;&amp;#8230;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&#37027;&#20040; &#34920;&#25913;&#20026; innodb &#24341;&#25806;&#21602; ,&#19981;error &#20102; ,&#20294;&#26159; &#20250;&#25265;&#19979;&#38754;&#30340;warning&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;warning&#65306;Specified key was too long;max key length is &lt;span class=&quot;i&quot;&gt;767&lt;/span&gt; bytes.&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;why?&lt;/p&gt;
&lt;p&gt;&#21407;&#26469; innodb&#34920;&#30340;&#32452;&#21512;&#32034;&#24341;&#30340;&#38271;&#24230; &#26159; 767 bytes &#65292; &#27604; myisam &#30340;&#36824;&#23569; &#65292;&#20294;&#26159; innodb&#30340;&#21487;&#20197;&#39034;&#21033; &#24314;&#32034;&#24341;&#65292;&#36229;&#36807;767&#38271;&#24230;&#30340;&#37096;&#20998; &#24314;&#19981;&#34987;&#32034;&#24341;&#65292;&#21069;&#38754;&#30340;&#21462; &#21069;&#32512;&#32034;&#24341;  ,&#36825;&#37324; &#35201;&#27880;&#24847;!&lt;/p&gt;
&lt;p&gt;&#24314;&#35758;;&lt;br /&gt;
1,&#34920; &#35774;&#32622;&#20026; innodb&lt;br /&gt;
2,&#24314;&#23383;&#27573;&#26102;&#65292;&#19968;&#23450;&#35201;&#26681;&#25454;&#23454;&#38469;&#24773;&#20917;,&#38480;&#21046;&#38271;&#24230;,&#22312; rails migration&#20013;&#23601;&#26159; &#21152; :limit  &#21442;&#25968;&lt;/p&gt;
&lt;p&gt;see:&lt;br /&gt;
&lt;a href=&quot;http://blog.fesite.com/2009/02/09/mysql-specified-key-was-too-long-max-key-length-is-1000-bytes/&quot;&gt;http://blog.fesite.com/2009/02/09/mysql-specified-key-was-too-long-max-key-length-is-1000-bytes/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://samyubw.blog.51cto.com/978243/223773&quot;&gt;http://samyubw.blog.51cto.com/978243/223773&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/21/mysql-index'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 21 Dec 2010 04:11:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c567cd1d-6252-4ee2-a8a5-340d8efe3c6e</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/21/mysql-index#comments</comments>
      <category>Mysql</category>
      <category>Mysql</category>
      <category>&#32034;&#24341;</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=143</trackback:ping>
      <link>http://wxianfeng.com/2010/12/21/mysql-index</link>
    </item>
    <item>
      <title>ruby module extend self</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + ubuntu 10.10 + rails 3.0.3&lt;/p&gt;
&lt;p&gt;&#25105;&#20204;&#30693;&#36947; ruby &#20013; &#25193;&#23637;class ,&#20889;&#20844;&#29992;&#26041;&#27861; ,&#25110;&#32773; &#21033;&#29992;&#21629;&#21517;&#31354;&#38388; &#26469;&#27169;&#22359;&#21270; &#65292;&#37117;&#26159;&#36890;&#36807; module &#26469;&#23454;&#29616;&#30340; &#65292; &#20170;&#22825; &#30475; rails &#20013; camelize &#26041;&#27861;&#30340;&#28304;&#30721;&#30340;&#26102;&#20505; &#65292; &#21457;&#29616; module &#36825;&#26679;&#20889;&#30340;&amp;#8230;..&lt;/p&gt;
&lt;p&gt;active_support/inflector/methods.rb&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;ActiveSupport&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without,&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# in inflections.rb.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# The Rails core team has stated patches for the inflections library will not be accepted&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# in order to avoid breaking legacy applications which may be relying on errant inflections.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# If you discover an incorrect inflection and require it for your application, you'll need&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# to correct it yourself (explained below).&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Inflector&lt;/span&gt;
    extend &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# By default, +camelize+ converts strings to UpperCamelCase. If the argument to +camelize+&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# is set to &amp;lt;tt&amp;gt;:lower&amp;lt;/tt&amp;gt; then +camelize+ produces lowerCamelCase.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Examples:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;active_record&amp;quot;.camelize                # =&amp;gt; &amp;quot;ActiveRecord&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;active_record&amp;quot;.camelize(:lower)        # =&amp;gt; &amp;quot;activeRecord&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;active_record/errors&amp;quot;.camelize         # =&amp;gt; &amp;quot;ActiveRecord::Errors&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;active_record/errors&amp;quot;.camelize(:lower) # =&amp;gt; &amp;quot;activeRecord::Errors&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# As a rule of thumb you can think of +camelize+ as the inverse of +underscore+,&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# though there are cases where that does not hold:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;SSLError&amp;quot;.underscore.camelize # =&amp;gt; &amp;quot;SslError&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;camelize&lt;/span&gt;(lower_case_and_underscored_word, first_letter_in_uppercase = &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;)
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; first_letter_in_uppercase
        lower_case_and_underscored_word.to_s.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(.?)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;) { &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;.upcase&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(?:^|_)(.)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;) { &lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;.upcase }
      &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;
        lower_case_and_underscored_word.to_s[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;].chr.downcase + camelize(lower_case_and_underscored_word)[&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;..&lt;span class=&quot;i&quot;&gt;-1&lt;/span&gt;]
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Makes an underscored, lowercase form from the expression in the string.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Changes '::' to '/' to convert namespaces to paths.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Examples:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;ActiveRecord&amp;quot;.underscore         # =&amp;gt; &amp;quot;active_record&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;ActiveRecord::Errors&amp;quot;.underscore # =&amp;gt; active_record/errors&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# As a rule of thumb you can think of +underscore+ as the inverse of +camelize+,&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# though there are cases where that does not hold:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;SSLError&amp;quot;.underscore.camelize # =&amp;gt; &amp;quot;SslError&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;underscore&lt;/span&gt;(camel_cased_word)
      word = camel_cased_word.to_s.dup
      word.gsub!(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
      word.gsub!(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;([A-Z]+)([A-Z][a-z])&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
      word.gsub!(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;([a-z&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;])([A-Z])&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;\2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
      word.tr!(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
      word.downcase!
      word
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Replaces underscores with dashes in the string.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Example:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;puni_puni&amp;quot; # =&amp;gt; &amp;quot;puni-puni&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;dasherize&lt;/span&gt;(underscored_word)
      underscored_word.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Removes the module part from the expression in the string.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Examples:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;ActiveRecord::CoreExtensions::String::Inflections&amp;quot;.demodulize # =&amp;gt; &amp;quot;Inflections&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;Inflections&amp;quot;.demodulize                                       # =&amp;gt; &amp;quot;Inflections&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;demodulize&lt;/span&gt;(class_name_in_module)
      class_name_in_module.to_s.gsub(&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;^.*::&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Creates a foreign key name from a class name.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# +separate_class_name_and_id_with_underscore+ sets whether&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# the method should put '_' between the name and 'id'.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Examples:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;Message&amp;quot;.foreign_key        # =&amp;gt; &amp;quot;message_id&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;Message&amp;quot;.foreign_key(false) # =&amp;gt; &amp;quot;messageid&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   &amp;quot;Admin::Post&amp;quot;.foreign_key    # =&amp;gt; &amp;quot;post_id&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;foreign_key&lt;/span&gt;(class_name, separate_class_name_and_id_with_underscore = &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;)
      underscore(demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Ruby 1.9 introduces an inherit argument for Module#const_get and&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# #const_defined? and changes their default behavior.&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Module&lt;/span&gt;.method(&lt;span class=&quot;sy&quot;&gt;:const_get&lt;/span&gt;).arity == &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;# Tries to find a constant with the name specified in the argument string:&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#   &amp;quot;Module&amp;quot;.constantize     # =&amp;gt; Module&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#   &amp;quot;Test::Unit&amp;quot;.constantize # =&amp;gt; Test::Unit&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;# The name is assumed to be the one of a top-level constant, no matter whether&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;# it starts with &amp;quot;::&amp;quot; or not. No lexical context is taken into account:&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#   C = 'outside'&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#   module M&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#     C = 'inside'&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#     C               # =&amp;gt; 'inside'&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#     &amp;quot;C&amp;quot;.constantize # =&amp;gt; 'outside', same as ::C&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#   end&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;# NameError is raised when the name is not in CamelCase or the constant is&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;# unknown.&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;constantize&lt;/span&gt;(camel_cased_word)
        names = camel_cased_word.split(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
        names.shift &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; names.empty? || names.first.empty?

        constant = &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;
        names.each &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |name|
          constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
        &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
        constant
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;constantize&lt;/span&gt;(camel_cased_word) &lt;span class=&quot;c&quot;&gt;#:nodoc:&lt;/span&gt;
        names = camel_cased_word.split(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
        names.shift &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; names.empty? || names.first.empty?

        constant = &lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;
        names.each &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |name|
          constant = constant.const_defined?(name, &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;) ? constant.const_get(name) : constant.const_missing(name)
        &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
        constant
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Turns a number into an ordinal string used to denote the position in an&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# ordered sequence such as 1st, 2nd, 3rd, 4th.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Examples:&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   ordinalize(1)     # =&amp;gt; &amp;quot;1st&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   ordinalize(2)     # =&amp;gt; &amp;quot;2nd&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   ordinalize(1002)  # =&amp;gt; &amp;quot;1002nd&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#   ordinalize(1003)  # =&amp;gt; &amp;quot;1003rd&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;ordinalize&lt;/span&gt;(number)
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;11&lt;/span&gt;..&lt;span class=&quot;i&quot;&gt;13&lt;/span&gt;).include?(number.to_i % &lt;span class=&quot;i&quot;&gt;100&lt;/span&gt;)
        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;number&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;
        &lt;span class=&quot;r&quot;&gt;case&lt;/span&gt; number.to_i % &lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;
          &lt;span class=&quot;r&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;number&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;st&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
          &lt;span class=&quot;r&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;number&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;nd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
          &lt;span class=&quot;r&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;number&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rd&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
          &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;number&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21457;&#29616; &#20102;&#36825;&#26679;&#30340;&#20889;&#27861;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;A&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;B&lt;/span&gt;
extend &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;
.....
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;extend self &#26377;&#20309;&#20316;&#29992;?&lt;/p&gt;
&lt;p&gt;&#20808;&#26469;&#30475;&#20010;demo:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Foo&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Bar&lt;/span&gt;
      extend &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# self =&amp;gt; Foo::Bar&lt;/span&gt;

    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;hello&lt;/span&gt;
      p &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hello&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Klass&lt;/span&gt;
  include &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Bar&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.new.hello &lt;span class=&quot;c&quot;&gt;#  &amp;quot;hello&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Bar&lt;/span&gt;.hello &lt;span class=&quot;c&quot;&gt;# &amp;quot;hello&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.hello &lt;span class=&quot;c&quot;&gt;# undefined method `hello' for Klass:Class (NoMethodError)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21457;&#29616; module &#20013;&#30340;&#26041;&#27861; &#21487;&#20197;&#24403;&#20316;&#27169;&#22359;&#26041;&#27861; &#30452;&#25509;&#34987;Module&#35843;&#29992; &#65292; &#34987;include &#21040;class &#20013;&#21518; &#65292; &#20381;&#28982;&#36824;&#26159; class &#30340;&#23454;&#20363;&#26041;&#27861; &#65292; &#24681;,&#19981;&#38169;,&#20197;&#21518; &#20687;&#19979;&#38754; &#36825;&#26679;&#30340;&#20889;&#27861;&#65292; &#37117;&#35201; &#25913;&#25913;&#20102;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;A&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;fu&quot;&gt;foo&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25913;&#25104;&#36825;&#26679;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;A&lt;/span&gt;
extend &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;foo&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;demo&#37324;&#30340;extend self  &#20854;&#23454;&#23601;&#26159; Foo::Bar.extend(Foo::Bar)&lt;/p&gt;
&lt;p&gt;&#25152;&#20197; &#21487;&#20197; &#26356;&#21160;&#24577;&#30340; &#20889;&#25104;&#36825;&#26679;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Foo&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Bar&lt;/span&gt;     

    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;hello&lt;/span&gt;
      p &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hello&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Klass&lt;/span&gt;
  include &lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Bar&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Bar&lt;/span&gt;.extend(&lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Bar&lt;/span&gt;)

&lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.new.hello &lt;span class=&quot;c&quot;&gt;#  &amp;quot;hello&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Foo&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Bar&lt;/span&gt;.hello &lt;span class=&quot;c&quot;&gt;# &amp;quot;hello&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;Klass&lt;/span&gt;.hello &lt;span class=&quot;c&quot;&gt;# undefined method `hello' for Klass:Class (NoMethodError)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;see:&lt;br /&gt;
&lt;a href=&quot;http://www.railsfire.com/article/extending-self-module&quot;&gt;http://www.railsfire.com/article/extending-self-module&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/21/ruby-module-extend-self'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 21 Dec 2010 01:39:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:26878324-1a70-464a-8df8-b19b5bedd3c6</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/21/ruby-module-extend-self#comments</comments>
      <category>Ruby</category>
      <category>ruby</category>
      <category>Metaprogramming</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=142</trackback:ping>
      <link>http://wxianfeng.com/2010/12/21/ruby-module-extend-self</link>
    </item>
    <item>
      <title>ruby1.9 char to ascii(int value)</title>
      <description>&lt;p&gt;&#29615;&#22659; : ruby 1.9.2  + ruby 1.8.7&lt;/p&gt;
&lt;p&gt;ruby 1.8 &#26102;&#20195; char to ascill &#19968;&#33324;&#36825;&#20040;&#20570;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;]  &lt;span class=&quot;c&quot;&gt;# 97&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;?a&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# 97&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20294;&#26159; 1.9  &#26102;&#20195; &#35813;&#26041;&#27861; &#19981;&#21487;&#20197;&#20102;&#65292;&#36755;&#20986;&#22914;&#19979;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;] &lt;span class=&quot;c&quot;&gt;# a&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;?a&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# a&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21518;&#26469; &#25105;&#29992;&#20102; &#19968;&#20010; &#21464;&#24577;&#30340; &#26041;&#27861;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.bytes.to_a.first &lt;span class=&quot;c&quot;&gt;# 97&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;1.9 &#26102;&#20195; &#24212;&#35813;&#20351;&#29992;ord &#20989;&#25968;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.ord  &lt;span class=&quot;c&quot;&gt;# 97&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;].ord &lt;span class=&quot;c&quot;&gt;# 97&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;?a&lt;/span&gt;.ord &lt;span class=&quot;c&quot;&gt;# 97&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;ascill to char &#36890;&#29992;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;i&quot;&gt;97&lt;/span&gt;.chr &lt;span class=&quot;c&quot;&gt;# &amp;quot;a&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20294;&#26159; ord &#20989;&#25968; 1.8 &#29615;&#22659;&#19979; &#21516;&#26679;&#21487;&#20197;&#20351;&#29992;;&lt;/p&gt;
&lt;p&gt;&#30475;&#19979; ord &#20989;&#25968;&#30340;&#28304;&#30721;(built in &#26041;&#27861;,&#20869;&#37096;&#30475;&#19981;&#21040;ruby&#20195;&#30721;):&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;c&quot;&gt;#     int.ord    =&amp;gt; int&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# Returns the int itself.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#    ?a.ord    #=&amp;gt; 97&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# This method is intended for compatibility to&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# character constant in Ruby 1.9.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# For example, ?a.ord returns 97 both in 1.8 and 1.9.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;ord&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# This is just a stub for a builtin Ruby method.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# See the top of this file for more info.&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;see:&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/1270209/getting-an-ascii-character-code-in-ruby-fails&quot;&gt;http://stackoverflow.com/questions/1270209/getting-an-ascii-character-code-in-ruby-fails&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/17/ruby1-9-char-to-ascii-int-value'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 17 Dec 2010 04:20:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e5f932a5-a2be-4d23-a07b-160a2fdcd54b</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/17/ruby1-9-char-to-ascii-int-value#comments</comments>
      <category>Ruby</category>
      <category>ruby1.9.2</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=138</trackback:ping>
      <link>http://wxianfeng.com/2010/12/17/ruby1-9-char-to-ascii-int-value</link>
    </item>
    <item>
      <title>Rails &#21160;&#24577;&#29983;&#25104;&#34920;&#21644;Model</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3  + ubuntu 10.10&lt;/p&gt;
&lt;p&gt;&#39033;&#30446;&#38656;&#35201;&#36816;&#34892;&#20013;&#21160;&#24577;&#29983;&#25104;&#34920; &#21644; Model &#65292; &#24590;&#20040;&#21150; &#65311;&lt;/p&gt;
&lt;p&gt;&#20511;&#21161; ActiveRecord::Migration &#26469;&#23454;&#29616; &#21160;&#24577;&#24314;&#34920; &#21644; &#23383;&#27573;&lt;/p&gt;
&lt;p&gt;&#21487;&#20197; &#20511;&#21161; Object.const_set &#26469;&#23454;&#29616; &#21160;&#24577;Model&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DEMO&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# RUN : rails runner lib/dynamic_table.rb&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.create_table &lt;span class=&quot;sy&quot;&gt;:posts&lt;/span&gt;
&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_column &lt;span class=&quot;sy&quot;&gt;:posts&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:title&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:string&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_set(&lt;span class=&quot;sy&quot;&gt;:Post&lt;/span&gt;,&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt;.new(&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;)) &lt;span class=&quot;c&quot;&gt;# =&amp;gt; Object.class_eval { const_set(:Post,Class.new(ActiveRecord::Base)) }&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# p Post.columns&lt;/span&gt;
p &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt;.column_names &lt;span class=&quot;c&quot;&gt;# [&amp;quot;id&amp;quot;, &amp;quot;title&amp;quot;]&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Migration&lt;/span&gt;.add_column &lt;span class=&quot;sy&quot;&gt;:posts&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:body&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:text&lt;/span&gt;

p &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt;.column_names &lt;span class=&quot;c&quot;&gt;# [&amp;quot;id&amp;quot;, &amp;quot;title&amp;quot;]&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.class_eval { remove_const &lt;span class=&quot;sy&quot;&gt;:Post&lt;/span&gt; }
&lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;.const_set(&lt;span class=&quot;sy&quot;&gt;:Post&lt;/span&gt;,&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt;.new(&lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;))

p &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt;.column_names &lt;span class=&quot;c&quot;&gt;# [&amp;quot;id&amp;quot;, &amp;quot;title&amp;quot;, &amp;quot;body&amp;quot;]&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21160;&#24577;Model &#23454;&#36136;&#23601;&#30456;&#24403;&#20110; Post = Class.new(ActiveRecord::Base)  &#25110;&#32773; Post &amp;lt; ActiveRecord::Base&lt;/p&gt;
&lt;p&gt;Class.new(ActiveRecord::Base) &#21442;&#25968;&#25351;&#23450; super_class &#65292; &#40664;&#35748;&#26159; Object&lt;/p&gt;
&lt;p&gt;&#21487;&#20197;&#20174;ruby&#28304;&#30721;&#20013;&#30475;&#20986;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;c&quot;&gt;#     Class.new(super_class=Object)   =&amp;gt;    a_class&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# Creates a new anonymous (unnamed) class with the given superclass&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# (or &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt; if no parameter is given). You can give a&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# class a name by assigning the class object to a constant.&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;fu&quot;&gt;new&lt;/span&gt;(super_class=&lt;span class=&quot;co&quot;&gt;Object&lt;/span&gt;)
    &lt;span class=&quot;c&quot;&gt;# This is just a stub for a builtin Ruby method.&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# See the top of this file for more info.&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#24403;&#32473;&#34920;&#28155;&#21152;&#20102;&#26032;&#30340;&#23383;&#27573;&#21518;,Model &#38656;&#35201;&#37325;&#26032; const_set &#19968;&#27425; ,&#27880;&#24847; const_set &#20043;&#21069; &#38656;&#35201; remove_const &#19968;&#27425; , &#19981;&#28982;&#20250;&#20986;&#29616; &#24050;&#32463;&#21021;&#22987;&#21270;&#30340;&#35686;&#21578;&lt;/p&gt;
&lt;p&gt;see:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://hildolfur.wordpress.com/2006/10/29/class-reloading-in-ruby/&quot;&gt;http://hildolfur.wordpress.com/2006/10/29/class-reloading-in-ruby/&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/17/rails-dynamic-model'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 17 Dec 2010 01:12:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5fdce330-3246-4fcd-953f-9d581cb0f0e2</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/17/rails-dynamic-model#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <category>Metaprogramming</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=136</trackback:ping>
      <link>http://wxianfeng.com/2010/12/17/rails-dynamic-model</link>
    </item>
    <item>
      <title>rails check_box_tag boolean</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3 + ubuntu 10.10&lt;/p&gt;
&lt;p&gt;scaffold &#29983;&#25104;&#30340; form_for &#23545;&#24212;&#30340; boolean &#31867;&#22411; &#26159;check_box , &#25968;&#25454;&#24211;&#20013; &#20540;&#26159; 1 check_box&#23601;&#36873;&#20013;, &#26159; 0 &#23601;&#19981;&#36873;&#20013;, &#20294;&#26159;&#19981;&#26159; form_for &#30340;&#35805; &#65292;check_box_tag &#24590;&#20040;&#23454;&#29616;&#21602;&lt;/p&gt;
&lt;p&gt;&#20223;&#29031; form_for check_box &#29983;&#25104;&#30340;&#20195;&#30721;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&amp;lt;input name=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user[abc]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; type=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; value=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;
&amp;lt;input checked=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;checked&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; id=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user_abc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; name=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user[abc]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; type=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;checkbox&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; value=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21487;&#20197;&#30475;&#20986; &#22810;&#29983;&#25104;&#20102; &#19968;&#27573; hidden , &#20026;&#20160;&#20040; &#65311;&lt;/p&gt;
&lt;p&gt;&#22240;&#20026; check_box &#30340;&#24037;&#20316;&#21407;&#29702;&#26159; :&lt;/p&gt;
&lt;p&gt;&#36873;&#20013;&#20102; &#23601;&#20256;check_box &#30340;&#21442;&#25968; , &#19981;&#36873;&#20013; &#19981;&#20256; check_box &#30340; &#21442;&#25968;&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;&#19978;&#38754; &#36873;&#20013;&#30340;&#35805;,&#20256;&#30340;&#20540;&#26159; 1&lt;/p&gt;
&lt;p&gt;&#27809;&#36873;&#20013;&#30340;&#35805;, &#20256;&#30340;&#26159; 0&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;check_box_tag &#30340;&#35805;,&#23601;&#24212;&#35813;&#36825;&#26679;&#20889;&#20102;.&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;     &amp;lt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; hidden_field_tag &amp;quot;user[abc]&amp;quot; , 0 %&amp;gt;
      &amp;lt;%&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;=&lt;/span&gt;&lt;/span&gt; check_box_tag &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user[abc]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; , &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; , (&lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; ele.abc == &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;)  %&amp;gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#27880;&#24847; &#38656;&#35201; &#28155;&#21152; hidden &#22495; , &#24182;&#19988; &#38656;&#35201;&#22312; checkbox &#30340;&#19978;&#38754;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/16/rails-check_box_tag-boolean'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 16 Dec 2010 00:16:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:40ea5117-80d9-449b-96b7-3cd963827bd7</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/16/rails-check_box_tag-boolean#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=134</trackback:ping>
      <link>http://wxianfeng.com/2010/12/16/rails-check_box_tag-boolean</link>
    </item>
    <item>
      <title>rails attr_accessible  attr_protected</title>
      <description>&lt;p&gt;&#29615;&#22659;:ruby 1.9.2 + rails 3.0.3 + ubuntu 10.10&lt;/p&gt;
&lt;p&gt;&#25105;&#20204;&#32463;&#24120;&#22312; &#29992;&#25143;&#27880;&#20876; &#39564;&#35777; &#30340;&#26102;&#20505; &#20250;&#29992;&#21040; attr_accessible , &#37027;&#20040;&#26377;&#20160;&#20040;&#20316;&#29992;&#21602;&#65311;&lt;/p&gt;
&lt;p&gt;&#38382;&#39064;&#37325;&#29616;:&lt;/p&gt;
&lt;p&gt;&#29992;&#25143;&#27880;&#20876;&#30340;&#26102;&#20505; &#38656;&#35201; &#22635;&#20889; login , name , password , confirm_password&lt;/p&gt;
&lt;p&gt;User:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;attr_accessible &lt;span class=&quot;sy&quot;&gt;:login&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:email&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:password&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:password_confirmation&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#21518;&#21488;&#20256;&#21442;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Parameters&lt;/span&gt;: {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;utf8&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&#10003;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;authenticity_token&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;r+rfq6Wcu/64ZvkMOi6kPE1k6NHELDi99GmaehGFA4g=&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;{&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wwwwww&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ww@ww.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;[&lt;span class=&quot;caps&quot;&gt;FILTERED&lt;/span&gt;]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password_confirmation&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;[&lt;span class=&quot;caps&quot;&gt;FILTERED&lt;/span&gt;]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Sign up&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;&#39034;&#21033;&#36890;&#36807;&lt;/p&gt;
&lt;p&gt;User:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;attr_accessible  &lt;span class=&quot;sy&quot;&gt;:email&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:password&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:password_confirmation&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt; &lt;span class=&quot;co&quot;&gt;Parameters&lt;/span&gt;: {&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;utf8&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&#10003;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;authenticity_token&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;r+rfq6Wcu/64ZvkMOi6kPE1k6NHELDi99GmaehGFA4g=&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;{&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;qqqqqq&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;qq@qq.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;[&lt;span class=&quot;caps&quot;&gt;FILTERED&lt;/span&gt;]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password_confirmation&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;[&lt;span class=&quot;caps&quot;&gt;FILTERED&lt;/span&gt;]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Sign up&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;&#25253;&#38169;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;    * &lt;span class=&quot;co&quot;&gt;Login&lt;/span&gt; can&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;t be blank
    * Login is too short (minimum is 3 characters)
    * Login use only letters, numbers, and .-_@ please.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20026;&#20160;&#20040;&#65311;&lt;/p&gt;
&lt;p&gt;attr_accessible &#26159;&#20026;&#20102;&#23433;&#20840;&#24615;&#32771;&#34385;&#30340;,&#34920;&#21333;&#25552;&#20132;&#26159; &#36890;&#36807; attributes= &#30340;&#22359;&#36171;&#20540; , &#25918;&#22312; attr_accessible &#20013;&#30340;&#23646;&#24615; &#25165;&#21487;&#20197; &#36890;&#36807;&#22359;&#36171;&#20540;,&#22359;&#23601;&#26159;&#25351;  &amp;#8220;user&amp;#8221;=&amp;gt;{&amp;quot;login&amp;quot;=&amp;gt;&amp;quot;qqqqqq&amp;quot;, &amp;#8220;email&amp;#8221;=&amp;gt;&amp;quot;qq@qq.com&amp;quot;, &amp;#8220;password&amp;#8221;=&amp;gt;&amp;quot;[&lt;span class=&quot;caps&quot;&gt;FILTERED&lt;/span&gt;]&amp;quot;, &amp;#8220;password_confirmation&amp;#8221;=&amp;gt;&amp;quot;[&lt;span class=&quot;caps&quot;&gt;FILTERED&lt;/span&gt;]&amp;quot;} &#21518;&#21488; &#30452;&#25509;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.new(params[&lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;]) 
user.save!&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#22914;&#26524;&#19981;&#21152; attr_accessible &#30340;&#35805;&#65292;&#29992;&#25143;&#21487;&#20197; &#26500;&#36896; &#21442;&#25968; &#65292;&#27169;&#25311;&#34920;&#21333;&#25552;&#20132; ,&#20363;&#22914;&#20320;&#30340;&#34920;&#37324; status = 1 &#34920;&#31034;&#24050;&#32463;&#28608;&#27963;,admin = 1 &#34920;&#31034; &#31649;&#29702;&#21592; , &#37027;&#20040;&#29992;&#25143;&#25552;&#20132; :&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;{&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;wwwwww&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ww@ww.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;[FILTERED]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password_confirmation&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;[FILTERED]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,admin=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,status=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#33258;&#21160;&#23601;&#28608;&#27963; &#21644; &#21464;&#25104;&#31649;&#29702;&#21592;&#65292;&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;  &#37325;&#35201;&#23383;&#27573; &#65292; &#36825;&#26159;&#24517;&#39035;&#35201;&#32771;&#34385;&#30340;..&lt;/p&gt;
&lt;p&gt;&#37027;&#20040; attr_protected &#21448;&#26159;&#24178;&#20160;&#20040;&#30340;&#65292;&#23427;&#21644; attr_accessible &#30456;&#21453; , attr_protected &#26159;&#40657;&#21517;&#21333;&#65292;attr_protected &#20445;&#25252;&#30340;&#23646;&#24615;,&#37117;&#19981;&#21487;&#20197;&#36890;&#36807;&#22359;&#36171;&#20540;,attr_accessible &#26159;&#30333;&#21517;&#21333;,&#20445;&#25252;&#30340;&#23646;&#24615;&#21487;&#20197; &#36890;&#36807;&#22359;&#36171;&#20540;&lt;/p&gt;
&lt;p&gt;rails &#20013;&#33258;&#24102; demo:&lt;/p&gt;
&lt;p&gt;attr_accessible:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;active_model&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Customer&lt;/span&gt;
  include &lt;span class=&quot;co&quot;&gt;ActiveModel&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;MassAssignmentSecurity&lt;/span&gt;

  attr_accessor &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:credit_rating&lt;/span&gt;
  attr_accessible &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;attributes=&lt;/span&gt;(values)
    sanitize_for_mass_assignment(values).each &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |k, v|
       send(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, v)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

customer = &lt;span class=&quot;co&quot;&gt;Customer&lt;/span&gt;.new
customer.attributes = { &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;David&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:credit_rating&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Excellent&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }
p customer.name          &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;David&amp;quot;&lt;/span&gt;
p customer.credit_rating &lt;span class=&quot;c&quot;&gt;# =&amp;gt; nil&lt;/span&gt;

customer.credit_rating = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Average&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
p customer.credit_rating &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;Average&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;attr_protected:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;active_model&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Customer&lt;/span&gt;
  include &lt;span class=&quot;co&quot;&gt;ActiveModel&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;MassAssignmentSecurity&lt;/span&gt;

  attr_accessor &lt;span class=&quot;sy&quot;&gt;:name&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:credit_rating&lt;/span&gt;
  attr_protected &lt;span class=&quot;sy&quot;&gt;:credit_rating&lt;/span&gt;

  &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;attributes=&lt;/span&gt;(values)
    sanitize_for_mass_assignment(values).each &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt; |k, v|
      send(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, v)
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

customer = &lt;span class=&quot;co&quot;&gt;Customer&lt;/span&gt;.new
customer.attributes = { &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;David&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;credit_rating&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Excellent&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }
customer.name          &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;David&amp;quot;&lt;/span&gt;
customer.credit_rating &lt;span class=&quot;c&quot;&gt;# =&amp;gt; nil&lt;/span&gt;

customer.credit_rating = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Average&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
customer.credit_rating &lt;span class=&quot;c&quot;&gt;# =&amp;gt; &amp;quot;Average&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#27169;&#25311; attributes = &#36171;&#20540;,&#21487;&#20197;&#30475;&#20986; attr_accessible &#21644; attr_protected &#27491;&#22909; &#30456;&#21453;&lt;/p&gt;
&lt;p&gt;see:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.javaeye.com/topic/161256&quot;&gt;http://www.javaeye.com/topic/161256&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/13/rails-attr_accessible-attr_protected'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 13 Dec 2010 22:07:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3ba331b4-65ae-4984-ba27-4bf2a250784c</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/13/rails-attr_accessible-attr_protected#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=132</trackback:ping>
      <link>http://wxianfeng.com/2010/12/13/rails-attr_accessible-attr_protected</link>
    </item>
    <item>
      <title>Rails one-to-many foreign_key class_name</title>
      <description>&lt;p&gt;&#29615;&#22659;: ruby 1.9.2 + rails 3.0.3 + ubuntu  10.10&lt;/p&gt;
&lt;p&gt;rails  1 &#23545; &#22810;&#20851;&#32852; &#25351;&#23450; foreign_key&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;rails &#40664;&#35748;&#30340;&#20851;&#32852;&#20851;&#31995;:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;posts &#34920;:&lt;br /&gt;
user_id &#23383;&#27573; &#22806;&#24314;&#20851;&#32852;&lt;/p&gt;
&lt;p&gt;Model:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
has_many &lt;span class=&quot;sy&quot;&gt;:posts&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
belongs_to &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25214;&#20986;&#36825;&#20010; user &#25152;&#26377;posts&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.first
user.posts&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25214;&#20986; post &#23646;&#20110;&#21738;&#20010;user&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;post = &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt;.last
post.user&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&#33258;&#23450;&#20041;&#22806;&#24314;:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;posts &#34920;:&lt;br /&gt;
member_id &#23383;&#27573; &#22806;&#24314;&#20851;&#32852;&lt;/p&gt;
&lt;p&gt;Model:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
has_many &lt;span class=&quot;sy&quot;&gt;:posts&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:foreign_key&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;member_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
belongs_to &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:foreign_key&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;member_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25214;&#20986;user&#30340;&#25152;&#26377;posts&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.first
user.posts&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25214;&#20986; post &#23646;&#20110;&#21738;&#20010;user&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;post = &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt;.last
post.user&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#27880;&#24847; Model&#30340;&#23450;&#20041; &#20004;&#36793;&#37117;&#35201; &#22768;&#26126; foreign_key&lt;/p&gt;
&lt;p&gt;&#21516;&#29702; &#25105;&#20204;&#21487;&#20197;&#32473; &#33258;&#24341;&#29992; &#28155;&#21152;&#33258;&#23450;&#20041; &#22806;&#38190;&lt;/p&gt;
&lt;p&gt;categories &#34920;&#22806;&#38190;:&lt;/p&gt;
&lt;p&gt;master_id integer&#31867;&#22411;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Category&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
has_many &lt;span class=&quot;sy&quot;&gt;:categories&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:foreign_key&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;master_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
belongs_to &lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:foreign_key&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;master_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20027;&#20998;&#31867;&#19979;&#30340;&#25152;&#26377;&#20998;&#31867;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;c = &lt;span class=&quot;co&quot;&gt;Category&lt;/span&gt;.first
c.categories&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#20998;&#31867;&#23646;&#20110;&#21738;&#20010;&#20027;&#20998;&#31867;:&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;c = &lt;span class=&quot;co&quot;&gt;Category&lt;/span&gt;.last
c.category&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&#33258;&#23450;&#20041;class_name&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
has_many &lt;span class=&quot;sy&quot;&gt;:posts&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:foreign_key&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;member_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;co&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt; &amp;lt; &lt;span class=&quot;co&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Base&lt;/span&gt;
belongs_to &lt;span class=&quot;sy&quot;&gt;:member&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:foreign_key&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;member_id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; , &lt;span class=&quot;sy&quot;&gt;:class_name&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25214;&#20986;user&#30340;&#25152;&#26377;posts&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span class=&quot;co&quot;&gt;User&lt;/span&gt;.first
user.posts&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&#25214;&#20986; post &#23646;&#20110;&#21738;&#20010;user&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;post = &lt;span class=&quot;co&quot;&gt;Post&lt;/span&gt;.last
post.member  &lt;span class=&quot;c&quot;&gt;# &#27880;&#24847;&#36825;&#37324;&#23601;&#26159;member&#20102; &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;small&gt;Original article writen by wxianfeng and published on &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt; | &lt;a href='http://wxianfeng.com/2010/12/13/rails-one-to-many-foreign_key'&gt;direct link to this article&lt;/a&gt; | If you are reading this article elsewhere than &lt;a href='http://wxianfeng.com'&gt;{:web=&gt;:wxianfeng}&lt;/a&gt;, it has been illegally reproduced and without proper authorization.&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 13 Dec 2010 04:30:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:341c90a2-e3c5-4aed-bc69-b5296a9be63b</guid>
      <author>wang.fl1429@gmail.com (wxianfeng)</author>
      <comments>http://wxianfeng.com/2010/12/13/rails-one-to-many-foreign_key#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <trackback:ping>http://wxianfeng.com/trackbacks?article_id=131</trackback:ping>
      <link>http://wxianfeng.com/2010/12/13/rails-one-to-many-foreign_key</link>
    </item>
    <item>
      <title>Google &#21019;&#26032;&#35770;&#22363; + Nexus S &#21457;&#24067;</title>
      <description>&lt;p&gt;2010-12-07 &#22312;&#21271;&#20140;&#21484;&#24320;&#20102; Google&#21019;&#26032;&#35770;&#22363;&#65292;&#22312;&#22914;&#20170;&#30340; &#20114;&#32852;&#32593;&#26102;&#20195; &#25105;&#35748;&#20026;Google &#26159;&#32769;&#22823;&#65292;&#20063;&#19968;&#30452;&#26159;&#25105;&#23815;&#25308;&#30340;&#20844;&#21496;&#65292;&#39034;&#20415;&#20063;&#26159;Google&#26381;&#21153;&#30340;&#20013;&#27602;&#32773;&#65292;&#30475;&#20102;&#19979;&#36825;&#20010;&#21019;&#26032;&#35770;&#22363;&#30340;&#35270;&#39057;&#65292;&#21644; &#28436;&#35762;&#30340;&#19996;&#35199; &#65292;&#20250;&#32473;&#20320;&#19968;&#20123;&#28789;&#24863;&#65292;&#24819;&#20687;&#19979;&#26410;&#26469;&#30340; &#20114;&#32852;&#32593;&#26102;&#20195; &#65292; &#36824;&#30495;&#19981;&#21487;&#24605;&#35758;&#65292;&#22914;&#26524;&#20320;&#25972;&#22825;&#33510;&#20110; &#19981;&#30693;&#36947; &#20570;&#20160;&#20040; &#65292; &#19981;&#30693;&#36947;&#24590;&#20040;&#21019;&#26032;&#65292;&#25110;&#32773; &#30475;&#30475; &#20250;&#32473;&#20320;&#19968;&#20123;&#21551;&#21457;&#12290;&#24403;&#28982;&#26377;&#30340;&#24050;&#32463;&#23454;&#29616;,&#21482;&#26159;&#27809;&#26377;&#26222;&#21450;:&lt;/p&gt;
&lt;p&gt;1,&#26410;&#26469; 5-10 &#24180;&#20869;&#65292;&#20840;&#29699;&#20154;&#20043;&#38388;&#30340;&#20132;&#27969; &#19981;&#20877;&#25104;&#38382;&#39064;,&#32763;&#35793;&#21487;&#20197;&#23454;&#29616;&#32763;&#35793; &#25991;&#23383;&#65292;&#38899;&#39057;&#65292;&#35270;&#39057;&#12290;&lt;br /&gt;
2,&#20197;&#21518;&#19978;&#32593; &#19981;&#20877;&#23616;&#38480;&#20110; PC &#65292;&#31227;&#21160;&#35774;&#22791; &#65292;&#30005;&#35270; &#65292; &#28216;&#25103;&#26426; == &#37117;&#23558;&#21487;&#20197;&#19978;&#32593;&lt;br /&gt;
3,&#24378;&#22823;&#30340;&#20113;&#26381;&#21153; &#21644;&#25968;&#25454;&#20013;&#24515; &#23558;&#20250;&#32473;&#29992;&#25143;&#29983;&#27963;&#24102;&#26469; &#26356;&#22810;&#26041;&#20415; &#65292;&#20363;&#22914; &#21040;&#36798;&#38476;&#29983;&#22320; &#31227;&#21160;&#35774;&#22791;&#19978;&#32593; &#23558;&#20250;&#32473;&#20320;&#24102;&#26469;&#24456;&#22823;&#30340;&#24110;&#21161;&#65292;&#20363;&#22914; &#25214;&#22320;&#28857;&#65292;&#25214;&#26053;&#39302; &#65292;&#25214;&#38468;&#36817;&#30340;facebook&#32593;&#32476;&#22909;&#21451;== &#65292; &#29978;&#33267;&#25214;WC &lt;br /&gt;
4,&#35821;&#35328;&#25628;&#32034; + &#23454;&#26102;&#25628;&#32034; &lt;br /&gt;
5,&amp;#8230;&amp;#8230;&amp;#8230;&amp;#8230;&amp;#8230;&amp;#8230;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&#19979;&#38754;&#26159;&#28436;&#35762;&#20869;&#23481;:&lt;/p&gt;
&lt;p&gt;&#35270;&#39057;:&lt;/p&gt;
&lt;p&gt;&lt;embed src=&quot;http://player.youku.com/player.php/sid/XMjI4MjczMDMy/v.swf&quot; quality=&quot;high&quot; width=&quot;480&quot; height=&quot;400&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;p&gt;Alan Eustace&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&#38750;&#24120;&#24863;&#35874;&#32993;&#29702;&#20107;&#38271;&#65281;

&#30830;&#23454;&#65292;&#20114;&#32852;&#32593;&#34892;&#19994;&#30446;&#21069;&#38754;&#20020;&#30528;&#38750;&#24120;&#20196;&#20154;&#28608;&#21160;&#30340;&#26102;&#21051;&#65292;

&#20013;&#22269;&#20114;&#32852;&#32593;&#32593;&#27665;&#24050;&#32463;&#36229;&#36807;&#20102;4.&lt;span class=&quot;i&quot;&gt;4&lt;/span&gt;&#20159;&#65292;

&#25163;&#26426;&#20114;&#32852;&#32593;&#30340;&#20351;&#29992;&#29992;&#25143;&#36229;&#36807;3&#20159;&#65292;

&#20013;&#22269;&#20114;&#32852;&#32593;&#34892;&#19994;&#26159;&#20840;&#19990;&#30028;&#22686;&#38271;&#26368;&#24555;&#30340;&#65292;

&#25105;&#20204;&#33021;&#22815;&#26469;&#21040;&#26410;&#26469;&#20114;&#32852;&#32593;&#34892;&#19994;&#30340;&#26680;&#24515;&#22320;&#21306;&#65292;

&#36825;&#26159;&#38750;&#24120;&#20196;&#20154;&#28608;&#21160;&#30340;&#12290;

&lt;span class=&quot;i&quot;&gt;50&lt;/span&gt;&#24180;&#20043;&#21069;&#65292;&#22914;&#26524;&#20320;&#26159;&#19968;&#20010;&#20316;&#23478;&#65292;&#24819;&#35753;&#20840;&#19990;&#30028;&#30340;&#20154;&#37117;&#30475;&#21040;&#20320;&#30340;&#20070;&#65292;&#24590;&#20040;&#20570;&#21602;&#65311;

&#20320;&#20063;&#35768;&#20889;&#19968;&#26412;&#20070;&#65292;&#35753;&#36825;&#26412;&#20070;&#20986;&#29256;&#12290;

&#20986;&#29256;&#21830;&#21487;&#33021;&#21360;2000&#21040;3000&#26412;&#12290;&#22914;&#26524;&#20320;&#24456;&#25104;&#21151;&#65292;&#20063;&#35768;&#20320;&#20250;&#25104;&#20026;&#19990;&#30028;&#19978;&#23569;&#25968;&#30340;&#20960;&#20010;&#20316;&#23478;&#20043;&#19968;&#65292;&#33021;&#22815;&#25226;&#20320;&#30340;&#20070;&#32763;&#35793;&#25104;&#20854;&#23427;&#22269;&#23478;&#30340;&#35821;&#35328;&#65292;&#24182;&#22312;&#20854;&#20182;&#22269;&#23478;&#36827;&#34892;&#38144;&#21806;&#12290;

&#20320;&#20063;&#35768;&#26159;&#19968;&#20010;&#22823;&#22411;&#25110;&#23567;&#22411;&#30340;&#26032;&#38395;&#25253;&#31038;&#35760;&#32773;&#65292;&#35753;&#20840;&#19990;&#30028;&#21548;&#21040;&#20320;&#30340;&#22768;&#38899;&#12290;

&#29616;&#22312;&#20154;&#20204;&#30340;&#20889;&#20316;&#26041;&#24335;&#24443;&#24213;&#25913;&#21464;&#20102;&#65292;&#21482;&#35201;&#26377;&#19968;&#21488;PC&#25110;&#25163;&#26426;&#23601;&#21487;&#20197;&#39532;&#19978;&#25509;&#35302;&#21040;&#20840;&#29699;&#29992;&#25143;&#12290;

&#30830;&#23454;&#65292;&#36825;&#21644;&#22810;&#24180;&#21069;&#21457;&#29983;&#30340;&#24773;&#20917;&#24456;&#19981;&#19968;&#26679;&#65292;&#22914;&#26524;&#20320;&#26377;&#29420;&#21040;&#30340;&#35265;&#35299;&#12289;&#26377;&#20160;&#20040;&#19996;&#35199;&#25945;&#32473;&#22823;&#23478;&#25110;&#32773;&#21644;&#22823;&#23478;&#20998;&#20139;&#12290;

&#19968;&#20999;&#37117;&#26159;&#21487;&#34892;&#30340;&#65292;&#22312;&#20114;&#32852;&#32593;&#26032;&#19990;&#30028;&#37324;&#65292;&#19968;&#20999;&#37117;&#21487;&#23454;&#29616;&#12290;

&lt;span class=&quot;i&quot;&gt;15&lt;/span&gt;&#24180;&#21069;&#29978;&#33267;10&#24180;&#21069;&#65292;&#22914;&#26524;&#20320;&#24819;&#36141;&#29289;&#65292;&#20320;&#20250;&#21435;&#21738;&#20799;&#24819;&#30475;&#30475;&#22823;&#23478;&#30340;&#24847;&#35265;&#65311; &#20080;&#36710;&#26102;&#22914;&#20309;&#20915;&#23450;&#12289;&#20581;&#24247;&#21307;&#30103;&#26041;&#38754;&#22914;&#20309;&#20915;&#23450;&#12289;&#23478;&#24237;&#38382;&#39064;&#26041;&#38754;&#22914;&#20309;&#20915;&#23450;&#65292;&#37027;&#26102;&#20320;&#26080;&#27861;&#65288;&#24471;&#21040;&#36825;&#20123;&#20449;&#24687;&#65289;&#12290;

&#20294;&#29616;&#22312;&#22823;&#23478;&#21487;&#20197;&#25366;&#25496;&#20840;&#19990;&#30028;&#30340;&#20449;&#24687;&#24182;&#35780;&#35770;&#12290;

&#29616;&#22312;&#25105;&#20204;&#22312;&#36141;&#29289;&#20043;&#21069;&#65292;&#19968;&#23450;&#20250;&#30475;&#30475;&#20854;&#20182;&#20154;&#22312;&#20080;&#20160;&#20040;&#19996;&#35199;&#65292;&#20135;&#21697;&#35268;&#26684;&#26377;&#20160;&#20040;&#20449;&#24687;&#12290;&#36825;&#20123;&#37117;&#21487;&#20197;&#25214;&#21040;&#20102;&#12290;

&#22914;&#26524;&#20320;&#24819;&#20462;&#29702;&#20160;&#20040;&#19996;&#35199;&#65292;&#21487;&#20197;&#19978;&#32593;&#65307;

&#20320;&#24819;&#23398;&#20064;&#20160;&#20040;&#65292;&#21487;&#20197;&#19978;&#32593;&#12290;

&#22312;&#20114;&#32852;&#32593;&#26102;&#20195;&#65292;&#20154;&#20204;&#30340;&#24037;&#20316;&#12289;&#29983;&#27963;&#26041;&#24335;&#24443;&#24213;&#25913;&#21464;&#20102;&#12290;

&#22914;&#26524;&#25105;&#26159;&#20225;&#19994;&#23478;&#65292;&#24819;&#20570;&#20840;&#29699;&#24191;&#21578;&#23459;&#20256;&#65292;&#24819;&#25509;&#35302;&#21040;&#22269;&#22806;&#26576;&#21306;&#22495;&#30340;&#29992;&#25143;&#65292;&#24590;&#20040;&#21150;&#21602;&#65311;

&#22914;&#26524;&#20320;&#24819;&#20570;&#20840;&#29699;&#24191;&#21578;&#23459;&#20256;&#27963;&#21160;&#65292;&#22312;&#37027;&#20010;&#26102;&#20505;&#65292;&#36825;&#38656;&#35201;&#33457;&#20960;&#21315;&#19975;&#29978;&#33267;&#20960;&#20159;&#32654;&#20803;&#65292;&#22240;&#20026;&#20320;&#35201;&#36328;&#36234;&#22269;&#30028;&#21040;&#21478;&#22806;&#19968;&#20010;&#22269;&#23478;&#20570;&#20135;&#21697;&#23459;&#20256;&#12289;&#38144;&#21806;&#12290;

&#21487;&#33021;&#38656;&#35201;&#33457;7&#24180;&#26102;&#38388;&#25165;&#33021;&#23454;&#29616;&#36825;&#19968;&#28857;&#12290;

&#20294;&#20114;&#32852;&#32593;&#24443;&#24213;&#25913;&#21464;&#20102;&#36825;&#19968;&#20999;&#65292;&#20225;&#19994;&#21487;&#20197;&#22312;&#20840;&#29699;&#33539;&#22260;&#20869;&#25509;&#35302;&#20182;&#20204;&#30340;&#23458;&#25143;&#65292;&#32780;&#19988;&#26159;&#31435;&#21051;&#12289;&#39532;&#19978;&#22320;&#25509;&#35302;&#21040;&#12290;

&#20013;&#22269;&#36825;&#26679;&#30340;&#22269;&#23478;&#26159;&#24222;&#22823;&#30340;&#21046;&#36896;&#22522;&#22320;&#65292;&#29983;&#20135;&#19990;&#30028;&#19978;&#35768;&#22810;&#30340;&#20135;&#21697;&#12289;&#21830;&#21697;&#65292;&#29616;&#22312;&#20013;&#22269;&#30340;&#20225;&#19994;&#20063;&#21487;&#20197;&#25509;&#35302;&#21040;&#20840;&#29699;&#23458;&#25143;&#12290;

&#36825;&#23545;&#20013;&#22269;&#21644;&#20840;&#19990;&#30028;&#20135;&#29983;&#20102;&#28145;&#36828;&#30340;&#24433;&#21709;&#12290;

&lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;&#24180;&#21069;&#65292;&#22914;&#26524;&#20320;&#26377;&#25163;&#26426;&#65292;&#25163;&#26426;&#21482;&#26159;&#29992;&#26469;&#25320;&#25171;&#25110;&#26159;&#25509;&#21548;&#30005;&#35805;&#12290;

&#29616;&#22312;&#25163;&#26426;&#24050;&#32463;&#21464;&#25104;&#20102;&#38376;&#25143;&#65292;&#23427;&#24320;&#21551;&#20840;&#19990;&#30028;&#30340;&#20449;&#24687;&#65292;&#19981;&#20165;&#20165;&#20877;&#26159;&#19968;&#37096;&#30005;&#35805;&#20102;&#12290;

&#36825;&#26159;&#25105;&#20204;&#20170;&#22825;&#21018;&#21018;&#20844;&#24067;&#30340;&#19968;&#27454;&#26032;&#22411;&#25163;&#26426;Nexus &lt;span class=&quot;co&quot;&gt;S&#65292;&#23427;&#23601;&#20687;&#26377;&#30528;&#30524;&#30555;&#19968;&#26679;&#65292;&#22240;&#20026;&#25163;&#26426;&#19978;&#26377;&#25668;&#20687;&#22836;&#65292;&#21487;&#20197;&#25293;&#35270;&#39057;&#12289;&#30475;&#19990;&#30028;&#12290;&lt;/span&gt;

&#36825;&#27454;&#25163;&#26426;&#19978;&#26377;&#32819;&#26421;&#65292;&#26377;&#32819;&#26426;&#65292;&#36824;&#26377;GPS&#65292;&#21487;&#20197;&#23548;&#33322;&#23450;&#20301;&#65292;&#30693;&#36947;&#20320;&#22312;&#21738;&#20799;&#12290;

&#19978;&#38754;&#26377;&#23631;&#24149;&#65292;&#23631;&#24149;&#21487;&#20197;&#21521;&#20320;&#23637;&#31034;&#65292;&#24182;&#19988;&#21487;&#20197;&#26080;&#32447;&#19978;&#32593;&#65292;&#21516;&#26102;&#23427;&#36824;&#26377;&#33455;&#29255;&#65292;&#21487;&#20197;&#36827;&#34892;&#21830;&#21153;&#20132;&#26131;&#12290;

&#36825;&#37096;&#25163;&#26426;&#19978;&#26377;&#35768;&#22810;&#38750;&#24120;&#31934;&#37319;&#30340;&#21151;&#33021;&#65292;&#19978;&#38754;&#26377;&#21160;&#20316;&#20256;&#24863;&#22120;&#65292;&#26377;&#32599;&#30424;&#65292;&#30693;&#36947;&#25105;&#38754;&#21521;&#30340;&#26159;&#20160;&#20040;&#26041;&#21521;&#65292;&#36825;&#20010;&#35774;&#22791;&#65292;&#21487;&#20197;&#25509;&#35302;&#20320;&#30340;&#20840;&#19990;&#30028;&#65292;&#19981;&#20809;&#26159;&#20320;&#30340;&#26379;&#21451;&#65292;&#19981;&#20165;&#20165;&#21487;&#20197;&#25171;&#30005;&#35805;&#65292;&#21482;&#35201;&#28165;&#28857;&#25163;&#26426;&#23601;&#21487;&#20197;&#25509;&#35302;&#20840;&#19990;&#30028;&#65292;&#36825;&#21644;&#20960;&#24180;&#21069;&#30340;&#25163;&#26426;&#32943;&#23450;&#26159;&#25130;&#28982;&#19981;&#21516;&#30340;&#12290;

&#20877;&#26469;&#30475;&#19968;&#19979;&#24212;&#29992;&#36719;&#20214;&#65292;&#25105;&#20204;&#22312;&#20960;&#24180;&#21069;&#20250;&#22312;&#21830;&#24215;&#37324;&#36141;&#20080;&#22871;&#35013;&#36719;&#20214;&#12290;

&#25171;&#24320;&#21253;&#35013;&#21518;&#20250;&#30475;&#21040;&#19968;&#24352;&#23567;&#20809;&#30424;&#12290;

&#29616;&#22312;&#25152;&#26377;&#30340;&#24212;&#29992;&#22522;&#26412;&#37117;&#26159;&#22312;&#20114;&#32852;&#32593;&#19978;&#23637;&#24320;&#30340;&#65292;&#20320;&#19981;&#38656;&#35201;&#21435;&#21830;&#24215;&#20080;&#23567;&#30418;&#23376;&#35013;&#36719;&#20214;&#20102;&#12290;

&#22914;&#26524;&#38656;&#35201;&#19968;&#20010;&#24212;&#29992;&#65292;&#25105;&#21487;&#20197;&#30452;&#25509;&#19979;&#36733;&#32780;&#26080;&#38656;&#31561;&#24453;&#12290;

&#29616;&#22312;&#25105;&#20204;&#27599;&#22825;&#29992;&#30340;&#24456;&#22810;&#24212;&#29992;&#30340;&#37117;&#26159;&#36890;&#36807;&#20114;&#32852;&#32593;HTML5&#65292; &#19968;&#31181;Java&#25216;&#26415;&#26469;&#22788;&#29702;&#12290;

&lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;&#24180;&#21069;&#65292;&#22914;&#26524;&#25105;&#26469;&#21040;&#19968;&#20010;&#26032;&#30340;&#22478;&#24066;&#20986;&#24046;&#65292;&#38656;&#35201;&#25214;&#37202;&#24215;&#65292;&#23601;&#20250;&#36141;&#20080;&#19968;&#24352;&#22320;&#22270;&#65292;&#29616;&#22312;&#27809;&#20154;&#20080;&#22320;&#22270;&#20102;&#65292;&#22240;&#20026;&#25163;&#26426;&#19978;&#20160;&#20040;&#37117;&#26377;&#65292;&#20648;&#23384;&#20102;&#20840;&#19990;&#30028;&#30340;&#22320;&#22270;&#24182;&#19988;&#21487;&#20197;&#38543;&#26102;&#38142;&#25509;&#21644;&#19979;&#36733;&#12290;

&#22914;&#26524;&#25105;&#24819;&#25214;&#37202;&#24215;&#12289;&#39184;&#21381;&#65292;&#25163;&#26426;&#37324;&#37117;&#26377;&#65292;&#24182;&#19988;&#21487;&#20197;&#38543;&#26102;&#35775;&#38382;&#12290;

&lt;span class=&quot;i&quot;&gt;10&lt;/span&gt;&#24180;&#21069;&#65292;&#22914;&#26524;&#25105;&#19981;&#20250;&#35828;&#26576;&#20010;&#22269;&#23478;&#30340;&#35821;&#35328;&#65292;&#37027;&#23601;&#20250;&#23436;&#20840;&#36855;&#22833;&#26041;&#21521;&#65292;&#19968;&#28857;&#20799;&#21150;&#27861;&#20063;&#27809;&#26377;&#65292;&#38656;&#35201;&#33457;&#22810;&#24180;&#26102;&#38388;&#25484;&#25569;&#19968;&#38376;&#35821;&#35328;&#12290;

&#29616;&#22312;&#21602;&#65311;&#20219;&#20309;&#20154;&#37117;&#26377;&#33021;&#21147;&#35828;&#20219;&#20309;&#19968;&#31181;&#35821;&#35328;&#12289;&#29702;&#35299;&#20219;&#20309;&#19968;&#31181;&#35821;&#35328;&#12290;

&#31350;&#31455;&#21457;&#29983;&#20102;&#20160;&#20040;&#24773;&#20917;&#65311;&#30001;&#20110;&#25216;&#26415;&#21457;&#23637;&#38750;&#24120;&#24555;&#65292;15&#24180;&#21069;&#65292;&#25105;&#35273;&#24471;&#30001;&#20110;&#25216;&#26415;&#30340;&#21457;&#23637;&#65292;&#20840;&#29699;&#30340;&#20449;&#24687;&#37117;&#21487;&#20197;&#35013;&#22312;&#36825;&#37096;&#25163;&#26426;&#37324;&#65292;&#20840;&#19990;&#30028;&#30340;&#22320;&#22270;&#37117;&#21487;&#20197;&#25918;&#36827;&#21435;&#12290;

&#30828;&#30424;&#25216;&#26415;&#38750;&#24120;&#26834;&#65292;CPU&#25216;&#26415;&#22312;&#19981;&#26029;&#25913;&#36827;&#65292;15&#24180;&#21069;&#25105;&#35273;&#24471;&#25105;&#38656;&#35201;&#30340;&#19996;&#35199;&#37117;&#21487;&#20197;&#25918;&#22312;&#36825;&#37324;&#20102;&#65292;&#19981;&#38656;&#35201;&#20114;&#32852;&#20114;&#36890;&#12290;

&#29616;&#22312;&#36825;&#20123;&#20107;&#24773;&#23436;&#20840;&#25913;&#21464;&#20102;&#65292;&#19981;&#20877;&#26159;&#25226;&#25152;&#26377;&#20449;&#24687;&#23384;&#22312;&#36825;&#20010;&#25163;&#26426;&#19978;&#65292;&#25105;&#20204;&#26377;&#24040;&#22823;&#30340;&#25968;&#25454;&#20013;&#24515;&#65292;&#26377;&#21069;&#20154;&#19981;&#26366;&#24819;&#20687;&#30340;&#25968;&#25454;&#20648;&#23384;&#33021;&#21147;&#12289;&#21508;&#25968;&#25454;&#20013;&#24515;&#20043;&#38388;&#20043;&#38388;&#30340;&#36830;&#25509;&#33021;&#21147;&#12290;

&#22312;&#36825;&#20010;&#35774;&#22791;&#19978;&#21487;&#20197;&#35299;&#20915;&#38750;&#24120;&#22256;&#38590;&#30340;&#38382;&#39064;&#65292;&#27604;&#22914;&#19978;&#32593;&#65292;&#35775;&#38382;&#20840;&#19990;&#30028;&#30340;&#22320;&#22270;&#12289;&#20570;&#20840;&#19990;&#30028;&#21508;&#31181;&#35821;&#35328;&#30340;&#20114;&#35793;&#12290;&#23427;&#21487;&#20197;&#21457;&#20986;&#25351;&#20196;&#65292;&#25226;&#22312;&#25163;&#26426;&#12289;&#30005;&#33041;&#19978;&#35201;&#20570;&#30340;&#20107;&#24773;&#21464;&#25104;&#25351;&#20196;&#65292;&#25351;&#25381;&#21518;&#21488;&#25968;&#21315;&#19975;&#21488;&#35745;&#31639;&#26426;&#35201;&#20570;&#30340;&#20107;&#24773;&#12290;

&#27604;&#22914;&#22312;&#25628;&#32034;&#26694;&#37324;&#36755;&#20837;&#20004;&#19977;&#20010;&#23383;&#65292;&#20840;&#29699;&#30340;&#25968;&#21315;&#21488;&#35745;&#31639;&#26426;&#23601;&#21487;&#20197;&#24110;&#21161;&#20320;&#20840;&#19990;&#30028;&#33539;&#22260;&#20869;&#25628;&#23547;&#24819;&#25214;&#21040;&#30340;&#31572;&#26696;&#65292;&#28982;&#21518;&#36820;&#36824;&#32473;&#20320;&#33021;&#22815;&#25552;&#20379;&#32473;&#20320;&#30340;&#26368;&#22909;&#30340;&#31572;&#26696;&#12290;

&#22914;&#26524;&#20320;&#24819;&#20570;&#32763;&#35793;&#65292;&#37027;&#20040;&#65288;&#23545;&#30528;&#35774;&#22791;&#65289;&#35828;&#20960;&#20010;&#23383;&#65292;&#25968;&#25454;&#20013;&#24515;&#21518;&#21488;&#20960;&#21315;&#21488;&#30005;&#33041;&#23601;&#20250;&#25214;&#21040;&#26368;&#21512;&#36866;&#30340;&#32763;&#35793;&#29256;&#26412;&#24182;&#22312;&#20320;&#30340;&#25163;&#26426;&#19978;&#26174;&#31034;&#20986;&#26469;&#12290;

&#25163;&#26426;&#26412;&#36523;&#26159;&#26377;&#35745;&#31639;&#33021;&#21147;&#30340;&#65292;&#20973;&#25163;&#26426;&#30340;&#35745;&#31639;&#33021;&#21147;&#20063;&#35768;&#38656;&#35201;&#19968;&#20010;&#26376;&#30340;&#26102;&#38388;&#21644;&#35768;&#22810;&#35768;&#22810;&#30005;&#27744;&#25165;&#33021;&#22815;&#23454;&#29616;&#20113;&#35745;&#31639;&#65292;&#22240;&#20026;&#29616;&#22312;&#25105;&#20204;&#36827;&#20837;&#20102;&#20113;&#35745;&#31639;&#26102;&#20195;&#65292;&#21487;&#20197;&#35299;&#20915;&#38750;&#24120;&#22797;&#26434;&#26840;&#25163;&#30340;&#38382;&#39064;&#12290;

&#36825;&#20123;&#25968;&#25454;&#20013;&#24515;&#38656;&#35201;&#36880;&#27493;&#24314;&#35774;&#36215;&#26469;&#12290;

&#36825;&#20123;&#25968;&#25454;&#20013;&#24515;&#30340;&#35745;&#31639;&#33021;&#21147;&#21069;&#25152;&#26410;&#26377;&#65292;&#32780;&#19988;&#30456;&#20114;&#20043;&#38388;&#23454;&#29616;&#20114;&#32852;&#65292;&#25968;&#25454;&#20043;&#38388;&#21487;&#20197;&#20256;&#36755;&#65292;&#20256;&#36755;&#36895;&#24230;&#20063;&#26159;&#38750;&#24120;&#37325;&#35201;&#30340;&#65292;&#20320;&#38656;&#35201;&#23545;&#35745;&#31639;&#26426;&#36827;&#34892;&#38598;&#32676;&#65292;&#20877;&#35753;&#23427;&#23436;&#25104;&#21333;&#19968;&#30340;&#20219;&#21153;&#12290;

&#29616;&#22312;Google&#26377;&#24456;&#22810;&#24212;&#29992;&#24050;&#32463;&#25104;&#20026;&#20102;&#22312;&#20113;&#29615;&#22659;&#20013;&#30340;&#24212;&#29992;&#12290;&#22914;&#26524;&#25105;&#20204;&#36880;&#19968;&#26597;&#30475;&#30340;&#35805;&#65292;&#20320;&#20250;&#30475;&#21040;&#21363;&#20351;&#22312;&#25105;&#20204;&#30340;&#26085;&#24120;&#24037;&#20316;&#20013;&#65292;&#20063;&#38656;&#35201;&#24456;&#22810;&#30340;&#20449;&#24687;&#12290;

&#25105;&#20204;&#26377;&#20114;&#32852;&#32593;&#65292;&#25226;&#32593;&#19978;&#30340;&#25104;&#21315;&#19978;&#19975;&#30340;&#32593;&#39029;&#24314;&#31435;&#32034;&#24341;&#65292;&#26159;&#25105;&#20204;&#22312;Google&#30340;&#37325;&#35201;&#24037;&#20316;&#65292;&#20063;&#26377;&#19968;&#20123;&#20854;&#20182;&#30340;&#20844;&#21496;&#20063;&#22312;&#20570;&#30528;&#36825;&#26679;&#30340;&#24037;&#20316;&#12290;

&#25105;&#20204;&#36824;&#20570;&#24456;&#22810;&#22270;&#29255;&#25628;&#32034;&#65292;&#22240;&#20026;&#24456;&#22810;&#20154;&#26597;&#23547;&#30340;&#26159;&#22270;&#29255;&#65292;&#32780;&#19981;&#21482;&#26159;&#25991;&#23383;&#12290;

&#20182;&#20204;&#20063;&#38656;&#35201;&#25628;&#32034;&#12290;

&#21478;&#22806;&#36824;&#26377;&#35270;&#39057;&#12290;&#29616;&#22312;&#36234;&#26469;&#36234;&#22810;&#35270;&#39057;&#20869;&#23481;&#25152;&#21253;&#21547;&#30340;&#20449;&#24687;&#27491;&#26159;&#20320;&#25152;&#38656;&#35201;&#30340;&#26368;&#26377;&#36259;&#65292;&#26368;&#24688;&#24403;&#30340;&#20449;&#24687;&#12290;

&#25105;&#32463;&#24120;&#20250;&#19978;Youtube&#36825;&#20010;&#32593;&#31449;&#65292;&#25105;&#20250;&#25226;&#38656;&#35201;&#30340;&#19996;&#35199;&#25918;&#21040;&#25628;&#32034;&#26694;&#37324;&#65292;&#20986;&#26469;&#30340;&#26159;&#35270;&#39057;&#65292;&#32780;&#19981;&#26159;&#25991;&#23383;&#12290;

&#29616;&#22312;&#36234;&#26469;&#36234;&#22810;&#30340;&#25628;&#32034;&#32467;&#26524;&#26159;&#26469;&#33258;&#20110;&#35270;&#39057;&#20869;&#23481;&#32780;&#19981;&#26159;&#25991;&#23383;&#20869;&#23481;&#12290;

&#24403;&#28982;&#65292;&#21478;&#22806;&#19968;&#20010;&#24456;&#22823;&#30340;&#26469;&#28304;&#23601;&#26159;&#26032;&#38395;&#65292;&#27599;&#20010;&#35774;&#22791;&#37117;&#21487;&#20197;&#24471;&#21040;&#26368;&#26032;&#20449;&#24687;&#12290;

&#27492;&#22806;&#36824;&#26377;&#19968;&#20010;&#21151;&#33021;&#23601;&#26159;&#22320;&#22270;&#65292;&#36825;&#26159;&#20196;&#25105;&#20204;&#38750;&#24120;&#33258;&#35946;&#30340;&#21151;&#33021;&#65292;&#21487;&#20197;&#24314;&#31435;&#19968;&#20123;&#24037;&#20855;&#20351;&#22823;&#23478;&#33021;&#22815;&#36890;&#36807;&#24037;&#20855;&#29983;&#25104;&#24403;&#22320;&#22320;&#22270;&#65292;&#36825;&#26159;&#25105;&#20204;&#30340;&#8220;&#22320;&#22270;&#29983;&#25104;&#22120;&#8221;&#65292;&#20219;&#20309;&#20154;&#24819;&#35201;&#29983;&#25104;&#22320;&#22270;&#37117;&#21487;&#20197;&#36890;&#36807;&#36825;&#20123;&#24037;&#20855;&#12290;

&#20320;&#21487;&#20197;&#21019;&#24314;&#20320;&#20204;&#33258;&#24049;&#31038;&#21306;&#30340;&#22320;&#22270;&#65292;&#28982;&#21518;&#25226;&#23427;&#19978;&#36733;&#65292;&#35753;&#25972;&#20010;&#19990;&#30028;&#37117;&#21487;&#20197;&#30475;&#21040;&#20320;&#29983;&#25104;&#30340;&#22320;&#22270;&#65292;&#36825;&#19968;&#28857;&#22312;&#28023;&#22320;&#28798;&#38590;&#20013;&#65288;&#36215;&#21040;&#20102;&#65289;&#38750;&#24120;&#37325;&#35201;&#65288;&#30340;&#20316;&#29992;&#65289;&#65292;&#24403;&#26102;&#24456;&#22810;&#25628;&#32034;&#20154;&#21592;&#20351;&#29992;&#21355;&#26143;&#25968;&#25454;&#29983;&#25104;&#22320;&#22270;&#20197;&#24110;&#21161;&#25628;&#25937;&#24037;&#20316;&#12290;

&#25105;&#20204;&#36824;&#24110;&#21161;&#25919;&#24220;&#26426;&#26500;&#20570;&#19968;&#20123;&#24212;&#29992;&#65306;

&#27492;&#22806;&#36824;&#26377;&#19968;&#20010;&#24212;&#29992;&#23601;&#26159;&#34903;&#26223;&#65292;&#21578;&#35785;&#20320;&#34903;&#36947;&#30340;&#20449;&#24687;&#12289;&#22478;&#24066;&#20449;&#24687;&#20197;&#21450;&#26576;&#20010;&#24215;&#38138;&#30340;&#38376;&#21475;&#38271;&#20160;&#20040;&#26679;&#30340;&#20449;&#24687;&#12290;

&#20197;&#21069;&#24403;&#22320;&#20225;&#19994;&#21482;&#26377;&#19968;&#31181;&#21150;&#27861;&#25509;&#35302;&#21040;&#28508;&#22312;&#23458;&#25143;&#65292;&#23601;&#26159;&#36890;&#36807;&#40644;&#39029;&#25552;&#20379;&#20449;&#24687;&#12290;

&#29616;&#22312;&#22823;&#23478;&#37117;&#21487;&#20197;&#36890;&#36807;&#22240;&#29305;&#32593;&#25509;&#35302;&#25104;&#21315;&#19978;&#19975;&#30340;&#26032;&#30340;&#23458;&#25143;&#12290;

&#20197;&#21069;&#22914;&#26524;&#20320;&#25104;&#31435;&#20102;&#19968;&#23478;&#26032;&#20844;&#21496;&#65292;&#31532;&#19968;&#20214;&#35201;&#23601;&#26159;&#35201;&#24314;&#31435;&#19968;&#20010;IT&#37096;&#38376;&#65292;&#36825;&#20010;IT&#37096;&#38376;&#20250;&#24314;&#31435;&#26381;&#21153;&#22120;&#65292;&#36825;&#20010;&#26381;&#21153;&#22120;&#20013;&#20250;&#26377;&#19968;&#20123;&#30005;&#23376;&#37038;&#20214;&#20197;&#21450;&#37038;&#20214;&#32452;&#12290;

&#20294;&#29616;&#22312;&#20225;&#19994;&#24050;&#32463;&#19981;&#36825;&#26679;&#20570;&#20102;&#12290;

&#20182;&#20204;&#26377;&#20114;&#32852;&#32593;

&#26377;&#26356;&#22810;&#26041;&#24335;&#26469;&#24314;&#31435;&#20182;&#20204;&#30340;&#32852;&#31995;&#26041;&#24335;&#65292;&#20351;&#29992;Gmail&#12290;

&#20182;&#20204;&#30340;IT&#21592;&#24037;&#20063;&#25104;&#20026;&#20102;&#32593;&#32476;&#26377;&#21592;&#24037;&#25110;&#38144;&#21806;&#20154;&#21592;&#12290;

&#21478;&#22806;&#65292;&#22914;&#26524;&#35828;&#26377;&#19968;&#31181;&#22312;&#20114;&#32852;&#32593;&#19978;&#32570;&#23569;&#30340;&#20449;&#24687;&#65292;&#37027;&#23601;&#26159;&#22270;&#20070;&#20449;&#24687;&#12290;

&#30446;&#21069;&#65292;&#25105;&#20204;&#19981;&#33021;&#36890;&#36807;&#20114;&#32852;&#32593;&#33719;&#24471;&#25152;&#26377;&#30340;&#22270;&#20070;&#20449;&#24687;&#12290;

&#36825;&#19968;&#28857;&#25105;&#20204;&#35748;&#20026;&#26159;&#25361;&#25112;&#12290;

&#25105;&#20204;&#26399;&#26395;&#33021;&#22815;&#25226;&#22270;&#20070;&#25968;&#23383;&#21270;&#24182;&#25918;&#22312;&#32593;&#19978;&#12290;

&#29616;&#22312;&#25105;&#20204;&#24050;&#32463;&#20351;&#20960;&#20159;&#22270;&#20070;&#25968;&#23383;&#21270;&#20102;&#65292;&#24182;&#25918;&#19978;&#20102;&#20114;&#32852;&#32593;&#12290;

&#27492;&#22806;&#36824;&#26377;&#20135;&#21697;&#25628;&#32034;&#30340;&#21151;&#33021;&#12290;

&#22312;&#19978;&#20114;&#32852;&#32593;&#30340;&#26102;&#20505;&#65292;&#25105;&#20204;&#38656;&#35201;&#24471;&#21040;&#26576;&#20123;&#20135;&#21697;&#30340;&#20449;&#24687;&#12290;

&#36825;&#20123;&#20135;&#21697;&#24635;&#26159;&#26377;&#33258;&#24049;&#29305;&#33394;&#30340;&#12290;

&#27604;&#22914;&#19968;&#20123;&#31454;&#20105;&#20135;&#21697;&#30340;&#20449;&#24687;&#65292;&#29992;&#25143;&#21487;&#33021;&#38656;&#35201;&#30693;&#36947;&#36825;&#26679;&#30340;&#20449;&#24687;&#65292;

&#36825;&#26679;&#23601;&#21487;&#20197;&#20114;&#30456;&#27604;&#36739;&#27492;&#31867;&#20135;&#21697;&#21644;&#30456;&#31867;&#20135;&#21697;&#30340;&#24615;&#33021;&#22914;&#20309;&#12290;

&#27492;&#22806;&#36824;&#26377;&#19968;&#28857;&#38750;&#24120;&#37325;&#35201;&#65292;

&#21363;&#31038;&#20132;&#32593;&#12290;

&#27604;&#22914;&#20320;&#30340;&#26379;&#21451;&#21487;&#33021;&#35748;&#20026;&#26576;&#19968;&#26041;&#38754;&#38750;&#24120;&#37325;&#35201;&#65292;

&#20182;&#38750;&#24120;&#30456;&#20449;&#26576;&#20123;&#19996;&#35199;&#65292;&#36825;&#26679;&#23601;&#20250;&#23545;&#20320;&#20135;&#29983;&#24433;&#21709;&#12290;

&#21478;&#22806;&#36824;&#26377;&#19968;&#31181;&#25152;&#35859;&#30340;&#34987;&#21160;&#35774;&#22791;&#65292;

&#20197;&#21069;&#25105;&#20204;&#20570;&#19968;&#20010;&#32034;&#24341;&#65292;&#33021;&#32034;&#24341;30&#22825;&#20043;&#21069;&#30340;&#35760;&#24405;&#65292;

&#25105;&#20204;&#20351;&#29992;&#20114;&#32852;&#32593;&#65292;&#20351;&#29992;Google&#12290;

&#20294;&#24930;&#24930;&#22320;&#25105;&#20204;&#21457;&#29616;&#20154;&#20204;&#24076;&#26395;&#31435;&#21051;&#33719;&#24471;&#20449;&#24687;&#65292;

&#20182;&#20204;&#19981;&#24076;&#26395;&#31561;&#19978;&#21322;&#20010;&#26376;&#25110;&#19968;&#20010;&#26376;&#25165;&#30693;&#36947;&#20449;&#24687;&#65292;&#32780;&#26159;&#24076;&#26395;&#21363;&#26102;&#24471;&#21040;&#12290;

&#29616;&#22312;Google&#33021;&#32034;&#24341;&#30340;&#20869;&#23481;&#65292;&#26368;&#26032;&#30340;&#26159;&#21482;&#26377;&#20960;&#31186;&#38047;&#21069;&#25165;&#20986;&#29616;&#30340;&#20449;&#24687;&#65292;&#21363;&#26102;&#24471;&#21040;&#26368;&#26032;&#20449;&#24687;&#26159;&#38750;&#24120;&#37325;&#35201;&#30340;&#65292; &#32780;&#19981;&#26159;&#20960;&#21608;&#20043;&#21069;&#30340;&#12290;

&#27492;&#22806;&#65292;&#24191;&#21578;&#23545;&#25105;&#20204;&#26469;&#35828;&#20063;&#26159;&#19968;&#20010;&#38750;&#24120;&#22909;&#30340;&#20449;&#24687;&#28304;&#65292;&#22914;&#26524;&#20320;&#22312;&#20114;&#32852;&#32593;&#19978;&#36141;&#20080;&#20102;&#19996;&#35199;&#65292;

&#24191;&#21578;&#19981;&#20877;&#21482;&#26159;&#20026;&#36186;&#38065;&#65292;&#36824;&#21487;&#20197;&#25552;&#20379;&#20154;&#20204;&#38656;&#35201;&#36141;&#20080;&#30340;&#19996;&#35199;&#30340;&#20449;&#24687;&#12290;

&#36825;&#20063;&#26159;&#25105;&#20204;&#20570;&#30340;&#37325;&#35201;&#20107;&#24773;&#12290;

&#25105;&#20204;&#20570;&#20102;&#24456;&#22810;&#24037;&#20316;&#26469;&#24110;&#21161;&#36825;&#20123;&#20107;&#24773;&#65288;&#30340;&#36798;&#25104;&#65289;&#65292;

&#22240;&#20026;&#24191;&#21578;&#36136;&#37327;&#19978;&#21162;&#21147;&#21644;&#22312;&#25552;&#39640;&#25628;&#32034;&#36136;&#37327;&#19978;&#30340;&#21162;&#21147;&#19968;&#26679;&#22810;&#12290;

&#27492;&#22806;&#65292;&#30446;&#21069;&#25152;&#21457;&#29983;&#30340;&#21478;&#22806;&#19968;&#20010;&#21464;&#21270;&#23601;&#26159;&#65306;

&#19981;&#31649;&#20160;&#20040;&#26679;&#30340;&#35774;&#22791;&#37117;&#33021;&#25509;&#20837;&#20114;&#32852;&#32593;&#12290;

&#36807;&#21435;&#21482;&#26377;&#30005;&#33041;&#21487;&#20197;&#19978;&#32593;&#12290;

&#29616;&#22312;&#25163;&#26426;&#20316;&#20026;&#31227;&#21160;&#35774;&#22791;&#20063;&#21487;&#20197;&#19978;&#32593;&#20102;&#12290;

&#26368;&#36817;&#21448;&#26377;&#23459;&#24067;&#35828;&#30005;&#35270;&#20063;&#21487;&#20197;&#19978;&#32593;&#20102;&#12290;

&#24456;&#26126;&#26174;&#65292;iPad&#20043;&#31867;&#30340;&#24179;&#26495;&#30005;&#33041;&#20063;&#33021;&#22815;&#25509;&#20837;&#12290;

&#25152;&#20197;&#65292;&#29616;&#22312;&#25509;&#20837;&#20114;&#32852;&#32593;&#30340;&#26041;&#24335;&#36234;&#26469;&#36234;&#22810;&#26679;&#21270;&#65292;

&#25105;&#20204;&#24847;&#35782;&#21040;&#36825;&#19968;&#28857;&#36235;&#21183;&#65292;&#20063;&#21162;&#21147;&#22320;&#21033;&#29992;&#25216;&#26415;&#20351;&#21508;&#31181;&#35774;&#22791;&#37117;&#33021;&#22815;&#33719;&#24471;&#20114;&#32852;&#32593;&#19978;&#30340;&#20449;&#24687;&#12290;

&#19979;&#19968;&#27493;&#26159;&#20160;&#20040;&#21602;&#65311;

&#25105;&#20204;&#20570;&#20102;&#24456;&#22810;&#26377;&#24847;&#20041;&#30340;&#20107;&#24773;&#65292;

&#25105;&#20204;&#20250;&#32487;&#32493;&#36825;&#26679;&#20570;&#12290;

&#20294;&#35753;&#25105;&#32473;&#22823;&#23478;&#20998;&#20139;&#20960;&#28857;&#21543;&#65306;

&#25628;&#32034;&#23454;&#38469;&#26159;&#24456;&#22810;&#20135;&#21697;&#30340;&#25972;&#21512;&#12290;

&#26368;&#36817;&#25105;&#20204;&#25512;&#20986;&#20102;&#19968;&#20010;&#26032;&#30340;&#25216;&#26415;- &lt;span class=&quot;co&quot;&gt;Caffeine&#65292;&#23427;&#25972;&#21512;&#20102;&#23613;&#21487;&#33021;&#22810;&#30340;&#25991;&#20214;&#65292;&#26377;70&lt;/span&gt;%&#30340;&#26032;&#32034;&#24341;&#65292;&#20063;&#23601;&#26159;&#25105;&#20204;&#19981;&#24517;&#31561;&#24453;&#32034;&#24341;&#26356;&#26032;&#65292;&#32780;&#26159;&#33021;&#22815;&#38750;&#24120;&#24555;&#22320;&#21319;&#32423;&#21644;&#26356;&#26032;&#12290;

&#29616;&#22312;&#25628;&#32034;&#30340;&#20114;&#21160;&#24615;&#20063;&#36234;&#26469;&#36234;&#24378;&#20102;&#65292;

&#19981;&#21482;&#26159;&#32473;&#20320;&#25552;&#20379;10&#20010;&#36229;&#32423;&#38142;&#25509;&#65292;&#20063;&#35768;&#38500;&#20102;10&#20010;&#38142;&#25509;&#20043;&#22806;&#36824;&#26377;&#19968;&#20123;&#22270;&#29255;&#12289;&#30005;&#24433;&#21098;&#36753;&#65292;&#26410;&#26469;&#30340;&#25628;&#32034;&#26159;&#38750;&#24120;&#22810;&#26679;&#21270;&#30340;&#65292;

&#21478;&#22806;&#25628;&#32034;&#20063;&#36234;&#26469;&#36234;&#20010;&#20154;&#21270;&#12290;

&#27604;&#22914;&#25105;&#25628;&#32034;&#33181;&#30422;&#25163;&#26415;&#30340;&#20449;&#24687;&#12290;

&#25628;&#32034;&#32467;&#26524;&#23558;&#20250;&#20998;&#25104;&#19981;&#21516;&#30340;&#31867;&#21035;&#65306;

&#27604;&#22914;&#29992;&#20110;&#36816;&#21160;&#21592;&#21644;&#29992;&#20110;&#26222;&#36890;&#20154;&#30340;&#12290;

&#20320;&#26159;&#24590;&#26679;&#30340;&#36523;&#20221;&#65292;&#23558;&#20915;&#23450;&#20320;&#24471;&#21040;&#30340;&#25628;&#32034;&#32467;&#26524;&#26159;&#20160;&#20040;&#26679;&#30340;&#12290;

&#20063;&#23601;&#26159;&#35828;&#65292;&#36825;&#31181;&#25628;&#32034;&#32467;&#26524;&#23558;&#20250;&#26356;&#21152;&#20010;&#20154;&#21270;&#12290;

&#22312;&#36825;&#26041;&#38754;&#25105;&#20204;&#26377;&#24456;&#22810;&#20363;&#23376;&#21487;&#20197;&#21644;&#22823;&#23478;&#20998;&#20139;&#12290;

&#21508;&#20010;&#19981;&#21516;&#22320;&#21306;&#30340;&#20363;&#23376;&#12290;

&#27492;&#22806;&#26377;&#24456;&#22810;&#20154;&#22312;&#29992;Chrome&#27983;&#35272;&#22120;&#65292;&#25105;&#20204;&#24076;&#26395;&#36825;&#20010;&#27983;&#35272;&#22120;&#33021;&#22815;&#36234;&#24555;&#36234;&#22909;&#12290;&#25105;&#20204;&#24076;&#26395;&#25512;&#36827;HTML5&#30340;&#26497;&#38480;&#12290;

&#25105;&#20204;&#26399;&#24453;&#25152;&#26377;&#20154;&#37117;&#33021;&#24314;&#31435;&#33258;&#24049;&#30340;&#24212;&#29992;&#12290;

&#23454;&#38469;&#19978;&#20114;&#32852;&#32593;&#20381;&#36182;&#30340;&#26159;&#23427;&#30340;&#21487;&#29992;&#24615;&#12290;

&#22914;&#26524;&#20154;&#20204;&#33021;&#22312;&#20114;&#32852;&#32593;&#19978;&#24314;&#31435;&#20182;&#30340;&#24212;&#29992;&#12290;

&#23601;&#33021;&#21019;&#24314;&#24456;&#22810;&#26377;&#24847;&#24605;&#30340;&#20107;&#24773;&#12290;

&#27604;&#22914;&#28216;&#25103;&#25110;&#20854;&#23427;&#21830;&#19994;&#24212;&#29992;&#12290;

&#20063;&#23601;&#26159;&#35828;&#65292;&#19981;&#38656;&#20174;&#32593;&#19978;&#19979;&#36733;&#24212;&#29992;&#65292;&#32780;&#26159;&#30452;&#25509;&#38142;&#20837;&#20114;&#32852;&#32593;&#12290;

&#25105;&#20204;&#21162;&#21147;&#22312;&#20351;&#36825;&#20010;&#27983;&#35272;&#22120;&#21152;&#24555;&#36895;&#24230;&#65292;&#32780;&#19988;&#33021;&#22815;&#26356;&#22810;&#23481;&#32435;&#22823;&#23478;&#25152;&#21019;&#24314;&#30340;&#24212;&#29992;&#12290;&#20320;&#24212;&#35813;&#19981;&#38656;&#35201;&#19979;&#36733;&#24212;&#29992;&#65292;&#21482;&#35201;&#19978;&#32593;&#65292;&#23601;&#33021;&#31435;&#21363;&#24471;&#21040;&#20114;&#21160;&#30340;&#20114;&#32852;&#32593;&#24212;&#29992;&#20307;&#39564;&#12290;

&#25105;&#20204;&#36824;&#26377;Chrome &lt;span class=&quot;co&quot;&gt;OS&#65292;&#23427;&#26159;&#19968;&#20010;&#26032;&#30340;&#25805;&#20316;&#31995;&#32479;&#12290;&lt;/span&gt;

&#19987;&#38376;&#20026;Web&#21019;&#24314;&#12290;

&#36825;&#26159;&#26377;&#21490;&#20197;&#26469;&#26368;&#23433;&#20840;&#30340;&#25805;&#20316;&#31995;&#32479;&#65292;&#27809;&#26377;&#30149;&#27602;&#65292;&#27809;&#26377;&#40657;&#23458;&#30340;&#25915;&#20987;&#65292;&#25105;&#20204;&#35201;&#25226;&#23427;&#20570;&#25104;&#26159;&#26368;&#23433;&#20840;&#30340;&#12290;

&#36807;&#21435;&#20845;&#20010;&#26376;&#20013;&#25105;&#19968;&#30452;&#22312;&#20351;&#29992;Chrome &lt;span class=&quot;co&quot;&gt;OS&#36825;&#20010;&#20135;&#21697;&#12290;&lt;/span&gt;

&#22312;&#25105;&#25343;&#21040;&#23427;&#30340;&#26102;&#20505;&#65292;&#23427;&#31435;&#21051;&#23601;&#33021;&#24037;&#20316;&#12290;&#25105;&#19968;&#30331;&#20837;&#65292;&#23427;&#23601;&#20250;&#19979;&#36733;&#19968;&#20123;&#25105;&#25152;&#21018;&#20852;&#36259;&#30340;&#19996;&#35199;&#12290;&#26377;&#19968;&#27425;&#65292;&#25105;&#30340;&#26426;&#22120;&#22351;&#20102;&#65292;&#25105;&#25442;&#20102;&#19968;&#21488;&#26032;&#30340;&#65292;&#25105;&#30340;&#36816;&#34892;&#29615;&#22659;&#31435;&#21051;&#21464;&#25104;&#21644;&#20197;&#21069;&#19968;&#27169;&#19968;&#26679;&#12290;&#25105;&#19981;&#20877;&#20381;&#36182;&#20110;&#19968;&#37096;&#22266;&#23450;&#30340;&#35774;&#22791;&#12290;&#29616;&#22312;&#65292; &#25105;&#21487;&#20197;&#22312;&#25105;&#30340;Andriod&#25163;&#26426;&#20013;&#36755;&#20837;&#25105;&#30340;&#23494;&#30721;&#21644;&#29992;&#25143;&#21517;&#65292;&#25152;&#26377;&#19996;&#35199;&#37117;&#21487;&#20197;&#19979;&#36733;&#21040;&#36825;&#37096;&#25163;&#26426;&#19978;&#65292;&#25152;&#26377;&#30340;&#32852;&#32476;&#20449;&#24687;&#65292;&#25105;&#21916;&#27426;&#30340;&#20869;&#23481;&#21644;&#24212;&#29992;&#12290;

&#36825;&#20123;&#37117;&#25913;&#21464;&#20102;&#25105;&#30340;&#24037;&#20316;&#12289;&#29983;&#27963;&#26041;&#24335;&#12290;

&#29616;&#22312;&#22312;&#20154;&#20204;&#20043;&#38388;&#26377;&#24456;&#22810;&#20114;&#21160;&#65292;

&#36825;&#26159;&#31038;&#20132;&#32593;&#32476;&#26368;&#25797;&#38271;&#30340;&#22320;&#26041;&#12290;

&#25105;&#38750;&#24120;&#22312;&#20046;&#25105;&#30340;&#26379;&#21451;&#21916;&#27426;&#20160;&#20040;&#26679;&#30340;&#30005;&#24433;&#12290;

&#65288;&#22312;&#20046;&#65289;&#25105;&#30340;&#26379;&#21451;&#35835;&#20160;&#20040;&#26679;&#30340;&#20070;&#12289;&#20182;&#20204;&#22312;&#21738;&#37324;&#21507;&#39277;&#12290;

&#36825;&#20123;&#37117;&#26159;&#25105;&#25152;&#20851;&#27880;&#30340;&#12290;&#25628;&#32034;&#20170;&#21518;&#20250;&#26377;&#31038;&#20132;&#26041;&#38754;&#30340;&#21151;&#33021;&#12290;

&#20316;&#20026;&#19968;&#20010;&#34892;&#19994;&#26469;&#35828;&#65292;&#24314;&#31435;&#24179;&#21488;&#26159;&#38750;&#24120;&#37325;&#35201;&#30340;&#12290;

&#36825;&#28857;&#25105;&#21644;&#32993;&#29702;&#20107;&#38271;&#20063;&#20132;&#35848;&#36807;&#12290;

&#25105;&#20204;&#35201;&#24314;&#31435;&#19968;&#20010;&#24179;&#21488;&#65292;&#24314;&#31435;&#19979;&#19968;&#20195;&#30340;&#24212;&#29992;&#12290;

&#25105;&#20204;&#38656;&#35201;&#19968;&#20010;&#24456;&#22909;&#30340;&#22522;&#30784;&#35774;&#26045;&#12290;

&#20351;&#20154;&#20204;&#33021;&#22815;&#22312;&#22522;&#30784;&#35774;&#26045;&#20043;&#19978;&#21019;&#24314;&#20182;&#20204;&#30340;&#19996;&#35199;&#12290;

&#25972;&#20010;&#34892;&#19994;&#25152;&#20570;&#30340;&#23601;&#26159;&#35201;&#24314;&#31435;&#19968;&#20010;&#22909;&#30340;&#22522;&#30784;&#35774;&#26045;&#12290;

&#25105;&#20204;&#38656;&#35201;&#36825;&#26679;&#19968;&#31181;&#33021;&#21147;&#65292;&#20351;&#19979;&#19968;&#20195;&#30340;&#33021;&#21147;&#33021;&#22312;&#27492;&#22522;&#30784;&#19978;&#20570;&#20182;&#20204;&#30340;&#20107;&#24773;&#12290;

&#27604;&#22914;IPV6&#65292;&#36825;&#26159;&#38750;&#24120;&#22522;&#26412;&#30340;&#25216;&#26415;&#12290;

&#20294;&#38500;&#20102;IPV6&#20043;&#22806;&#36824;&#26377;&#19968;&#20123;&#20854;&#23427;&#30340;&#25216;&#26415;&#12290;

&#27604;&#22914;HTML5&#65292; &lt;span class=&quot;co&quot;&gt;Java&#31561;&#12290;&lt;/span&gt;

&#19979;&#19968;&#20195;&#30340;&#24191;&#21578;&#20063;&#20250;&#20010;&#24615;&#21270;&#12290;

&#20174;&#29992;&#25143;&#30340;&#35282;&#24230;&#26469;&#35828;&#65292;&#20182;&#20204;&#19981;&#24819;&#24471;&#21040;&#25152;&#26377;&#30340;&#24191;&#21578;&#12290;

&#32780;&#21482;&#24819;&#24471;&#21040;&#21644;&#25105;&#30456;&#20851;&#12289;&#25226;&#25105;&#20316;&#20026;&#30446;&#26631;&#30340;&#24191;&#21578;&#12290;

&#32780;&#19988;&#35201;&#26159;&#25105;&#25152;&#20851;&#27880;&#30340;&#20449;&#24687;&#12290;

&#36825;&#20063;&#25913;&#21464;&#20102;&#24191;&#21578;&#30340;&#26041;&#24335;&#12290;

&#65288;&#24191;&#21578;&#65289;&#19981;&#20877;&#26159;&#39578;&#25200;&#25105;&#30340;&#65292;&#32780;&#26159;&#20154;&#20204;&#30830;&#23454;&#38656;&#35201;&#30340;&#12290;

&#20154;&#20204;&#21487;&#20197;&#20174;&#24191;&#21578;&#20013;&#33719;&#24471;&#20182;&#25152;&#38656;&#35201;&#30340;&#20449;&#24687;&#12290;

&#21478;&#22806;&#36824;&#26377;&#19968;&#20123;&#37325;&#35201;&#30340;&#25913;&#21464;&#65306;

&#32763;&#35793;&#21644;&#35821;&#38899;&#35782;&#21035;&#12290;

&#22914;&#26524;&#20320;&#35828;&#20986;&#35821;&#35328;&#65292;&#23427;&#39532;&#19978;&#23601;&#33021;&#25226;&#23427;&#21464;&#25104;&#25991;&#26412;&#12290;

&#36825;&#26159;&#24456;&#22823;&#30340;&#36827;&#27493;&#12290;

&#21516;&#26102;&#25105;&#20204;&#20063;&#22312;&#20851;&#27880;&#32763;&#35793;&#12290;

&#21487;&#20197;&#20570;&#21508;&#31181;&#35821;&#35328;&#30340;&#20114;&#35793;&#65292;

&#20174;&#35821;&#38899;&#36716;&#21270;&#20026;&#25991;&#26412;&#65292;

&#20877;&#25226;&#25991;&#26412;&#32763;&#35793;&#25104;&#21478;&#19968;&#31181;&#35821;&#35328;&#12290;

&#22914;&#26524;&#26377;&#36825;&#26679;&#30340;&#19968;&#20010;&#36807;&#31243;&#65292;

&#20840;&#19990;&#30028;&#20154;&#20204;&#30340;&#27807;&#36890;&#38556;&#30861;&#23601;&#20250;&#28040;&#22833;&#65292;

&#21487;&#20197;&#24471;&#21040;&#21508;&#22320;&#30340;&#20449;&#24687;&#65292;

&#35835;&#25026;&#25152;&#26377;&#30340;&#35270;&#39057;&#12289;&#21548;&#25026;&#38899;&#39057;&#12289;&#30475;&#25026;&#25152;&#26377;&#30340;&#25991;&#23383;&#65292;

&#23545;&#25105;&#26469;&#35828;&#65292;&#36825;&#19981;&#26159;&#21313;&#24180;&#20043;&#21518;&#25165;&#33021;&#23454;&#29616;&#30340;&#26790;&#24819;&#65292;

&#25105;&#35748;&#20026;&#25105;&#20204;&#20960;&#20046;&#23601;&#33021;&#36798;&#21040;&#36825;&#26679;&#30340;&#24212;&#29992;&#20102;&#65292;

&#22312;&#26410;&#26469;&#20116;&#21040;&#21313;&#24180;&#20013;&#65292;

&#25105;&#20204;&#30456;&#20449;&#36328;&#22320;&#29702;&#21306;&#22495;&#30340;&#27807;&#36890;&#23558;&#20250;&#39532;&#19978;&#23454;&#29616;&#12290;

&#36825;&#26159;&#20114;&#32852;&#32593;&#23558;&#35201;&#25913;&#21464;&#19990;&#30028;&#30340;&#19968;&#20010;&#20363;&#23376;&#12290;

&#38750;&#24120;&#24863;&#35874;&#22823;&#23478;&#30340;&#20809;&#20020;&#65292;

&#24863;&#35874;&#32993;&#29702;&#20107;&#38271;&#30340;&#20809;&#20020;&#12290;

&#24863;&#35874;&#24744;&#23545;&#20114;&#32852;&#32593;&#34892;&#19994;&#30340;&#39046;&#23548;&#65292;&#20114;&#32852;&#32593;&#26159;&#19968;&#20010;&#29305;&#27530;&#30340;&#22320;&#26041;&#65292;&#23427;&#34164;&#34255;&#30528;&#26410;&#26469;&#65292;

&#21253;&#25324;&#20225;&#19994;&#30340;&#26410;&#26469;&#12289;&#20844;&#27665;&#30340;&#26410;&#26469;&#12289;&#25945;&#32946;&#30340;&#26410;&#26469;&#20197;&#21450;&#25919;&#24220;&#37096;&#38376;&#20844;&#20849;&#20107;&#21153;&#30340;&#26410;&#26469;&#65292;

&#23427;&#23381;&#32946;&#30528;&#25972;&#20010;&#30340;&#26410;&#26469;&#12290;

&#25105;&#20204;&#26377;&#23853;&#26032;&#30340;&#25216;&#26415;&#65292;&#25105;&#20204;&#22312;&#8220;&#38271;&#24449;&#8221;&#20013;&#24050;&#32463;&#36808;&#20986;&#20102;&#37325;&#35201;&#20960;&#27493;&#65292;

&#25216;&#26415;&#38750;&#24120;&#20808;&#36827;&#65292;&#23427;&#22312;&#32487;&#32493;&#21457;&#23637;&#65292;&#22312;&#20013;&#22269;&#21457;&#23637;&#12290;

&#25105;&#30456;&#20449;&#20013;&#22269;&#20250;&#22788;&#22312;&#36825;&#22330;&#38761;&#21629;&#30340;&#21069;&#27839;&#12290;

&#35874;&#35874;&#22823;&#23478;&#65281;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;T.V Raman&lt;/p&gt;
&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&#22823;&#23478;&#22909;&#65281;

&#38750;&#24120;&#39640;&#20852;&#22823;&#23478;&#21442;&#19982;&#25105;&#20204;&#30340;&#27963;&#21160;&#65281;

&lt;span class=&quot;co&quot;&gt;Alan&#21018;&#25165;&#35762;&#21040;&#25105;&#20204;&#33021;&#20570;&#20107;&#24773;&#30340;&#33539;&#22260;&#22312;&#19981;&#26029;&#25193;&#22823;&#65292;&lt;/span&gt;

&#27599;&#20010;&#20154;&#37117;&#33021;&#22815;&#24471;&#21040;&#20449;&#24687;&#65292;&#20855;&#26377;&#21487;&#35775;&#38382;&#24615;&#12290;

&#36825;&#23601;&#26159;&#25105;&#35828;&#30340;&#8220;&#23646;&#20110;&#27599;&#20010;&#20154;&#30340;&#20114;&#32852;&#32593;&#8221;&#65292;

&#20808;&#26469;&#20570;&#19968;&#19979;&#27010;&#36848;&#65306;

&#39318;&#20808;&#25105;&#20250;&#35762;&#19968;&#19979;&#25105;&#20204;&#25152;&#35828;&#30340;&#25972;&#21512;&#20449;&#24687;&#26102;&#20195;&#30340;&#35775;&#38382;&#26159;&#20160;&#20040;&#24847;&#24605;&#65292;

&#25105;&#20250;&#32473;&#22823;&#23478;&#35848;&#19968;&#19979;&#33258;&#24049;&#30340;&#35266;&#28857;&#12290;

&#22312;&#36825;&#33410;&#20043;&#21518;&#25105;&#20250;&#35848;&#19968;&#19979;&#31185;&#25216;&#21040;&#24213;&#33021;&#20570;&#20160;&#20040;&#12290;

&lt;span class=&quot;co&quot;&gt;Alan&#21018;&#25165;&#35762;&#21040;&#20102;&#19968;&#20123;&#65292;&lt;/span&gt;

&#20294;&#25105;&#20250;&#26356;&#35814;&#32454;&#22320;&#35762;&#21040;&#31185;&#25216;&#23558;&#32473;&#25105;&#20204;&#24102;&#26469;&#20160;&#20040;&#65292;

&#31532;&#22235;&#37096;&#20998;&#25105;&#20250;&#35762;&#19968;&#19979;Google&#30340;&#20135;&#21697;&#22914;&#20309;&#25512;&#21160;&#25972;&#21512;&#20449;&#24687;&#30340;&#35775;&#38382;&#65292;

&#25105;&#20204;&#22914;&#20309;&#20805;&#20998;&#22320;&#21033;&#29992;&#19968;&#20123;&#26032;&#30340;&#25216;&#26415;&#26469;&#25512;&#21160;&#23427;&#12290;

&#26368;&#21518;&#19968;&#37096;&#20998;&#25105;&#20250;&#35762;&#19968;&#19979;&#26410;&#26469;

&#25105;&#35748;&#20026;&#26410;&#26469;&#20250;&#26356;&#32654;&#22909;&#12290;

&#22312;&#36807;&#21435;15&#24180;&#20013;&#65292;&#25105;&#20204;&#30830;&#23454;&#21462;&#24471;&#20102;&#24456;&#22810;&#25104;&#23601;&#65292;&#20294;&#26410;&#26469;&#20250;&#26356;&#32654;&#22909;&#12290;

&#36825;&#26159;&#20170;&#22825;&#25105;&#25152;&#35201;&#35762;&#30340;&#20869;&#23481;&#65292;&#20854;&#20013;&#36824;&#20250;&#31359;&#25554;&#19968;&#20123;&#28436;&#31034;&#12290;

&#39318;&#20808;&#30475;&#19968;&#19979;&#25972;&#21512;&#20449;&#24687;&#30340;&#35775;&#38382;&#65306;

&#22312;&#36825;&#20043;&#21069;&#25105;&#24819;&#35762;&#19968;&#19979;&#33258;&#24049;&#30340;&#32972;&#26223;&#65292;

&#24456;&#23567;&#30340;&#26102;&#20505;&#25105;&#23601;&#22833;&#26126;&#20102;&#65292;

&#25105;&#29983;&#20110;&#21360;&#24230;&#65292;&#21518;&#26469;&#23398;&#20064;&#20102;&#25968;&#23398;&#21644;&#35745;&#31639;&#26426;&#31185;&#23398;&#65292;

&#25105;&#22312;&#20843;&#20061;&#21313;&#24180;&#20195;&#27605;&#19994;&#26102;&#65292;&#20114;&#32852;&#32593;&#21018;&#21018;&#20852;&#36215;&#12290;

&#21482;&#26377;&#22312;&#30005;&#33041;&#21069;&#22352;&#30528;&#65292;&#25105;&#20204;&#25165;&#33021;&#33719;&#24471;&#20449;&#24687;&#12290;

&#23601;&#20687;&#26159;&#22352;&#30528;&#24341;&#25806;&#38750;&#24120;&#21457;&#36798;&#30340;&#27773;&#36710;&#65292;

&#24403;&#26102;&#24456;&#22810;&#19996;&#35199;&#37117;&#21487;&#20197;&#20174;&#32593;&#19978;&#30475;&#21040;&#12290;

&#25105;&#24847;&#35782;&#21040;&#65292;&#33021;&#22815;&#35753;&#25152;&#26377;&#20154;&#33719;&#24471;&#20114;&#32852;&#32593;&#19978;&#30340;&#20449;&#24687;&#23558;&#20250;&#26159;&#19968;&#20010;&#38750;&#24120;&#20196;&#20154;&#20852;&#22859;&#30340;&#35805;&#39064;&#21644;&#30740;&#31350;&#26041;&#21521;&#65292;

&#24590;&#26679;&#20351;&#25152;&#26377;&#20154;&#65288;&#21253;&#25324;&#21548;&#21147;&#21644;&#35270;&#21147;&#21463;&#25439;&#30340;&#20154;&#65289;&#35775;&#38382;&#20840;&#29699;&#20449;&#24687;&#21602;&#65311;

&#25105;&#20204;&#35201;&#25630;&#28165;&#26970;&#36825;&#19968;&#20999;&#24847;&#21619;&#30528;&#20160;&#20040;&#65292;

&#24590;&#26679;&#30830;&#20445;&#20449;&#24687;&#21487;&#35775;&#38382;&#24615;&#30340;&#22686;&#38271;&#12290;

&#22312;&#20170;&#22825;&#65292;&#20840;&#19990;&#30028;&#30340;&#20449;&#24687;&#21644;&#20116;&#24180;&#21069;&#30456;&#27604;&#24050;&#32463;&#26377;&#20102;&#24456;&#22823;&#30340;&#22686;&#38271;&#65292;

&#25105;&#20204;&#24076;&#26395;&#23545;&#20110;&#27599;&#20010;&#20154;&#65288;&#26469;&#35828;&#65289;&#65292;

&#26080;&#35770;&#20182;&#26159;&#27491;&#24120;&#20154;&#36824;&#26159;&#27531;&#38556;&#20154;&#22763;&#65292;

&#37117;&#33021;&#22815;&#22312;&#20219;&#20309;&#26102;&#38388;&#12289;&#20219;&#20309;&#22320;&#26041;&#35775;&#38382;&#20449;&#24687;&#12290;

&#36825;&#20010;&#24895;&#26223;&#29616;&#22312;&#24050;&#32463;&#24320;&#22987;&#23454;&#29616;&#20102;&#65292;

&#26080;&#35770;&#26159;&#20320;&#22352;&#22312;&#24037;&#20316;&#21488;&#36793;&#65288;&#36824;&#26159;&#20854;&#23427;&#22320;&#26041;&#65289;&#65292;

&#26377;&#30340;&#24037;&#31243;&#24072;&#35745;&#31639;&#26426;&#26174;&#31034;&#22120;&#38750;&#24120;&#22823;&#65292;&#21487;&#20197;&#29992;&#23427;&#35775;&#38382;&#12290;

&#24403;&#20010;&#20154;&#36208;&#22312;&#22806;&#38754;&#26102;&#65292;&#25343;&#30528;&#38750;&#24120;&#23567;&#30340;&#25163;&#25345;&#35774;&#22791;&#20063;&#21487;&#20197;&#19978;&#32593;&#12290;

&#23545;&#25105;&#26469;&#35828;&#24819;&#23454;&#29616;&#30340;&#19968;&#28857;&#23601;&#26159;&#65292;

&#22312;&#20219;&#20309;&#26102;&#20505;&#12289;&#20219;&#20309;&#22320;&#28857;&#65292;&#20197;&#20320;&#24819;&#35201;&#30340;&#26041;&#24335;&#33719;&#24471;&#20320;&#25152;&#38656;&#35201;&#30340;&#20449;&#24687;&#12290;

&#25105;&#20204;&#31245;&#24494;&#36864;&#21518;&#19968;&#27493;&#26469;&#30475;&#30475;15&#24180;&#21069;&#12289;20&#24180;&#21069;&#30340;&#24773;&#20917;&#26159;&#20160;&#20040;&#26679;&#30340;&#12290;

&#20570;&#25216;&#26415;&#24037;&#20316;&#30340;&#37117;&#30693;&#36947;&#65292;

&#30005;&#35805;&#30340;&#65288;&#21457;&#23637;&#65289;&#36895;&#24230;&#22914;&#27492;&#20043;&#24555;&#65292;

&#24456;&#23481;&#26131;&#35753;&#20320;&#24536;&#25481;&#20116;&#24180;&#21069;&#12289;&#21313;&#24180;&#21069;&#30340;&#29366;&#20917;&#12290;

&#26469;&#30475;&#30475;&#20108;&#21313;&#24180;&#21069;&#20114;&#32852;&#32593;&#38382;&#19990;&#20043;&#21069;&#19990;&#30028;&#26159;&#20160;&#20040;&#26679;&#23376;&#12289;&#32654;&#22269;&#26159;&#20160;&#20040;&#26679;&#23376;&#65306;

&#24403;&#26102;&#19990;&#30028;&#19978;&#21482;&#26377;&#24456;&#23567;&#19968;&#37096;&#20998;&#30340;&#20449;&#24687;&#23454;&#29616;&#20102;&#25968;&#23383;&#21270;&#65292;

&#25105;&#20204;&#36861;&#28335;&#21040;&#20114;&#32852;&#32593;&#20197;&#21450;&#30005;&#23376;&#21270;&#20449;&#24687;&#26102;&#20195;&#20043;&#21069;&#65292;

&#24403;&#26102;&#38754;&#20020;&#30528;&#19968;&#31995;&#21015;&#38480;&#21046;&#65306;

&#20108;&#21313;&#21040;&#19977;&#21313;&#24180;&#21069;&#22914;&#26524;&#20320;&#24819;&#32473;&#25105;&#20889;&#20449;&#65292;

&#38656;&#35201;&#25214;&#19968;&#24352;&#20449;&#32440;&#65292;

&#20889;&#22909;&#20449;&#65292;&#35013;&#20837;&#20449;&#23553;&#65292;&#25214;&#21040;&#37038;&#23616;&#20877;&#25226;&#20449;&#23492;&#32473;&#25105;&#12290;

&#20316;&#20026;&#25910;&#20449;&#20154;&#65292;&#25910;&#21040;&#20320;&#30340;&#20449;&#20043;&#21518;&#25105;&#25165;&#33021;&#30475;&#21040;&#20320;&#24819;&#21578;&#35785;&#25105;&#20160;&#20040;&#12290;

&#20063;&#23601;&#26159;&#35828;&#65292;&#24403;&#20320;&#25343;&#36215;&#20449;&#32440;&#20889;&#20449;&#26102;&#65292;&#32943;&#23450;&#35748;&#20026;&#25910;&#20449;&#20154;&#26159;&#26377;&#35270;&#21147;&#30340;&#12290;

&#22914;&#26524;&#25105;&#26159;&#30450;&#20154;&#65292;&#37027;&#23601;&#38656;&#35201;&#25214;&#21478;&#22806;&#19968;&#20010;&#20154;&#25226;&#36825;&#23553;&#20449;&#30340;&#20869;&#23481;&#24565;&#32473;&#25105;&#21548;&#12290;

&#22914;&#26524;&#25105;&#20204;&#29992;&#40614;&#20811;&#39118;&#21457;&#34920;&#35762;&#35805;&#24182;&#36890;&#36807;&#24191;&#25773;&#20844;&#24320;&#25773;&#20986;&#65292;

&#37027;&#23601;&#21448;&#38656;&#35201;&#19968;&#20010;&#20551;&#23450;&#26465;&#20214;&#65292;&#25152;&#26377;&#25910;&#21548;&#24191;&#25773;&#30340;&#20154;&#37117;&#24517;&#39035;&#21548;&#21147;&#27491;&#24120;&#12290;

&#21518;&#26469;&#25105;&#20204;&#36827;&#20837;&#20102;&#30005;&#23376;&#20449;&#24687;&#26102;&#20195;&#65292;

&#36827;&#20837;&#30005;&#23376;&#20449;&#24687;&#26102;&#20195;&#20043;&#21518;&#21457;&#29983;&#20102;&#21738;&#20123;&#21464;&#21270;&#21602;&#65311;

&#25105;&#20204;&#25226;&#21069;&#19968;&#20010;&#26102;&#20195;&#30340;&#21407;&#23376;&#21464;&#25104;&#20102;&#36825;&#20010;&#26102;&#20195;&#30340;&#27604;&#29305;&#12290;

&#27604;&#22914;&#36807;&#21435;&#30340;&#25253;&#32440;&#65292;&#37117;&#26159;&#30333;&#32440;&#40657;&#23383;&#21360;&#21047;&#20986;&#26469;&#30340;&#65292;&#23454;&#38469;&#36825;&#26159;&#30001;&#22909;&#22810;&#21407;&#23376;&#65288;&#32452;&#21512;&#65289;&#22312;&#19968;&#36215;&#30340;&#12290;

&#24403;&#20320;&#25226;&#21407;&#23376;&#25253;&#32440;&#21464;&#25104;&#22522;&#20110;&#27604;&#29305;&#30340;&#25253;&#32440;&#20043;&#21518;&#65292;

&#23601;&#26159;&#25226;&#20320;&#25152;&#35201;&#20256;&#36882;&#12289;&#33719;&#21462;&#30340;&#20449;&#24687;&#21644;&#23427;&#30340;&#20171;&#36136;&#20998;&#31163;&#20986;&#26469;&#20102;&#65292;&#36825;&#26159;&#19968;&#20010;&#38750;&#24120;&#37325;&#35201;&#30340;&#21464;&#21270;&#12290;

&#20063;&#23601;&#26159;&#35828;&#65292;&#22312;&#36825;&#37324;&#25226;&#36807;&#21435;&#30340;&#20551;&#23450;&#37117;&#25512;&#32763;&#20102;&#65292;

&#8220;&#20449;&#24687;&#25509;&#25910;&#26041;&#24517;&#39035;&#35201;&#26377;&#35270;&#21147;&#12289;&#26377;&#21548;&#21147;&#8221;

&#36825;&#19968;&#20551;&#23450;&#34987;&#25512;&#32763;&#20102;&#65292;&#20449;&#24687;&#25509;&#25910;&#32773;&#20063;&#21487;&#20197;&#26159;&#30450;&#20154;&#65292;&#36890;&#36807;&#35745;&#31639;&#26426;&#20026;&#20182;&#26391;&#35835;&#26469;&#33719;&#21462;&#20449;&#24687;&#65292;&#21516;&#26102;&#35745;&#31639;&#26426;&#20063;&#20855;&#26377;&#32763;&#35793;&#30340;&#33021;&#21147;&#12290;

&lt;span class=&quot;i&quot;&gt;1988&lt;/span&gt;&#12289;1989&#24180;&#24038;&#21491;&#26102;&#25105;&#36824;&#26159;&#23398;&#29983;&#65292;

&#35201;&#24819;&#35835;&#20070;&#30340;&#35805;&#24517;&#39035;&#35201;&#30001;&#24535;&#24895;&#32773;&#24110;&#25105;&#25226;&#20070;&#24565;&#20986;&#26469;&#12290;

&#20170;&#24180;&#26159;2010&#24180;&#65292;

&#29616;&#22312;&#25105;&#24050;&#32463;&#26377;&#21313;&#19971;&#20843;&#24180;&#19981;&#29992;&#21035;&#20154;&#24565;&#20070;&#36825;&#31181;&#26041;&#24335;&#26469;&#24110;&#21161;&#25105;&#20102;&#12290;

&#27491;&#26159;&#22240;&#20026;&#30005;&#23376;&#20449;&#24687;&#20351;&#20043;&#25104;&#20026;&#21487;&#33021;&#12290;

&#22312;&#36825;&#22330;&#38761;&#21629;&#21457;&#29983;&#20043;&#21069;&#65292;

&#25105;&#33021;&#24471;&#21040;&#30340;&#19996;&#35199;&#26159;&#38750;&#24120;&#26377;&#38480;&#30340;&#12290;

&#20063;&#23601;&#26159;&#35828;&#65292;&#25105;&#33719;&#24471;&#30340;&#20449;&#24687;&#21463;&#21040;&#20102;&#25105;&#23454;&#38469;&#26465;&#20214;&#30340;&#38480;&#21046;&#12290;

&#20294;&#20170;&#22825;&#25105;&#24819;&#33719;&#24471;&#22810;&#23569;&#20449;&#24687;&#20027;&#35201;&#21462;&#20915;&#20110;&#25105;&#26377;&#22810;&#23569;&#26102;&#38388;&#12290;

&#36825;&#26159;&#19968;&#20010;&#26497;&#22823;&#30340;&#21464;&#21270;&#12290;

&lt;span class=&quot;co&quot;&gt;Alan&#21018;&#25165;&#20063;&#35762;&#21040;&#20102;&#36825;&#26041;&#38754;&#30340;&#24773;&#20917;&#12290;&lt;/span&gt;

&#20108;&#21313;&#24180;&#21069;&#25105;&#20204;&#22312;&#35848;&#20449;&#24687;&#30005;&#23376;&#21270;&#26102;&#65292;&#20173;&#28982;&#35273;&#24471;&#36825;&#20123;&#20449;&#24687;&#35201;&#25918;&#22312;&#30913;&#30424;&#37324;&#12290;

&#21518;&#26469;&#38543;&#30528;&#20113;&#35745;&#31639;&#30340;&#20852;&#36215;&#65292;&#36825;&#19968;&#20999;&#21448;&#21457;&#29983;&#20102;&#26032;&#30340;&#21464;&#21270;&#12290;

&#19979;&#38754;&#26469;&#30475;&#30475;&#25216;&#26415;&#33021;&#32473;&#25105;&#20204;&#24102;&#26469;&#20160;&#20040;&#65306;

&#25105;&#22312;&#36825;&#37324;&#30340;&#20027;&#35762;&#35201;&#28857;&#26159;&#20174;&#20026;&#33258;&#24049;&#32771;&#34385;&#30340;&#35282;&#24230;&#26469;&#35828;&#30340;&#65292;

&#27604;&#26041;&#35828;&#65292;&#25105;&#35273;&#24471;&#36890;&#36807;&#35745;&#31639;&#25216;&#26415;&#33021;&#22815;&#35299;&#20915;&#24456;&#22810;&#20687;&#25105;&#36825;&#26679;&#20154;&#30340;&#38382;&#39064;&#65292;

&#28982;&#21518;&#25105;&#21448;&#24847;&#35782;&#21040;&#65292;&#36825;&#26679;&#30340;&#25216;&#26415;&#19981;&#20809;&#23545;&#25105;&#26377;&#29992;&#65292;&#23545;&#20854;&#20182;&#30340;&#30450;&#20154;&#20063;&#20250;&#24456;&#26377;&#29992;&#12290;

&#20877;&#36827;&#19968;&#27493;&#24037;&#20316;&#19979;&#21435;&#21518;&#65292;&#25105;&#35273;&#24471;&#21487;&#20197;&#25226;&#36825;&#20214;&#20107;&#24773;&#20570;&#24471;&#26356;&#22823;&#12290;

&#25152;&#20197;&#25105;&#26500;&#24314;&#20986;&#26469;&#30340;&#25216;&#26415;&#19981;&#20809;&#35201;&#23545;&#30450;&#20154;&#26377;&#29992;&#65292;&#36824;&#35201;&#23545;&#27599;&#20010;&#20154;&#37117;&#26377;&#29992;&#12290;

&#19979;&#38754;&#25105;&#23558;&#32473;&#22823;&#23478;&#20171;&#32461;&#36825;&#27573;&#26053;&#31243;&#65292;&#25105;&#20204;&#19968;&#36215;&#22238;&#39038;&#19968;&#36941;&#65306;

&#36825;&#26159;&#20061;&#21313;&#24180;&#20195;&#20013;&#26399;&#21457;&#26126;&#30340;&#35789;&#65306;

&#8220;&#20107;&#24773;&#22312;&#20197;&#22240;&#29305;&#32593;&#30340;&#36895;&#24230;&#21462;&#24471;&#36827;&#27493;&#8221;

&#36825;&#23601;&#20351;&#24471;&#19990;&#30028;&#19978;&#36234;&#26469;&#36234;&#22810;&#30340;&#20449;&#24687;&#20197;&#36234;&#26469;&#36234;&#24555;&#30340;&#36895;&#24230;&#22312;&#32447;&#21270;&#12289;&#30005;&#23376;&#21270;&#65292;

&#38543;&#30528;&#25105;&#20204;&#35753;&#36234;&#26469;&#36234;&#22810;&#30340;&#20449;&#24687;&#22312;&#32447;&#65292;

&#23601;&#20351;&#24471;&#36825;&#26679;&#30340;&#20449;&#24687;&#23545;&#20110;&#35775;&#38382;&#32773;&#26469;&#35828;&#65292;

&#26080;&#35770;&#20182;&#36523;&#22312;&#20309;&#22788;&#37117;&#21487;&#20197;&#35775;&#38382;&#65292;

&#20449;&#24687;&#23545;&#27599;&#20010;&#20154;&#26469;&#35828;&#21464;&#24471;&#36234;&#26469;&#36234;&#24179;&#31561;&#65292;

&#22240;&#20026;&#22312;&#20114;&#32852;&#32593;&#20013;&#65292;&#20219;&#20309;&#22320;&#26041;&#37117;&#26159;&#20855;&#26377;&#24179;&#31561;&#35775;&#38382;&#26435;&#30340;&#12290;

&#26089;&#20123;&#26102;&#20505;&#35848;&#36807;&#20102;&#65292;&#36890;&#36807;&#20449;&#24687;&#25968;&#23383;&#21270;&#65292;&#25105;&#20204;&#25226;&#20449;&#24687;&#21644;&#20171;&#36136;&#20998;&#24320;&#20102;&#65292;

&#26080;&#35770;&#20320;&#36523;&#22312;&#20309;&#22788;&#12289;&#20197;&#20309;&#31181;&#24418;&#24335;&#35775;&#38382;&#12289;&#26080;&#35770;&#20010;&#20154;&#33021;&#21147;&#22914;&#20309;&#65292;

&#37117;&#21487;&#20197;&#35775;&#38382;&#12290;

&#36825;&#26679;&#30340;&#20449;&#24687;&#37117;&#20855;&#26377;&#21487;&#35775;&#38382;&#24615;&#65292;&#36825;&#19968;&#28857;&#38750;&#24120;&#37325;&#35201;&#12290;

&#24403;&#25105;&#20204;&#22312;&#32771;&#34385;&#20449;&#24687;&#21487;&#20351;&#29992;&#24615;&#26102;&#65292;

&#36825;&#19968;&#28857;&#21516;&#26102;&#20063;&#21457;&#29983;&#20102;&#24456;&#22823;&#30340;&#21464;&#21270;&#12290;

&#23601;&#20687;&#25105;&#25171;&#24320;&#36825;&#20010;&#25151;&#38388;&#30340;&#28783;&#26102;&#65292;&#27599;&#20010;&#20154;&#37117;&#21487;&#20197;&#20139;&#21463;&#23427;&#30340;&#20809;&#20142;&#12290;

&#25105;&#20204;&#19981;&#20809;&#30475;&#21040;&#20102;&#20449;&#24687;&#19978;&#32593;&#65292;&#21516;&#26102;&#25105;&#20204;&#20351;&#29992;&#30340;&#35775;&#38382;&#35774;&#22791;&#20063;&#21464;&#24471;&#26356;&#20016;&#23500;&#20102;&#12290;

&#19981;&#31649;&#26159;&#30028;&#38754;&#36824;&#26159;&#35774;&#22791;&#12290;

&#20108;&#21313;&#24180;&#21069;&#25105;&#20204;&#38656;&#35201;&#29992;&#38190;&#30424;&#21644;&#40736;&#26631;&#26469;&#30475;&#30005;&#33041;&#65292;&#20294;&#30475;&#19968;&#30475;&#20170;&#22825;&#30340;&#29992;&#25143;&#35774;&#22791;&#65292;

&#24456;&#22810;&#35774;&#22791;&#37117;&#26377;&#29615;&#22659;&#24863;&#30693;&#21147;&#12289;&#26377;GPS&#23450;&#20301;&#21151;&#33021;&#65292;

&#21487;&#20197;&#21548;&#24471;&#35265;&#12289;&#30475;&#24471;&#21040;&#65292;

&#21487;&#20197;&#20027;&#21160;&#24110;&#21161;&#20320;&#65292;&#23454;&#29616;&#20102;&#29992;&#25143;&#20132;&#20114;&#24335;&#30028;&#38754;&#65292;

&#36825;&#26679;&#30340;&#20449;&#24687;&#21457;&#23637;&#26159;&#38750;&#24120;&#28608;&#21160;&#20154;&#24515;&#30340;&#12290;

&#23427;&#23545;&#20110;&#32593;&#32476;&#26469;&#35828;&#24847;&#21619;&#30528;&#20160;&#20040;&#65311;

&#24403;&#25105;&#20204;&#20174;Google&#24037;&#31243;&#24072;&#30340;&#35282;&#24230;&#26469;&#30475;&#24453;&#36825;&#20123;&#65292;

&#31616;&#32780;&#35328;&#20043;&#65292;&#20114;&#32852;&#32593;&#23601;&#26159;&#19968;&#20010;&#24179;&#21488;&#12290;

&#20114;&#32852;&#32593;&#26159;&#19968;&#20010;&#24320;&#25918;&#24335;&#24179;&#21488;&#65292;&#27599;&#19968;&#20010;&#20154;&#37117;&#21487;&#20197;&#22312;&#19978;&#38754;&#21457;&#24067;&#20449;&#24687;&#12290;

&#24403;&#20320;&#25226;&#20449;&#24687;&#21457;&#24067;&#21040;&#20114;&#32852;&#32593;&#19978;&#26102;&#65292;&#26080;&#35770;&#22312;&#20219;&#20309;&#22320;&#26041;&#37117;&#33021;&#20570;&#21040;&#36825;&#19968;&#28857;&#12290;

&#20114;&#32852;&#32593;&#32473;&#25105;&#20204;&#35775;&#38382;&#32593;&#32476;&#30340;&#24418;&#24335;&#24102;&#26469;&#20102;&#24040;&#22823;&#21464;&#21270;&#65292;

&#20351;&#24471;&#20320;&#12289;&#20351;&#24471;&#27599;&#19968;&#20010;&#20154;&#25104;&#20026;&#20102;&#20449;&#24687;&#35775;&#38382;&#27963;&#21160;&#30340;&#20013;&#24515;&#65292;&#32780;&#19981;&#20877;&#26159;&#35774;&#22791;&#12290;

&#24182;&#19981;&#26159;&#30001;&#21457;&#24067;&#20449;&#24687;&#30340;&#20154;&#20915;&#23450;&#21463;&#20247;&#22914;&#20309;&#35775;&#38382;&#20449;&#24687;&#65292;&#32780;&#26159;&#30001;&#21463;&#20247;&#20013;&#30340;&#27599;&#19968;&#20010;&#20154;&#36873;&#25321;&#35775;&#38382;&#20449;&#24687;&#30340;&#21457;&#29983;&#12290;

&#20320;&#21487;&#20197;&#36873;&#25321;&#20320;&#21916;&#27426;&#30340;&#27983;&#35272;&#22120;&#65292;

&#21487;&#20197;&#36873;&#25321;&#20351;&#29992;&#36215;&#26469;&#26368;&#26041;&#20415;&#30340;&#32456;&#31471;&#35774;&#22791;&#12290;

&#21487;&#20197;&#22312;&#24320;&#36710;&#26102;&#20351;&#29992;&#65292;

&#21487;&#20197;&#22312;&#36208;&#22312;&#34903;&#19978;&#26102;&#20351;&#29992;&#65292;

&#21487;&#20197;&#20351;&#29992;&#31227;&#21160;&#35774;&#22791;&#12289;&#26234;&#33021;&#25163;&#26426;&#12290;

&#22352;&#22312;&#20241;&#24687;&#23460;&#37324;&#20320;&#23601;&#21487;&#20197;&#29992;&#31508;&#35760;&#26412;&#19978;&#32593;&#12290;

&#22312;&#21150;&#20844;&#23460;&#26102;&#20063;&#21487;&#20197;&#29992;&#21488;&#24335;&#26426;&#35775;&#38382;&#65288;&#32593;&#32476;&#65289;&#12290;

&#36825;&#20123;&#35774;&#22791;&#65292;&#26080;&#35770;&#29992;&#21738;&#31181;&#23454;&#29616;&#21644;&#20182;&#20154;&#30340;&#27807;&#36890;&#21644;&#20132;&#20114;&#65292;

&#37117;&#21487;&#20197;&#65288;&#23454;&#29616;&#65289;&#12290;

&#20320;&#25509;&#21040;&#30340;&#20449;&#24687;&#26159;&#29992;&#24179;&#26495;&#30005;&#33041;&#36824;&#26159;&#29992;&#25163;&#26426;&#21457;&#36807;&#26469;&#26080;&#25152;&#35859;&#65292;

&#33021;&#22815;&#25171;&#24320;&#37038;&#20214;&#24182;&#19988;&#22238;&#22797;&#37038;&#20214;&#65292;

&#36825;&#25165;&#26159;&#26368;&#37325;&#35201;&#30340;&#12290;

&#36825;&#20123;&#25104;&#20026;&#29616;&#23454;&#65292;&#23427;&#30340;&#32972;&#21518;&#27491;&#26159;&#22240;&#20026;&#20114;&#32852;&#32593;&#26159;&#19968;&#20010;&#24378;&#22823;&#24320;&#25918;&#30340;&#24179;&#21488;&#65292;

&#25165;&#35753;&#22823;&#23478;&#26377;&#20102;&#22914;&#27492;&#20016;&#23500;&#30340;&#36873;&#25321;&#24615;&#12290;

&#25509;&#19979;&#26469;&#25226;&#38236;&#22836;&#36827;&#19968;&#27493;&#25289;&#36817;&#65292;&#26469;&#30475;&#19968;&#20010;&#38750;&#24120;&#20855;&#20307;&#30340;&#20363;&#23376;&#65306;

&#8220;&#20154;&#26426;&#20114;&#21160;&#30340;&#26032;&#26102;&#20195;&#8221;

&#22312;&#20219;&#20309;&#19968;&#20010;&#30028;&#23450;&#26102;&#21051;&#65292;

&#27599;&#20010;&#20154;&#37117;&#26377;&#20854;&#20010;&#20307;&#24615;&#65292;&#24444;&#27492;&#37117;&#19981;&#21516;&#12290;

&#25509;&#19979;&#26469;&#30475;&#19968;&#30475;&#23545;&#20110;&#30450;&#20154;&#26469;&#35828;&#22914;&#20309;&#20351;&#29992;&#31227;&#21160;&#35774;&#22791;&#25110;&#35745;&#31639;&#26426;&#65292;

&#36825;&#34429;&#28982;&#26159;&#19968;&#20010;&#24494;&#22937;&#30340;&#21464;&#21270;&#65292;

&#20294;&#21487;&#20197;&#25442;&#20010;&#38382;&#39064;&#26469;&#38382;&#65292;

&#25105;&#20204;&#19981;&#35201;&#38382;&#8220;&#30450;&#20154;&#24590;&#26679;&#20351;&#29992;&#8221;&#65292;

&#32780;&#26159;&#38382;&#8220;&#22914;&#26524;&#20320;&#19981;&#24819;&#30475;&#23631;&#24149;&#24590;&#26679;&#20351;&#29992;&#8221;

&#65288;&#20174;&#65289;&#36825;&#20010;&#35282;&#24230;&#65288;&#25552;&#38382;&#65289;&#23601;&#20250;&#26356;&#24191;&#27867;&#12290;

&#22914;&#26524;&#19981;&#24819;&#30475;&#30528;&#23427;&#20320;&#24819;&#24590;&#20040;&#20351;&#29992;&#36825;&#20010;&#35774;&#22791;&#65292;&#32780;&#19981;&#26159;&#38382;&#8220;&#30450;&#20154;&#24590;&#26679;&#20351;&#29992;&#36825;&#20010;&#35774;&#22791;&#8221;&#12290;

&#36825;&#26679;&#25105;&#20204;&#24102;&#26469;&#30340;&#35299;&#20915;&#26041;&#26696;&#23558;&#20250;&#26356;&#23485;&#24191;&#65292;

&#24453;&#20250;&#20799;&#25105;&#20204;&#20250;&#20570;&#19968;&#20123;DEMO&#65292;

&#20294;&#25105;&#20808;&#32473;&#22823;&#23478;&#20171;&#32461;&#19968;&#19979;&#35201;&#24212;&#23545;&#36825;&#20010;&#38382;&#39064;&#25105;&#20204;&#36935;&#21040;&#30340;&#25361;&#25112;&#65292;

&#22312;&#20320;&#30340;&#20351;&#29992;&#29615;&#22659;&#20013;&#65292;&#19981;&#33021;&#25226;&#30524;&#30555;&#25918;&#21040;&#35774;&#22791;&#19978;&#26102;&#65292;

&#27604;&#22914;&#24403;&#20320;&#36825;&#26679;&#25343;&#30528;&#25163;&#26426;&#20351;&#29992;&#26102;&#65292;&#36208;&#36335;&#23601;&#19981;&#26041;&#20415;&#20102;&#65292;

&#30524;&#30555;&#38656;&#35201;&#30475;&#36335;&#65292;&#32780;&#19981;&#26159;&#30475;&#23631;&#24149;&#12290;

&#36825;&#23601;&#38656;&#35201;&#36827;&#19968;&#27493;&#30340;&#20154;&#26426;&#23398;&#35774;&#35745;&#12290;

&#25105;&#20204;&#35201;&#35753;&#35774;&#22791;&#26377;&#35328;&#12289;&#21548;&#21450;&#24863;&#30693;&#21160;&#20316;&#30340;&#33021;&#21147;&#12290;

&#24403;&#25105;&#20204;&#26500;&#24314;&#35745;&#31639;&#26426;&#31243;&#24207;&#21644;PC&#29992;&#25143;&#30028;&#38754;&#26102;&#65292;

&#21482;&#35201;&#26377;&#38190;&#30424;&#21644;&#40736;&#26631;&#23601;&#22815;&#20102;&#12290;

&#32780;&#20316;&#20026;&#29992;&#25143;&#65292;&#20320;&#35201;&#36890;&#36807;&#40736;&#26631;&#12289;&#38190;&#30424;&#21578;&#35785;&#20320;&#30340;&#35745;&#31639;&#26426;&#19968;&#20123;&#20449;&#24687;&#12290;

&#20316;&#20026;&#20154;&#65292;&#20320;&#35201;&#25226;&#20320;&#30340;&#24819;&#27861;&#19981;&#26029;&#34920;&#36798;&#32473;&#26426;&#22120;&#65292;

&#26426;&#22120;&#25910;&#21040;&#25351;&#20196;&#20043;&#21518;&#20877;&#25343;&#20986;&#32467;&#26524;&#12290;

&#20294;&#23558;&#26469;&#30340;&#35774;&#22791;&#38271;&#20102;&#24456;&#22810;&#21482;&#30524;&#30555;&#12289;&#24456;&#22810;&#21482;&#32819;&#26421;&#65292;

&#20316;&#20026;&#20154;&#65292;&#25105;&#20204;&#38656;&#35201;&#30340;&#25805;&#20316;&#27493;&#39588;&#23601;&#23569;&#20102;&#24456;&#22810;&#65292;&#32780;&#20135;&#29983;&#30340;&#32467;&#26524;&#21448;&#22810;&#20102;&#24456;&#22810;&#12290;

&#36825;&#19968;&#28857;&#26159;&#26497;&#20854;&#37325;&#35201;&#30340;&#12290;

&#23545;&#22312;&#24231;&#27599;&#20010;&#20154;&#26469;&#35828;&#65292;

&#24403;&#20320;&#20204;&#27599;&#22825;&#25171;&#24320;&#33258;&#24049;&#30340;&#31508;&#35760;&#26412;&#30005;&#35805;&#25110;&#26234;&#33021;&#25163;&#26426;&#26102;&#65292;

&#20320;&#26159;&#21542;&#19981;&#24076;&#26395;&#28857;&#20987;&#24456;&#22810;&#38190;&#25165;&#23436;&#25104;&#19968;&#20010;&#25805;&#20316;&#65311;

&#22914;&#26524;&#38656;&#35201;&#28857;&#20987;&#24456;&#22810;&#38190;&#65292;&#20320;&#20250;&#35273;&#24471;&#24456;&#21872;&#21990;&#12290;

&#29616;&#22312;&#25105;&#20204;&#30340;&#35774;&#22791;&#21464;&#24471;&#36234;&#26469;&#36234;&#26234;&#33021;&#21270;&#65292;&#20320;&#38656;&#35201;&#21578;&#35785;&#23427;&#30340;&#36234;&#26469;&#36234;&#23569;&#12290;

&#23427;&#23601;&#21487;&#20197;&#30693;&#36947;&#20320;&#35201;&#23427;&#20570;&#30340;&#20107;&#24773;&#12290;

&#36825;&#27425;&#25105;&#27809;&#25226;&#25105;&#30340;&#23548;&#30450;&#29356;&#24102;&#36807;&#26469;&#65292;

&#22240;&#20026;&#35753;&#23427;&#22352;&#37027;&#20040;&#36828;&#30340;&#39134;&#26426;&#19981;&#26041;&#20415;&#12290;

&#20294;&#25105;&#30340;&#23548;&#30450;&#29356;&#23601;&#20687;&#21018;&#25165;&#30340;&#27604;&#26041;&#37027;&#26679;&#65292;

&#23427;&#21487;&#20197;&#20027;&#21160;&#30693;&#36947;&#25105;&#30340;&#24456;&#22810;&#38656;&#27714;&#12290;

&#29616;&#22312;&#25163;&#26426;&#20063;&#21516;&#26679;&#20855;&#26377;&#36825;&#26679;&#30340;&#26234;&#33021;&#21270;&#65292;

&#23427;&#21487;&#20197;&#24110;&#21161;&#20320;&#25214;&#21040;&#27773;&#36710;&#31449;&#65292;

&#21578;&#35785;&#20320;&#27773;&#36710;&#26202;&#28857;&#20116;&#20998;&#38047;&#12290;

&#36825;&#23601;&#32473;&#25105;&#20204;&#30340;&#24453;&#20154;&#25509;&#29289;&#26041;&#24335;&#24102;&#26469;&#20102;&#24040;&#22823;&#21464;&#21270;&#12290;

&#22312;&#36825;&#37324;&#25105;&#19981;&#24819;&#25277;&#35937;&#22320;&#35762;&#25216;&#26415;&#65292;

&#22240;&#20026;&#25152;&#26377;&#36825;&#20123;&#25216;&#26415;&#37117;&#26159;&#20108;&#21313;&#24180;&#20013;&#36880;&#28176;&#26500;&#24314;&#36215;&#26469;&#30340;&#12290;

&#25105;&#24819;&#22312;&#25509;&#19979;&#26469;&#30340;5&#20998;&#38047;&#20869;&#35762;&#19968;&#20123;Google&#30340;&#26381;&#21153;&#65292;

&#36825;&#20123;&#26381;&#21153;&#22823;&#22823;&#25913;&#21464;&#20102;&#25105;&#20204;&#20570;&#20107;&#30340;&#26041;&#24335;&#12290;

&lt;span class=&quot;co&quot;&gt;Google&#30340;&#26680;&#24515;&#33021;&#21147;&#26159;&#25628;&#32034;&#65292;&lt;/span&gt;

&#36825;&#24182;&#19981;&#20165;&#20165;&#26159;&#19968;&#21477;&#32769;&#29983;&#24120;&#35848;&#30340;&#35805;&#65292;&#32780;&#26159;&#19968;&#20010;&#20107;&#23454;&#12290;

&#25628;&#32034;&#26377;&#19977;&#20010;&#26041;&#38754;&#23545;&#27599;&#20010;&#20570;&#25628;&#32034;&#30340;&#20154;&#26469;&#35828;&#26159;&#38750;&#24120;&#37325;&#35201;&#30340;&#65306;

&#29305;&#21035;&#24403;&#30896;&#21040;&#24102;&#23485;&#25361;&#25112;&#26102;&#65292;&#36825;&#19977;&#28857;&#21464;&#24471;&#26684;&#22806;&#37325;&#35201;&#12290;

&#22312;&#24102;&#23485;&#26377;&#38480;&#26102;&#65292;&#22914;&#26524;&#25628;&#32034;&#38656;&#35201;&#25226;&#27599;&#20010;&#35201;&#27714;&#37117;&#36755;&#20837;&#36827;&#21435;&#65292;

&#36895;&#24230;&#23601;&#20250;&#24456;&#24930;&#12290;

&#19979;&#38754;&#25105;&#20204;&#26469;&#30475;&#30475;&#25628;&#32034;&#30340;&#20960;&#20010;&#20851;&#38190;&#28857;&#26159;&#20160;&#20040;&#65306;

&#26377;&#20154;&#26159;&#30450;&#20154;&#65292;&#26377;&#20154;&#30340;&#30524;&#30555;&#26080;&#27861;&#22312;&#24403;&#26102;&#30475;&#23631;&#24149;&#65292;&#36825;&#26102;&#25105;&#20204;&#26469;&#30475;&#30475;&#20182;&#24590;&#26679;&#25628;&#32034;&#65306;

&#8220;&#24819;&#38382;&#38382;&#21271;&#20140;&#30340;&#22825;&#27668;&#8221;

&#20320;&#30495;&#27491;&#22312;&#20046;&#30340;&#26159;&#20160;&#20040;&#65311;

&#39318;&#20808;&#20851;&#20110;&#21271;&#20140;&#22825;&#27668;&#30340;&#31572;&#26696;&#35201;&#33021;&#20986;&#26469;&#65307;

&#31532;&#20108;&#20320;&#20851;&#24515;&#36825;&#20010;&#31572;&#26696;&#26159;&#21542;&#20934;&#30830;&#65307;

&#31532;&#19977;&#65292;&#20320;&#20851;&#24515;&#36825;&#20010;&#31572;&#26696;&#22914;&#20309;&#35753;&#20320;&#33719;&#21462;&#12290;

&#25105;&#20204;&#21018;&#25165;&#35762;&#21040;&#35774;&#22791;&#36234;&#26469;&#36234;&#26234;&#33021;&#21270;&#65292;&#33021;&#22815;&#30693;&#36947;&#20320;&#30340;&#35201;&#27714;&#12290;

&#20320;&#25552;&#20986;&#20102;&#35201;&#27714;&#65292;&#24076;&#26395;&#30693;&#36947;&#21271;&#20140;&#30340;&#22825;&#27668;&#12290;

&#36825;&#26102;&#22270;&#19978;&#20986;&#29616;&#20102;&#27668;&#20505;&#22270;&#65292;&#26126;&#22825;&#23558;&#20250;&#26377;&#19968;&#22330;&#24378;&#20919;&#31354;&#27668;&#21040;&#36798;&#21271;&#20140;&#12290;

&#22914;&#26524;&#36825;&#26102;&#20320;&#22312;&#24320;&#36710;&#65292;&#20063;&#26377;&#36825;&#20010;&#38656;&#27714;&#65292;&#38656;&#35201;&#24471;&#21040;&#30701;&#28040;&#24687;&#65288;&#35753;&#35774;&#22791;&#65289;&#21578;&#35785;&#20320;&#21271;&#20140;&#22825;&#27668;&#30340;&#24773;&#20917;&#12290;

&#25110;&#32773;&#20320;&#22312;&#21478;&#22806;&#19968;&#20010;&#22320;&#26041;&#65292;

&#24819;&#30693;&#36947;&#24076;&#33098;&#39318;&#37117;&#38597;&#20856;&#30340;&#22825;&#27668;&#12290;

&#25110;&#32773;&#26159;&#24403;&#20320;&#22312;&#32654;&#22269;&#65292;&#32654;&#22269;&#30340;&#24503;&#24030;&#21644;&#23494;&#27463;&#26681;&#24030;&#20063;&#26377;&#21483;&#38597;&#20856;&#30340;&#22320;&#26041;&#65292;

&#20320;&#24819;&#30693;&#36947;&#30340;&#26159;&#32654;&#22269;&#37027;&#20010;&#21483;&#38597;&#20856;&#30340;&#22320;&#26041;&#12290;

&#25152;&#20197;&#20934;&#30830;&#24615;&#12289;&#36895;&#24230;&#37117;&#38750;&#24120;&#37325;&#35201;&#12290;

&#23545;&#20110;&#29992;&#25143;&#26469;&#35828;&#65292;

&#24590;&#26679;&#20351;&#36825;&#20123;&#65288;&#26381;&#21153;&#65289;&#29992;&#20110;&#30450;&#20154;&#21602;&#65311;

&#20030;&#20010;&#31616;&#21333;&#30340;&#20363;&#23376;&#65292;

&#27604;&#22914;&#20320;&#36890;&#36807;UPS&#32473;&#25105;&#36865;&#36807;&#26469;&#19968;&#20010;&#21253;&#35065;&#65292;

&#36825;&#20010;&#21253;&#35065;&#26377;&#19968;&#20010;&#36861;&#36394;&#21495;&#65292;

&#21487;&#20197;&#35753;&#25105;&#19978;UPS&#30340;&#32593;&#31449;&#19978;&#26597;
