<?xml version="1.0" encoding="gb2312"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="zh-cn">
    
    <title>EasyTime - Ruby学习笔记</title> 
<link rel="alternate" type="text/html" href="http://my4java.itpub.net" /> 
 
<modified>Thu,17 05 2012 00:45:42</modified> 
<tagline></tagline> 
<generator url="http://www.plogworld.net/" version="1.0.1">pLog</generator> 
 
<copyright>Copyright (c) my4java</copyright> 
    
 <entry> 
 <id>tag:post:blog.itpub.net,Tue,13 03 2007 20:44:40</id>
 <title>AWDWR 第二版感想！</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/271342" /> 
  
 <modified>Tue,13 03 2007 20:44:40</modified> 
 <issued>Tue,13 03 2007 20:44:40</issued> 
 <created>Tue,13 03 2007 20:44:40</created> 
 <summary type="text/plain"> 事物发展的就是快，像时间一样不知会不会停一下，让我们多想想为什么！前两天看到了 AWDWR 的第二版，与第一版真的像两本书的。希望能尽快看到它的中文版啊！我在看的时候也进行了一些中文的整理。想让大家看看，能更快地学到知识，并把它用到工作中。我怎么好像没有勇气，时间来把这个第二版也做个中文，让没钱，或鸟文不好的兄弟也看看呢！时间真是个好东西，它总是在改变着什么。</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
Rails散文
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 事物发展的就是快，像时间一样不知会不会停一下，让我们多想想为什么！前两天看到了 AWDWR 的第二版，与第一版真的像两本书的。希望能尽快看到它的中文版啊！我在看的时候也进行了一些中文的整理。想让大家看看，能更快地学到知识，并把它用到工作中。我怎么好像没有勇气，时间来把这个第二版也做个中文，让没钱，或鸟文不好的兄弟也看看呢！时间真是个好东西，它总是在改变着什么。</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Mon,12 02 2007 18:41:05</id>
 <title>关于&quot;agile web development with rails&quot;!</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/263080" /> 
  
 <modified>Mon,12 02 2007 18:41:05</modified> 
 <issued>Mon,12 02 2007 18:41:05</issued> 
 <created>Mon,12 02 2007 18:41:05</created> 
 <summary type="text/plain"> 很多朋友来邮件向我索要&quot;agile web development with rails&quot;的电子版。其实翻译它原只是为了自己学习用的，但是没有想到放到线上有这么多朋友看，并给我留言，让我甚为感动。但是我一直没有把它做成电子版的想法，因为它的中文版已出来有段日子了。我也卖了一本，翻译得很好。我在这里想告诉大家，如果你手里的money允许的话，还是卖一本吧！这样即加快了你的学习速度，也会鼓励中文版译者有动力来翻译第二版。这里的译文原只是为了方便学习而译的，译文也不甚准确，它不值得你，也不值得我去做成电子版。我认为每个人都有学习的权力，即便...</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
Rails散文
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 很多朋友来邮件向我索要&quot;agile web development with rails&quot;的电子版。其实翻译它原只是为了自己学习用的，但是没有想到放到线上有这么多朋友看，并给我留言，让我甚为感动。但是我一直没有把它做成电子版的想法，因为它的中文版已出来有段日子了。我也卖了一本，翻译得很好。我在这里想告诉大家，如果你手里的money允许的话，还是卖一本吧！这样即加快了你的学习速度，也会鼓励中文版译者有动力来翻译第二版。这里的译文原只是为了方便学习而译的，译文也不甚准确，它不值得你，也不值得我去做成电子版。我认为每个人都有学习的权力，即便...</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Wed,31 01 2007 21:00:08</id>
 <title>有段时间没有更新文章了</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/259026" /> 
  
 <modified>Wed,31 01 2007 21:00:08</modified> 
 <issued>Wed,31 01 2007 21:00:08</issued> 
 <created>Wed,31 01 2007 21:00:08</created> 
 <summary type="text/plain"> 人也真是奇怪的，在每天都要写些文章时，就养成了不写反到感到有些什么事没有完成的感觉，而放弃写文章几天之后，竟然有这么长时间没更新。人真是喜欢惰性，真是喜欢放弃。不过想来给自己找个理由，我没有放弃自己喜欢的Ruby，及Rails，我只是要验证一下，我能否用学到的这两个东西来创造财富。自己开发的网站也已有七八成了，不知道能否在未来的三个月内上线，先祝福自己一下吧！我经常到 RailsCN 论坛上寻找我需要的东西，我喜欢那里，也推荐学习Ruby及Rails的同道多到那儿去看看，版主是个很有学问的人，向它请教你会受益非浅的。我也经...</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
随生随想随笔
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 人也真是奇怪的，在每天都要写些文章时，就养成了不写反到感到有些什么事没有完成的感觉，而放弃写文章几天之后，竟然有这么长时间没更新。人真是喜欢惰性，真是喜欢放弃。不过想来给自己找个理由，我没有放弃自己喜欢的Ruby，及Rails，我只是要验证一下，我能否用学到的这两个东西来创造财富。自己开发的网站也已有七八成了，不知道能否在未来的三个月内上线，先祝福自己一下吧！我经常到 RailsCN 论坛上寻找我需要的东西，我喜欢那里，也推荐学习Ruby及Rails的同道多到那儿去看看，版主是个很有学问的人，向它请教你会受益非浅的。我也经...</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Fri,01 12 2006 01:00:40</id>
 <title>申请gmail邮箱</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/233462" /> 
  
 <modified>Fri,01 12 2006 01:00:40</modified> 
 <issued>Fri,01 12 2006 01:00:40</issued> 
 <created>Fri,01 12 2006 01:00:40</created> 
 <summary type="text/plain"> 申请gmail邮箱http://www.daviesliu.net/share/
</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
Rails散文
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 申请gmail邮箱http://www.daviesliu.net/share/
</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Sat,25 11 2006 19:13:32</id>
 <title>MySQL5.1新特性翻译系列 - 通过分区（Partition）提升MySQL性能</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/232105" /> 
  
 <modified>Sat,25 11 2006 19:13:32</modified> 
 <issued>Sat,25 11 2006 19:13:32</issued> 
 <created>Sat,25 11 2006 19:13:32</created> 
 <summary type="text/plain"> MySQL5.1新特性翻译系列 - 通过分区（Partition）提升MySQL性能http://www.phpv.net/article.php/1514随机选择记录问题（比如答题系统需要随机从题库抽取题目）http://www.phpx.com/viewarticle.php?id=102057</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
MySQL
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 MySQL5.1新特性翻译系列 - 通过分区（Partition）提升MySQL性能http://www.phpv.net/article.php/1514随机选择记录问题（比如答题系统需要随机从题库抽取题目）http://www.phpx.com/viewarticle.php?id=102057</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Tue,21 11 2006 11:33:02</id>
 <title>UJS Rails Plugin</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/230875" /> 
  
 <modified>Tue,21 11 2006 11:33:02</modified> 
 <issued>Tue,21 11 2006 11:33:02</issued> 
 <created>Tue,21 11 2006 11:33:02</created> 
 <summary type="text/plain"> UJS Rails Plugin不知道这个插件是否会对RJS有影响，它会不会也像simply_restful插件一样，被 rails 吸纳进来呢？http://www.ujs4rails.com/resources/quickstart-guide
</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
Rails散文
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 UJS Rails Plugin不知道这个插件是否会对RJS有影响，它会不会也像simply_restful插件一样，被 rails 吸纳进来呢？http://www.ujs4rails.com/resources/quickstart-guide
</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Fri,17 11 2006 19:48:40</id>
 <title>用 has_many :through 实现自引用连接二</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/229887" /> 
  
 <modified>Fri,17 11 2006 19:48:40</modified> 
 <issued>Fri,17 11 2006 19:48:40</issued> 
 <created>Fri,17 11 2006 19:48:40</created> 
 <summary type="text/plain"> 用 has_many
:through 实现自引用连接二


This example is for modeling digraphs.

create_table &quot;nodes&quot; do |t|

t.column &quot;name&quot;, 
:string

t.column &quot;capacity&quot;, 
:integer

end

create_table &quot;edges&quot; do |t|

t.column &quot;source_id&quot;, :integer, :null =&gt; false

t.column &quot;sink_id&quot;, 
:integer, :null =&gt; false

t.column &quot;flow&quot;, 
:integer

end

class Edge &lt; ActiveRecord::Base

belongs_to :source, :foreign_key =&gt; &quot;source_id&quot;,
:class_name =&gt; &quot;Node&quot;

belongs_to :sink, :foreign_key
...</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
Rails散文
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 用 has_many
:through 实现自引用连接二


This example is for modeling digraphs.

create_table &quot;nodes&quot; do |t|

t.column &quot;name&quot;, 
:string

t.column &quot;capacity&quot;, 
:integer

end

create_table &quot;edges&quot; do |t|

t.column &quot;source_id&quot;, :integer, :null =&gt; false

t.column &quot;sink_id&quot;, 
:integer, :null =&gt; false

t.column &quot;flow&quot;, 
:integer

end

class Edge &lt; ActiveRecord::Base

belongs_to :source, :foreign_key =&gt; &quot;source_id&quot;,
:class_name =&gt; &quot;Node&quot;

belongs_to :sink, :foreign_key
...</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Fri,17 11 2006 19:02:43</id>
 <title>用 has_many :through 实现自引用连接</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/229886" /> 
  
 <modified>Fri,17 11 2006 19:02:43</modified> 
 <issued>Fri,17 11 2006 19:02:43</issued> 
 <created>Fri,17 11 2006 19:02:43</created> 
 <summary type="text/plain"> 用 has_many
:through 实现自引用连接


想在 people 表内找出是朋友的 person。

 

&lt;code&gt;

# people 表

create_table :people do |t|

 
t.column :name, :string

end

 

# 连接模型
authorized 用于表示其是否是我的朋友。

# 关联的朋友表 friendships 

create_table :friendships do |t|

 
t.column :person_id, :integer

 t.column
:friend_id, :integer

 
t.column :authorized, :boolean, :default =&gt; false

end

 

class Friendship &lt; ActiveRecord::Base

 
belongs_to ...</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
Rails散文
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 用 has_many
:through 实现自引用连接


想在 people 表内找出是朋友的 person。

 

&lt;code&gt;

# people 表

create_table :people do |t|

 
t.column :name, :string

end

 

# 连接模型
authorized 用于表示其是否是我的朋友。

# 关联的朋友表 friendships 

create_table :friendships do |t|

 
t.column :person_id, :integer

 t.column
:friend_id, :integer

 
t.column :authorized, :boolean, :default =&gt; false

end

 

class Friendship &lt; ActiveRecord::Base

 
belongs_to ...</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Fri,10 11 2006 20:06:39</id>
 <title>Rails的RJS模板-完</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/228338" /> 
  
 <modified>Fri,10 11 2006 20:06:39</modified> 
 <issued>Fri,10 11 2006 20:06:39</issued> 
 <created>Fri,10 11 2006 20:06:39</created> 
 <summary type="text/plain"> Rails的RJS模板-完
14、pluck(variable, property) Iterates through the collection
creating a new Array from the value of the given property of each object
without a function call. The resulting Array is assigned to the JavaScript
variable. 

# Ruby code

page.select('.amounts').pluck('amounts', 'innerHTML')

// Generated JavaScript

var amounts = $$(&quot;.amounts&quot;).pluck(&quot;innerHTML&quot;);

 

15、reject(variable){|value, index| block } Each element is
passed to the given block. The block ...</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
RJS
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 Rails的RJS模板-完
14、pluck(variable, property) Iterates through the collection
creating a new Array from the value of the given property of each object
without a function call. The resulting Array is assigned to the JavaScript
variable. 

# Ruby code

page.select('.amounts').pluck('amounts', 'innerHTML')

// Generated JavaScript

var amounts = $$(&quot;.amounts&quot;).pluck(&quot;innerHTML&quot;);

 

15、reject(variable){|value, index| block } Each element is
passed to the given block. The block ...</content> 
</entry> 

 <entry> 
 <id>tag:post:blog.itpub.net,Fri,10 11 2006 20:05:56</id>
 <title>Rails的RJS模板二十五</title> 
 <link rel="alternate" type="text/html" href="http://my4java.itpub.net/post/9983/228337" /> 
  
 <modified>Fri,10 11 2006 20:05:56</modified> 
 <issued>Fri,10 11 2006 20:05:56</issued> 
 <created>Fri,10 11 2006 20:05:56</created> 
 <summary type="text/plain"> Rails的RJS模板二十五
1、all(variable) {|value,index| block } Each element is passed to the block. The block
is converted to a JavaScript iterator function. The JavaScript variable is set
to TRue if the iterator function never returns false or null. 把每个元素传递给块。块被转换成 JavaScript 的 iterator 函数。如果iterator函数从不返回false或null，则JavaScript 变量被设置为true。

# Ruby code

page.select('#line-items li').all('allVisible') do |value, index|

value.visible

end

// Gener...</summary> 
 <author> 
  
 <name>my4java</name> 
 <url>http://my4java.itpub.net</url> 
 <email>javafifth@yahoo.com.cn</email> 
</author> 
<dc:subject>
RJS
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="zh-cn" xml:base="http://my4java.itpub.net"> 
 Rails的RJS模板二十五
1、all(variable) {|value,index| block } Each element is passed to the block. The block
is converted to a JavaScript iterator function. The JavaScript variable is set
to TRue if the iterator function never returns false or null. 把每个元素传递给块。块被转换成 JavaScript 的 iterator 函数。如果iterator函数从不返回false或null，则JavaScript 变量被设置为true。

# Ruby code

page.select('#line-items li').all('allVisible') do |value, index|

value.visible

end

// Gener...</content> 
</entry> 
     </feed>



