ChinaonRails | ChinaonRails are one of the very few China based web consultancies, who specialize in application development using RubyOnRails/Agile/Ajax.DHH合作的新书Rework,有人说读此书比MBA的创业课程更实用 ... 1 reply 
Published on 2010-3-10 16:50:12 by bd7lx

Published on 2010-3-10 16:50:12 by bd7lx
http://37signals.com/rework/

节选下载
http://s3.amazonaws.com/37assets/svn/Rework-by-Jason-Fried-and-David-Heinemeier-Hansson-Excerpts.pdf
里面充斥着颠覆传统商业运作的诳语:
会议是毒药,创业起步找个对头单挑,计划就是瞎猜
不太理解的还有
不用尽全力去竞争Underdo your competition(体现在产品功能上不必求大而全多而杂)

节选下载
http://s3.amazonaws.com/37assets/svn/Rework-by-Jason-Fried-and-David-Heinemeier-Hansson-Excerpts.pdf
里面充斥着颠覆传统商业运作的诳语:
会议是毒药,创业起步找个对头单挑,计划就是瞎猜
不太理解的还有
不用尽全力去竞争Underdo your competition(体现在产品功能上不必求大而全多而杂)
程序员上火怎么办Programmers: What To Do If You Get Fired ... 3 replies 
Published on 2010-3-10 10:33:05 by bd7lx

Published on 2010-3-10 10:33:05 by bd7lx
http://gilesbowkett.blogspot.com/2010/03/programmers-what-to-do-if-you-get-fired.html
不是靠喝汽水能解决的

主要探讨的还是声誉创造机会和财富
不是靠喝汽水能解决的

主要探讨的还是声誉创造机会和财富
gemsday 每周gem秀 ... no reply 
Published on 2010-3-8 8:38:44 by bd7lx

Published on 2010-3-8 8:38:44 by bd7lx
http://gemsday.org/
Share your favorite new RubyGems weekly. Tweet #gemsday and a list of gems on Wed!

Share your favorite new RubyGems weekly. Tweet #gemsday and a list of gems on Wed!

JRuby Startup Time Tips 启动提速贴士 ... no reply 
Published on 2010-3-2 9:08:12 by bd7lx

Published on 2010-3-2 9:08:12 by bd7lx
http://blog.headius.com/2010/03/jruby-startup-time-tips.html
说道选什么JVM
据说Oracle收了SUN后要把旗下两个JVM合成一个
下面的client backend需要留意

http://chinaonrails.com/topic/view/2934.html
说道选什么JVM
据说Oracle收了SUN后要把旗下两个JVM合成一个
下面的client backend需要留意
most JVM installs preferred the "client" backend, which meant JVM startup was about as fast as it could get. Unfortunately, many newer JVM releases on many operating systems are either defaulting to "server" or defaulting to a 64-bit JVM (which only has "server")

http://chinaonrails.com/topic/view/2934.html
New Relic 副总裁讲解 “应用性能指数”如何反映用户满意程度 ... no reply 
Published on 2010-2-25 17:16:25 by bd7lx

Published on 2010-2-25 17:16:25 by bd7lx
http://blog.newrelic.com/2010/02/17/new-relic-ceo-lew-cirne-discusses-how-apdex-reveals-user-frustration-with-your-web-experience/
作为Apdex联盟之一,New Relic在丰富监控新兴各种服务器和架构的服务线同时,不遗余力地推广其客户满意程度的测量理念
http://www.rubyinside.com/new-relic-rpm-officially-supports-rack-and-sinatra-finally-3014.html
Apdex联盟,一个由众多网络分析技术公司和测量工业组成的联盟组织,它们联合起来开发了“应用性能指数”即“Apdex”(Application Performance Index),用一句话来概括,Apdex是用户对应用性能满意度的量化值。它提供了一个统一的测量和报告用户体验的方法,第一次把最终用户的体验和应用性能联系在了一起。
http://hi.baidu.com/gimn/blog/item/cfcead3e37b4563571cf6cfb.html

不能说New Relic太张狂,只能怨FiveRuns死的太快
http://chinaonrails.com/topic/view/282.html
作为Apdex联盟之一,New Relic在丰富监控新兴各种服务器和架构的服务线同时,不遗余力地推广其客户满意程度的测量理念
http://www.rubyinside.com/new-relic-rpm-officially-supports-rack-and-sinatra-finally-3014.html
Apdex联盟,一个由众多网络分析技术公司和测量工业组成的联盟组织,它们联合起来开发了“应用性能指数”即“Apdex”(Application Performance Index),用一句话来概括,Apdex是用户对应用性能满意度的量化值。它提供了一个统一的测量和报告用户体验的方法,第一次把最终用户的体验和应用性能联系在了一起。
http://hi.baidu.com/gimn/blog/item/cfcead3e37b4563571cf6cfb.html

不能说New Relic太张狂,只能怨FiveRuns死的太快
http://chinaonrails.com/topic/view/282.html
iPad 托管主机服务?你舍得吗 ... no reply 
Published on 2010-2-25 9:06:51 by bd7lx

Published on 2010-2-25 9:06:51 by bd7lx
http://www.ipadcolo.net/
ipadcolo.net 这家公司提供的服务是:
host iPads to be used as web servers, mail servers, or whatever else you'd like.
其实就是负责帮你每天充电
他们早在mac mini刚刚出来的时候就提供过hosting的服务
其承诺网络速度不会有问题,又有当地3G后备
但ipad不支持多任务,如何遥控其服务停下来并重新启动呢?
有招:他们有一指功

ipadcolo.net 这家公司提供的服务是:

host iPads to be used as web servers, mail servers, or whatever else you'd like.
其实就是负责帮你每天充电
他们早在mac mini刚刚出来的时候就提供过hosting的服务
其承诺网络速度不会有问题,又有当地3G后备
但ipad不支持多任务,如何遥控其服务停下来并重新启动呢?
有招:他们有一指功

读Sybase Advantage Database Server 文件的Ruby-ADT Gem ... no reply 
Published on 2010-2-24 17:11:26 by bd7lx

Published on 2010-2-24 17:11:26 by bd7lx
http://chase.ratchetsoftware.com/2010/02/reading-advantage-database-server-files-adt-in-ruby/

http://github.com/chasemgray/Ruby-ADT
目前该ruby库只能读adt格式
有读foxpro的插件吗?
http://github.com/infused/dbf
DBF is a small fast Ruby library for reading dBase, xBase, Clipper and FoxPro database files
Advantage Database Server 是一款功能全面的高性能客户端/服务器数据管理系统,专为满足商业应用程序开发人员的需求而设计。Advantage 在 Sybase 数据库产品中是独一无二的,原因在于它同时提供了对基于 ISAM(Indexed Sequential Access Method,索引顺序访问方法)表的数据和基于 SQL 的数据的访问,从而为旧数据库应用程序提供了一条迈向现代技术的发展之路。
优点
可通过本机关系 SQL 或直接的数据库导航命令进行灵活的数据访问。
数据访问经过优化,适用于所有开发环境,包括 Delphi、Visual Studio、Visual Objects、Visual Basic 等。
零管理,易于安装和控制 — 无需数据库管理员,从而消除了高昂的管理成本。
完整的参照完整性支持,包括主键/外键定义和级联的更新及删除。
基于服务器的完整的事务处理可避免数据库损坏,因此将大幅减少支持成本。
数据库安全性和加密支持。
一组源代码适用于本地、对等以及客户端/服务器环境 — 全面的可伸缩性。
优点
可通过本机关系 SQL 或直接的数据库导航命令进行灵活的数据访问。
数据访问经过优化,适用于所有开发环境,包括 Delphi、Visual Studio、Visual Objects、Visual Basic 等。
零管理,易于安装和控制 — 无需数据库管理员,从而消除了高昂的管理成本。
完整的参照完整性支持,包括主键/外键定义和级联的更新及删除。
基于服务器的完整的事务处理可避免数据库损坏,因此将大幅减少支持成本。
数据库安全性和加密支持。
一组源代码适用于本地、对等以及客户端/服务器环境 — 全面的可伸缩性。

http://github.com/chasemgray/Ruby-ADT
目前该ruby库只能读adt格式
require 'adt'
table = ADT::Table.new("test.adt")
table.each do |record|
puts record.name
puts record.email
end
table = ADT::Table.new("test.adt")
table.each do |record|
puts record.name
puts record.email
end
有读foxpro的插件吗?
http://github.com/infused/dbf
DBF is a small fast Ruby library for reading dBase, xBase, Clipper and FoxPro database files
jruby能运行rails3吗?最新版本肯定行 ... no reply 
Published on 2010-2-24 16:42:19 by bd7lx

Published on 2010-2-24 16:42:19 by bd7lx
http://blog.nicksieger.com/articles/2010/02/24/jruby-and-rails-3-sitting-in-a-tree

activerecord-jdbc-adapter 0.9.3 Released 支持rails3而来

activerecord-jdbc-adapter 0.9.3 Released 支持rails3而来
jQuery Simple Multi-Select 点点即多选 ... no reply 
Published on 2010-2-24 10:55:19 by bd7lx

Published on 2010-2-24 10:55:19 by bd7lx
rake和ant共建 ... no reply 
Published on 2010-2-23 13:46:30 by bd7lx

Published on 2010-2-23 13:46:30 by bd7lx
沾上了想甩了就没那么容易,现实地折中是个不错的策略
http://www.engineyard.com/blog/2010/rake-and-ant-together-a-pick-it-n-stick-it-approach/
集成rake和ant 场景
JRuby’s Rake and Ant integration handles the following use cases:
Call any ant task or type from within Rake
Allow Rake to be invoked from within Ant
Allow Rake tasks to be imported as callable Ant targets
Allow Ant to be invoked from Rake
Allow Ant targets to be called as Rake tasks from within Rake

http://www.engineyard.com/blog/2010/rake-and-ant-together-a-pick-it-n-stick-it-approach/
集成rake和ant 场景
JRuby’s Rake and Ant integration handles the following use cases:
Call any ant task or type from within Rake
Allow Rake to be invoked from within Ant
Allow Rake tasks to be imported as callable Ant targets
Allow Ant to be invoked from Rake
Allow Ant targets to be called as Rake tasks from within Rake

Rails 3 Upgrade Handbook 美刀12 ... no reply 
Published on 2010-2-23 12:37:18 by bd7lx

Published on 2010-2-23 12:37:18 by bd7lx
http://www.railsupgradehandbook.com/
趁rails3刚出锅,赚快钱

还有新书
the Live Edition will include the Rails 3.x versions
http://broadcast.oreilly.com/2010/02/a-live-edition-for-learning-ra.html

作者在其博客omgbloglol 上传播rails3新知,声名鹊起
趁rails3刚出锅,赚快钱

还有新书
the Live Edition will include the Rails 3.x versions
http://broadcast.oreilly.com/2010/02/a-live-edition-for-learning-ra.html

作者在其博客omgbloglol 上传播rails3新知,声名鹊起
阶乘有不止一种写法,利用ruby的特性,奥妙各不相同 ... no reply 
Published on 2010-2-17 16:07:52 by bd7lx

Published on 2010-2-17 16:07:52 by bd7lx
http://gist.github.com/295352
有多少种写法,还能怎么写
有多少种写法,还能怎么写
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)
# Discovered #upto
def factorial(x)
factorial = 1
1.upto(x) do |i|
factorial *= i
end
factorial
end
puts factorial(6)
puts factorial(0)
# Discovered Enumerators
def factorial(x)
x.downto(1).inject(1) { |m, i| m * i }
end
puts factorial(6)
puts factorial(0)
# Discovered Range+Inject
def factorial(x)
(1..x).inject(1) { |m, i| m * i }
end
puts factorial(6)
puts factorial(0)
# Embraced 1.8.7/1.9
def factorial(x)
(1..x).inject(:*) || 1
end
puts factorial(6)
puts factorial(0)
# Discovered Ternary Operators
def fac(x); x == 0 ? 1 : x * fac(x - 1);end
puts fac(6)
puts fac(0)
# Discovered Operator Precedence
def factorial(x)
i = 1 and (i *= x and x -= 1 while x > 0) or i
end
puts factorial(6)
puts factorial(0)
# Discovered Rails
class Numeric
def fact
(1..self).inject(:*) || 1
end
end
puts 6.fact
puts 0.fact
# Discovered Camping
def F(x)((1..x).inject(:*)||1)end;p(F(6));p(F(0))
# Discovered Magic
module Math
extend self
def method_missing(method, *args)
if method.to_s =~ /^fact(orial)?/
class_eval <<-EOS
def #{method}(x)
(1..x).inject(:*) || 1
end
EOS
send(method, *args)
else
super
end
end
end
puts Math.fact(6)
puts Math.fact(0)
# Discovered Hash Magic
FACTORIALS = Hash.new { |h, k| h[k] = (1..k).inject(:*) || 1 }
puts FACTORIALS[6]
puts FACTORIALS[0]
# Attends Seattle.rb
require 'rubygems'
require 'inline'
class Factorial
class << self
inline do |builder|
builder.c %q{
long factorial(int value) {
long result = 1, i = 1;
for (i = 1; i <= value; i++) {
result *= i;
}
return result;
}
}
end
end
end
puts Factorial.factorial(6)
puts Factorial.factorial(0)
# Premature Optimizer + eval
class << self; class_eval "def factorial(x); case x; #{(0..100).map{|i|"when #{i} then #{(1..i).inject(:*) || 1};"}}; else (1..x).inject(:*) || 1 end end" end
puts factorial(6)
puts factorial(0)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)
# Discovered #upto
def factorial(x)
factorial = 1
1.upto(x) do |i|
factorial *= i
end
factorial
end
puts factorial(6)
puts factorial(0)
# Discovered Enumerators
def factorial(x)
x.downto(1).inject(1) { |m, i| m * i }
end
puts factorial(6)
puts factorial(0)
# Discovered Range+Inject
def factorial(x)
(1..x).inject(1) { |m, i| m * i }
end
puts factorial(6)
puts factorial(0)
# Embraced 1.8.7/1.9
def factorial(x)
(1..x).inject(:*) || 1
end
puts factorial(6)
puts factorial(0)
# Discovered Ternary Operators
def fac(x); x == 0 ? 1 : x * fac(x - 1);end
puts fac(6)
puts fac(0)
# Discovered Operator Precedence
def factorial(x)
i = 1 and (i *= x and x -= 1 while x > 0) or i
end
puts factorial(6)
puts factorial(0)
# Discovered Rails
class Numeric
def fact
(1..self).inject(:*) || 1
end
end
puts 6.fact
puts 0.fact
# Discovered Camping
def F(x)((1..x).inject(:*)||1)end;p(F(6));p(F(0))
# Discovered Magic
module Math
extend self
def method_missing(method, *args)
if method.to_s =~ /^fact(orial)?/
class_eval <<-EOS
def #{method}(x)
(1..x).inject(:*) || 1
end
EOS
send(method, *args)
else
super
end
end
end
puts Math.fact(6)
puts Math.fact(0)
# Discovered Hash Magic
FACTORIALS = Hash.new { |h, k| h[k] = (1..k).inject(:*) || 1 }
puts FACTORIALS[6]
puts FACTORIALS[0]
# Attends Seattle.rb
require 'rubygems'
require 'inline'
class Factorial
class << self
inline do |builder|
builder.c %q{
long factorial(int value) {
long result = 1, i = 1;
for (i = 1; i <= value; i++) {
result *= i;
}
return result;
}
}
end
end
end
puts Factorial.factorial(6)
puts Factorial.factorial(0)
# Premature Optimizer + eval
class << self; class_eval "def factorial(x); case x; #{(0..100).map{|i|"when #{i} then #{(1..i).inject(:*) || 1};"}}; else (1..x).inject(:*) || 1 end end" end
puts factorial(6)
puts factorial(0)
1.8.7的枚举技巧 待一小会儿take_while 和 drop_while过了一小会儿 ... no reply 
Published on 2010-2-17 11:55:11 by bd7lx

Published on 2010-2-17 11:55:11 by bd7lx
http://www.aimred.com/news/developers/2010/02/14/neat_ruby_tricks_take_while_and_drop_while/
[ 1, 2, 5, 4, 3 ].take_while{ |num| num < 5 }
=> [1, 2]
[ 1, 2, 5, 4, 3 ].drop_while{ |num| num < 5 }
=> [5, 4, 3]

http://chinaonrails.com/topic/view/2032.html
http://www.globalnerdy.com/2008/08/01/enumerating-enumerable-enumerableeach_with_index/
[ 1, 2, 5, 4, 3 ].take_while{ |num| num < 5 }
=> [1, 2]
[ 1, 2, 5, 4, 3 ].drop_while{ |num| num < 5 }
=> [5, 4, 3]

http://chinaonrails.com/topic/view/2032.html
http://www.globalnerdy.com/2008/08/01/enumerating-enumerable-enumerableeach_with_index/
超级模特supermodel:与AR相配的内存数据库 ... no reply 
Published on 2010-2-17 10:27:39 by bd7lx

Published on 2010-2-17 10:27:39 by bd7lx
http://github.com/maccman/supermodel
如果你还记得曾经提到过的桌面开发-绳结Bowline
http://chinaonrails.com/topic/view/3209.html
Simple in-memory database using ActiveModel.
Primarily developed for Bowline applications.
http://github.com/maccman/bowline

当内存数据库来用的ruby库,sequel可能会有点心不甘
http://chinaonrails.com/topic/view/1691.html
如果你还记得曾经提到过的桌面开发-绳结Bowline
http://chinaonrails.com/topic/view/3209.html
Simple in-memory database using ActiveModel.
Primarily developed for Bowline applications.
http://github.com/maccman/bowline

当内存数据库来用的ruby库,sequel可能会有点心不甘
http://chinaonrails.com/topic/view/1691.html
海港harbor: 新框架招商 ... no reply 
Published on 2010-2-16 10:17:16 by bd7lx

Published on 2010-2-16 10:17:16 by bd7lx
http://wiecklabs.com/
git clone git://github.com/wiecklabs/harbor
git checkout -b 0.18.4 0.18.4
rake install
Harbor 是Ruby 做的新框架来拯救开发人员的负担
海港里面有港口
利用港口 ports 现成的应用,重组配置集成多个应用,就获得成为自己的码头
现在已经有开发出来的港口有
http://wiecklabs.com/marketplace

git clone git://github.com/wiecklabs/harbor
git checkout -b 0.18.4 0.18.4
rake install
Harbor 是Ruby 做的新框架来拯救开发人员的负担
海港里面有港口
利用港口 ports 现成的应用,重组配置集成多个应用,就获得成为自己的码头
现在已经有开发出来的港口有
http://wiecklabs.com/marketplace

Buzzr: 让谷歌嗡嗡叫 ... no reply 
Published on 2010-2-12 8:28:02 by bd7lx

Published on 2010-2-12 8:28:02 by bd7lx
Buzzr: Google Buzz Library For Ruby
http://github.com/conorh/buzzr
A simple wrapper to help retrieve and parse the Google Buzz Atom Feed.
安装
gem install buzzr
Buzzr is hosted on the Gemcutter repository. 依赖 RAtom library - http://github.com/seangeo/ratom
Google Buzz发布会上着重介绍的功能之一就是所谓的“自动跟随”系统,Buzz会自动将你经常写信或聊天的人加入好友列表里,这对一些人来说可能会是不合的导火索。

http://chinaonrails.com/topic/view/3012.html
也可以一键关停,不让它吱啦哇嘞叫

http://github.com/conorh/buzzr
A simple wrapper to help retrieve and parse the Google Buzz Atom Feed.
安装
gem install buzzr
Buzzr is hosted on the Gemcutter repository. 依赖 RAtom library - http://github.com/seangeo/ratom
Google Buzz发布会上着重介绍的功能之一就是所谓的“自动跟随”系统,Buzz会自动将你经常写信或聊天的人加入好友列表里,这对一些人来说可能会是不合的导火索。

http://chinaonrails.com/topic/view/3012.html
也可以一键关停,不让它吱啦哇嘞叫

rake db:size 获得数据库及表的大小 ... no reply 
Published on 2010-2-9 14:06:04 by bd7lx

Published on 2010-2-9 14:06:04 by bd7lx
使用在mysql和postgresql
http://gist.github.com/296719
http://gist.github.com/296719
# Run rake db:size to get a print of your database size in bytes.
# Run rake db:tables:size to get the sizes for individual tables
# Works for MySQL and PostgreSQL. Not tested elsewhere.
namespace :db do
desc 'Print data size for entire database'
task :size => :environment do
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
adapter = ActiveRecord::Base.connection.adapter_name.downcase
case adapter
when "mysql"
sql = "select FORMAT(SUM(data_length + index_length), 0) as bytes from information_schema.TABLES where table_schema = '#{database_name}'"
puts ActiveRecord::Base.connection.execute(sql).fetch_hash.values.first
when "postgres", "postgresql"
sql = "SELECT pg_size_pretty(pg_database_size('#{database_name}'));"
puts ActiveRecord::Base.connection.execute(sql)[0]["pg_size_pretty"]
when "oracle", "oci"
sql = "select a.data_size+b.temp_size+c.redo_size+d.controlfile_size from ( select sum(bytes) data_size from dba_data_files) a, ( select nvl(sum(bytes),0) temp_size from dba_temp_files ) b, ( select sum(bytes) redo_size from sys.v_$log ) c, ( select sum(BLOCK_SIZE*FILE_SIZE_BLKS) controlfile_size from v$controlfile) d;"
puts ActiveRecord::Base.connection.execute(sql).fetch_hash.values.first
else
raise "#{adapter} is not supported"
end
end
namespace :tables do
desc 'Print data size for all tables'
task :size => :environment do
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
adapter = ActiveRecord::Base.connection.adapter_name.downcase
case adapter
when "mysql"
sql = "select TABLE_NAME, FORMAT((data_length + index_length), 0) as bytes from information_schema.TABLES where table_schema = '#{database_name}' ORDER BY (data_length + index_length) DESC"
result = ActiveRecord::Base.connection.execute(sql)
while (row = result.fetch_hash) do
puts "#{row['TABLE_NAME']} #{row['bytes']}"
end
when "postgres", "postgresql"
sql = "SELECT tablename FROM pg_tables WHERE schemaname = 'public' ORDER BY tablename;"
tables = ActiveRecord::Base.connection.execute(sql)
tables.each do |table|
name = table['tablename']
sql = "SELECT pg_size_pretty(pg_total_relation_size('#{name}'));"
res = ActiveRecord::Base.connection.execute(sql)
puts "#{name} #{res[0]['pg_size_pretty']}"
end
else
raise "#{adapter} is not supported"
end
end
end
end
# Run rake db:tables:size to get the sizes for individual tables
# Works for MySQL and PostgreSQL. Not tested elsewhere.
namespace :db do
desc 'Print data size for entire database'
task :size => :environment do
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
adapter = ActiveRecord::Base.connection.adapter_name.downcase
case adapter
when "mysql"
sql = "select FORMAT(SUM(data_length + index_length), 0) as bytes from information_schema.TABLES where table_schema = '#{database_name}'"
puts ActiveRecord::Base.connection.execute(sql).fetch_hash.values.first
when "postgres", "postgresql"
sql = "SELECT pg_size_pretty(pg_database_size('#{database_name}'));"
puts ActiveRecord::Base.connection.execute(sql)[0]["pg_size_pretty"]
when "oracle", "oci"
sql = "select a.data_size+b.temp_size+c.redo_size+d.controlfile_size from ( select sum(bytes) data_size from dba_data_files) a, ( select nvl(sum(bytes),0) temp_size from dba_temp_files ) b, ( select sum(bytes) redo_size from sys.v_$log ) c, ( select sum(BLOCK_SIZE*FILE_SIZE_BLKS) controlfile_size from v$controlfile) d;"
puts ActiveRecord::Base.connection.execute(sql).fetch_hash.values.first
else
raise "#{adapter} is not supported"
end
end
namespace :tables do
desc 'Print data size for all tables'
task :size => :environment do
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
adapter = ActiveRecord::Base.connection.adapter_name.downcase
case adapter
when "mysql"
sql = "select TABLE_NAME, FORMAT((data_length + index_length), 0) as bytes from information_schema.TABLES where table_schema = '#{database_name}' ORDER BY (data_length + index_length) DESC"
result = ActiveRecord::Base.connection.execute(sql)
while (row = result.fetch_hash) do
puts "#{row['TABLE_NAME']} #{row['bytes']}"
end
when "postgres", "postgresql"
sql = "SELECT tablename FROM pg_tables WHERE schemaname = 'public' ORDER BY tablename;"
tables = ActiveRecord::Base.connection.execute(sql)
tables.each do |table|
name = table['tablename']
sql = "SELECT pg_size_pretty(pg_total_relation_size('#{name}'));"
res = ActiveRecord::Base.connection.execute(sql)
puts "#{name} #{res[0]['pg_size_pretty']}"
end
else
raise "#{adapter} is not supported"
end
end
end
end
rails server之后发生了什么? rails3代码启动过程代码分析 ... no reply 
Published on 2010-2-9 13:40:24 by bd7lx

Published on 2010-2-9 13:40:24 by bd7lx
http://ryanbigg.com/guides/initialization.html
目前很多网站的头header上都打着导游guides的旗号
The Rails Initialization Process
This guide explains how the initialization process in Rails works as of Rails 3.
rails改变了命令行的习惯,对windows的用户不友好,没有顾忌他们的感受
Using rails server
Using Passenger

目前很多网站的头header上都打着导游guides的旗号
The Rails Initialization Process
This guide explains how the initialization process in Rails works as of Rails 3.
rails改变了命令行的习惯,对windows的用户不友好,没有顾忌他们的感受
Using rails server
Using Passenger

DCI架构 重新思考对象导向编程的根基 颠覆之 ... no reply 
Published on 2010-2-9 9:56:57 by bd7lx

Published on 2010-2-9 9:56:57 by bd7lx
http://architects.dzone.com/videos/dci-architecture-trygve
Trygve Reenskaug, 发明 DCI (Data, Collaborations, and Interactions)在09瑞典开发会议上演讲视频
http://www.jdon.com/jivejdon/thread/37976

Trygve Reenskaug, 发明 DCI (Data, Collaborations, and Interactions)在09瑞典开发会议上演讲视频
DCI是数据Data 场景Context 交互Interactions的简称,DCI是一种特别关注行为的模式(可以对应GoF行为模式),而MVC模式是一种结构性模式,MVC模式由于结构化,而可能忽视了行为事件。
http://www.artima.com/articles/dci_vision.htmlhttp://www.jdon.com/jivejdon/thread/37976

D’Note 开发者的 便捷注释工具 ... no reply 
Published on 2010-2-8 14:51:45 by bd7lx

Published on 2010-2-8 14:51:45 by bd7lx
http://wiki.github.com/proutils/dnote/
编程的代码注释中 TODO: and FIXME: 便签标注多了就很难看仔细
D’Note 扫描代码找标注,合理组织起来,格式美观易读
安装
$ sudo gem install dnote
$ cd myproject
输出成养眼的格式
$ dnote --html --output log/dnote/index.html lib/**/*.rb
$ xdg-open log/dnote/index.html

如何写note的规格
http://proutils.github.com/dnote/
http://chinaonrails.com/topic/view/1689.html
编程的代码注释中 TODO: and FIXME: 便签标注多了就很难看仔细
D’Note 扫描代码找标注,合理组织起来,格式美观易读
安装
$ sudo gem install dnote
$ cd myproject
输出成养眼的格式
$ dnote --html --output log/dnote/index.html lib/**/*.rb
$ xdg-open log/dnote/index.html

如何写note的规格
http://proutils.github.com/dnote/
http://chinaonrails.com/topic/view/1689.html
20 items








bd7lx
