??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲男人av,免费观看又污又黄在线观看国产,国产乱人伦精品一区二区http://www.aygfsteel.com/rain1102/category/37656.html<br/><font color="green" style="font-family: 华文行楷;font-size:16px;">子曰Q危邦不入,乱邦不居。天下有道则见,无道则隐?lt;/font><font color="#3C1435"></font>zh-cnSat, 21 Feb 2009 19:05:05 GMTSat, 21 Feb 2009 19:05:05 GMT60?Django ?Ruby on Rails 成功的原?/title><link>http://www.aygfsteel.com/rain1102/archive/2008/12/04/244362.html</link><dc:creator>Eric.Zhou</dc:creator><author>Eric.Zhou</author><pubDate>Thu, 04 Dec 2008 06:06:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2008/12/04/244362.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/244362.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2008/12/04/244362.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/244362.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/244362.html</trackback:ping><description><![CDATA[<p>q裡有一份对?cookoo 写的对Django的遗憾,真是一好文章Q裡面描写到 Django 如何错失大鸣大放的机?x)。我看完之后Q突然发?cookoo q篇文章藉由 Django 的缺点,他也Z偷偷分析?Ruby on Rails 成功的原因。大家可以来看看</p> <p><br /> django的原始码改动频繁<br /> ORM API J琐Q后来按ActiveRecord风格重写Q?br /> 没有整合的测试框?br /> 没出书,文g相比Rails~Z甚多<br /> python内部有h对django完全独立的一套full-stackpȝ有不同看法,又搞了很多别的框Ӟ比如turbogearsQ?br /> django对AJAX热潮无动D<br /> 相比h</p> <p><br /> Rails Team 相当E_Q很大?br /> ORM 太优了<br /> 出的书籍一U棒Q文件也相当?br /> Ruby 因ؓ(f)C,团结<br /> Full Stack 框架QUnit Test 内徏<br /> RJS 赶上 AJAX 热潮Q炒热不话?br /> 虽然 Open Source 技术ؓ(f)本,但是撇开 Ruby on Rails 优秀的技术不谈?/p> <p>假如大家都不写文ӞRuby on Rails 的文件不够多的话Q有人敢用一个不熟?zhn)的语a吗?<br /> 没有?Ruby Cd攑֜ Rails w上Q写得出那麼?API 吗?<br /> 没有团结的团队,人员来来dQ吵来吵ȝ团队作得出好作品吗?<br /> 没有 DHH 肯花写程式以外的旉推销 Rails Qƈ且花眑֤旉写出一本Agile Web Development with RailsQ会(x)更多人愿意花旉d?fn)一个听都没听过Q也没有公司support ?Ruby on Rails 吗?</p> <p><br /> 一向是一盘散沙的 Open Source C可以仔细思考一?Ruby on Rails 带给大家的啟C。Ruby C向心力强Q不分散力量Q又懂得Z以及(qing)掌握时势用RJS炒热话题。这说明Q团队管理好Q向心力强,行销强,正是 Ruby on Rails 扩散那麼快速的d。其实,q不正是一个好商业团队应该具备的特质吗Q?</p><img src ="http://www.aygfsteel.com/rain1102/aggbug/244362.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">Eric.Zhou</a> 2008-12-04 14:06 <a href="http://www.aygfsteel.com/rain1102/archive/2008/12/04/244362.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Why I moved from Ruby on Rails to Python/Django and back[excerpt]http://www.aygfsteel.com/rain1102/archive/2008/11/21/241807.htmlEric.ZhouEric.ZhouFri, 21 Nov 2008 02:46:00 GMThttp://www.aygfsteel.com/rain1102/archive/2008/11/21/241807.htmlhttp://www.aygfsteel.com/rain1102/comments/241807.htmlhttp://www.aygfsteel.com/rain1102/archive/2008/11/21/241807.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/241807.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/241807.htmlAround March of 2006, I decided to proceed with a complete rewrite of Ajaxwhois.com. I had been studying Ruby on Rails for long enough and knew it would be the ideal platform to develop with. And I was right. While Ruby and Rails might be a little awkward at first for the Java or .NET coder in you, it all really makes sense after a little while.

The behind the scene code generation (aka: magic), the lack of a decent IDE, and worse, of a good debugger made my transition to Ruby somewhat difficult and sometimes confusing frustrating. I used to live in Visual Studio .NET and breath Intellisense. In fact, I still miss that to this day.

Any newcomer to Rails will quickly discover why it is so talked about. First of all, even though I don’t consider myself anywhere near a decent Rails programmer, I am now at least twice as productive with Ruby on Rails than with ASP.NET and C#. Thanks to the MVC (Model, View, Controller), DRY (Don’t Repeat Yourself) and Convention Over Configuration mindset of Rails. All the data access code is automagically generated for you (without running a code generator), templating is built in and creating AJAX’ed applications is a snap.

Life was good with Rails and the more I used it, the more I liked it. That was until early August of 2006. I was ready to launch version 2.0 of Ajaxwhois. Knowing so many professional Rails hackers, I thought deploying my application to my production server was going to be a breeze. I was wrong. Even though the installation of Linux (Ubuntu Dapper Drake 64 bit), Lighttpd, MySql and Mongrel went well, I experienced weird problems, mainly related to Mongrel. Sometimes, my Mongrel instances would simply die and disappear from the process list for no apparent reason. I didn’t have ANY traffic at this point because I hadn’t done DNS transfers yet. On other occasions, Mongrel went crazy and started peaking the CPU at 99%. I had to manually kill and restart it.

After extensive research and countless “from scratch” reinstalls, I found out that Mongrel was known to not play well with 64 bit Ubuntu (I lost the links to this evidence, unfortunately). Mongrel was patched accordingly, but it didn’t solve my problem. It still crashed many times a day and I just couldn’t figure out what was wrong. I asked my good friends Rich Collins and Adam Thorsen (of Guruza.com) who are both experienced Rails developers and they had no idea either. I was stuck.

I wanted to launch. Badly. I didn’t want to waste anymore time with this so I picked up a Python book and rewrote the whole site one more time, in Python using the Django framework this time. I had never programmed in Python before and much less used Django. However, the switch was easy enough since Ruby and Python are somewhat similar.

My experience with Python and Django was great; it is a combination every web developer should consider. However, I soon missed Ruby and Rails. Ruby supports “real” private/public/protected methods (Python just fakes that with its naming convention) and it’s syntax is more forgiving (the need for () at the end of each method call in Python was killing me). Django is not as straightforward as Rails, and requires more code to get things done. There are also many little things that don’t “feel right” in Django, like the need to manually pass variables to a view. Data access is confusing at best while Rails’ ActiveRecord is god-sent. These little things really add up.

On the flip side, Python is faster than Ruby and less memory hungry. I was also surprised to actually love Python’s significant indentation (see example). But more importantly, Python and Django just worked! I never experienced weird crashes like I did with my Rails stack.

So, why am I back to Rails for my next project? 3 letters: FUN. I find Ruby and Rails to be pleasant to use. The community large, active and very helpful. The number of freely available Rails plugins and the fast evolution of the core code are also welcomed additions. Rails requires less code, less self.__awkward_method_calls(), has built-in AJAX and REST support, and has much more flexible data access and templating engines.

But what about those crashes? What about the speed issue? Well, I don’t have the crashes anymore. Don’t ask me why, I don’t know, but it’s fine now, I swear! Something somewhere got fixed and it seems to have solved the problem. However, speed is still one of the low points of Rails. Using caching and proper code optimization should take you a long way, though. Matz, the author of Ruby, is working hard on a new virtual machine that should make Ruby just as fast, if not faster than Python.

My recommendation is, try both for long enough to figure out what works and what doesn’t for you. If you are a long-time Python user, Django might be more compelling for you, but if you are coming from a Java, Perl or Smalltalk background, Ruby and Rails will most likely be what you’ll end up using. Either way, I don’t think you can go wrong.

PS: I don’t want to blame Mongrel for my Rails problems because I am still not sure who was the guilty party. Mongrel is a wonderful piece of software and I heartily recommend it. Just make sure you watch it closely if you use Ubuntu on a 64 bit machine.



Eric.Zhou 2008-11-21 10:46 发表评论
]]>
pȝ~程语言和脚本语ahttp://www.aygfsteel.com/rain1102/archive/2008/06/15/208114.htmlEric.ZhouEric.ZhouSun, 15 Jun 2008 09:41:00 GMThttp://www.aygfsteel.com/rain1102/archive/2008/06/15/208114.htmlhttp://www.aygfsteel.com/rain1102/comments/208114.htmlhttp://www.aygfsteel.com/rain1102/archive/2008/06/15/208114.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/208114.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/208114.html pȝ~程语言应该用于如下目的:
1.开发复杂的法或者数据结?br /> 2.实现计算密集型应?br /> 3.操作大型数据?br /> 4.实现良好定义? ~慢变更的需?br /> 5.是大型项目的一部分
而脚本语a应该用于如下目的:
1.q接已有的组?br /> 2.处理l常变化的多U类型的实体
3.h囑Ş化用L(fng)?br /> 4.拥有快速变化的功能
5.是小型或者中型项目的一部分

Eric.Zhou 2008-06-15 17:41 发表评论
]]>
学习(fn)Ruby Onehttp://www.aygfsteel.com/rain1102/archive/2008/04/09/191679.htmlEric.ZhouEric.ZhouWed, 09 Apr 2008 14:05:00 GMThttp://www.aygfsteel.com/rain1102/archive/2008/04/09/191679.htmlhttp://www.aygfsteel.com/rain1102/comments/191679.htmlhttp://www.aygfsteel.com/rain1102/archive/2008/04/09/191679.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/191679.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/191679.html模块定义Qmodule
cd义:(x)class
Ҏ(gu)定义Qdef, undef
(g)查类型:(x)defined?
条g语句Qif, then, else, elsif, case, when, unless
循环语句Qfor, in, while, until, next, break, do, redo, retry, yield
逻辑判断Qnot, and, or
逻辑值和I|(x)true, false, nil
异常处理Qrescue, ensure
对象引用Qsuper, self
块的起始Qbegin/end
嵌入模块QBEGIN, END (require, include)
文g相关Q__FILE__, __LINE__
Ҏ(gu)q回Qreturn
别名Qalias

局部变量,Ҏ(gu)参数和方法名U应该用一个小写字母开头或者用一个下划线开?
全局变量用美元符作ؓ(f)前缀$;
实例变量使用@开_(d)
cd量用@@
cdQ模块名和常量应该用大写字母开?/p>

RubyE序代码现在?位的ACSII码来表示Q通过语言扩展来支持EUCQSJIS或UTF-8{?位编码系l。Ruby2.0版本支?6位的Unicode~码

puts print gets
printf "Number: %4.3f, String:%s", 7.8, "hi!"

数据cdQ数字,字符Ԍ数组Q哈希表Q区_(d)正则表达?br /> 1..5  ---> 1,2,3,4,5;
1...5 ---> 1,2,3,4

a=1; b=1.0; a==b #true 比较两个对象的值是否相{?br /> a=1; b=1.0; a.eql?(b) #false 比较两个对象的g?qing)类型是否相{?br /> a=1.0; b=1.0; a.equal?(b) #false 比较两个对象在内存中的地址是否相同
a=1.0; b=a; a.equal?(b) #true
<=> 比较两个对象的大,大于Q等于,于 分别q回1Q?Q-1
===双的对象是否在左边区间之内Q返回true和false
puts (0..9) === 3.14 #true
puts ('a'..'f')==='c' #true
=~用来比较是否W合一个正则表辑ּQ返回模式在字符串中被匹配到的位|,否则q回nil
!~断言不符合一个正则表辑ּQ返回trueQfalse

break,跛_当层循环
next,忽略本次的@环的剩下部分Q开始下一ơ的循环
redo,重新开始@环,q是从这一ơ开?br /> retryQ重头开始这个@环体

times,upto,downto,each.step
3.times{print 'Hi'} #HiHiHi
1.upto(9) {|i| print i if i<7} #123456
9.downto(1){|i| print i if i<7} #654321
(1..9).each{|i| print i if i<7} #123456
0.step(11, 3){|i| print i} #0369

异常处理begin/end...rescue...ensure...raise  retry可以用在rescue?/p>

attr_writer:motherland
相当?br /> def motherland=(value)
    return @motherland = value
end

attr_reader:motherland
相当?br /> def motherland
    return @motherland
end

attr_accessor:motherland 相当?attr_reader:motherland; attr_writer:motherland



Eric.Zhou 2008-04-09 22:05 发表评论
]]>
zd脚手架功能列?/title><link>http://www.aygfsteel.com/rain1102/archive/2008/04/08/191475.html</link><dc:creator>Eric.Zhou</dc:creator><author>Eric.Zhou</author><pubDate>Tue, 08 Apr 2008 06:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2008/04/08/191475.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/191475.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2008/04/08/191475.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/191475.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/191475.html</trackback:ping><description><![CDATA[zd脚手架参考了Rails自带的脚手架QScaffoldQ功能,提供了一个更丰富的通用模式Q除了CRUDQ还有排序、搜索、分늭{许多功能。这里是一?a title="功能列表" target="_blank">功能列表</a>?br /> <ul> <li>AJAX化的表格界面Q可以创建、修攏V查看ƈ删除对象? <li>自动处理ActiveRecord兌的编? <li>排序、搜索和分页 <li>支持RESTful <span id="wmqeeuq" class="caps">API</span>Q包括XML/YAML/JSONQ? <li>支持换肤 <li>支持扩展 <li>支持多种览器,在Firefox 1+Q?span class="caps">IE 6</span>+和Safari 2+通过验证 <li>与Rails一样遵?span class="caps">MIT协议</span> LicenseQ你可以在你的商业应用中自由使用?</li> </ul><img src ="http://www.aygfsteel.com/rain1102/aggbug/191475.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">Eric.Zhou</a> 2008-04-08 14:02 <a href="http://www.aygfsteel.com/rain1102/archive/2008/04/08/191475.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ruby on Rails 安装手记http://www.aygfsteel.com/rain1102/archive/2008/03/25/188591.htmlEric.ZhouEric.ZhouTue, 25 Mar 2008 13:42:00 GMThttp://www.aygfsteel.com/rain1102/archive/2008/03/25/188591.htmlhttp://www.aygfsteel.com/rain1102/comments/188591.htmlhttp://www.aygfsteel.com/rain1102/archive/2008/03/25/188591.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/188591.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/188591.html     ?http://www.ruby-lang.org/en/  下蝲 ruby186-26.exeQ安装Ruby?br />     d环境变量 ruby186-26\bin ?path
   
    q行 ruby -v 昄版本P表示安装成功?br />
安装RailsQ?br />     (1) q程安装Q?br />     q行 gem install rails --include-dependenciesQ安装RailsQ需要连接网l)(j)?br />    
    (2) 本地安装Q?br />     ?http://www.rubyonrails.org/  下蝲 rails-2.0.2.gemQ安装Rails?br />     q行 gem install rails-2.0.2.gem

    q行 rails -v 昄版本P表示安装成功?br />
使用Q?br />     q行 rails path/to/your/new/application 创徏一个新的项目?br />     q行 ruby path/to/your/new/application/script/server 启动服务?br />
    查看http://localhost:3000成功
    
    手工安装非常ȝ(ch)Q可以从 http://instantrails.rubyforge.org/  下蝲InstantRailsQ全部搞定?br />

相关目录和\径如下:(x)
http://rubyforge.org/frs/?group_id=307  M载rails
http://rubyforge.org/projects/activesupport M载activesupport
http://rubyforge.org/projects/activerecord/  M载activerecord
http://rubyforge.org/projects/actionpack M载actionpack
http://rubyforge.org/projects/actionmailer  M载actionmailer
http://rubyforge.org/projects/aws  M载actionwebservice
http://rubyforge.org/projects/rake  M载rake

如果是升U,记得最后执?gem cleanup把原来的老版本清除?br />

Eric.Zhou 2008-03-25 21:42 发表评论
]]>
RoR中的分页http://www.aygfsteel.com/rain1102/archive/2007/01/15/93996.htmlEric.ZhouEric.ZhouMon, 15 Jan 2007 09:22:00 GMThttp://www.aygfsteel.com/rain1102/archive/2007/01/15/93996.htmlhttp://www.aygfsteel.com/rain1102/comments/93996.htmlhttp://www.aygfsteel.com/rain1102/archive/2007/01/15/93996.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/93996.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/93996.html
  在控制层Q分必L如下代码实现Q?br />
def user_list
@user_pages, @users = paginate(:users, :order_by =Q?'name')
end

  以上代码通过paginateҎ(gu)讄的分器。这个方法有两个参数Q第一个参数是要读取数据的表的名子Q第二个参数是在取数据时要排序的字段。这个方法返回两个对象,W一个对象@user_pages是分器对象Q?W二个对?@users 是每一늚记录数。其中@users用来向视图提供要昄的数据?而@user_pages负责从表中得到数据,然后这些数据保存在@users中?br />
  视图层的实现:

  在视囑ֱ的RHTML文g中,@users中的数据被展现l用戗pagination_links()Ҏ(gu)可以实现D的功能。以下是具体的实C码:(x)

QtableQ?
QtrQ<thQ姓名</thQ</trQ?
Q? for user in @users %Q?
QtrQ<tdQ<%= user.name %Q</tdQ?
Q? end %Q?
Q?tableQ?
QhrQ?
Q?= pagination_links(@user_pages) %Q?
QhrQ?


Eric.Zhou 2007-01-15 17:22 发表评论
]]>
Ruby和Rails的一些好|站http://www.aygfsteel.com/rain1102/archive/2006/12/31/91152.htmlEric.ZhouEric.ZhouSun, 31 Dec 2006 06:22:00 GMThttp://www.aygfsteel.com/rain1102/archive/2006/12/31/91152.htmlhttp://www.aygfsteel.com/rain1102/comments/91152.htmlhttp://www.aygfsteel.com/rain1102/archive/2006/12/31/91152.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/91152.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/91152.html需要用到的一些书
The Ruby Way
Programming Ruby 2nd edition
Agile Web Development with Rails
Best of Ruby Quiz
Rails Recipes
Enterprise Integration with Ruby
Ruby Hacking Guide
Ruby In A Nutshell

http://www.itpub.net/forum61.html
里大多有下,重点推荐
Programming Ruby 2nd edition
Agile Web Development with Rails


一些不错的论坛 ?qing)网?br />国内?br />http://railscn.crispynews.com/
http://www.railscn.com
http://chinaonrails.com
http://r4rclub.schtuff.com/
http://forum.javaeye.com
http://rorwiki.hellopen.net

国外?br />http://www.ruby-forum.com/
http://www.rubyonrailsforum.com/rails-code-questions/
http://rubyforge.org/
http://www.rubyonrails.org/
http://www.ruby-lang.org/en/
http://www.webrick.org/
http://www.yaml.org/

blog

<博客>
铁道播客Q有诸多视频教程
http://rorcast.blogger2blogger.com/

my4java的文字博客:(x)有很多教E的译稿、笔记等
http://my4java.itpub.net/

cnruby道喜技术日讎ͼ(x)众多实例教程
http://www.hhtong.com/blog1/

caphe的博?
http://www.aygfsteel.com/cap

Caiwangqin的博?
http://www.uuzone.com/blog/uu_1115110/

中文RubyOnRailsWiki
http://rorwiki.hellopen.net/index.p...%A6%96%E9%A1%B5

关于rails和ajax相结?br />http://www.rubynoob.com/

http://inquirylabs.com/blog/

q个当中有一些介l?br />http://www.railscn.com/about704.html



Eric.Zhou 2006-12-31 14:22 发表评论
]]>
վ֩ģ壺 Ӧñر| ֹ| ¹Ȫ| ƽ| ͨ| | ̨| | | | ˮ| | ̩| | ʳ| ¡Ң| | °| ľ| ߴ| ³| Ͼ| ǿ| ʡ| | | | | ̩| | ̨ɽ| | | | ͺ| | Ͷ| | ݰ| ˳| |