ruby
Inosin_Wu
﹖不要企圖愛上哥哥無非是個傳説.........
﹖哥吥在江湖江湖却流傳着哥嘚傳說.........
展开
-
linux下用ruby访问SQL SERVER数据库
先安装 unixODBC wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.0.tar.gz ./configure make && make install 默认安装在 /usr/local/lib目录下 ini配置文件在 /usr/loca/etc 目录下 wget http://ibiblio.org/pub...2010-12-20 13:32:57 · 111 阅读 · 0 评论 -
Lighttpd下的Rack使用的一些注意
rack可以通过这种方式取得或修改参数: [code="java"]request = Rack::Request.new(env) params = request.params[/code] 但对于lighttpd+fcgi来说,只有post method有效,get无法通过此方式取得参数,如果时get请求,只能通过env["REQUEST_URI"]方式取得参数和修改参数 ...原创 2011-07-29 17:17:39 · 276 阅读 · 0 评论 -
Ruby中delegate的一些用法
[code="ruby"]Class Account < ActiveRecord::Base delegate :firstname, :to => :user # firstname => user.firstname delegate :firstname, :to => :user, :prefix => true # user_first...原创 2011-08-04 14:48:15 · 720 阅读 · 0 评论 -
Redis和Memcached在Ruby上的性能评测(1)——写入性能
因为memcached只支持String数据类型,所以本文只比较String,redis支持的其他数据类型不做评测,另外关闭了redis持久化特性!因为redis的持久化是另起后台任务进行,所以数据量小的时候不会对测试结果有明显影响。 测试环境: [quote]REDHAT6.0 x86_64 Ruby Enterprise Edition version 1.8.7-2010.02 ...2012-01-19 11:43:40 · 134 阅读 · 0 评论 -
Redis和Memcached在Ruby上的性能评测(2)——读取性能
上一篇我们测试了memcached和redis在ruby上的写入性能,这次我们来测试一下它们的单纯读取性能。 测试环境不变,代码只需要进行一点点修改 memcached测试代码: [code="ruby"] require 'rubygems' require 'memcached' @cache = Memcached.new('localhost:11211') 1000...2012-01-31 15:24:22 · 115 阅读 · 0 评论 -
Ruby的case语法
[code="ruby"] switch/case syntaxes (remember: Ruby uses "case" and "when" where others use "switch" and "case"): # Basically if/elsif/else (notice there's nothing # after the word "case"):原创 2012-08-08 11:02:13 · 296 阅读 · 0 评论 -
ruby1.9各补丁性能评测
ruby版本: ruby1.9.3-p327 ruby1.9.3-p327 + rvm补丁集合 ruby1.9.3-p327 + falcon.diff ruby1.9.3-p327 + falcon-gc.diff [url=https://github.com/wayneeseguin/rvm/tree/master/patches/ruby/1.9.3/p327/railsex...2012-12-04 10:05:06 · 166 阅读 · 0 评论