This file contains 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
// Credit to @JogoShugh | |
// Sourced from https://github.com/JogoShugh/OpenEpi.com/blob/8c90dc075c6a9b8e2a8de8ff26d7cd0b1987762a/OpenEpi/Proportion/Proportion.js | |
function criticalValue(confLevel) { | |
// Returns z value for various levels of confidence and 1 degree | |
// of freedom. OEConfLevel must be expressed as | |
// a string with two digits, then two optional digits, without a % sign. | |
const critMap = { | |
.99999: 15.137, | |
.99: 6.635, |
This file contains 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
import pandas as pd | |
import requests | |
def datafold(data): | |
return [dict(zip(data["headers"], d)) for d in data["data"]] | |
def api_to_df(url): | |
req = requests.get(url) | |
data = datafold(req.json()) | |
df = pd.DataFrame(data) |
This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
margin: 0; | |
} | |
path { | |
fill: none; |
This file contains 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
<!doctype html> | |
<meta charset="utf-8"> | |
<!-- load D3js --> | |
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script type="text/javascript" src="http://gabelerner.github.io/canvg/rgbcolor.js"></script> | |
<script type="text/javascript" src="http://gabelerner.github.io/canvg/StackBlur.js"></script> | |
<script type="text/javascript" src="http://gabelerner.github.io/canvg/canvg.js"></script> |
This file contains 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
" Jonathan Speiser's vimrc file | |
" Based on Yosef Berman's vimrc file | |
:syntax on | |
:set number | |
:set nohlsearch | |
" indentation stuff | |
:set autoindent | |
:set expandtab | |
:set tabstop=4 |
This file contains 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
SELECT * from rais_yb y1, rais_yb y2 | |
WHERE y1.year + 1 = y2.year | |
AND y1.bra_id = y2.bra_id | |
AND y1.wage IS NOT NULL | |
AND y2.wage_growth IS NULL | |
AND y2.wage IS NOT NULL | |
AND (y1.wage != 0 OR (y1.wage = 0 AND y2.wage!=0)) | |
LIMIT 1 | |
SELECT * from rais_ybi y1, rais_ybi y2 |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Setup script for the tables package""" | |
import os | |
import re | |
import sys | |
import ctypes | |
import tempfile |
This file contains 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
sub to_roman_numeral { | |
my %roman = ( | |
1_000_000 => '(MBAR)', | |
900_000 => '(CBAR)(MBAR)', | |
500_000 => '(DBAR)', | |
400_000 => '(CBAR)(DBAR)', | |
100_000 => '(CBAR)', | |
90_000 => '(XBAR)(CBAR)', | |
50_000 => '(LBAR)', | |
40_000 => '(XBAR)(LBAR)', |
This file contains 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
class A(): | |
test = 'Everyone' | |
def __init__(self): | |
self.local = 'Just Me' | |
def __str__(self): | |
return self.test + " " + self.local | |
x = A() |
This file contains 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
import random | |
class A(object): | |
def __init__(self): | |
self.x = random.randint(0,100000) | |
def f(self): | |
return A() | |
def __str__(self): | |
return str(self.x) | |
a = A() |