Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Can your programming language do this?.
#!/usr/bin/ruby -Ku # encoding: utf-8 module Enumerable def sum inject { |acc, val| acc + val } end def Σ(&blk) map(&blk).sum end def entropy(&prob) - Σ { |i| prob[i] * Math.log(prob[i]) } end end