Skip to content

Instantly share code, notes, and snippets.

View maliabadi's full-sized avatar

Matt Aliabadi maliabadi

  • None
  • Seattle, WA
View GitHub Profile
include Math
class FrequencyDistribution
attr :samples, :data
def initialize samples=[]
@data = {}
samples.each(&method(:add))
end
@maliabadi
maliabadi / gist:5916fb8ab3ffdbc6ef58
Created September 17, 2014 02:46
solr_segment_file_parser.py
import bitstring
from sys import argv
class SegmentsFile(object):
def __init__(self, path):
self.stream = bitstring.ConstBitStream(filename=path)
def read_32(self):
return self.stream.read('uint:32')