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
08:41:30,006 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Stats for Queue /queues/foo | |
08:41:30,006 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Paused: false | |
08:41:30,006 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Temporary: false | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Message Count: 0 | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Delivering Count: 0 | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Scheduled Count: 0 | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Messages Added Since Creation: 6 | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Consumer Count: 1 | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Expiry Address: jms.queue.ExpiryQueue | |
08:41:30,007 INFO [stdout] (JobScheduler$blah-knob.yml_Worker-2) Dead Letter Address: jms.queue.DLQ |
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
diff --git a/load.c b/load.c | |
index b070a120ac25cc07bcca478f8b584f885c593566..d53e06ef5e243ac5577756285997e051314248c8 100644 | |
--- a/load.c | |
+++ b/load.c | |
@@ -298,6 +298,23 @@ rb_f_require_imp(VALUE obj, SEL sel, VALUE fname) | |
return rb_f_require(obj, fname); | |
} | |
+VALUE | |
+rb_f_require_relative(VALUE obj, VALUE fname) |
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
# Compare the results running under Ruby 1.9.2 and Ruby 1.9.3 | |
class Foo | |
def initialize | |
@@value = "Set from Foo initialize" | |
end | |
def report | |
@@value | |
end | |
end |
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
# Both examples work under Ruby 1.9.2, but not under Ruby 1.9.3 (and yes, I | |
# realize both are bad practice anyway...): | |
# 1. | |
def test(foo, &block) | |
end | |
test 'hello', do; end | |
# 2. | |
class Foo; end |
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
l = ->(a = 'ichi', b = 'ni', c = 'san') { puts "#{a}, #{b}, #{c}" } | |
p l.arity # => -1 in JRuby, 0 in MRI...no good answer | |
def l.arity; 3; end # force to "3" so curry delays evaluation | |
c = l.curry | |
c.('one').('two').('three') # => one, two, three |
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
# following is a little benchmark looking a real world example of inserting a | |
# bunch of records into pg and mongo using a few methods available in ruby. | |
# | |
# the code inserst a value with a simple uniq contraint and then looks it up. | |
# | |
# this is not meant to be an apples to apples benchmark, rather it's trying to | |
# see how the various dbs might perform in a real world situation. i know | |
# mongo does not fsync to disk. i know it's not fair using a transaction with | |
# the rdbms, but these conditions will exist in real world usage and it's that | |
# which i'm interested in. |
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
framework 'AppKit' | |
class Download | |
attr_reader :response, :responseBody | |
def start(request) | |
puts "START!" | |
NSURLConnection.connectionWithRequest(request, delegate:self) | |
end |
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 <Carbon/Carbon.h> | |
#import <dlfcn.h> | |
/* | |
* Returns an array of CFDictionaryRef types, each of which contains information about one of the processes. | |
* The processes are ordered in front to back, i.e. in the same order they appear when typing command + tab, from left to right. | |
* See the ProcessInformationCopyDictionary function documentation for the keys used in the dictionaries. | |
* If something goes wrong, then this function returns NULL. | |
*/ | |
CFArrayRef CopyLaunchedApplicationsInFrontToBackOrder(void) |
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 'test/unit' | |
require 'rubygems' | |
require 'shoulda' | |
require 'factory_girl' | |
require 'dm-core' | |
require 'dm-validations' # Needed for save! | |
class User | |
NewerOlder