Gisting is an implementation of Google\'s MapReduce framework for processing and extracting useful information from very large data sets. At the time of this writing, the code is available for PREVIEW at http://github.com/mchung/gisting. I am currently working to release this framework for general usage.
34. class Book
def title()
“Ruby programming”
end
end
35. Operator Precedence
with Guy Decoux: a b c, d
[[:fcall, :a,
[:array,
[:fcall, :b,
[:array,
[:vcall, :c],
[:vcall, :d]]]]]]
ParseTree.new.parse_tree_for_string(“a b c, d”)
39. class Ruby2Java < SexpProcessor
def process_class(exp)
“public class #{exp.shift} #{next_token(exp, true)}”
end
def process_const(exp)
“extends #{exp.shift}”
end
....
end
40. public class JavaClass {
public static void main(String argv[]) {
return “Hello, Java”;
}
}
45. module Enumerable
def drmap(&block)
pool = Drmap::BeanstalkPool.new
jid = rand(100)
each_with_index do |element, idx|
pool.put_job(jid, block.to_ruby, element)
end
results = []
while results.size < length
results << pool.next_result(jid)
end
results
end
end
46. def process
loop do
begin
job_payload = next_job
fn = job_payload[:proc]
data = job_payload[:data]
result = eval(fn).call(data)
save(job_payload[:jid], result)
success!
rescue => e
fail!(e)
end
end
end
59. self.give(:thanks)
OpenRain
openrain.com
My Git Repo
github.com/mchung
Marc Chung
blog.marcchung.com
Ruby::AZ
rubyaz.org
60. Resources
Code Generation: The Safety Scissors Of Metaprogramming
mwrc2008.confreaks.com/03bowkett.html
Forbidden Fruit: A Taste of Ruby's Parse Tree
goruco2008.confreaks.com/03_wanstrath.html
Ruby2Ruby
seattlerb.rubyforge.org/ruby2ruby/
ParseTree
parsetree.rubyforge.org