A bit of nothing.
A little more on Twitter.
Some code on GitHub.
A few photographs on Flickr.
Recent HD video on Vimeo.
Cool phone apps on Cloudvox.

# Parallel map
class Array
  def pmap
    threads = []
    0.upto(size - 1) do |n|
      threads « Thread.new do
        yield(at(n))
      end
    end
    threads.collect {|thread| thread.value}
  end
end
 
# Trade-off between resource consumption
# and speed of execution.
# Much faster in some scenarios,
# much slower in others.
 
# e.g.
def expensive_operation
  open(‘http://google.com’).read
end
# Expensive operation 50 times
# user system total real
# map 50x 0.3400 0.2100 0.5500 ( 17.334429)
# pmap 50x 0.3000 0.2500 0.5500 ( 1.200705)
view raw This Gist brought to you by GitHub.