Skip to content

Instantly share code, notes, and snippets.

@deanmalmgren
deanmalmgren / hats.py
Created January 4, 2017 20:29
get datascope hat names
"""Export a json of the-hat-rack board and run this script to print out all of the names of the internal hats:
hats.py trello_export.json
"""
import sys
import json
from pprint import pprint
with open(sys.argv[1]) as stream:
data = json.loads(stream.read().decode("utf-8", "ignore"))
@deanmalmgren
deanmalmgren / matrix_data.dat
Created July 20, 2016 21:56
matrix that is failing for msp-boxes
This file has been truncated, but you can view the full file.
1.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.888888888888888840 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.888888888888888840 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.444444444444444420 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.888888888888888840 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.000000000000000000 0.00000000000000
@deanmalmgren
deanmalmgren / README.md
Last active February 23, 2016 14:59
random number generator

no idea if this will work or not.

@deanmalmgren
deanmalmgren / results.txt
Last active December 5, 2023 06:11
comparison of various ways to write a lots of irrational floats to disk in python
5 function calls in 6.465 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
1 6.461 6.461 6.465 6.465 similarity_profiling.py:20(print_approach)
1 0.004 0.004 0.004 0.004 {open}
1 0.000 0.000 0.000 0.000 {range}
1 0.000 0.000 6.465 6.465 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
@deanmalmgren
deanmalmgren / README.md
Last active March 28, 2022 19:45
example of how to export a png directly from an svg
@deanmalmgren
deanmalmgren / after.dat
Last active September 22, 2015 15:05
issue for msp-boxes?
1.0 0.022566380334 0.04 0.0245276407981 0.029769291226 0.0536675041929 0.0268831375565 0.0421124148346 0.0320871215252 0.0444774273755 0.0444774273755 0.0186396379746 0.0363831094317 0.029769291226 0.0105892274179 0.0348216114596 0.0134713615846 0.0194822293602 0.0320871215252 0.029769291226 0.0363831094317 0.0308824682094 0.0444774273755 0.0682274642961 0.021983276081 0.0277777777778 0.0421124148346 0.0444774273755 0.0238353731866 0.0171625207348 0.0381007372999 0.0320871215252 0.0209064363614 0.0363831094317 0.0320871215252 0.0381007372999 0.0231827458604 0.0471451211741 0.04 0.021983276081 0.0238353731866 0.029769291226 0.0209064363614 0.0260468863234 0.00918543875722 0.00721809760087 0.0348216114596 0.0252633672918 0.0138953290753 0.029769291226
0.022566380334 1.0 0.0252633672918 0.029769291226 0.0141178336851 0.0182460947032 0.0287373176349 0.0471451211741 0.0348216114596 0.0214307586872 0.0333953686704 0.0186396379746 0.0363831094317 0.0231827458604 0.0130732739486 0.0231827458604 0.0333953686704 0.0333
@deanmalmgren
deanmalmgren / README.md
Last active August 29, 2015 14:15
scialog pre-conference network

This is a quick visualization of the Scialog pre-conference network. Orange nodes are theorists, blue nodes are experimentalists, and yellow circles are both experimentalists and theorists. For simplicity, this only displays the bidirectional links between pairs of scientists where the thickness of the line joining two scientists corresponds with how strongly they know each other.

To run this in development, just use python's simple server:

python -m SimpleHTTPServer
@deanmalmgren
deanmalmgren / README.md
Last active August 29, 2015 14:11
elongated dice analysis
@deanmalmgren
deanmalmgren / README.md
Created September 9, 2014 13:56
statistical significance of number of CEOs hired internally

When I saw this on twitter, it really made me wonder whether the reported statistics had any significance. Based on the numbers reported, I wrote a quick little program to estimate the 95% confidence interval of the percent of CEOs hired internally. Alongside each regions name is the lower and upper cutoff on the 95% confidence interval.

[unix]$ python simulate.py
          USA/Canada	0.679	0.859
      Western Europe	0.625	0.854
               Japan	0.897	1.000
        Other mature	0.565	0.826
               China	0.710	0.968
Brazil, Russia, India	0.517	0.828
@deanmalmgren
deanmalmgren / .gitignore
Last active August 29, 2015 14:03
how often is A better than B?
sample_a.dat
sample_b.dat