View include.rb
1 2 3 4 5 6 7 8 9 10
module A
def hello
puts "Hello from A"
end
def goodbye
puts "Goodbye from A"
end
end
 
class B
View each_rescue.rb
1 2 3 4 5 6 7 8 9
class A
include Enumerable
def each
(1..10).each do |i|
raise RuntimeError.new("SIX") if i == 6
yield i
end
end
end
View marc-threadedreader.rb
1 2 3 4 5 6 7 8 9 10
require 'concurrent'
require 'thread'
require 'marc'
 
class MARC::ThreadedReader < MARC::Reader
include Enumerable
include Concurrent::Async
def initialize(file, options={})
super
View threaded_read.rb
1 2 3 4 5 6 7 8 9 10
require 'concurrent'
require 'thread'
require 'json'
require 'stringio'
require 'marc'
 
require 'benchmark'
 
# OK. Try to read in a line, and then have another thread transform it, and expose
# via #each.
View index.rb
1 2 3 4 5 6 7 8 9 10
require 'library_stdnums'
 
require 'traject/macros/marc21_semantics'
extend Traject::Macros::Marc21Semantics
 
require 'traject/macros/marc_format_classifier'
extend Traject::Macros::MarcFormats
 
require 'traject/solr_json_writer'
require 'traject/marc_reader'
View gist:7b8e60587e71c2009ced
1 2 3 4 5 6 7 8 9
require 'benchmark'
require 'benchmark/ips'
 
require 'marc'
require 'marc/fastxmlwriter'
 
record = MARC::Reader.new('test/one.dat').first
 
puts RUBY_DESCRIPTION
View results.txt
1 2 3 4 5 6 7 8 9 10
 
jruby 1.7.18 (1.9.3p551) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.8.0-b132 +jit [darwin-x86_64]
 
 
 
Rehearsal ------------------------------------------------
marc4j w/bin 19.640000 1.000000 20.640000 ( 8.313000)
ruby w/bin 22.470000 0.600000 23.070000 ( 14.930000)
 
marc4j w/xml 12.950000 1.130000 14.080000 ( 6.189000)
View blacklight_toy_index.rb
1 2 3 4 5 6 7 8 9 10
gem 'traject', '2.0.pre' # from the dev-2.0 branch
 
$:.unshift '.'
require 'library_stdnums'
 
require 'traject/macros/marc21_semantics'
extend Traject::Macros::Marc21Semantics
 
require 'traject/macros/marc_format_classifier'
extend Traject::Macros::MarcFormats
View gist:96d605b5dd5e75da9e22

Sorry you had to ask over and over again

I could make chicken schnitzel one night if you'd like; Nadav bitches about it, but the rest of us like it. The older boys will always fall back on pasta with pesto, and Shai would eat penne with parm grated over it every meal if we let him. Which we kinda do, now that I think about it. Pizza is always good, too, obviously.

The younger boys both eat the strawberry tube yogurt two at a time, which is why I asked for so many of those.

Stuff you should probably get at TJs

View gist:b2def26222d17f01e002
1 2 3 4 5 6 7 8 9 10
v.1
pt.1
pt.13
1973
1
v.2*
v. 1-2
v. 3
v.5 1968
v.2 1942-1945
Something went wrong with that request. Please try again.