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
| # i386-mingw32: RubyInstaller | |
| # x64-mswin64_100: Arton's NougakuDo (http://www.artonx.org/data/nougakudo/index.html) | |
| # x64-mingw32: Experimental 64bits RubyInstaller | |
| ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32] | |
| time elapsed: 10.772616 sec. | |
| time elapsed: 10.782617 sec. | |
| time elapsed: 10.796617 sec. | |
| time elapsed: 10.754615 sec. | |
| time elapsed: 10.824619 sec. |
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
| C:\Users\Luis\Projects\_sandbox\ruby-perf>ruby -v require_benchmark.rb | |
| ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32] | |
| user system total real | |
| 500 requires 0.078000 0.202000 0.280000 ( 0.283016) | |
| 1000 requires 0.187000 0.375000 0.562000 ( 0.575033) | |
| 1500 requires 0.265000 0.624000 0.889000 ( 0.900051) | |
| 2000 requires 0.515000 0.780000 1.295000 ( 1.292074) | |
| 2500 requires 0.686000 1.076000 1.762000 ( 1.773102) | |
| ruby 1.9.2p180 (2011-02-18) [i386-mingw32] |
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
| #!/usr/bin/env ruby | |
| # Daemons sets pwd to /, so we have to explicitly set RAILS_ROOT | |
| RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
| require 'rubygems' | |
| require 'apn' | |
| require 'apn/sender_daemon' | |
| APN::SenderDaemon.new(ARGV).daemonize |
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
| require 'tire' | |
| require 'active_support/core_ext/numeric' | |
| require 'active_support/core_ext/time/zones' | |
| # Tire.configure { logger STDERR, level: 'debug' } | |
| class Time; DATE_FORMATS.update lucene: "%Y-%m-%dT%H:%M"; end | |
| Tire.index 'venues' do |
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
| executables = {} | |
| total = 0 | |
| path_extensions = ENV["PATHEXT"].gsub(".", "").downcase.split(File::PATH_SEPARATOR) | |
| path = ENV["Path"] | |
| path.split(File::PATH_SEPARATOR).each do |value| | |
| dir = Pathname.new(value) | |
| if dir.exist? then | |
| filter = File.join(dir.realpath, "*.{" + path_extensions.join(",") + "}") | |
| Dir.glob(filter).each do |file| |
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
| module ValueObject | |
| def self.new(*attrs) | |
| klass = Class.new(Object) | |
| klass.send(:attr_reader, *attrs) | |
| klass.send(:define_method, :initialize) do |*args| | |
| raise ArgumentError, "wrong number of arguments (#{args.size} for #{attrs.size})" unless args.size == attrs.size | |
| attrs.each_with_index do |attr, idx| | |
| instance_variable_set("@#{attr}", args[idx]) |
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
| require "benchmark" | |
| TESTS = 10_000 | |
| puts "File.expand_path: #{TESTS} times." | |
| Benchmark.bmbm do |results| | |
| results.report("Ruby '':") { TESTS.times { File.expand_path('') } } | |
| results.report("Ruby '.':") { TESTS.times { File.expand_path('.') } } |
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
| require 'minitest/autorun' | |
| class Subject < Struct.new(:lol) | |
| def render_controls | |
| lol.button_to 'Vote' | |
| end | |
| end | |
| describe 'lolwot' do | |
| it "should generate a button" do |
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 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32] | |
| rails 3.1.1 | |
| C:\>rails new empty-187 -d sqlite3 | |
| C:\empty-187>timer ruby script\rails runner "puts $LOADED_FEATURES.size" | |
| 705 | |
| real 4.538 | |
| system 2.667 | |
| user 1.794 |
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
| diff --git a/samples/file_access.cpp b/samples/file_access.cpp | |
| new file mode 100644 | |
| index 0000000..1ea02e3 | |
| --- /dev/null | |
| +++ b/samples/file_access.cpp | |
| @@ -0,0 +1,108 @@ | |
| +#include <ios> | |
| +#include <iostream> | |
| +#include <ostream> | |
| +#include <iomanip> |