??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日韩精品无码专区,老司机亚洲精品影院在线观看,亚洲第一区在线观看http://m.tkk7.com/keywen1983/h子,没错Q我是Mzone民工~zh-cnMon, 12 May 2025 11:44:28 GMTMon, 12 May 2025 11:44:28 GMT60oracle redo日志恢复http://m.tkk7.com/keywen1983/archive/2007/12/28/171198.htmlkeywenkeywenFri, 28 Dec 2007 07:08:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/12/28/171198.htmlhttp://m.tkk7.com/keywen1983/comments/171198.htmlhttp://m.tkk7.com/keywen1983/archive/2007/12/28/171198.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/171198.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/171198.html阅读全文

keywen 2007-12-28 15:08 发表评论
]]>
Oracle SQL 内置函数大全http://m.tkk7.com/keywen1983/archive/2007/11/26/163216.htmlkeywenkeywenMon, 26 Nov 2007 08:46:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/11/26/163216.htmlhttp://m.tkk7.com/keywen1983/comments/163216.htmlhttp://m.tkk7.com/keywen1983/archive/2007/11/26/163216.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/163216.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/163216.html阅读全文

keywen 2007-11-26 16:46 发表评论
]]>
必须得体验的flexE序http://m.tkk7.com/keywen1983/archive/2007/09/29/149521.htmlkeywenkeywenSat, 29 Sep 2007 03:50:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/09/29/149521.htmlhttp://m.tkk7.com/keywen1983/comments/149521.htmlhttp://m.tkk7.com/keywen1983/archive/2007/09/29/149521.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/149521.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/149521.html


        http://www.thereplicants.net/flex/test/Dashboard.html 

        q个flexE序是一个spain人做的,javierQ?6岁了Q项目经

理,人很不错Q欧zh的Y件架构思想Q就是和国内不一?/span>



keywen 2007-09-29 11:50 发表评论
]]>
警惕Q电脑视疲劳l合?/title><link>http://m.tkk7.com/keywen1983/archive/2007/06/22/125874.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Fri, 22 Jun 2007 08:34:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/06/22/125874.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/125874.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/06/22/125874.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/125874.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/125874.html</trackback:ping><description><![CDATA[     摘要: 提醒大家Q请爱护自己的眼睛!Q!  <a href='http://m.tkk7.com/keywen1983/archive/2007/06/22/125874.html'>阅读全文</a><img src ="http://m.tkk7.com/keywen1983/aggbug/125874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-06-22 16:34 <a href="http://m.tkk7.com/keywen1983/archive/2007/06/22/125874.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>让h泪的照?-----感动Q?/title><link>http://m.tkk7.com/keywen1983/archive/2007/06/22/125730.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Fri, 22 Jun 2007 01:27:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/06/22/125730.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/125730.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/06/22/125730.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/125730.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/125730.html</trackback:ping><description><![CDATA[     摘要:   <a href='http://m.tkk7.com/keywen1983/archive/2007/06/22/125730.html'>阅读全文</a><img src ="http://m.tkk7.com/keywen1983/aggbug/125730.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-06-22 09:27 <a href="http://m.tkk7.com/keywen1983/archive/2007/06/22/125730.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle、DB2、PostgreSQL之Sequenceȝhttp://m.tkk7.com/keywen1983/archive/2007/06/20/125387.htmlkeywenkeywenWed, 20 Jun 2007 09:48:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/06/20/125387.htmlhttp://m.tkk7.com/keywen1983/comments/125387.htmlhttp://m.tkk7.com/keywen1983/archive/2007/06/20/125387.html#Feedback1http://m.tkk7.com/keywen1983/comments/commentRss/125387.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/125387.html阅读全文

keywen 2007-06-20 17:48 发表评论
]]>
svchost.exe占CPU 100%的解x?/title><link>http://m.tkk7.com/keywen1983/archive/2007/05/17/118099.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Thu, 17 May 2007 07:17:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/05/17/118099.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/118099.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/05/17/118099.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/118099.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/118099.html</trackback:ping><description><![CDATA[<blockquote dir=ltr style="MARGIN-RIGHT: 0px; FONT-FAMILY: Comic Sans MS; BACKGROUND-COLOR: #ccffcc"> <p>svchost.exe占CPU 100%的解x?/p> <p>--------------------------------------------------------------------------------<br>现象Q?</p> <p style="BACKGROUND-COLOR: #ccffcc">机器启动q行几分钟后 svchost.exe׃占系lcpu资源?00% <br><br>拔掉|线好了,重连上网后一会儿Qsvchost.exe又占cpu资源?9%Q?<br><br>解决Q?</p> <p style="BACKGROUND-COLOR: #ccffcc">假设你已l用了免费杀毒Y件排除了病毒和已l用防间谍软g排除了恶意Y件的影响Q?br><br>惛_法清IC:\WINDOWS\SoftwareDistribution 目录下所有的文g重启机器卛_?<br><br>如果机器提示文g正在使用Q?Automatic Updates"服务正在q行Q无法删除相应目录:</p> <p style="BACKGROUND-COLOR: #ccffcc">则想办法打开控制面板==>理工具==>服务Q找?Automatic Updates"Q设|成手动启动Q?br><br>重启后再删除 C:\WINDOWS\SoftwareDistribution。问题就解决了?br><br>然后再打开控制面板==>理工具==>服务Q找?Automatic Updates"Q恢复成自动启动重启?<br><br>注意Q重启后最好在上网条g比较好的地方让系l顺利完成一ơ系l自动更新?</p> <p style="BACKGROUND-COLOR: #ccffcc">原因分析Q?</p> <p style="BACKGROUND-COLOR: #ccffcc">先说说什么是svchost.exeQ?br><br>单的说没有这个服务机器几乎就上不了网了。很多应用服务都是以来于q个接口RPC的,<br><br>如果发现q个q程占了太多的CPU资源Q直接把pȝ的RPC服务用了会是一场灾难:<br><br>因ؓq恢复这个界面的pȝ服务讄界面都无法用了。恢复的Ҏ需要用注册表~辑器,<br><br>扑ֈ HKEY_LOCAL_MACHINE >> SYSTEM >> CurrentControlSet >> Services >> RpcSs, <br><br>右侧扑ֈStart属性,把它的值改?再重启即?</p> <p style="BACKGROUND-COLOR: #ccffcc">造成svchost占系lCPU 100%的原因ƈ非svchost服务本nQ?br><br>以上的情冉|׃Windows Update服务下蝲/安装p|而导致更新服务反复重试造成的?br><br>而Windows的自动更C是依赖于svchost服务的一个后台应用,从而表Cؓsvchost.exe负蝲极高?<br><br>常发生这c问题的机器一般是上网条gQ尤其是d外网站)不稳定的机器Q比如家里的父母的机器,<br><br>往往在安装机器几个月以后不定期发生,每个月的W二个星期是高发期:<br><br>因ؓ最q几qMS很有规律的在每个月的W二个星期发布补丁程序)?/p> <p style="BACKGROUND-COLOR: #ccffcc">上面的解x法ƈ不能保证不重发作Q但是ؓ了svchost文g而每隔几个月重装一ơ操作系l?br><br>q是太浪Ҏ间了?</p> <p style="BACKGROUND-COLOR: #ccffcc">教训Qspoolsv.exe的问题都是应用遇到失?例外情况后自动重试造成的,<br><br>本想为用戯省时间的设计Q但是重试的频度q高反而导致了和病毒一L效果?br></p> </blockquote> <img src ="http://m.tkk7.com/keywen1983/aggbug/118099.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-05-17 15:17 <a href="http://m.tkk7.com/keywen1983/archive/2007/05/17/118099.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>好好学习Q好好工作,好好生活Q好好微W!http://m.tkk7.com/keywen1983/archive/2007/05/17/118097.htmlkeywenkeywenThu, 17 May 2007 07:12:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/05/17/118097.htmlhttp://m.tkk7.com/keywen1983/comments/118097.htmlhttp://m.tkk7.com/keywen1983/archive/2007/05/17/118097.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/118097.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/118097.html

      刚从学校出来工作Q的有一些不适应Q不q还好了Q慢慢应该养成良好的工作习惯Q这样工作、生zLL些?br>      公司五一攑ց七天Q可BLOG比公司放假时间还要长Q得攏V?br>      手中现在两个目Q一?NET目Q一个公司ERP目Q虽然是忙v来挺好,可是ROR没时间学了。以前一直玩的JAVAQ现在好好学一?NET以及SAP的标准流E也是不错的啊!



keywen 2007-05-17 15:12 发表评论
]]>
2006q优UFlex大型|站ƣ赏http://m.tkk7.com/keywen1983/archive/2007/04/28/114256.htmlkeywenkeywenSat, 28 Apr 2007 01:55:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/28/114256.htmlhttp://m.tkk7.com/keywen1983/comments/114256.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/28/114256.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/114256.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/114256.html

2006q优UFlex大型|站ƣ赏

2006qFlex大型|站层出不穷Q下面是国际上几个优U的RIA应用?br>
AFR Access

  • The Australian Financial Review
  • Sony Ericsson Phone Selector
  • Adobe Flex Store
  • Kodak EasyShare Gallery
  • NOMOS Online
  • Flex Data Services
  • Pikeo
  • Motionbox
  • Trenitalia -
  • Fidelity Labs
  • www.fidelitylabs.com
  • Belgacom TV Portal
  • ESRI ArcWeb Explorer
  • services
  • Harley-Davidson Customizer
  • Intelligent Finance Mortgage Offset Calculator
  • Yahoo! Maps
  • 更多的好|站Q可以去
    Adobe Flex Showcase Finder看到



    keywen 2007-04-28 09:55 发表评论
    ]]>
    面向对象脚本语言 Ruby 参考手?/title><link>http://m.tkk7.com/keywen1983/archive/2007/04/27/114138.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Fri, 27 Apr 2007 08:59:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/04/27/114138.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/114138.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/04/27/114138.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/114138.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/114138.html</trackback:ping><description><![CDATA[<blockquote> <h2><a id=a.a5.aa.a5.d6.a5.b8.a5.a7.a5.af.a5.c8.bb.d8.b8.fe.a5.b9.a5.af.a5.ea.a5.d7.a5.c8.b8.c0.b8.ec.20Ruby.20.a5.ea.a5.d5.a5.a1.a5.ec.a5.f3.a5.b9.a5.de.a5.cb.a5.e5.a5.a2.a5.eb name=a.a5.aa.a5.d6.a5.b8.a5.a7.a5.af.a5.c8.bb.d8.b8.fe.a5.b9.a5.af.a5.ea.a5.d7.a5.c8.b8.c0.b8.ec.20Ruby.20.a5.ea.a5.d5.a5.a1.a5.ec.a5.f3.a5.b9.a5.de.a5.cb.a5.e5.a5.a2.a5.eb><span style="FONT-FAMILY: Comic Sans MS">面向对象脚本语言 Ruby 参考手?/span></a><a id=a.cc.dc.bc.a1 name=a.cc.dc.bc.a1><br><br><span style="FONT-FAMILY: Comic Sans MS">目录</span></a></h2> <ul> <li><span style="FONT-FAMILY: Comic Sans MS">更新记录 </span> <li><a class=modified-month title="卷首?(12d)" ><u><span style="FONT-FAMILY: Comic Sans MS">卷首?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="Ruby的启?(284d)" ><u><span style="FONT-FAMILY: Comic Sans MS">Ruby的启?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <ul> <li><a class=modified-year title="Ruby的启?(284d)" ><u><span style="FONT-FAMILY: Comic Sans MS">命o行选项</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="Ruby的启?(284d)" ><u><span style="FONT-FAMILY: Comic Sans MS">关于解释器行</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span></li> </ul> <li><a class=modified-year title="环境变量 (292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">环境变量</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><span style="FONT-FAMILY: Comic Sans MS">Ruby 语言样式 </span> <ul> <li><a class=modified-year title="对象 (292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">对象</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="c?(292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">c?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month title="执行 (12d)" ><u><span style="FONT-FAMILY: Comic Sans MS">执行</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="l束时的相关处理 (290d)" ><u><span style="FONT-FAMILY: Comic Sans MS">l束时的相关处理</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month title="Ruby U程 (3d)" ><u><span style="FONT-FAMILY: Comic Sans MS">U程</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="安全模型 (109d)" ><u><span style="FONT-FAMILY: Comic Sans MS">安全模型</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="正则表达?(218d)" ><u><span style="FONT-FAMILY: Comic Sans MS">正则表达?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span></li> </ul> <li><span style="FONT-FAMILY: Comic Sans MS">Ruby的语?</span> <ul> <li><a class=modified-year title="字句构?(292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">字句构?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="E序 (292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">E序</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="变量和常?(292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">变量和常?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="字面?(292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">字面?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="操作W表辑ּ (211d)" ><u><span style="FONT-FAMILY: Comic Sans MS">操作W表辑ּ</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month title="控制l构 (12d)" ><u><span style="FONT-FAMILY: Comic Sans MS">控制l构</span></u></a><span style="FONT-FAMILY: Comic Sans MS">Q异常处?</span> <li><a class=modified-month title="Ҏ调用 (12d)" ><u><span style="FONT-FAMILY: Comic Sans MS">Ҏ调用</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="c/Ҏ的定?(292d)" ><u><span style="FONT-FAMILY: Comic Sans MS">c/Ҏ的定?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span></li> </ul> <li><span style="FONT-FAMILY: Comic Sans MS">标准?</span> <ul> <li><a class=modified-month title="内部函数 (18d)" ><u><span style="FONT-FAMILY: Comic Sans MS">内部函数</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month title="内部变量 (18d)" ><u><span style="FONT-FAMILY: Comic Sans MS">内部变量</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month title="内部常数 (18d)" ><u><span style="FONT-FAMILY: Comic Sans MS">内部常数</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month title="内部c/模块Q异常类 (18d)" ><u><span style="FONT-FAMILY: Comic Sans MS">内部c/模块Q异常类</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span></li> </ul> <li><a class=modified-month title="附加?(12d)" ><u><span style="FONT-FAMILY: Comic Sans MS">附加?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">Ruby变更记录</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <ul> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">ruby 1.6 Ҏ?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">ruby 1.7 Ҏ?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month><span style="FONT-FAMILY: Comic Sans MS">ruby 1.8 Ҏ?/span></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <ul> <li><a class=modified-month><span style="FONT-FAMILY: Comic Sans MS">1.6.8?.8.0的变更点(ȝ)</span></a><span style="FONT-FAMILY: Comic Sans MS"> </span></li> </ul> <li><a class=modified-month><span style="FONT-FAMILY: Comic Sans MS">ruby 1.9 Ҏ?/span></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month><span style="FONT-FAMILY: Comic Sans MS">obsolete</span></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month><span style="FONT-FAMILY: Comic Sans MS">对应DOSISH</span></a><span style="FONT-FAMILY: Comic Sans MS"> </span></li> </ul> <li><span style="FONT-FAMILY: Comic Sans MS">附录 </span> <ul> <li><span style="FONT-FAMILY: Comic Sans MS">疑似BNF的Ruby语法 </span> <li><a class=modified-month title="Ruby术语?(12d)" ><u><span style="FONT-FAMILY: Comic Sans MS">Ruby术语?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">Ruby的运行^?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">pack模板字符?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">sprintf格式</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-month ><u><span style="FONT-FAMILY: Comic Sans MS">Marshal格式</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year title="Ruby FAQ" ><u><span style="FONT-FAMILY: Comic Sans MS">Ruby FAQ</span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><a class=modified-year ><u><span style="FONT-FAMILY: Comic Sans MS">Ruby的陷?/span></u></a><span style="FONT-FAMILY: Comic Sans MS"> </span> <li><span style="FONT-FAMILY: Comic Sans MS">Ruby/Tk FAQ </span> <li><span style="FONT-FAMILY: Comic Sans MS">Ruby的相关书c?</span> <li><span style="FONT-FAMILY: Comic Sans MS">Ruby Documentation Project (RDP) </span> <li><span style="FONT-FAMILY: Comic Sans MS">HTML Help版和分立HTML </span> <li><span style="FONT-FAMILY: Comic Sans MS">ReFe </span></li> </ul> <li><span style="FONT-FAMILY: Comic Sans MS">索引 </span> <li><span style="FONT-FAMILY: Comic Sans MS">功能分类索引 </span> <li><span style="FONT-FAMILY: Comic Sans MS">发布条g </span></li> </ul> <p><span style="FONT-FAMILY: Comic Sans MS">链接Q?a >http://rubycn.ce-lab.net/man/index.html</a></span></p> </blockquote> <img src ="http://m.tkk7.com/keywen1983/aggbug/114138.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-04-27 16:59 <a href="http://m.tkk7.com/keywen1983/archive/2007/04/27/114138.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我爱Ruby?7个理?http://m.tkk7.com/keywen1983/archive/2007/04/27/114136.htmlkeywenkeywenFri, 27 Apr 2007 08:55:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/27/114136.htmlhttp://m.tkk7.com/keywen1983/comments/114136.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/27/114136.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/114136.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/114136.html原著Q?nbsp;   http://hypermetrics.com/ruby.html

    译Q?a >http://www.ruby-cn.org/

    一切权利归原作者所有,转蝲请保留?

     

     

            没有必要费旉来谈论Ruby的历Ԍ如果你没有听说过它,你可以去它的主页看看www.ruby-lang.orgQ或者去它的新闻lcomp.lang.ruby。如果你知道RubyQ我讲q我Z么会喜爱它?

     

    1. 它是面向对象?/font>?/font> q表CZ么意义呢Q?如果?0个程序员Q你也许会得?2U结果,你有你的看法Q我不会试图L变你的看法。但是有一点,Ruby提供了对数据和方法的装Q允许类的承,对象的多态。不像其它语aQC++,Perl{)QRuby从设计的时候开始就是一U面向对象的语言?/p>

    2. 它是U面向对象的语言?/font>N是我多余Q不是这LQ之所以这么说Q因为Ruby中一切都是对象,包括原始数据cdQprimitive data typesQ,比如字符Ԍ整型Q都表示的是一个对象,而不需要Java那样提供包装c(wrapper classesQ。另外,甚至是常量,也会被当作对象来处理Q所以一个方法的接收者,可以是一个数字常量?/p>

    3. 它是动态语a?/font> 对于只熟悉像C++QJavaq样静态语a的h来说Q这是一个重大的概念上的差别。动态意味着Ҏ和变量可以在q行时候添加和重定义。它减少了像C语言那样的条件编译(#ifdefQ,而且Ҏ实现反射APIQreflection APIQ。动态性得程序能自我感知Qself-awareQ,比如q行时类型信息,丢qҎQ用来检增加方法的钩子{。在q些斚wRuby和Lisp和Smalltalk都有一些关pR?/p>

    4. 它是一U解释执行的语言?/font>q是一个负杂的问题Q值得重点解释一下,也许q个特点会因为性能的原因而引起从优点变ؓ~点的争论。对于此Q我有几点见解:1.W一Q快速开发@环是一个巨大的好处Q这要得意于Ruby的解释执行?.多慢才叫慢呢Q在说它慢之前先定一个慢的基准?.也许有h要批评我了,但我q要_处理器每q都在变得原来越快?.如果你真的很在意你的速度Q你可以用C开发一部分你的代码?.最后,从某U意义上_q是一个还在争Z的问题,没有一个语a天生是解释型的Q世界上没有哪个法律q制开发一个Ruby~译器出来?

    5. 它理解正则表辑ּ?/font> 很多q之前,正则表达式只是用在UNIX的工具如grep或者sed中,或者在vi中进行一些一定的查找Q替换等。Perl的出现解决了q些问题Q而现在,Ruby同样也能做到q些。越来越多得识到了这U字W串和文本处理技术的难以|信的能力,如果你对此表C怀疑,那么请去看一?Jeffrey Friedl的书Mastering Regular ExpressionsQ然后,你就应该不会有什么怀疑了?/p>

    6. 它是多^台的?/font> Ruby可以q行在LinuxQUNIXQWindowsQBeOSQ甚至MS-DOS。如果我没记错,甚至q有一个Amiga 版本?/p>

    7. 它是z来的?/font> q是一件好事情吗?抛去书本上的知识Q它是有用的。牛曾说过“我如果看得比别hq,那是因ؓ我站在巨人的肩膀?#8221;。Ruby同样也是站在巨h的肩膀上,它借鉴了Smalltalk, CLU, Lisp, C, C++, Perl, Kornshell{的优点。在我看来它的原则包括:1.不要重复刉轮子?.不要修补没有损坏的东ѝ?.最后一个也是比较特别的Q它能^衡(Leverage Q你已有的知识。你了解UNIX的文件和道Q没关系Q你可以在Ruby中l用Q你用了两年的时间学习了printf 指示W,不必担心QRuby中你也可以?strong>printf。你知道Perl的正则表辑ּ处理Q那么你也就学会了Ruby中的正则表达式?/p>

    8. 它是创新的?/font> 是不是觉得这个和W七条矛盾了Q也许是有一部分矛盾Q每个硬币都有两面。一些Ruby的特炚w是创新的东西Q比如非常有用的Mix-inQ也许这个特点会被后来的语言借鉴。(注:一位读者指出Lisp早在1979q就有mix-in了,q是我的疏忽Q我应该找个更好的例子,q且能确信它。)

    9. 它是非常高层ơ的语言。(Very High-Level Language QVHLL) q是一个容易引起争论的话题Q因个术语还没有q泛使用。而且它的意思比起OOP来说q是有讨Z地的。我q么_指的是Ruby能支持复杂的l构和这些结构的负杂的操作,而需要的指o非常,q与最努力原则(Principle of Least EffortQ一致?/p>

    10. 它有一个灵巧的垃圾攉器?/font> ?strong>malloc?strong>free q样的例E已l是昨天的恶梦了Q你不需要什么回收内存的操作Q甚x调用垃圾攉器?

    11. 它是脚本语言?/font> 不要因ؓ此就认ؓ它不够强大,它不是一个玩兗它是完全成熟的语言Q用它能L的完成传l的脚本操作Q比如运行外部程序,查系l资源,使用道Q捕莯出等{?/p>

    12. 它是通用的?/font> Kornshell做的东西它也可以做,C语言做的东西它也可以做的很好。你可以用它写一个只q行一ơ的只有10行的E序Q或者对一些遗留程序进行包装,你想写个web serverQ或者一个CGIQ都可以用Ruby来写?/p>

    13. 它是多线E的?/font> Y你可以用一些简单的API来写多线E程序,甚至在MS-DOS上都可以?/p>

    14. 它是open source的?/font> 你想看它的源代码吗?可以Q你也可以提交补丁,参加q泛的社区,包括它的创造者?/p>

    15. 它是直觉得?/font> Ruby的学习曲U比较低Q而如果你过了一个坎Q你开?#8220;猜测”事情是怎么工作的,而且你的猜测很多时候都是正的。Ruby坚持最惊Ӟ Least AstonishmentQ的原则?/p>

    16. 它有异常机制?/font> 像Java?C++一P Ruby 中也有异常机Ӟq意味着你不必因回D将代码弄得凌ؕ不堪Q很的嵌套if语句Q很的意大利面条似的逻辑Q更好的错误处理?/p>

    17. 它有一个高U的数组c:Array?/font> Ruby中数l都是动态的Q你不必像pascal那样在声明它的大,也不必像CQC++那样为它分配内存。它们是对象Q所以你不必兛_它们的长度,实际上你不能"走到末尾Qwalk off the endQ?。这个类提供了各U方法,使得你能够根据烦引,Ҏ元素来访问数l内容,也可以反向处理数l。你也可以用C作ؓsetQ队列,堆栈{。如果你想用查找表,可以用哈希结构?/p>

    18. 它是可以扩展的?/font> 你可以用C或者Ruby来编写外部库Qexternal librariesQ,同样Q你也可以修改已有的cd对象?/p>

    19. 鼓励文档~程Qliterate programmingQ?/font> 你可以在RubyE序中嵌入注释或者文档,q些文档可以用Ruby的文档工h取和处理。(真正的文档编E者可能认是必ȝ基本东西吧)

    20. 创造性的使用标点W号和大写字母?/font> 比如一个方法返回一个boolean型(Ruby中ƈ没有q种说法Q,那么一般这个方法最后都以问L,如果一个方法要修改接收者本w,或者具有破坏性,则用一个感叹号l尾Q简单,直觉。所有常量,包括cdQ都以大写字母开_所有对象属性以@W号开头。这有匈牙利命名法的实用性,但是没有视觉上的丑陋性?/p>

    21. Reserved words aren't.It's perfectly allowable to use an identifier that is a so-called "reserved word" as long as the parser doesn't perceive an amibiguity. This is a breath of fresh air.Q能用保留字作ؓ变量吗?没看太懂。)

    22. 支持q代器?/font> q得你可以l一个数l,listQtree{对象传递一个块Q然后对它们的每个元素进行block调用。这个技术值得深入学习?/p>

    23. 它的安全性?Ruby借鉴了Perl中基?SAFE变量的分层控制机?。这对于CGIE序来说非常有用Q可以防止h们攻击web服务器?/p>

    24. Ruby中没有指针?/font> ?Java一P和C++不同QRuby中没有指针的概念Q所以免除了关于指针语法和调试的头疼。当Ӟq也意味着最底层的程序开发将会很困难Q比如访问一个设备的控制状态寄存器Q但是,我们可以用一个C库来调用。(像C语言E序员有时候要使用汇编语言一PRubyE序员有时候也要用C语言来完成一定的dQ?/p>

    25. 它得h们专注于l节?/font> Ruby中有很多同义词和别名Q你也许不记得字W串或数l的长度?strong>sizeq是lengthQ没关系Q它们Q何一个都可以工作。对于Range来说Q你可以使用begin ?strong>end 或者?first ?lastQ它们也都工作。你x?strong>indicesQ结果写成了indexesQ没关系Q这两个都一栗?/p>

    26. 非常灉|的语法?/font> Ҏ调用时候括号可以省略,参数之间只需用逗号分割。类似Perl风格的数l定义可以让你不用全部用引号和逗号定义一个字W串的数l。关键字return可以生\?/p>

    27. 丰富的库函数?/font> Ruby提供了线E,socketQ有限对象持久化QCGIQ服务器端可执行的,数据库等其它库函敎ͼq有对Tk的支持等。还有很多其它的库函数?/p>

    28. 本n自带调试器(debuggerQ?/font> 在完的世界中,我们才不需要调试器Q但是这个世界不是完的?/p>

    29. 交互式执行?/font> 可以用Ruby像Kornshell那样执行?(q可能是本页最具争论的一点,我不得不承认QRuby真的不是一个很好的shell。但我仍然坚持,ZRuby的shell是一个不错的L。)

    30. 它是明的?/font> 不像Pascal那样要求if后面跟着thenQ?strong>while后面跟着do 。变量不需要声明,它们不需要类型。返回类型不必指定,关键?strong>return 可以省略Q它返回最后一个表辑ּ的倹{另一斚wQ它也不像Perl或者C那样复杂难懂?

    31. 它是面向表达式的Qexpression-orientedQ?/font> 你可以轻易的使用 x = if a<0 then b else c  q样的表辑ּ?/p>

    32. 语法砂糖Qsyntax sugarQ?/font> (像Mary Poppins解释Q一法的p能使语义被接受) 。如果你惛_数组xq行q代Q可以用for a in x。你也可以用a+=b代替a=a+bQ这都行。很多操作符其实在Ruby中都是方法,q些Ҏ的名字比较直观,短小Q有着便利的语法?/p>

    33. 它支持操作符重蝲?/font> 如果我没有记错的话,早在很久之前的SNOBOL提供了q个功能Q但是直到C++它才变得行。虽然它可能q而出错,但是q仍是一个非怸错的优点。另外Ruby自动定义操作W的赋值版本,比如Q如果你重定义了+Q那么,你同时得C一?=操作W?/p>

    34. 支持无限_ֺ的数字?/font> 有h会关?short, int, long吗,只需要?Bignump了,你可以轻杄实现365的阶乘?/p>

    35. 有幂操作W?/font> 在很久以前,我们在BASIC和FORTRAN中用它Q然而当我们学习Pascal和C之后Q我们才认识到这个操作符有多差劲。(我们被告知自p它是怎么工作的都不知道-它用了ҎQP代了吗,效率如何Q)Q但是,我们真的关系q些吗?如果是,我们可以重写q个ҎQ否则,Ruby有非常好?*操作W可以用?/p>

    36. 强大的字W串处理?/font> If如果你想查找Q判断,格式化,trimQ定界(delimitQ,interposeQtokenizeQ你可以自己选择随便用哪一个来得到你想要的l果?

    37. 规则很少引v异常?/font> Ruby的语法和语义比其它语a有条理,每种语言都有独特的一面,每条规则都会有异常发生,但是Ruby规则引v的异常就的多了?/p>





    keywen 2007-04-27 16:55 发表评论
    ]]>
    RubyE序快速入门之数据l构http://m.tkk7.com/keywen1983/archive/2007/04/27/114134.htmlkeywenkeywenFri, 27 Apr 2007 08:51:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/27/114134.htmlhttp://m.tkk7.com/keywen1983/comments/114134.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/27/114134.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/114134.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/114134.html

    RubyE序快速入门之数据l构


             p许多E序语言一PRuby也提供了完整的数据结构来存储和管理数据与对象。数l是使用Ҏ号和用逗号隔开的单个对象参考列表创建的?br>

    presidents=["John"Q?Richard"Q?Gerald"Q?Ronald"Q?George"Q?William"];

      Z更ؓҎ地创Z个充满单词的数组QRuby提供了一个特D的标志来消除双引号和逗号Q见下面例子Q?br>
    presidents= %w[ John Richard Gerald Ronald George William];

      在其它编E语a中,"数组"一词经常意味着一l相同性质的对象的集合。但在Ruby中,不是q样。在Ruby中,一?数组"可以是由不同性质的对象参考组成的集合。因此,下面是有效的数组表达形式Q?/span>

    order_date=Date.today()
    shirt_information=[14.5Q?Long"Q?2Qorder_date]

      在这个数l中Q对象参考按序存储q烦引。象Java一P索引?开始,索引可用来从数组中检索对象参考。下面的CZ中请求的是,上面创徏的shirt_information数组中的W?个元素(索引?Q。注意,你可以用方括号标志或atҎ来检索数l中的对象参考?/span>

    irb(main):003:0Q?shirt_information[2]
    =Q?32
    irb(main):004:0Q?shirt_information.at(2)
    =Q?32

      有趣的是Q你q可以用一个负数烦引来引用数组中的元素。一个负数烦引是从数l尾部开始计数的?

    irb(main):005:0Q?shirt_information[-3]
    =Q?"Long"

      数组是动态的Q意味着数组的大可以根据你的操作而动态地改变。你可以使用[index]=操作W来d或替换一个数l中的元素?/span>

    irb(main):013:0Q?shirt_information
    =Q?[14.5Q?"Long"Q?32Q?#<Date: 4907585/2Q?Q?299161Q]
    irb(main):014:0Q?shirt_information[1]="Medium" #change shirt length
    =Q?"Medium"
    irb(main):015:0Q?shirt_information[4]=49.99 #add shirt cost
    =Q?49.99
    irb(main):016:0Q?shirt_information
    =Q?[14.5Q?"Medium"Q?32Q?#<Date: 4907585/2Q?Q?299161Q, 49.99]

      你也可以使用数字对和范围来由数组的一部分创徏一个新数组Q通过使用一个[开始烦引,元素数目]标志或[开始烦?..l束索引]标志?br>
    irb(main):019:0Q?shirt_information
    =Q?[14.5Q?"Long"Q?32Q?#<Date: 4907585/2Q?Q?299161Q, 49.99]
    irb(main):020:0Q?shirt_dimensions = shirt_information[0Q?]
    =Q?[14.5Q?"Long"Q?32]
    irb(main):021:0Q?shirt_order = shirt_information[2..5]
    =Q?[32Q?#<Date: 4907585/2Q?Q?299161Q, 49.99]
    irb(main):030:0Q?shirt_information[-3Q?]
    =Q?[32Q?#<Date: 4907585/2Q?Q?299161Q]

      q个l合了赋D符([]=)的标志将产生一个很复杂的元素插入或代替操作。一个开?l束索引或范围可以用在赋值操作符中。具体用请参考下面的CZQ?/span>

    irb(main):001:0Q?test_array=["zero"Q?"one"Q?"two"Q?"three"Q?"four"]
    =Q?["zero"Q?"one"Q?"two"Q?"three"Q?"four"]
    irb(main):002:0Q?#starting at the second elementQ?replace the next
    two elements with a single element
    irb(main):003:0* test_array[1Q?]=1
    =Q?1
    irb(main):004:0Q?test_array
    =Q?["zero"Q?1Q?"three"Q?"four"]
    irb(main):005:0Q?#insert a new element after the second one
    (zero as a second parameter indicates "insert")
    irb(main):006:0* test_array[2Q?]=2
    =Q?2
    irb(main):007:0Q?test_array
    =Q?["zero"Q?1Q?2Q?"three"Q?"four"]
    irb(main):008:0Q?#add an array of elements after element 5
    irb(main):009:0* test_array[5Q?]=[5Q?Q?]
    =Q?[5Q?6Q?7]
    irb(main):010:0Q?test_array
    =Q?["zero"Q?1Q?2Q?"three"Q?"four"Q?5Q?6Q?7]
    irb(main):011:0Q?#replace elements in the index range of 3..4 with the array assigned
    irb(main):012:0* test_array[3..4]=[3Q?]
    =Q?[3Q?4]
    irb(main):013:0Q?test_array
    =Q?["zero"Q?1Q?2Q?3Q?4Q?5Q?6Q?7]

      最后,也许Ruby数组中最有力量的q算可以从数学操作符中找到答?它们能够从现在数l创建新的数l。例如,+操作W允怽׃个数l的q接创徏一个新数组Q?操作W允怽复制或连接一个数l自w若q次?/span>

    irb(main):033:0Q?shirt_information
    =Q?[14.5Q?"Long"Q?32Q?#<Date: 4907585/2Q?Q?299161Q, 49.99]
    irb(main):034:0Q?pant_information=[34Q?2Q?9.99Qorder_date]
    =Q?[34Q?32Q?59.99Q?#<Date: 4907585/2Q?Q?299161Q]
    irb(main):035:0Q?shirt_information + pant_information
    =Q?[14.5Q?"Long"Q?32Q?#<Date: 4907585/2Q?Q?299161Q, 49.99Q?34Q?32Q?59.99Q?
    #<Date: 4907585/2Q?Q?299161Q]
    irb(main):036:0Q?shirt_information * 2
    =Q?[14.5Q?"Long"Q?32Q?#<Date: 4907585/2Q?Q?299161Q, 49.99Q?14.5Q?"Long"Q?32Q?
    #<Date: 4907585/2Q?Q?299161Q, 49.99]
    irb(main):037:0Q?array1 = [2Q?Q?Q?Q?0]
    =Q?[2Q?4Q?6Q?8Q?10]
    irb(main):038:0Q?array2=[3Q?Q?]
    =Q?[3Q?6Q?9]
    irb(main):039:0Q?array1 - array2
    =Q?[2Q?4Q?8Q?10]

      在Ruby中,与数l联pL密切的就是哈希表。在一个数l中Q烦引是一个整数。在Ruby中Hashc行Z与Array非常怼Q但是它允许在集合中出现到参考对象的Mcd的对?索引"Q或键)。在另外的程序语a中,q可能被UCؓ一个字典或地图或哈希地图。一般地Q当使用哈希表时Q你应该为集合中的每个元素提供两个对象参考。其中,一个对象参考用作键Q另一个用作该键所指对象(??Q。用于指CZ个键对象所指内容的标志?Q符受当创徏哈希表时Q键/值对可以在两个大括号之间被收集。作Z个哈希表的例子,你可以在哈希表中使用单的字符串对象作为键来引用Date对象Q|?br>
    holidays={"New Year"=QDate.parse("2006-01-02")Q?"MLB Birthday"=Q?Date.parse("2006-01-16")Q?
    "Washington Birthday"=QDate.parse("2006-02-20")Q?"Memorial Day"=QDate.parse("2006-05-29")Q?"July
    4th"=QDate.parse("2006-07-05")}

      Z索纪忉|的Date对象Q你可以使用"Memorial Day"字符串键?br>
    irb(main):004:0Q?holidays["Memorial Day"]
    =Q?#
    irb(main):005:0Q?holidays["Memorial Day"].to_s
    =Q?"2006-05-29"

      如你所惻I在数l和哈希表中q有另外许多Ҏ来允怽存取和修攚w合中的单个元素或改变全部集合本n。因此,在Ruby中,数组和哈希表都是功能极强的动态的数据l构?/span>

      一旦你有一个对象参考的集合Q那么在~程中最常用的一Q务就是遍历该集合中的每一个元素ƈ执行某些操作。Ruby当然也提供了数组和哈希表中的cM机制。Ruby提供的实现遍历集合的机制是该集合对象上的一l方法。Array中的ҎQ如eachQeach_indexQdelete_ifQ和Hash中的ҎQ如eachQeach_keyQeach_valueQeach_pairQ允怽的编码进行集合遍历ƈ执行特定的Q务。事实上QRuby中的许多c都包含q代子(iteratorQ方法。例如,String提供了一个iteratorҎ来执行字W串的以字符或字节ؓ单位的遍历Q务。然而,在你理解iteratorҎ前,你首先需要理解Ruby中代码块的概c因为当遍历集合中的元素Ӟ对于每一个iteratorҎQ都是通过传递一个代码块来执行的?/span>


    keywen 2007-04-27 16:51 发表评论
    ]]>
    下蝲ruby辅导资料(Downloadable Ruby Tutorials)http://m.tkk7.com/keywen1983/archive/2007/04/26/113870.htmlkeywenkeywenThu, 26 Apr 2007 09:57:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/26/113870.htmlhttp://m.tkk7.com/keywen1983/comments/113870.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/26/113870.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/113870.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/113870.html

    Downloadable Ruby Tutorials

    You will find many sites on the net from where you can download Ruby tutorials. You can download the entire course material and programs presented on this site too, here:



     

    全文链接Q?a >http://rubylearning.com/download/downloads.html



    keywen 2007-04-26 17:57 发表评论
    ]]>
    q行ruby学习的例?/title><link>http://m.tkk7.com/keywen1983/archive/2007/04/26/113866.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Thu, 26 Apr 2007 09:46:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/04/26/113866.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/113866.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/04/26/113866.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/113866.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/113866.html</trackback:ping><description><![CDATA[<blockquote style="FONT-FAMILY: Comic Sans MS"> <h1>Table of Contents</h1> <ul> <li><a ><strong><u><font color=#ec981f>Introduction</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Installation</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>First Program</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Features</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Numbers</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Fun with Strings</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Variables and Assignment</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Scope</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Getting Input</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Names</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>More on Ruby Methods</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Writing own Ruby Methods</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Method Missing</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>More on Strings</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Simple Constructs</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Arrays</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Ranges</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Blocks and Procs</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Random Numbers</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Read/Write files</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Writing our own Class</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Including Other Files</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Ruby Open Classes</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Inheritance</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Duck Typing</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Overloading Methods</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Overriding Methods</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Symbols</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Hashes</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Exploring Time class</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Exceptions</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Access Control</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Syntactic Sugar</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Mutable and Immutable Objects</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Object Serialization</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Constants</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Modules/Mixins</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Self</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Regular Expressions</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Unit Testing</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Socket Programming</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>SMTP class</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Web services</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Ruby/Tk</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Using Ruby/MySQL</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Ruby Tools</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Java to Ruby</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Ruby on Rails</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Solutions</font></u></strong></a> <li><a ><strong><u><font color=#ec981f>Ruby Quirks</font></u></strong></a> </li> </ul> <p>都是英文版的Q耐心看吧Q?/p> </blockquote> <img src ="http://m.tkk7.com/keywen1983/aggbug/113866.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-04-26 17:46 <a href="http://m.tkk7.com/keywen1983/archive/2007/04/26/113866.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>最快学习ruby的方?The Fastest Way to Learn Ruby)http://m.tkk7.com/keywen1983/archive/2007/04/26/113864.htmlkeywenkeywenThu, 26 Apr 2007 09:45:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/26/113864.htmlhttp://m.tkk7.com/keywen1983/comments/113864.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/26/113864.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/113864.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/113864.html

    The Fastest Way to Learn Ruby

    Wise Words

    rubylearning.com is a thorough collection of Ruby study notes for those who are new to the language and in search of a solid introduction to Ruby's concepts and constructs - ruby-lang.org


     

    Dive in to Learn Ruby.


    Ruby Logo My interest in Ruby was aroused after I read an article Ruby the Rival in November 2005. I started learning Ruby myself and made my own Ruby study notes. What's presented here is a result of that.

    I'd like to thank everyone on the ruby-talk mailing list for their thoughts and encouragement; all of my wonderful PuneRuby RUG members, for their help in making these study notes far better than I could have done alone. I would like to specially thank Andy Tyrrell from UK, for his help in tweaking the Syntax Highlighter css.

    Since these are my study notes, I have made extensive references to the blogs and articles of various Ruby Gurus and to the Ruby books from Apress, Manning, O'Reilly and Pragmatic Programmers; my acknowledgment and thanks to all of them.

    If you notice any errors or typos, or have any comments or suggestions or good exercises I could include, or have any queries on any of the topics here, please let me know by filling out the contact form on this site. Good luck and I hope you find this site useful!


    强力推荐Q?/span>http://rubylearning.com/

    keywen 2007-04-26 17:45 发表评论
    ]]>
    其他L~程语言和ruby的异同之?Ruby From Other Languages) http://m.tkk7.com/keywen1983/archive/2007/04/26/113861.htmlkeywenkeywenThu, 26 Apr 2007 09:38:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/26/113861.htmlhttp://m.tkk7.com/keywen1983/comments/113861.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/26/113861.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/113861.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/113861.html

    Ruby From Other Languages


    When you first look at some Ruby code, it will likely remind you of other programming languages you’ve used. This is on purpose. Much of the syntax is familiar to users of Perl, Python, and Java (among other languages), so if you’ve used those, learning Ruby will be a piece of cake.

    This document contains two major sections. The first attempts to be a rapid-fire summary of what you can expect to see when going from language X to Ruby. The second section tackles the major language features and how they might compare to what you’re already familiar with.

    What to Expect: Language X to Ruby

    Ruby From Other Languages

    是ruby官方|站写的Q比较了其他L~程语言和ruby的异同之处,l出了ruby比较有特点的功能介绍?br>
    http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/



    keywen 2007-04-26 17:38 发表评论
    ]]>
    加班学习RoRhttp://m.tkk7.com/keywen1983/archive/2007/04/18/111744.htmlkeywenkeywenWed, 18 Apr 2007 13:04:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/18/111744.htmlhttp://m.tkk7.com/keywen1983/comments/111744.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/18/111744.html#Feedback1http://m.tkk7.com/keywen1983/comments/commentRss/111744.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/111744.html
  • 明天公司一个项目开始,忙里偷闲学了两天的RoRQ以后只能抽I加班学习了Q大家l努力吧Q我可能写的旉了Q?/span>好东西就应该大家分nQ哪位朋友多学了C西,也给我分享一下把?/span>

  •  


  • keywen 2007-04-18 21:04 发表评论
    ]]>
    q行Rails 开发经典的Hello WorldE序Q?/title><link>http://m.tkk7.com/keywen1983/archive/2007/04/18/111702.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Wed, 18 Apr 2007 10:25:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/04/18/111702.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/111702.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/04/18/111702.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/111702.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/111702.html</trackback:ping><description><![CDATA[<ul> <li><br><span style="FONT-FAMILY: Comic Sans MS">Rails 开发工作的大部分集中在创徏和编?apps 目录下的文g?/span> <li><span style="FONT-FAMILY: Comic Sans MS"></span> <li><span style="FONT-FAMILY: Comic Sans MS"><br>先来了解一下这个目录下的结构?br>Apps 目录下包含四个主要目录,它们分别?Controllers, models, views, helpers<br><br>Q:Controllers 目录存放 rails 应用中相应的 controller c,controller cd理来自用L web h?br>Q:views 目录存放相应的模板文Ӟ模板文g填充数据后,转换?html 格式传递给用户的浏览器?br>Q:models目录存放数据模型c,模型cd装了数据库中的数据。很多框架在数据模型层都做的比较复杂Q用q?rails 后,你会发现它非常容易用?br>Q:helpers 目录存放了简?Controllers, models, views 使用的帮助类?br><br>~辑 controller c?br>开始?Rails 之前Q我们需要了解一?rails 是如何将 controller cM的方法和 url 映射CLQ这对于理解 rails 工作原理很重要?br>rails 在生成的 skeleton 框架中包含了一?scripts 目录Q这个目录中包含了很多脚本程序,它们可以帮助我们来简化很多工作,我们已经使用q了 script\server q个脚本Q它是用来启?webrick 服务器的。现在我们看看如何生成默认的 controller 文g<br>打开新的 DOS 命o行,在C:\student目录下运?ruby script\generate controller MyTest<br><br>C:\student\app\controllers 目录中将生成一个包?MyTestController cd义骨架的名ؓ my_test_controller.rb 的文?br>鼠标右键点击此文Ӟ选择”edit” 打开~辑此文件?/span><br><br><img style="WIDTH: 490px; HEIGHT: 183px" height=183 alt="" src="http://m.tkk7.com/images/blogjava_net/keywen1983/class.gif" width=490 border=0><br><br><span style="FONT-FAMILY: Comic Sans MS">在浏览器中访?</span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/My_Test/</span></a><br><br><span style="FONT-FAMILY: Comic Sans MS">览器响应没有找到对应的 index ҎQ不要担心,q不是什么大问题Q因为默认生成的控制器类Q不包含MҎ。不q这里我们了解到Q如果不输入d url q接的话Q默认rails 需要在控制器类中找一?index 的方法。这很容易理解,cM?apache 服务器中目录下面?index.html 文g一栗?br>我们现在~辑q个 MyTestController cR?br>如图Q?br></span><br><img height=318 alt="" src="http://m.tkk7.com/images/blogjava_net/keywen1983/hi.JPG" width=576 border=0><br><br><span style="FONT-FAMILY: Comic Sans MS">重新h刚才的页?</span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/My_Test/</span></a><span style="FONT-FAMILY: Comic Sans MS"> Q你会看到如下结?/span><br><br><img height=443 alt="" src="http://m.tkk7.com/images/blogjava_net/keywen1983/hworld.jpg" width=449 border=0><br><br><span style="FONT-FAMILY: Comic Sans MS">在浏览器中运?</span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/My_Test/keywen</span><br></a><br><img height=443 alt="" src="http://m.tkk7.com/images/blogjava_net/keywen1983/hkeywen.jpg" width=449 border=0><br><br><span style="FONT-FAMILY: Comic Sans MS">了解?rails 是如何将 url 和控制器中的函数做简单映的?br><br>需要做一些解释,在运?ruby script\generate controller MyTest 的时候, rails 做了一些默认的假设?MyTest 对应?controller 文g?my_test_controller.rb, 文g中控制器cd?MyTestControllerQ?url 映射?/My_Test/ .<br>q些默认规定的好处是Q我不需要编辑复杂的配置文gQ只要对相应的文件做~辑可以了。只需要关注程序逻辑Q而不是其它什么,q就?rails 设计原则中的“U定优于配置”?br><br>另外我们也感觉到 ruby 动态语a的好处,q点?java 所无法办到的。我们在~辑?controller 后,重新h面Q就可以使程序生效。对于编译型?java 语言来说Q不重新~译Q重新启动服务器是无法做到这点的。Rails 开发的易用性可见一斑了Q要知道启动和编译都是非常耗费旉的,其对于那些 QJQ?服务器来说更是如此?/span> </li> </ul> <p><embed style="WIDTH: 200px; HEIGHT: 45px" name=MediaPlayer1 pluginspage=http://www.microsoft.com/Windows/MediaPlayer src=/Files/keywen1983/2006090831127573.mp3 width=200 height=45 type=application/x-mplayer2 autostart="1" showcontrols="1"></embed> </p> <img src ="http://m.tkk7.com/keywen1983/aggbug/111702.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-04-18 18:25 <a href="http://m.tkk7.com/keywen1983/archive/2007/04/18/111702.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>创徏I的 rails |页应用E序骨架、运行webrick http 服务?/title><link>http://m.tkk7.com/keywen1983/archive/2007/04/18/111687.html</link><dc:creator>keywen</dc:creator><author>keywen</author><pubDate>Wed, 18 Apr 2007 09:20:00 GMT</pubDate><guid>http://m.tkk7.com/keywen1983/archive/2007/04/18/111687.html</guid><wfw:comment>http://m.tkk7.com/keywen1983/comments/111687.html</wfw:comment><comments>http://m.tkk7.com/keywen1983/archive/2007/04/18/111687.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/keywen1983/comments/commentRss/111687.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/keywen1983/services/trackbacks/111687.html</trackback:ping><description><![CDATA[<p> </p> <ul> <li><span style="FONT-FAMILY: Comic Sans MS">?DOS 命o行窗口运?rails studentQ本E序的工作目录是 C:\  Q?br><br>C:\>rails student<br>      create<br>      create  app/controllers<br>      create  app/helpers<br>      create  app/models<br>      create  app/views/layouts<br>      create  config/environments<br>      create  components<br>      create  db<br>      create  doc<br>      create  lib<br>      create  lib/tasks<br>      create  log<br>      create  public/images<br>      create  public/javascripts<br>      create  public/stylesheets<br>      create  script/performance<br>      create  script/process<br>      create  test/fixtures<br>      create  test/functional<br>      create  test/integration<br>      create  test/mocks/development<br>      create  test/mocks/test<br>      create  test/unit<br>      create  vendor<br>      create  vendor/plugins<br>      create  tmp/sessions<br>      create  tmp/sockets<br>      create  tmp/cache<br>      create  tmp/pids<br>      create  Rakefile<br>      create  README<br>      create  app/controllers/application.rb<br>      create  app/helpers/application_helper.rb<br>      create  test/test_helper.rb<br>      create  config/database.yml<br>      create  config/routes.rb<br>      create  public/.htaccess<br>      create  config/boot.rb<br>      create  config/environment.rb<br>      create  config/environments/production.rb<br>      create  config/environments/development.rb<br>      create  config/environments/test.rb<br>      create  script/about<br>      create  script/breakpointer<br>      create  script/console<br>      create  script/destroy<br>      create  script/generate<br>      create  script/performance/benchmarker<br>      create  script/performance/profiler<br>      create  script/process/reaper<br>      create  script/process/spawner<br>      create  script/process/inspector<br>      create  script/runner<br>      create  script/server<br>      create  script/plugin<br>      create  public/dispatch.rb<br>      create  public/dispatch.cgi<br>      create  public/dispatch.fcgi<br>      create  public/404.html<br>      create  public/500.html<br>      create  public/index.html<br>      create  public/favicon.ico<br>      create  public/robots.txt<br>      create  public/images/rails.png<br>      create  public/javascripts/prototype.js<br>      create  public/javascripts/effects.js<br>      create  public/javascripts/dragdrop.js<br>      create  public/javascripts/controls.js<br>      create  public/javascripts/application.js<br>      create  doc/README_FOR_APP<br>      create  log/server.log<br>      create  log/production.log<br>      create  log/development.log<br>      create  log/test.log<br><br>C:\><br><br>你可以看刎ͼrails 已经Z生成?nbsp;student 应用E序的完整目录结构?br>Rails 不仅仅是一个运行时|络应用框架Q它本n包含了丰富的脚本来帮你完成程序基本骨架的工作?br>q行 rails student 后, rails 生?nbsp;student 应用E序的默认目录结构和初始化文件?br><br>Rails 开发的方式是: ?rails 来生成默认的应用E序骨架Q你所做的工作是在默认目录结构中~辑文g增加应用E序逻辑可以了?br><br>紧接着试一下空的应用程序,看看 rails 默认l我们完成了什么工作?br>本程序的工作目录?D:\railsdoc>, 上面 rails 已经l我们生成了student目录Q进?nbsp;student 目录?br><br>q行 ruby script\server ?q条命o是运?script 目录下的 server 命o来启?webrick 服务器?br><br>启动 webrick 服务器如下:<br><br>C:\student>ruby script\server<br>=> Booting WEBrick...<br>=> Rails application started on </span><a ><span style="FONT-FAMILY: Comic Sans MS">http://0.0.0.0:3000</span></a><br><span style="FONT-FAMILY: Comic Sans MS">=> Ctrl-C to shutdown server; call with --help for options<br>[2007-04-18 17:02:32] INFO  WEBrick 1.3.1<br>[2007-04-18 17:02:32] INFO  ruby 1.8.6 (2007-03-13) [i386-mswin32]<br>[2007-04-18 17:02:32] INFO  WEBrick::HTTPServer#start: pid=3692 port=3000<br><br>打开览?Q输入网址</span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/</span></a><span style="FONT-FAMILY: Comic Sans MS"> 你会看到cM的网c?/span><br><br><img height=465 alt="" src="http://m.tkk7.com/images/blogjava_net/keywen1983/3000.jpg" width=554 border=0><br><br><br><span style="FONT-FAMILY: Comic Sans MS">暂时不要关闭q个H口?br><br>Webrick 介:<br><br>Ruby 默认已经包含了丰富的软gQ其?webrick http 服务器就是其中之一?q个E序包被用作 rubygem 的默认文档服务器。这是一个非常简单的U?ruby ~写的服务器。如果你掌握?webrick 你可以用几行代码来运行一?web 服务器?br><br>打开~辑器,~写以下脚本<br>require "webrick"<br>httpd = WEBrick::HTTPServer.new(<br>:DocumentRoot =>Dir::pwd + "/ruby",<br>:Port => 80<br>)<br>trap(:INT){ httpd.shutdown }<br>httpd.start<br>然后保存?c:\server.rb 下,双击 server.rb , 一个最单的 http server p行了Q它?c:\ruby 目录作ؓ服务器文档根目录?br><br>C:\student>ruby script\server<br>=> Booting WEBrick...<br>=> Rails application started on </span><a ><span style="FONT-FAMILY: Comic Sans MS">http://0.0.0.0:3000</span></a><br><span style="FONT-FAMILY: Comic Sans MS">=> Ctrl-C to shutdown server; call with --help for options<br>[2007-04-18 17:02:32] INFO  WEBrick 1.3.1<br>[2007-04-18 17:02:32] INFO  ruby 1.8.6 (2007-03-13) [i386-mswin32]<br>[2007-04-18 17:02:32] INFO  WEBrick::HTTPServer#start: pid=3692 port=3000<br>127.0.0.1 - - [18/Apr/2007:17:09:18 中国标准旉] "GET / HTTP/1.1" 200 7552<br>- -> /<br>127.0.0.1 - - [18/Apr/2007:17:09:19 中国标准旉] "GET /javascripts/prototype.js HTTP/1.1" 200 71260</span> <li><span style="FONT-FAMILY: Comic Sans MS"></span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/</span></a><span style="FONT-FAMILY: Comic Sans MS"> -> /javascripts/prototype.js<br>127.0.0.1 - - [18/Apr/2007:17:09:19 中国标准旉] "GET /javascripts/effects.js HTTP/1.1" 200 38200<br></span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/</span></a><span style="FONT-FAMILY: Comic Sans MS"> -> /javascripts/effects.js<br>127.0.0.1 - - [18/Apr/2007:17:09:19 中国标准旉] "GET /images/rails.png HTTP/1.1" 200 1787<br></span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1:3000/</span></a><span style="FONT-FAMILY: Comic Sans MS"> -> /images/rails.png<br></li> </ul> <blockquote dir=ltr style="MARGIN-RIGHT: 0px"></span><span style="FONT-FAMILY: Comic Sans MS"> <p><br>在浏览器H口打开 </span><a ><span style="FONT-FAMILY: Comic Sans MS">http://127.0.0.1/</span></a><br></p> </blockquote> <ul> <li><img style="WIDTH: 599px; HEIGHT: 503px" height=503 alt="" src="http://m.tkk7.com/images/blogjava_net/keywen1983/80.jpg" width=599 border=0><br><br><span style="FONT-FAMILY: Comic Sans MS">你将会看?c:/ruby 目录的内容,我们?Q??ruby 代码q成了一个简?http 服务器。你不光可以定制文档根目录,你还可以象编?java servlet 那样Qؓ webrick ~写 ruby servlet 代码。具体详l信息参?</span><a ><span style="FONT-FAMILY: Comic Sans MS">www.webrick.org</span></a> <li></li> </ul> <p><embed style="WIDTH: 200px; HEIGHT: 44px" name=MediaPlayer1 pluginspage=http://www.microsoft.com/Windows/MediaPlayer src=/Files/keywen1983/2006090831127573.mp3 width=200 height=44 type=application/x-mplayer2 autostart="1" showcontrols="1"></embed> <br></p> <img src ="http://m.tkk7.com/keywen1983/aggbug/111687.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/keywen1983/" target="_blank">keywen</a> 2007-04-18 17:20 <a href="http://m.tkk7.com/keywen1983/archive/2007/04/18/111687.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>快速入门Rubyhttp://m.tkk7.com/keywen1983/archive/2007/04/18/111620.htmlkeywenkeywenWed, 18 Apr 2007 06:16:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/18/111620.htmlhttp://m.tkk7.com/keywen1983/comments/111620.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/18/111620.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/111620.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/111620.html 

    ?Hello,World"开?快速入门Ruby

     

      最单的"Hello,World"E序开始逐步深入了解Ruby的类、block、P代器{特?/p>

      q是一个短的Ruby入门。这里假设读者已l安装了RubyQ如果你没有安装的话Q请在阅L前访?a target=_blank>Ruby官方|站q行下蝲q安装?br>




      交互式的Ruby

      打开IRB(交互式Ruby外壳)Q?/p>

    ·    如果你用Mac OS XQ那么请打开l端H口输入irb;

    ·    如果你用LinuxQ那么请打开shell输入irb;

    ·    如果你用windowsQ那么请在开始菜单中扑ֈRuby->fxriQƈ执行它?br>




      OkQ在打开IRB之后Q在其中输入"Hello World"?br>


     

    Ruby听从你的安排!

      发生了什?我们刚才~写了世界上最短小?#8220;Hello World”E序?q么说不太确切。第二行输出是IRB告诉我们Q上一个表辑ּ的评估结果。如果我们希望打印出“Hello World”Q那么就q需要一点努力:





      puts在Ruby中是一个简单的打印输出命o。后面的“=> nil”表示什?——那是表辑ּ的结果。PutsLq回nilQ这是Ruby中表C?#8220;l对无?#8221;(absolutely-positively-nothing value)的方式,看上L些类似Java中的null?/p>

    你的免费计算器在q里!

      无需做什么,我们p把IRB作ؓ一个简单的计算器用:



      q样p计算3+2。够单的!那么3乘以2如何?你可以在下面l箋输入3*2Q也可以回到上面(3+2?重新修改你刚刚输入的计算公式。用键盘上的向上键Q光标到达3+2那一行,再用左键Ud光标到加号上Q然后用空格键q行修改?br>



      下面Q让我们试计算3的^方:




      在Ruby语言中,**表示q运。那么如何计^Ҏ?



      OkQ等一下,表达式中的sqrt(9)表示什?你一定能猜到q是计算9的^Ҏ。而Math表示什?不要着急,下面p我们q一步了解像Mathq样的模块?/p>

      模块——按照主题分l的代码

      Math是Ruby内徏的数学模块。在Ruby中,模块提供了两U角Ԍ一U角色是类似的Ҏ聚集在同一?#8220;家族”名下。因此,Math也包括sin、tanq样的方法。第二种角色是一个圆?dot)Q它标记了消息的接收者。什么是消息?在上面的例子中,sqrt(9)便是消息Q它意味着调用sqrtҎ取出9的^Ҏ?/p>

      SqrtҎ调用的结果是3.0。你可能注意到它q不?。这是因为多数情况下Q数字的qx根ƈ不是整数Q所以这里返回了一个QҎ?/p>

      那么我们如何Cq些计算l果?——将l果赋值给变量?br>




    如何定义Ҏ?

      如何才能方便省事地随意输出字W串Q而无需q多地劳烦我们的手指?——我们需要定义一个方?




      上面的代码中W一?#8220;def h”标志着Ҏ定义的开始。它告诉Ruby我们正在定义一个名为h的方法。下面一行是Ҏ体:puts "Hello World"。最后,也就是第三行“end”通知Ruby我们完成了方法定义。Ruby的回?#8220;=> nil”告诉我们它已l知道我们定义了此方法?/p>

      短、重复地调用Ҏ

      现在Q让我们试多次执行q个ҎQ?br>



      哈,q太Ҏ了。在Ruby中调用某个方法只需方法名提交lRuby。当Ӟq是在方法没有参数的情况下。如果你愿意也可以添加一个空白的括号Q但是这没有必要?/p>

      如果我们惛_某个hello而不是整?#8220;世界”(world)Q那该怎么?——重定义hҎ使它接收name参数?br>


    字符串中的奥U?/p>

      “#{name}”是什么意?q是Ruby在某个字W串中插入其它字W的方式。在大括号之间放入的字符?q里是指name)被外部的字W串代替。你也可以用字W串cd建的capitalizeҎ来确保某人名字的首字母大写:




      上面的代码有两个地方需要说明:

      W一Q我们通过无括L方式调用ҎQ因为括h可选的;

      W二Q这里的默认参数gؓ“World”。也是说在调用Ҏ时如果没有提供name参数Q则使用默认?#8220;World”?/p>

      q化为Greeter!

      我们是否需要一个真正的问候?greeter)Q他能记住你的名字、问候你、L重地向你示?那么q就最好徏立一?#8220;Greeter”c:



    在上面的cM码中定义了一个称为Greeter的类和一些类ҎQ其中出C一些新?#8220;关键?#8221;:h?#8220;@name”Q它是类的实例变量,q对cM的所有方?say_hi和say_byeҎ)都有效?/p>

      如何让Greetercd挥作?现在让我们来建立一个Greeter对象q用它!




      Greetercȝ实例对象g被徏立后Q它便接受了name参数(gؓPat)。那么我们能直接讉Kname?



      看看上面的编译错误来看,q样直接讉Kname是行不通的?/p>

      H视对象的内?/p>

      对象中的实例变量L隐藏于其中,但也q毫无t迹可寻Q通过审查(inspect)对象便会见到它们。当然还有其它的讉KҎQ但是Ruby采用了良好的面向对象的方式来保持数据的隐藏性?br>



    ?q么多方法,可是我们只定义了两个Ҏ呀?其它的方法又何处?不要担心Qinstance_methodsҎ列出了Greeter对象的所有方法,其中包括父类中定义的Ҏ。如果我们只惛_GreetercȝҎq行列表的话Q那么把false作ؓ参数调用instance_methodsҎ卛_。false意味着我们不需要父cd义的Ҏ?br>


     

      哈哈Q这才是我们惌的。下面让我们看看Greeter对象能回应哪些方法:

     

      它知道say_hi、to_s(此方法将对象转换为字W串Q是M对象都必备的默认ҎQ很想Java中的toStringҎ)Q但它不知道name?/p>

      随时修改cd?/p>

      如何才能查看或者修改name?Ruby提供了访问对象变量的单方法:



      在Ruby语言中,你能够多ơ打开某个cdƈ修改它。而修Ҏ带来的变化将应用在此后徏立的M新对象中、甚至现存的此类对象中。下面让我们建立一个新对象q访问它的@name属性?br>



     

      我们通过使用attr_accessor定义了两个方法:

    ·                                   “.name”用来获取name属性?

    ·                                   “.name=”用来讄namee属性倹{?/p>

      q很cM在JavacM讉K被Public修饰的成员变量?/p>

    向每个h问候,MegaGreeter不会漏掉一个h

      Greeterq不完美Q因为它只能一ơ服务一个h。所以我们在q里设计一个能够一ơ向全世界、世界上每个人或者在名单中的人发送问候的MegaGreetercR在q里Q我们将攑ּ从前的IRB交互模式Q{而改为编写RubyE序文g?/p>

      退出IRB的方法:输入“quit”?#8220;exit”或者按下Control+D的组合键?br>


    保存上面的代码到名ؓ“ri20min.rb”的文件中Qƈ使用“ruby ri20min.rb”的命令执行它。程序输出如下:





      下面我们深入了解一下上面的代码?/p>

      h意上面代码中的v始行Q它?开头。在Ruby语言中,M?开头的行都被视为注释,q被解释E序忽略?/p>

      我们的say_hiҎ已经发生了变化:




      它查找@names参数q按照其参数g出决定:

      如果参数gؓnilQ它打C个圆炏V?/p>

      那么@names.respond_to?("each")表示什?

    循环——也叫P?/p>

      如果@names对象heachҎQ那么它是可以被q代的,q而可以对其进行P代,从而问候列表中每个人。如果@names不具备eachҎQ则它自动转换为字W串Qƈ执行默认的问候?/p>



      each是一U方法,它接受一个代码块(block of code)Q然后针对列表中的每个成员执行这个代码块Q而在do和end之间的部分便是这个非常类似匿名函数的代码块。在道W之间的变量是代码块的参数nameQ它作ؓ代码块参数被l定为列表成员,而代码块puts "Hello #{name}!"用这个参数进行输出?/p>

      大多数其它的~程语言使用循环遍历列表Q下面是C语言的@环示例:




      上面的代码显然可以工作,但它不够“优雅”!你不得不用iq个多余的@环变量,q需要指出列表的长度Q然后再解释如何遍历列表?/p>

      Ruby的P代方式则更加优雅Q所有的内部理l节都隐藏在eachҎ中,你所需做的是告诉它如何处理其中的每个成员?/p>

      ?block)QRuby边缘的高亮点!

      ?block)的真正优势在于:能够处理比列表更加复杂的对象。除了在Ҏ中可以处理简单的内部理l节外,你还能处理setup、teardown和所有错误,而不让用h所察觉?br>




      say_byeҎ没有使用eachQ而是查@names是否hjoinҎQ如果具有joinҎQ则调用joinҎ。否则它直接打印@names变量?/p>

      此方法ƈ不关心变量的实际cdQ这依赖于它所支持的那些被UCؓ“Duck Typing”的方法:duck typing是动态类型的一UŞ式:变量的Dw隐含地军_了了变量的行为。这暗示了某个对象与其它实现了相同接口的对象之间是可交换的,不管对象之间是否hl承关系。鸭子测?duck test)是对duck typing的一UŞ象比喠Z?#8220;如果它走路像鸭子Q那么也一定像鸭子一样呷呷地叫,那么它必定是一只鸭?#8221;。duck typing是某些编E语a的特性:如Smalltalk, Python, Ruby, ColdFusion?/p>

      Duck Typing的益处是无需对变量的cdq行严格地限Ӟ如果某h使用一U新cd的列表类Q只要它实现了与其它列表相同语义的joinҎQ便可以拿来使用?/p>

    启动脚本

      文g上半部分是MegaGreetercȝ代码Q而后面剩下的部分则是对这些类Ҏ的调用。而这是我们最后值得注意的一点:




      __FILE__是一?#8220;h力”的变量,它代表了当前文g名?0是用于启动程序的文g名。那么代?#8220;if __FILE__ == $0”便意味着查此文g是否为将被用的ȝ序文件。这样做可以使程序文件作Z码库使用Q而不是可执行代码;但当此文件被用作执行文gӞ也可被执行?/p>

      如何q一步学习Ruby

      到此便是本入门的֣了。当然还有许多值得览的:Ruby提供的各U不同的控制l构;块和yield的?模块作ؓmixins使用{。希望这ơRuby初体验能使你对Ruby更感兴趣?/p>

      注:mixin在面向对象编E语a中是一U提供某些功能给子类l承的类Q但mixinq不能实例化。从某个mixinl承q不是什么特D的形式Q而它更适于攉功能。某个子cȝ臛_以通过l承一个或者多个mixin选择l承它的全部或者多数功能。一个mixin能g期定义和l定Ҏ直到q行Ӟ而属性和实例参数也将在编译时才被定义。这不同于多数常见的方式Q定义所有的属性、方法,q在~译时进行初始化?/p>

      如果q样的话Q请埋头阅我们的文档,那里有免贏V丰富的在线手册和入门资源。或者如果你喜欢在啃书本的话Q可以到图书列表中选择一些你所需要的?/p>

    版权声明Q需Matrix授权发布,如需转蝲误pMatrix


    调试q的代码Q?br>
    irb(main):001:0> "Hello World"

    => "Hello World"

    irb(main):002:0> puts "hello world"

    hello world

    => nil

    irb(main):003:0> 3+2

    => 5

    irb(main):004:0> def h

    irb(main):005:1>   puts "hello world"

    irb(main):006:1>   end

    => nil

    irb(main):007:0> h

    hello world

    => nil

    irb(main):008:0> h()

    hello world

    => nil

    irb(main):009:0> def h(name)

    irb(main):010:1>   puts "hello #{name}!"

    irb(main):011:1>   end

    => nil

    irb(main):012:0> h("keywen")

    hello keywen!

    => nil

    irb(main):013:0> def h(name = "keywen")

    irb(main):014:1>   puts "hello #{name.capitalize}"

    irb(main):015:1>   end

    => nil

    irb(main):016:0> h"wen"

    hello Wen

    => nil

    irb(main):017:0> h

    hello Keywen

    => nil

    irb(main):018:0> class Greeter

    irb(main):019:1>   def initialize (name ="keywen")

    irb(main):020:2>     @name = name

    irb(main):021:2>     end

    irb(main):022:1>   def say_hi

    irb(main):023:2>     puts "Hi #{@name}!"

    irb(main):024:2>     end

    irb(main):025:1>   def say_bye

    irb(main):026:2>     puts "Bye #{@name},come back soon."

    irb(main):027:2>     end

    irb(main):028:1>   end

    => nil

    irb(main):029:0> g = Greeter.new("Pat")

    => #<Greeter:0x7237aec @name="Pat">

    irb(main):031:0> g.say_hi

    Hi Pat!

    => nil

    irb(main):032:0> g.say_bye

    Bye Pat,come back soon.

    => nil

    irb(main):034:0> Greeter.instance_methods

    => ["inspect", "clone", "public_methods", "display", "instance_variable_defined?", "equal?", "freeze", "methods", "respond_to?", "dup", "to_yaml_style", "instance_variables", "__id__", "eql?", "method", "pretty_print_inspect", "say_hi", "id", "send", "singleton_methods", "taint", "to_yaml_properties", "instance_variable_get", "frozen?", "instance_of?", "__send__", "to_a", "say_bye", "to_yaml", "type", "require_gem", "object_id", "instance_eval", "protected_methods", "require", "==", "h", "===", "taguri", "pretty_print_instance_variables", "instance_variable_set", "extend", "kind_of?", "pretty_print_cycle", "to_s", "gem", "taguri=", "class", "hash", "private_methods", "=~", "tainted?", "untaint", "nil?", "pretty_inspect", "is_a?", "pretty_print"]

    irb(main):035:0> Greeter.instance_methods(false)

    => ["say_bye", "say_hi"]

    irb(main):038:0> g.respond_to?("name")

    => false

    irb(main):039:0> g.respond_to?("say_bye")

    => true

    irb(main):040:0> g

    => #<Greeter:0x7237aec @name="Pat">

    irb(main):041:0> class Greeter

    irb(main):042:1>   attr_accessor:name

    irb(main):043:1>   end

    => nil

    irb(main):047:0> g = Greeter.new("keywen")

    => #<Greeter:0x71cef74 @name="keywen">

    irb(main):048:0> g.respond_to?("name")

    => true

    irb(main):049:0> g.respond_to?("name=")

    => true

    irb(main):050:0> g.say_hi

    Hi keywen!

    => nil

    irb(main):051:0> g.name="wen"

    => "wen"

    irb(main):052:0> g.say_hi

    Hi wen!

    => nil

    irb(main):053:0>




     



    keywen 2007-04-18 14:16 发表评论
    ]]>
    Integrating RadRails with Aptanahttp://m.tkk7.com/keywen1983/archive/2007/04/18/111511.htmlkeywenkeywenWed, 18 Apr 2007 02:06:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/18/111511.htmlhttp://m.tkk7.com/keywen1983/comments/111511.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/18/111511.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/111511.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/111511.htmlIntegrating RadRails with Aptana

    From Aptana

    This page describes how to integrate RadRails into your installed version of Aptana.

    Introduction

    Add RadRails as a plugin to Eclipse v3.2 with Aptana to create a well-integrated IDE for JavaScript and Ruby. Make sure that you have Ruby and Rails installed before installing RadRails. See Installing Ruby on Rails for instructions.

    Instructions

    To add RadRails to Eclipse:

    1.       From the Help menu, select Find and Install... to open the Install/Update wizard.

    2.       On the Install/Update window, choose the Search for new features to install option.

    3.       Add the two RadRails remote sites to Aptana.

    a.       Click the New Remote Site... button to open a New Update Site pop-up window.

    b.       In the New Update Site pop-up window, type "RadRails Release" in the Name field, and copy and paste the URL "URL field.

    c.       Click OK.

    d.       Click the New Remote Site... button to add the second remote site for RadRails.

    e.       In the New Update Site pop-up window, type "RadRails Update" in the Name field, and copy and paste the URL "URL field.

    f.        Click OK.

    4.       Choose the RadRails plugin(s) that you will be installing.

    a.       On the Update sites to visit screen, check the boxes next to the two RadRails plugins.

    b.       Click the Finish button.

    Aptana displays a Search Results screen for the plugin that you selected.

    5.       Install the plugin

    a.       On the Search Results screen, check the boxes next to the RadRails plugins that you are installing and check the Show the latest version of a feature only box.

    b.       Click the Next button to go to the Feature License screen.

    c.       On the Feature License screen, choose the option for I accept the terms of the license agreement.

    d.       Click the Next button to go to the Installation screen.

    e.       Click the Finish button.

    After a few seconds, a Verification pop-up window opens.

    f.        On the Verification pop-up window, click the Install All button.

    Aptana installs the plugin and prompts you to restart your workbench.

    6.       On the prompt to restart your workbench prompt, click the Yes button to restart your workbench. If you click the No button, your changes will not take effect until you restart.

    Aptana completes the update installation process. After installing the updates, Aptana will automatically close and re-start. You should now be able to use RadRails as a plugin for Aptana.

     


    keywen 2007-04-18 10:06 发表评论
    ]]>
    在eclipse中安?Rad Railshttp://m.tkk7.com/keywen1983/archive/2007/04/18/111505.htmlkeywenkeywenWed, 18 Apr 2007 01:56:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/18/111505.htmlhttp://m.tkk7.com/keywen1983/comments/111505.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/18/111505.html#Feedback4http://m.tkk7.com/keywen1983/comments/commentRss/111505.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/111505.htmlInstall Rad Rails

    As described in the article Using the Ruby Development Tools plug-in for Eclipse , the first thing to do is install Ruby Development Tools. It’s best to do that from directly within Eclipse. From the main menu select Help/Software Updates/Find and Install, and select the “Search for new features to install option”. Press “New Remote Site” and create a Ruby Development Tools entry at URL http://updatesite.rubypeople.org/release.
     




    Go ahead and install it, and check out its features. We will be using it as the foundation and necessary pre-requisite for using Rad Rails, however, so we won’t go into details here on this wonderful Eclipse IDE plugin.

    Now set up another “New Remote Site” for RadRails itself, as shown below:

     

     

    Go ahead and press “Finish” and proceed to installation.

    Just a couple of setup config items; in Window/Preferences, go to Ruby/Installed Interpreters and specifiy path to ruby in your system.



     

    Idem with Ri/rdoc for documentation (and mouse-over doc) support.

    All done!




    keywen 2007-04-18 09:56 发表评论
    ]]>
    开始学习Ruby on Railshttp://m.tkk7.com/keywen1983/archive/2007/04/17/111214.htmlkeywenkeywenTue, 17 Apr 2007 03:20:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/17/111214.htmlhttp://m.tkk7.com/keywen1983/comments/111214.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/17/111214.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/111214.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/111214.html 

     

    Ruby on Rails在windows下开发环境的搭徏

     Ruby On Rails是在Ruby语言基础上的完成的web应用开发框架。下面介l了本地安装ruby on rails的过E?/span>


      • 安装Ҏ1

        注意Q这是一U很ȝ的安装过E,下面的用方?

    1. 下蝲ruby: 可以下蝲windows安装版,是一个可执行的安装文件。下载地址Q?br>
      http://rubyforge.org/frs/?group_id=167 该网站也有其他^C的安装程序,然后安装卛_?/span>
    2. 安装rails : 依次安装插gQ最后安装railsQ插件之间有ơ序关系Q但如果ơ序错误Q系l会自动提示Q安装语法如下:gem instll actionpack Qgen instll actionmailer {等?br>
    3. 在命令行下输入命? ruby –v 查看ruby版本信息

      Rails blog 建立rails的一个工作目录,如果都运行正的话,说明安装成功?br>

      q行Rails Blog后,pȝ会在当前目录下徏立一个blog目录Q这一目录下还包含许多子目录和文gQ包括app目录Q我们程序的主要部分Qconfig目录Q存储诸如数据库联接信息{配?doc目录Q生成对E序的文档;public目录Q包括程序用的资源文gQ比如imagesQjavascript{;log目录Q程序运行时的logQvender目录Q存攄三方的开发程序包?/p>

      q入blog目录下输入命令: ruby script/serverQ然后打开览器,输入Q?a href="http://localhost:3000/">http://localhost:3000则看到缺省的|页画面Q实际上q一命o执行了rails自带的一个叫做webrick的小型web服务器,端口?000。开发的时候用它来试时比较方便的?br>

      • 安装Ҏ2

        Q开始之时我用的以上的方法,q种其实很是ȝQ因为在下蝲文g时会下蝲不同版本的文Ӟ最后在安装的时候可能生文件没有对应上的问题,如果你的|络条g好的话,你可以选择q程自动安装 Q在console中D:\RoR的目录下执行gem install rails --include -independencices命oQ然后就{着出现下面的信?/span>

        D:\RoR>gem install rails --include -independencices
        Bulk updating Gem source index for:
        http://gems.rubyforge.or
        Successfully installed rails-1.2.3
        Successfully installed activesupport-1.4.2
        Successfully installed activerecord-1.15.3
        Successfully installed actionpack-1.13.3
        Successfully installed actionmailer-1.3.3
        Successfully installed actionwebservice-1.2.3
        Installing ri documentation for activesupport-1.4.2...
        Installing ri documentation for activerecord-1.15.3...
        Installing ri documentation for actionpack-1.13.3...
        Installing ri documentation for actionmailer-1.3.3...
        Installing ri documentation for actionwebservice-1.2.3...
        Installing RDoc documentation for activesupport-1.4.2...
        Installing RDoc documentation for activerecord-1.15.3...
        Installing RDoc documentation for actionpack-1.13.3...
        Installing RDoc documentation for actionmailer-1.3.3...
        Installing RDoc documentation for actionwebservice-1.2.3...


        或者C:\的目录下执行gem install rails --remote命o

        C:\>gem install rails --remote
        Need to update 20 gems from
        http://gems.rubyforge.org
        ....................
        complete
        Install required dependency activesupport? [Yn]  y
        Install required dependency activerecord? [Yn]  y
        Install required dependency actionpack? [Yn]  y
        Install required dependency actionmailer? [Yn]  y
        Install required dependency actionwebservice? [Yn]  y
        Successfully installed rails-1.2.3
        Successfully installed activesupport-1.4.2
        Successfully installed activerecord-1.15.3
        Successfully installed actionpack-1.13.3
        Successfully installed actionmailer-1.3.3
        Successfully installed actionwebservice-1.2.3
        Installing ri documentation for activesupport-1.4.2...
        Installing ri documentation for activerecord-1.15.3...
        Installing ri documentation for actionpack-1.13.3...
        Installing ri documentation for actionmailer-1.3.3...
        Installing ri documentation for actionwebservice-1.2.3...
        Installing RDoc documentation for activesupport-1.4.2...
        Installing RDoc documentation for activerecord-1.15.3...
        Installing RDoc documentation for actionpack-1.13.3...
        Installing RDoc documentation for actionmailer-1.3.3...
        Installing RDoc documentation for actionwebservice-1.2.3...


        q样安装ok了,而且好的是安装的都是最新版本的文gQ只是网l经常出问题Q看q气了?/span>

     

     



    keywen 2007-04-17 11:20 发表评论
    ]]>
    Ruby on Rails在windows下开发环境的搭徏http://m.tkk7.com/keywen1983/archive/2007/04/17/111209.htmlkeywenkeywenTue, 17 Apr 2007 03:15:00 GMThttp://m.tkk7.com/keywen1983/archive/2007/04/17/111209.htmlhttp://m.tkk7.com/keywen1983/comments/111209.htmlhttp://m.tkk7.com/keywen1983/archive/2007/04/17/111209.html#Feedback0http://m.tkk7.com/keywen1983/comments/commentRss/111209.htmlhttp://m.tkk7.com/keywen1983/services/trackbacks/111209.html


    Ruby On Rails是一个在Ruby语言基础上的完成的web应用开发框架。下面介l了本地安装ruby on rails的过E?br>


    安装Ҏ1
    注意Q这是一U很ȝ的安装过E,下面的用方?

    1、下载ruby:Q可以下载windows安装版,是一个可执行的安装文件。下载地址Q?br>http://rubyforge.org/frs/?group_id=167 该网站也有其他^C的安装程序,然后安装卛_

    2、下载rails 及其插g:Q其对应的地址如下Q?/p>

    rails  http://rubyforge.org/frs/?group_id=307

    activesupport  http://rubyforge.org/frs/?group_id=570&release_id=4814

    rake  http://rubyforge.org/frs/?group_id=50&release_id=4770

    activerecord  http://rubyforge.org/frs/?group_id=182&release_id=5776

    actionmailer  http://rubyforge.org/frs/?group_id=361&release_id=5827

    actionpack  http://rubyforge.org/frs/?group_id=249&release_id=4816

    actionwebservice: http://rubyforge.org/frs/?group_id=567&release_id=5830

    下蝲后ؓ了安装方便,可以攑֜同一目录下比如D:\RoR\

    3、安装rails :Q依ơ安装插Ӟ最后安装railsQ插件之间有ơ序关系Q但如果ơ序错误Q系l会自动提示Q安装语法如下:gem instll actionpack Qgen instll actionmailer {等?br>4、在命o行下输入命o:Qruby –v 查看ruby版本信息

    Rails blog 建立rails的一个工作目录,如果都运行正的话,说明安装成功?/p>

    q行Rails Blog后,pȝ会在当前目录下徏立一个blog目录Q这一目录下还包含许多子目录和文gQ包括app目录Q我们程序的主要部分Qconfig目录Q存储诸如数据库联接信息{配?doc目录Q生成对E序的文档;public目录Q包括程序用的资源文gQ比如imagesQjavascript{;log目录Q程序运行时的logQvender目录Q存攄三方的开发程序包?/p>     q入blog目录下输入命令: ruby script/serverQ然后打开览器,输入Q?/span>http://localhost:3000则看到缺省的|页画面Q实际上q一命o执行了rails自带的一个叫做webrick的小型web服务器,端口?000。开发的时候用它来试时比较方便的?br>
    安装Ҏ2

    Q开始之时我用的以上的方法,q种其实很是ȝQ因为在下蝲文g时会下蝲不同版本的文Ӟ最后在安装的时候可能生文件没有对应上的问题,如果你的|络条g好的话,你可以选择q程自动安装 Q在console中D:\RoR的目录下执行gem install rails --include -independencices命oQ然后就{着出现下面的信?br>
    D:\RoR>gem install rails --include -independencices
    Bulk updating Gem source index for:
    http://gems.rubyforge.or
    Successfully installed rails-1.2.3
    Successfully installed activesupport-1.4.2
    Successfully installed activerecord-1.15.3
    Successfully installed actionpack-1.13.3
    Successfully installed actionmailer-1.3.3
    Successfully installed actionwebservice-1.2.3
    Installing ri documentation for activesupport-1.4.2...
    Installing ri documentation for activerecord-1.15.3...
    Installing ri documentation for actionpack-1.13.3...
    Installing ri documentation for actionmailer-1.3.3...
    Installing ri documentation for actionwebservice-1.2.3...
    Installing RDoc documentation for activesupport-1.4.2...
    Installing RDoc documentation for activerecord-1.15.3...
    Installing RDoc documentation for actionpack-1.13.3...
    Installing RDoc documentation for actionmailer-1.3.3...
    Installing RDoc documentation for actionwebservice-1.2.3...

    或者C:\的目录下执行gem install rails --remote命o

    C:\>gem install rails --remote
    Need to update 20 gems from
    http://gems.rubyforge.org
    ....................
    complete
    Install required dependency activesupport? [Yn]  y
    Install required dependency activerecord? [Yn]  y
    Install required dependency actionpack? [Yn]  y
    Install required dependency actionmailer? [Yn]  y
    Install required dependency actionwebservice? [Yn]  y
    Successfully installed rails-1.2.3
    Successfully installed activesupport-1.4.2
    Successfully installed activerecord-1.15.3
    Successfully installed actionpack-1.13.3
    Successfully installed actionmailer-1.3.3
    Successfully installed actionwebservice-1.2.3
    Installing ri documentation for activesupport-1.4.2...
    Installing ri documentation for activerecord-1.15.3...
    Installing ri documentation for actionpack-1.13.3...
    Installing ri documentation for actionmailer-1.3.3...
    Installing ri documentation for actionwebservice-1.2.3...
    Installing RDoc documentation for activesupport-1.4.2...
    Installing RDoc documentation for activerecord-1.15.3...
    Installing RDoc documentation for actionpack-1.13.3...
    Installing RDoc documentation for actionmailer-1.3.3...
    Installing RDoc documentation for actionwebservice-1.2.3...

    q样安装ok了,而且好的是安装的都是最新版本的文gQ会有网l问题,再试一遍?br>
     


    keywen 2007-04-17 11:15 发表评论
    ]]>
    վ֩ģ壺 þӰӹ| ձ޾ƷɫӰԺ| ùƷӰ˾þ| ޹Ʒۺϸר| պëƬƵ| 91߹ۿ| ͵͵Ʒ| ҹ޾Ʒ| ˽ӰԺƵվ | ԺԺҳ| ëƬ벥| 벻AV鶹| һëƬëƬëƬ| 91lƷ| AVѹۿ| ޳AƬ߹ۿ| Ƭ߹ۿ| ߳Ƶ| Ʒ޾Ʒ| ŷ޾Ʒ˾þԻӰƬ | ˳˳ۺþ| ƷAVѿ | ޾Ʒ߹ۿ| ѵӰ߹ۿվ| 2018av| ޾ƷԴ26u| aëƬͼƬ| Ƶ߹ۿ| ³ʦӰԺѹۿ | 1000ֹ߽ѹۿƵ| ɫͼ.com| þþƷ޸| ߹ۿΪƵ| AVһɫ| һëƬ߲| һ˿wwwѸ| ͵޹| ͼƬĻ| þþþ޾ƷС˵| Ѱvվ߹ۿg| þþþѿӰƬ|