I hereby claim:
- I am dvillega on github.
- I am dvillega (https://keybase.io/dvillega) on keybase.
- I have a public key whose fingerprint is 813C C62F 8B0F 9FCE C15C C555 110E 9C81 595C 23D6
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
ho |
# Helper class for statistics | |
# see: http://www.johndcook.com/blog/standard_deviation/ | |
class Stats: | |
""" Uses Welford's method to calculate stats. | |
Assumes positive values. | |
It's not thread safe | |
stats = Stats("ConnectionTimeStats") | |
stats.add(0.223) | |
stats.add(1.343) |
import time | |
# Simple Timer | |
class Timer: | |
def __init__(self): | |
self.reset() | |
def reset(self): | |
self._start = time.time() | |
def elapsed(self): # elapsed time in seconds (float) |