This file contains 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
asf asfd | |
afs | |
d a | |
sf | |
asdf | |
asdf |
This file contains 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
import functools | |
def memoized(func): | |
""" | |
Decorator that caches the result of this INSTANCE METHOD call. Does not work for unbound methods. | |
Caches data in the attribute __memoized_cache__ | |
>>> class Foo(object): | |
... @memoized |
This file contains 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 'rubygems' | |
require 'dm-core' | |
require 'dm-migrations' | |
require 'dm-mysql-adapter' | |
require 'ffaker' | |
require 'benchmark' | |
logger = DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, 'mysql://dm:dm@localhost/dm_join_tables') |
This file contains 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 'dm-types' | |
require 'dm-validations' | |
module DataMapper | |
module Validations | |
class DeferredJsonValidator < GenericValidator | |
def initialize(field_name, pending_error_ivar_name, options={}) | |
super(field_name, options) | |
This file contains 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
Building openssl | |
/Users/ian/Coding/OpenSource/rubinius/bin/rbx-build extconf.rb | |
An exception occurred running extconf.rb | |
Error trying to compile /Users/ian/Coding/OpenSource/rubinius/lib/mkmf.rb (Rubinius::CompileError) | |
Backtrace: | |
Rubinius::Compiler.compiler_error at /Users/ian/Coding/OpenSource/rubinius | |
/runtime/19/compiler/compiler.rbc:11 | |
Rubinius::Compiler.compile at /Users/ian/Coding/OpenSource/rubinius | |
/runtime/19/compiler/compiler.rbc:63 |
This file contains 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.9.2-p180 :001 > Array(1) | |
=> [1] | |
ruby-1.9.2-p180 :002 > Array([1,2,3]) | |
=> [1, 2, 3] | |
ruby-1.9.2-p180 :003 > Array.new | |
=> [] |
This file contains 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
Ian: 2 beef tacos, 2 pork tacos, 1 POG | |
Erik: 2 beef tacos, 1 pork taco, 1 pork slider, 2 spam slider, 1 hawaiian punch | |
Total: | |
4 beef tacos | |
3 pork tacos | |
1 pork slider | |
2 spam slider | |
1 POG | |
1 hawaiian punch |
This file contains 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.9.2-p180 :001 > class Foo | |
ruby-1.9.2-p180 :002?> def (*args) | |
ruby-1.9.2-p180 :003?> args | |
ruby-1.9.2-p180 :004?> end | |
ruby-1.9.2-p180 :005?> end | |
=> nil | |
ruby-1.9.2-p180 :006 > Foo.new. | |
=> [] | |
ruby-1.9.2-p180 :007 > Foo.new. 'stuff', other: 'stuff' | |
=> ["stuff", {:other=>"stuff"}] |
This file contains 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
NevBook:rubinius ian$ cat deep.rb | |
def deep | |
deep | |
end | |
deep | |
NevBook:rubinius ian$ bin/rbx deep.rb | |
An exception occurred running deep.rb |
This file contains 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
activesupport (3.1.0.rc4) lib/active_support/whiny_nil.rb:48:in method_missing' | |
cancan (1.6.5) lib/cancan/controller_resource.rb:116:inmember_action?' | |
cancan (1.6.5) lib/cancan/controller_resource.rb:73:in load_instance?' | |
cancan (1.6.5) lib/cancan/controller_resource.rb:31:inload_resource' | |
cancan (1.6.5) lib/cancan/controller_resource.rb:10:in block in add_before_filter' | |
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:448:in_run2228024897145879193process_action166216410147247412callbacks' | |
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:386:in _run_process_action_callbacks' | |
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:81:inrun_callbacks' | |
actionpack (3.1.0.rc4) lib/abstract_controller/callbacks.rb:17:in process_action' | |
actionpack (3.1.0.rc4) lib/action_controller/metal/instrumentation.rb:30:inblock in process_action' |
OlderNewer