Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

rubyÀà±äÁ¿ÔÚdevelopmentģʽʧЧ

·ÖÒ³ÖÐÓõ½Àà±äÁ¿£¬Ö÷ÒªÊÇÓÃÀ´±ê¼Ç¡°Ò³ÂëÊäÈë¿ò¡±µÄid Èç¹ûÒ»¸öÒ³ÃæÓм¸¸ö·ÖÒ³£¬¡°Ò³ÂëÊäÈë¿ò¡±µÄidÒªÊDz»Í¬µÄ²ÅÄÜ·ÖÇåÊÇÄĸöÒª·ÖÒ³¡£Ê¹ÓÃÀà±äÁ¿¾ÍÊÇΪÁË´ïµ½Õâ¸öÄ¿µÄ£¬ÈÃËùÓеĶÔÏóʵÀý¹²ÓÃÒ»¸ö±äÁ¿£¬²»±Øÿ´ÎÖØгõʼ»¯±äÁ¿¡£ Àà±äÁ¿Ê¹ÓôúÂëʾÀý 1 require 'ruby-debug'
2 debugger
3 class Myclassvar
4 @@a=1
5 puts 1111111111111111111111
6 puts @@a
7
8 def testa
9 @@a=@@a+5
10 end
11 def testb
12 @@a=@@a+3
13 end
14 end
15
16 class Reclassvar < Myclassvar
17 def testa
18 @@a+=10
19 end
20 end
21
22 obj=Myclassvar.new
23 puts obj.testa
24 puts obj.testb
25 obj2=Myclassvar.new
26 puts obj2.testb
27 obj3=Reclassvar.new
28 puts obj3.testa

Ö´ÐÐ˳ÐòÊÇ 3=>4=>5=>6=>8=>11=>16=>17=>22=>23=>9=>24=>12=>25=>26=>12¡­¡­
±¾µØ²âÊÔÀà±äÁ¿ÍêÈ«·ûºÏÔ¤Ï룬µ«ÊÇÏîÄ¿ÖеķÖÒ³Óõ½µÄÀà±äÁ¿È´ÊÇÿ´Î¶¼Òª³õʼ»¯£¬Ò»¶ÈÓôÃÆÖС£½á¹ûÊÇÒòΪRails¿ªÔÚdevelopmentģʽʱÅäÖÃÖÐÓÐconfig.cache_classes = false£¬ËùÒÔÎÒÃÇÿ´Î²»ÓÃÖØÆô·þÎñ¾Í¿ÉÒԲ鿴¸üдúÂëºóµÄÔËÐнá¹û¡£¶ø·þÎñÆ÷ÉϵijÌÐòÊÇ¿ªÆôÔÚproductionģʽ£¬ÆäÖÐconfig.cache_classes = true¡£Õâ¾ÍÊÇΪʲôÀà±äÁ¿ÔÚdevelopmentģʽ»áʧЧ£¬Ã¿´ÎÖØÐÂÔØÈëij¸öÀàʱ£¬ËüµÄËùÓÐÀà±äÁ¿¶¼»áÔٴγõʼ»¯¡£


Ïà¹ØÎĵµ£º

תÔØ——Ruby×Ö·û´®´¦Àí

ת×Ô£ºhttp://developer.51cto.com/art/200912/170762.htm 
Ruby×Ö·û´®´¦Àíº¯Êý×ܽáÁбí·ÖÏí
Ruby×Ö·û´®´¦Àíº¯Êý°üÀ¨·µ»Ø×Ö·û´®³¤¶Èº¯Êý£»ÅжÏ×Ö·û´®ÖÐÊÇ·ñ°üº¬ÁíÒ»¸ö´®º¯Êý£»×Ö·û´®²åÈ룻×Ö·û´®·Ö¸ô,ĬÈÏ·Ö¸ô·ûΪ¿Õ¸ñµÈµÈ¡£
 
str.length => integer 
str.include? other_str
&nbs ......

Install Cassandra with Ruby 1.9.1 on Windows

To get it done is not easy. I spent a whole day to figure out the various compatibility issues along the way out.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
  You may know that the Ruby gem cassandra will do it for you.
  ......

rubyÃüÁîÐнâÎö

   ¿ÉÓÿ⣺getoptlong.rs£¬ optionparser
   ¶ÔÓ¦ÀࣺGetoptLong,  OptionParser
   Ç°ÕßÒѹýʱ£¬½¨ÒéʹÓúóÕߣ¬ÇÒºóÕß±ÈÇ°ÕßÒ×Óá£
ºóÕßÌص㣺
1. ²ÎÊýÃèÊöºÍ´úÂë´¦ÀíдÔÚÒ»Æð
2. Êä³ö²ÎÊý˵Ã÷£¬²»Ðèµ¥¶Àά»¤
3. ¿ÉÑ¡²ÎÊýºÍÃüÁî²ÎÊýÃèÊö¼ò½à
4. ²ÎÊý¿É×Ô¶¯×ª»»ÎªÌض¨µÄÀà
5. ......

Ñ¡Ruby»¹ÊÇÑ¡Python

 
  ¡¡×î½ü£¬ÎÒÐèÒªÒ»ÖÖ¿ìËÙ¿ª·¢ÓïÑÔ£¬Ä¿Ç°ÖËÊÖ¿ÉÈȵĿìËÙ¿ª·¢ÓïÑÔ¾ÍÊÇPythonºÍRubyÁË¡£RubyºÍPython¶¼ÊǷdz£ÓÅÐãµÄ½Å±¾ÓïÑÔ£¬ËäÈ»ËûÃǵÄÉè¼ÆÕÜѧ¼¸ºõÍêÈ«²»Í¬£¬µ«ËûÃÇЧÂʲ¶à£¬Ó¦ÓÃÁìÓòÒ²²î¾à²»´ó£¬ËƺõÌìÉú¾ÍÊǾºÕù¶ÔÊÖ¡£µ½µ×Ñ¡ÄǸöÄØ?ÎÒ×öÁËһЩ¼òµ¥µÄ±È½Ï¡£  
   
  ¡¡¡¡ÎÒÃDZȽ ......

Ruby on RailsÖÐselectʹÓ÷½·¨

ÔÚRuby on RailsÖÐÕæµÄÓÐÒ»¶ÑSelect helper¿ÉÒÔÓÃ,ÎÒÃǾ­³£ÈÝÒ×»ìÏý¡£³£¼ûµÄÓÐÈý¸ö..
select, select_tag, collection_select(ÆäÓàµÄʲôselect_dateÄÇЩ²»Ì¸)
ÎÒÃÇÏÈÀ´¿´¿´Ò»¸ö»ù±¾µÄÏÂÀ­Ê½Ñ¡Ïî¹Ç¼Ü
</p>
<select
name="ROR">
<option
value="1">ROR1</option><br
/>
<optio ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ