2006/06/15
IBM 发布Starter Toolkit for DB2 on Rails
IBM alphaWorks 1日宣布,发布Starter Toolkit for DB2 on Rails 。
使用Starter Toolkit for DB2 on Rails,可以非常便利快捷的创建构造应用Ruby on Rails 技术的DB2 Web 应用程序。
访问下面的链接查看详细:
http://www.alphaworks.ibm.com/tech/db2onrails?open&S_TACT=105AGX59&S_CMP=GR&ca=dgr-jw26awdb2onrails
Jouy 发表于 2006-06-15 12:44 阅读( 781) 评论( 0) 引用( 0) Ruby on Rails
2006/04/17
Ruby on Rails学习资料
Ruby on Rails学习资料
Ruby on Rails官方网站:
http://www.rubyonrails.org/
Rolling with Ruby on Rails:
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1
Curt Hibbs写的对于ror的学习过程,还没来得及看,但是实在是太多地方reference了...随大流吧
Really Getting Started in Rails
http://www.slash7.com/articles/2005/01/24/really-getting-started-in-rails
另一处比较著名的入门网站
Ruby on Rails中文社区
http://www.railscn.com/
不知为啥,教育网上这个网站还要用代理...而且好像还不能注册?或者是我的代理的问题?
Setting up a Rails Development Environment on Windows Using Eclipse
http://www.napcs.com/howto/railsonwindows.html
这是一个step by step的在windows上利用eclipse搭建ruby on rails开发平台的指南
我自己就是参考的这个东东。
Why's(poignant) guide to ruby
http://poignantguide.net/ruby/
一个很有意思的ruby语言的入门介绍,作者还会自己画小狐狸插图,
还在侧边栏里写自己的价值观,让我们觉得老外还是蛮可爱的
恩,应该可以用强烈推荐来形容,寓学于乐。
RailsOnWindows:
http://wiki.rubyonrails.com/rails/pages/RailsOnWindows
教你怎样在windows下利用Rails进行开发,其中包括Apache服务器的配置等等
服务器的问题可以从这里找到答案。
Ajax on Rails
http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html
Ajax现在绝对是热点,当然不可放过...虽然对Ajax还仅仅是名词和用户体验上的了解...-___-
GemRails:
http://wiki.rubyonrails.com/rails/pages/GemRails
GemRails是rails的管理器,相当于linux系统中的包管理器
可以自动上网安装新的rails包,可以自动解决依赖,非常方便
添加点 :
Ruby on Rails Club
ror.uuclubs.com
UU 地带 的ROR技术圈
China on Rails
Jouy 发表于 2006-04-17 12:16 阅读( 837) 评论( 0) 引用( 0) Ruby on Rails
2006/04/06
Rails Partial 的魔力手册
Rails partial 参考手册: partial("partial views")是什么? partial("partial views")的用法 阅读全文...
Jouy 发表于 2006-04-06 11:06 阅读( 2051) 评论( 1) 引用( 0) Ruby on Rails
2006/03/30
图片魔术(ImageMagick)
一个 Rails 图片处理程序 . 阅读全文...
Jouy 发表于 2006-03-30 22:31 阅读( 733) 评论( 0) 引用( 0) Ruby on Rails
2006/03/28
RadRails新版本0.6.1
sourceforge下载:
改进了不少
Run:
http://prdownloads.sourceforge.net/radrails/radrails-0.6.1-win32.zip?download
Jouy 发表于 2006-03-28 13:16 阅读( 574) 评论( 0) 引用( 0) Ruby on Rails
2006/03/17
Apache ab test for Rails app on my machine.
D:\webserver\Apache2>bin\ab -c 10 -n 10000 http://127.0.0.1/show
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: Apache/2.0.55
Server Hostname: 127.0.0.1
Server Port: 80Document Path: /show
Document Length: 10967 bytesConcurrency Level: 10
Time taken for tests: 956.15625 seconds
Complete requests: 10000
Failed requests: 6933
(Connect: 0, Length: 6933, Exceptions: 0)
Write errors: 0
Total transferred: 112277616 bytes
HTML transferred: 109146354 bytes
Requests per second: 10.46 [#/sec] (mean)
Time per request: 956.016 [ms] (mean)
Time per request: 95.602 [ms] (mean, across all concurrent requests)
Transfer rate: 114.69 [Kbytes/sec] receivedConnection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 5.3 0 234
Processing: 140 951 107.0 968 1859
Waiting: 140 946 107.0 968 1812
Total: 171 952 107.0 968 1859Percentage of the requests served within a certain time (ms)
50% 968
66% 1015
75% 1031
80% 1046
90% 1078
95% 1093
98% 1140
99% 1203
100% 1859 (longest request)
SCGI ,
时间特别长,CPU一直下不来 . memchached 中缓存数据,
log:
Processing ShowController#index () [GET]
Parameters: {"action"=>"index", "controller"=>"show"}
Rendering within layouts/show
Rendering show/index
Completed in 0.09300 (10 reqs/sec) | Rendering: 0.03100 (33%) | DB: 0.00000 (0%) | 200 OK [http://www.jouy.dev.lode.net/]
Jouy 发表于 2006-03-17 13:20 阅读( 742) 评论( 2) 引用( 0) Ruby on Rails
2006/03/16
对MemCached的正确认识
刚开始,听说用MemCached来缓存数据到内存,然后对数据进行操作,(这里的操作包括了,查询和更新),听起来真是太棒了。这样,一定时间内不用操作数据库。真是太好了。
然后我一直在想一个问题,查询确实可以,可是更新内存要怎么处理并发?难道,我们的MemCached 来有这般功能,如果这样,那真是太神了。
可是事情,并不是像说的那样。对MemCached的这样认识是不正确的。
MemCache和其他的cache是一样的,当数据更新之后,cached 的东西,也就是 out date 的东西了。
在网上看了,前辈们对MemCached的阐述,更是说明了这点。
所以,不应该指望,直接更新MemCached,而省略了数据库这一环节。
这前认为 他提供的set方法是用来更新数据库的,那时自己的痴心妄想。
其实这个方法是将数据库中的记录缓存到MemCached中,同时指定它的有效期是多长。
现在我想到了,为什么,我们的MemCached中的内容一直都没变化,即使我已经删除了该条记录。
我们在set()的时候,并没有设置它的过期时间,也就默认是0,即永不过期。只要MemCached服务器没有重起,它就一直存在。
这样说来,我们的ROR项目中,使用缓存来减少数据库的检索,而不能指望让MemCached可以让我们连更新数据库也免了。
如果真的连更新数据库也免了,就真的跨入了非数据库时代,哈哈。估计不太可能。如果我们能保证用户是以队列的方式 ,一个接着一个来的话。
还是另想办法来减轻更新带来的压力。
Jouy 发表于 2006-03-16 10:00 阅读( 822) 评论( 0) 引用( 0) Ruby on Rails
2006/03/07
Action view-- Partial (Ruby on Rails)
学习Ruby on Rails的时间不长,
做项目的时候被怎么在template中添加现有的header 和footer困扰着。
因为不太熟悉Action View。
今天,将Agile Web Development with Rails 这本书Action View仔细地研读了一遍,发现了Partial Page Templates(on page:368)中找到了答案。
Partial可以解决我上面的问题,可是他并不是出于这样的本意而存才的。partial可以是一个页面任何位置的一部分。
在书中这样说到,
Rails中的Partial就像一种子程序,它可以被其他的template多次调用,潜在地作为参数通过传递对象呈现给浏览器.当partial template结束呈现,然后返回给controller ,在来调用自己的 template.
一个partial template 看起来和其他的template一样.有些许的差别,partial template 的文件名必须是以一个下划线开头.看到这回我明白了,为什么在创建一个scaffold,一般都会有一个叫_form.rhtml的文件。
<%= start_form_tag :action => 'update', :id => @photo %>
<%= render :partial => 'form' %>
<%= submit_tag 'Edit' %>
<%= end_form_tag %>
一定见过这段代码(一般就是一个scaffold中的edit.rhtml),这里就有用到
"render :partial"(或render(:partial=>"partilaname",在这里就不要在用下划线了)).
这样其他的template就可以用render(:partial=>)方法来调用了。
说上说的大概就是这个意思。
但是觉得在template中调用partial是对某个controller下的所有action有效的。如果是静态内容的partial当然是每什么问题。但是,当partial的内容是动态的,就像这样给partial传递个对象render(:partial=>"",:object =>""),那么这个对象在哪来?有的action 可能有这样一个同名的对象,使用该对象不会有问题。有的action并没有这个对象,而在template中调用的partial中使用到了这样的一个对象,就会出错。
这种情况时,我认为将内容写在action view中更有意义。使用到该partial的action中我们又这样一个对象。就不会有
问题。
另外,这样,我们将一个所有页面都要用到的对象,写在application 是切实可行的。
Jouy 发表于 2006-03-07 20:26 阅读( 1500) 评论( 0) 引用( 0) Ruby on Rails
Tables and Classes 表和类的关系 (Active Record)
- Tables and Classes
When I create a subclass of ActiveRecord:Base,
I am creating something that wraps a database table.By default ,
ActiveRecord assumes that the name of table is the plural formof the name of class.
If the class name contains multiple capitalized words,the table name is assumes to have underscores between these words.These rules reflects that class names should be singular while the names of tables should be plural. But ,some people don't like these default .You also can disable it by setting a global flag in your configuration (the file environment . rb in the config directory).Do it like this :
ActiveRecord::Base.pluralize_table_names = false
If you have a class named Sheep , sheeps is a table name . Rails know this.If you're operating with a legacy Schema, where the table names might otherwise force you to use strange or undesirable class names in you code. For this reason,Active Record allows you to override the default generation of a table name using set_table_name directive. Do it like this:
class Sheep < ActiveRecord::Baseset_table_name "sheep" # Not "sheeps"endclass Order < ActiveRecord::Baseset_table_name "ord_rev99_x" # Wrap a legacy table...end
Jouy 发表于 2006-03-07 12:54 阅读( 1003) 评论( 0) 引用( 0) Ruby on Rails
渐渐习惯了看英文资料--整理了一些Agile web development中Active Record
What is ORM? ( Active Record) 阅读全文...
Jouy 发表于 2006-03-07 12:43 阅读( 1381) 评论( 0) 引用( 0) Ruby on Rails








