This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/assets/application.css" for 127.0.0.1 at Tue Jan 17 15:26:06 +0800 2012 | |
Served asset /application.css - 200 OK (42ms) | |
[2012-01-17 15:26:06] ERROR NoMethodError: undefined method `each' for nil:NilClass | |
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rack-1.3.6/lib/rack/handler/webrick.rb:71:in `service' | |
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' | |
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' | |
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' | |
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:162:in `start' | |
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' | |
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:95:in `start' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
第一次在ruby客户端中途取消,第二次就华丽丽的down掉了 | |
248300/1548508 16% | |
Tue Nov 8 17:59:10 Invalid access at address: 0x2aabdf7dbe24 | |
Tue Nov 8 17:59:10 Got signal: 7 (Bus error). | |
Tue Nov 8 17:59:11 Backtrace: | |
0x8ad399 0x8ad970 0x3dc6a0eb10 0x7345f8 0x77b264 0x682625 0x6876e9 0x688b7f 0x689101 0x689370 0x688fed 0x689370 0x688fed 0x689370 0x688fed 0x689370 0x688fed 0x689370 0x688fed 0x689370 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new(ENV['MONGOID_HOST'], ENV['MONGOID_PORT'], :logger => Rails.logger).db(ENV['MONGOID_DATABASE']) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.justskins.com/forums/format-number-with-comma-37369.html | |
n.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.bjt.name/2011/06/beautiful-math-triangle-r/ | |
proc do |line| | |
(1..line).each do |num| | |
puts "#{' '*(line - num)}#{('1'*num).to_i**2}" | |
end | |
end.call((ARGV[0] || 36).to_i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
production: | |
listen: 0.0.0.0:9312 | |
address: 0.0.0.0 # 对应的安装了searchd(sphinx)的mysql服务器ip | |
port: 9312 # 对应的安装了searchd(sphinx)的mysql服务器端口 | |
bin_path: '/usr/local/bin' | |
searchd_file_path: '/data/sphinx/production' | |
query_log_file: '/data/sphinx/log/searchd.query.log' | |
searchd_log_file: '/data/sphinx/log/searchd.log' | |
exceptions: '/data/sphinx/log//exception.log' | |
enable_star: true # 支持通配符匹配 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml.feed(:xmlns => "http://www.w3.org/2005/Atom") { |feed| | |
feed.title("#{user.name}'s Private Notification Feed") | |
feed.link(:href => "http://#{account.subdomain}.domain.com/feeds/#{user.email_alias}.xml", :rel => "self") | |
feed.link(:href => "http://#{account.subdomain}.domain.com") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.read('number.txt').split("\n").select {|str| (str[4] == str[6]) && (str[8] == str[10]) }.reject {|str| str.match(/4/) }.map(&:strip) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nil.hello world | |
world | |
end | |
def method_rescue o | |
begin | |
nil.send(:hello) | |
rescue | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binary_search.rbc |