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
from IPython import get_ipython | |
# Levels less than warn (info, debug, etc.) are surpressed in the console output. | |
get_ipython().kernel.log.warn("Hello, world!") |
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
import pandas as pd | |
import numpy as np | |
import re | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.basemap import Basemap | |
def load_grid(path): | |
f = open(path, 'r') | |
headers = None |
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
import xml.etree.ElementTree as ET | |
import csv | |
from collections import defaultdict | |
# Note that 1Password is quite particular about the kind of escaping you use. | |
# The default Excel dialect blows it up & there is in fact no Python dialect | |
# corresponding to 1Password's requirements due to http://bugs.python.org/issue12178 | |
output = csv.writer(open('keepass.csv', 'wb'), doublequote=False, escapechar='\\', quoting=csv.QUOTE_ALL) | |
dom = ET.parse('keepass.xml') |
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
import sys | |
import xml.etree.ElementTree as ET | |
import re, htmlentitydefs, textwrap | |
def wrap(text): | |
paragraphs = re.split('\n{2,}', text) | |
wrapped = [] | |
for para in paragraphs: | |
para = re.sub('\s{2,}', ' ', para).strip() | |
wrapped.append('\n'.join(textwrap.wrap(para, 80))) |
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
{"TRTOHH_LN": {"files": ["Activity File"], "note": "TRTOHH_LN is calculated using TUCC5. It does not include activities with TRTIER2P=0101, 0301, 0302, 0303, or with TRCODEP=180381. It does not include any activity or part of any activity in which no household child was awake (determined by TUCC2 and TUCC4).", "validEntries": {"0": "Min Value", "1440": "Max Value"}, "description": "Total time spent during activity providing secondary childcare for own household children < 13 (in minutes)"}, "TRELHH": {"files": ["EC Roster File"], "note": "Questions about eldercare were introduced in January 2011.", "validEntries": {"1": "Recipient is a household member", "0": "Recipient is not a household member"}, "description": "Eldercare recipient is a household member"}, "PELAYLK": {"files": ["ATUS-CPS File"], "note": null, "validEntries": {"1": "Yes", "2": "No"}, "description": "Edited: even though you are to be called back to work, have you been looking for work during the last 4 weeks?"}, "PTDTRACE": {"files": ["ATUS-C |
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
{"13,2,16": "Watching hockey", "13,2,17": "Watching martial arts ", "13,2,14": "Watching golfing", "13,2,15": "Watching gymnastics", "13,2,12": "Watching fishing", "13,2,13": "Watching football", "13,2,10": "Watching equestrian sports", "13,2,11": "Watching fencing", "15,2,2": "Collecting & delivering clothing & other goods", "15,2,3": "Providing care", "1,4": "Personal Activities", "15,2,1": "Food preparation, presentation, clean-up", "1,2": "Grooming", "1,3": "Health-related self care", "13,2,18": "Watching racquet sports", "13,2,19": "Watching rodeo competitions", "5,4,99": "Job search and Interviewing, n.e.c.*", "15": "Volunteer Activities ", "3,1,99": "Caring for & helping hh children, n.e.c.*", "2,4,99": "Exterior maintenance, repair & decoration, n.e.c.*", "16,99": "Telephone Calls, n.e.c.*", "2,2,3": "Kitchen and food clean-up", "2,2,2": "Food presentation", "9,2,2": "Waiting associated w/ home main/repair/d\u00e9cor/constr", "9,2,1": "Using home maint/repair/d\u00e9cor/construction svcs", "7,1,3": "P |
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
javascript:(function(){var a=document.createElement("script");a.src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js",document.getElementsByTagName("head")[0].appendChild(a)})(); |
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
from svmutil import * | |
from os import devnull | |
import itertools | |
# Hello there! | |
# You should read the commentary in seven_steps_to_OK_performance, although | |
# you won't have to implement anything other than the data transformation | |
# (as it's somewhat tedious to go through the LibSVM docs, and they provide | |
# a similar module -- easy.py -- that does substantially the same thing |
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
[{"rank":1,"name":"Bill Gates"},{"rank":2,"name":"Warren Buffett"},{"rank":3,"name":"Larry Ellison"},{"rank":4,"name":"Charles Koch"},{"rank":4,"name":"David Koch"},{"rank":6,"name":"Christy Walton & family"},{"rank":7,"name":"Jim Walton"},{"rank":8,"name":"Alice Walton"},{"rank":9,"name":"S. Robson Walton"},{"rank":10,"name":"Michael Bloomberg"},{"rank":11,"name":"Sheldon Adelson"},{"rank":12,"name":"Jeff Bezos"},{"rank":13,"name":"Larry Page"},{"rank":14,"name":"Sergey Brin"},{"rank":15,"name":"Forrest Mars, Jr."},{"rank":15,"name":"Jacqueline Mars"},{"rank":15,"name":"John Mars"},{"rank":18,"name":"Carl Icahn"},{"rank":19,"name":"George Soros"},{"rank":20,"name":"Mark Zuckerberg"},{"rank":21,"name":"Steve Ballmer"},{"rank":22,"name":"Len Blavatnik"},{"rank":23,"name":"Abigail Johnson"},{"rank":24,"name":"Phil Knight"},{"rank":25,"name":"Michael Dell"},{"rank":26,"name":"Paul Allen"},{"rank":27,"name":"Donald Bren"},{"rank":27,"name":"Ronald Perelman"},{"rank":29,"name":"Anne Cox Chambers"},{"rank":30,"name |
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
echo "Making README..." | |
touch README | |
wget http://ipecho.net/plain -qO - >> README | |
echo -e "\n" >> README | |
echo "Updating packages..." | |
apt-get update | |
apt-get upgrade | |
echo "Installing default packages..." |
NewerOlder