A script to sum all the numbers on stdin (one per line): #!/usr/bin/env ruby puts STDIN.each_line.map(&:to_i).reduce(:+)
@nelhage @recursecenter I was thinking about dc but I couldn't see an obvious short answer...
-
-
@patrickc@recursecenter As I recall,@antifuchs came up with something truly awful involving conversion to unary and `wc -l`. -
@nelhage@patrickc@recursecenter@antifuchs well, there goes*my* evening - 9 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.