ruby ×Ö·û´® Àí½â "" ''
rubyÖе¥ÒýºÅºÍË«ÒýºÅµÄÒâÒåÓÐËù²»Í¬£¬Ë«ÒýºÅ°üΧµÄ×Ö·û×÷±äÁ¿Ìæ»»£¬µ¥ÒýºÅ°üΧµÄ±äÁ¿²»×öÌæ»»
Ò²¿ÉÒÔʹÓà %q ºÍ %Q À´Éú³É×Ö·û´®¶ÔÏó¡£%q Ï൱ÓÚµ¥ÒýºÅ£¬%QÏ൱ÓÚË«ÒýºÅ¡£
¾ÙÀýÈçÏ£º
irb(main):010:0> "show trsult: #{1*3}"
=> "show trsult: 3"
irb(main):011:0> 'show trsult: #{1*3}'
=> "show trsult: \#{1*3}"
Ïà¹ØÎĵµ£º
ÎÒÃÇÖªµÀrubyÖжÔÓÚÕûÊýµÄ[],[]=,<<,>>²Ù×÷ÊÇÕë¶ÔÓÚ¶þ½øÖƵÄÖµÀ´ÔËËãµÄ¡£
ÎÒÏÖÔÚдһ¸öÕë¶ÔÊ®½øÖÆÊý²Ù×÷µÄÀ࣬ӵÓÐÕûÊýµÄËùÓз½·¨£¬ÈçÏÂ:
class InterEx
def initialize(val=0)
@val=val
end
def to_s
@val.to_s
end
def [](idx)
self.to_s[idx].to_i
end
d ......
http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/
Understanding Ruby Blocks, Procs and Lambdas
Blocks, Procs and lambdas (referred to as closures
in Computer Science) are one of the most powerful aspects of Ruby, and
also one of the most misunderstood. This ......
Prepare
1. Download 'OCI 1.x.x.rb' (it's VERY important - execution MUST be *.rb)
2. Download 'oci8lib.so'
Install
1. Copy 'OCI8.rb' to .../ruby/lib/ruby/site_ruby/1.8/DBD/OCI8
2. Copy 'oci8.rb' to .../ruby/lib/ruby/site_ruby/1.8
3. Copy 'oci8lib.so' to .../ruby/lib/ruby/site_ruby/1.8/i386-msv ......
ÓÐÒ»¸öȫеÄÏîÄ¿£¬ÒòΪ¿¼Âǵ½½«À´µÄÊý¾ÝÀ©Õ¹ÐÔÄÜ£¬ËùÒÔ¿¼ÂÇÓÃCassandra×öÊý¾Ý´æ´¢£¬Ç°¶ËÓÃLighttpd + FastCGI + Rails¡£ÔÚʹÓÃCassandraµÄʱºò£¬¾õµÃÓÐһЩ¶«Î÷¿ÉÄÜ´ó¼Ò¶¼ÐèÒª£¬¾ÍдÁËÒ»¸ö¼òµ¥µÄÖ¸ÄÏ¡£ÒòΪÄÚÈݱȽϳ¤£¨16Ò³£©£¬¾ÍŪÁ˸öPDFÎļþ¸ø´ó¼ÒÏÂÔØ¡£
Cassandra in Action with Twitter's Ruby Client.pdf
Èç¹ûÏÂÔ ......