Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : Ruby

Cassandra in Action with Twitter's Ruby Client

ÓÐÒ»¸öȫеÄÏîÄ¿£¬ÒòΪ¿¼Âǵ½½«À´µÄÊý¾ÝÀ©Õ¹ÐÔÄÜ£¬ËùÒÔ¿¼ÂÇÓÃCassandra×öÊý¾Ý´æ´¢£¬Ç°¶ËÓÃLighttpd + FastCGI + Rails¡£ÔÚʹÓÃCassandraµÄʱºò£¬¾õµÃÓÐһЩ¶«Î÷¿ÉÄÜ´ó¼Ò¶¼ÐèÒª£¬¾ÍдÁËÒ»¸ö¼òµ¥µÄÖ¸ÄÏ¡£ÒòΪÄÚÈݱȽϳ¤£¨16Ò³£©£¬¾ÍŪÁ˸öPDFÎļþ¸ø´ó¼ÒÏÂÔØ¡£
Cassandra in Action with Twitter's Ruby Client.pdf
Èç¹ûÏÂÔØÁ´½ÓÓÐÎÊÌ⣬Çë¸øÎÒÓʼþ£ºspanzhang@gmail.com¡£ÐèҪ˵Ã÷һϵÄÊÇ£¬Õâ¸öÖ¸ÄÏÊÇÓÃÓ¢ÓïдµÄ£¬²»¹ý¶¼ÊÇЩºÜ¼òµ¥µÄ¾ä×Ó£¬ÏàÐÅÓÐËļ¶Ó¢Óï¾Í¿ÉÒÔºÁ²»·ÑÁ¦µÄ¿´Ã÷°×¡£ÏÂÃæ°ÑÎÄÕµÄÒýÎÄ·ÅÕâÀ¹©´ó¼Ò²Î¿¼£¬Äã¿ÉÒÔ¿´¿´Êʲ»ÊʺÏÄãµÄÐèÒª£º
Okay, let me get something straight. I’m not going to persuade you to use Cassandra. I just assume you have already chosen Cassandra as your storage solution. Maybe you know the basic things, the underneath mechanisms, about Cassandra or maybe not. Anyway, I assume you don’t care what makes Cassandra outstanding and you just want to use it. If that’s the case, this tutorial is going to help you, in these 3 aspects:
 
1) to set up the environment correctly, ......

¼Ç¼ÏÂ×Ô¼ºUbunt 10.04 ´î½¨ruby on rails»·¾³

1¡¢°²×°ubuntu
һ·next£¬¼Çס°²×°Ó¢ÎÄ°æ¡£´ý°²×°Íê±Ïºó£¬Ê×ÏÈÑ¡Ôñ“Èí¼þÔ´”£¬ÏµÍ³--ϵͳ¹ÜÀí-Èí¼þÔ´£¬¹úÄÚÒ»°ãÑ¡ÔñµÄÊÇ£ºhttp://ubuntu.cn99.com/ubuntu;½Ó×Å°²×°ÖÐÎÄ°ü£¬Ñ¡ÔñÈí¼þÔ´¾ÍÊÇΪÁËÏÂÔØÈí¼þµÄËٶȸü¿ì£¬°²×°Íê³ÉºóÖØÆôubuntu£¬ÖØÆôºó»áÌáʾÊÇ·ñ¸Ä±äijЩÎļþ¼ÐÃû³Æ£¬Ñ¡Ôñ“·ñ”£¬·Àֹϵͳ¶ÔÖÐÎÄÖ§³ÖÒý·¢µÄÎÊÌâ¡£
2¡¢¸üÐÂϵͳÈí¼þ
sudo apt-get update
3¡¢°²×°Ruby
sudo apt-get install ruby
4¡¢°²×°gem
sudo apt-get install rubygems
sudo gem update  
5¡¢°²×°rails
sudo apt-get install rails
6¡¢°²×°mysql
sudo apt-get install mysql-server
µ±ÊäÈëÖ¸Ásu Òâͼ½øÈëunix²Ù¿Ømysqlʱ£¬ÌáʾÊäÈëÃÜÂ룬ÈôÌáʾʧ°Ü£¬ÔòÐÞ¸ÄÃÜÂ룬ÊäÈësudo passwd root£¬ÊäÈëÐÂÃÜÂ룬ȷÈÏ
7¡¢°²×°jdk£¨Æäʵ¾ÍÊǽâѹ£©
ÏÂÔØjdk£ºhttp://java.sun.com/javase/downloads/index.jsp£¬ÎÒÏÂÔصÄÊÇjdk-6u20-linux-i586.bin
½¨Á¢Ä¿±êĿ¼£ºsudo mkdir /usr/lib/jvm
cd jdkµÄÎļþĿ¼£¨±ÈÈ磺cd Downloads£©
¿½±´Îļþ£ºsudo cp ./jdk-6u20-linux-i586.bin /usr/lib/jvm
cd Îļþ¿½±´ºóÎļþ¼Ð£ºcd /usr/lib/jvm
Ìí¼ÓÖ´ÐÐȨÏÞ£ºsudo chmo ......

Ruby Ruportʵ¼ù—¼òµ¥±¨±íϵͳ

¿ª·¢»·¾³
OS:WindowsXP
Ruby:Ruby1.8.7
Rails:Rails2.3.5
Mysql:Mysql5.0.9
IDE:Rubymine2.0.1
×¼±¸¹¤×÷£º
°²×°ÒÔÏÂgem°ü
gem install ruport
gem install ruport-util
gem install acts_as_reportable
±¾ÀýÉè¼ÆµÄ±¨±íϵͳ¹¤×÷Ô­ÀíÈçͼ£¨´¿Êô¸öÈËÀí½â£©£¬ÒÔProducts±íΪÀý£º
½ÓÏÂÀ´ÊµÏÖµÄÀý×Ó½«ÀûÓÃeval·½·¨ÊµÏÖ¶¯Ì¬½Å±¾£¬¶Ô¿ÉÄܱ䶯µÄµØ·½Í¨¹ýÊý¾Ý¿â±£´æÔËÐÐʱ´úÂëƬ¶Ï
Ò»¡¢´´½¨±¨±íÔËÐÐʱÐèÒªµÄÊý¾Ý±í
Ö÷¼ü×Ô¶¯Ôö³¤
create table report_definitions
(report_definition_id integer not null,
report_code varchar(30),
report_name varchar(240),
report_sql varchar(4000),
basic_model varchar(20),
primary key ('report_definition_id'));

create table report_templates
(report_template_id integer not null,
template_code varchar(30),
template_name varchar(240),
template_content varchar(4000),
template_type varchar(10),
primary key ('report_template_id'));

create table report_executions
(report_execute_id integer not null,
execute_code varchar(30),
execute_name varchar(240),
report_definition_ ......

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 Óï·¨

±¾ÎÄת×Ô:
http://hi.baidu.com/24xinhui/blog/item/9f52dd34382e11325ab5f553.html
ruby-Óï·¨
2009Äê06ÔÂ20ÈÕ ÐÇÆÚÁù ÉÏÎç 00:21
http://www.blogjava.net/xxllnnn/archive/2009/01/18/251762.html
http://www.cnblogs.com/cnblogsfans/archive/2009/01/24/1380804.html
__setobj__ £¨2009-7-14£©
    ½«½ÓÊÜίÍеĶÔÏó±äΪobj
    SimpleDelegator.new(obj)
    Éú³ÉÒ»¸ö¶ÔÏó, ËüίÍÐobjÀ´Ö´ÐÐ×ÔÉíËùÓµÓеķ½·¨
alias Óë alias_methodµÄÇø±ð (2009-7-14)
    1. aliasÊÇRubyµÄÒ»¸ö¹Ø¼ü×Ö£¬¶øalias_methodÊÇModuleÀàµÄÒ»¸ö·½·¨
    2. aliasµÄ²ÎÊý¾ÍÊÇ·½·¨±¾Éí£¨method identify£©£¬×¢Ò⣬²»ÊÇ×Ö·û´®£¬Ò²²»ÊÇSymbol£¬alias_methodµÄ²ÎÊýÔòÊÇ×Ö·û´®»òÕßsymbol£¬²¢ÇÒʹÓöººÅ·Ö¸ô¡£
    3. alias_method¿ÉÒÔÖض¨Ò壬¶øaliasÔò²»ÄÜ
    alias new_method_name old_method_name
    alias_method :new_method_name, :old_method_name
    alias_method 'new_method_name', 'old_method_name'
=~ Íê³ÉmatchÆ¥Åä²Ù×÷ £ ......

install ruby on cygwin

ת×Ô http://zhujg.javaeye.com/blog/355040
Ê×ÏÈ °²×° cygwin
cygwin Òª°²×°µÄ²å¼þÊÇ
ĬÈϵÄ+ make + gcc + libiconv
+ openssl
cygwinÏÂÐèÒª±àÒëÔ­Îļþ
µ½ruby-lang(http://ruby-lang.org/)
ÏÂÔØruby-1.9.1-p0.tar.gz
tar xvf ruby-1.9.1-p0.tar.gz
cd
ruby-1.9.1-p0
./configure
make && make install
°²
×°rails
gem install rails
rails demo
cd demo
ruby
script/server
´ËʱÌáʾÕÒ²»µ½iconv.so (google Ö®ºó
Ëƺõ1.8.6ÒÔÉÏ°æ±¾²»»á×Ô¶¯Éú³Éiconv.soÎļþÁË
תµ½ruby 1.9.1 Ô´´úÂë´¦
cd
/ruby-1.9.1-p0/ext/iconv
ruby extconf.rd  (Èç¹û֮ǰcygwin
°²×°ÊÇûÓÐÑ¡Ôñlibiconv ´Ë´¦¿ÉÄÜ»áÓдíÎó ÔÙ´ÎÔËÐÐcygwin°²×°Îļþ °²×°°É
»áÉú³Émakefile
make

Éú³Éiconv.so Îļþ
make install
ruby
script/server
Õâ´ÎÌáʾÕÒ²»µ½openssl
openssl.so
Îļþ°²×°·½·¨Í¬iconv.so
°²×°mysql ÏÂÔØÔ´Îļþ
http://dev.mysql.com/downloads/mysql/5.0.html#win32 ×îÏÂÃæµÄtar.gzÎļþ
tar
xvf ruby-1.9.1-p0.tar.gz
cd mysql-5.0.77
./configure
make
&& make install
°²×°mysql Çý¶¯
http://rubyforge.org ......
×ܼǼÊý:146; ×ÜÒ³Êý:25; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [1] [2] 3 [4] [5] [6] [7] [8] [9] [10]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ