This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "rspec" | |
end | |
require "rspec/autorun" | |
RSpec.describe "inline Bundler and autorun RSpec" do | |
it "is convenient for self-contained examples & bug repros" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Easily calculate mean and standard distribution of a distribution without | |
# collecting all values in memory | |
# | |
class Distribution | |
def initialize | |
@n, @sum_x, @sum_x_2 = 0, 0, 0 | |
@min, @max = nil, nil | |
end | |
def <<(x) |