Skip to content

Instantly share code, notes, and snippets.

@TomAugspurger
TomAugspurger / -v output
Created January 18, 2012 18:02
brew gtk+
dhcpw267c55f8:~ tom$ brew install -v gtk+
==> Downloading http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.8.tar.bz2
File already downloaded in /Users/tom/Library/Caches/Homebrew
/usr/bin/tar xf /Users/tom/Library/Caches/Homebrew/gtk+-2.24.8.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gtk+/2.24.8 --disable-glibtest
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gtk+/2.24.8 --disable-glibtest
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
HOMEBREW_VERSION: 0.9.2
HEAD: 03744647cc9271abc8c2cb368702fc328ee9a0ec
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit arrandale
OS X: 10.7.4-x86_64
Xcode: 4.3.3
CLT: 1.0.0.9000000000.1.1249367152
GCC-4.0: N/A
GCC-4.2: build 5666
Toms-MacBook-Pro:~ tom$ brew --config
HOMEBREW_VERSION: 0.9.2
HEAD: 03744647cc9271abc8c2cb368702fc328ee9a0ec
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit arrandale
OS X: 10.7.4-x86_64
Xcode: 4.3.3
CLT: 1.0.0.9000000000.1.1249367152
GCC-4.0: N/A
@TomAugspurger
TomAugspurger / trade_presentation.ipynb
Created December 6, 2012 18:36
Trade Presentation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TomAugspurger
TomAugspurger / read_csv_test
Created December 14, 2012 15:07
read_csv and compression. First 10 lines.
'currency,post,flow,partner,geo\\time\t2011 \t2010 \t2009 \t2008 \t2007 \t2006 \t2005 \t2004 \n',
'MIO_EUR,200,CREDIT,ACP,AT\t268.000 \t190.000 \t195.000 \t221.000 \t176.000 \t143.000 \t112.000 \t49.000 \n',
'MIO_EUR,200,CREDIT,ACP,BE\t1719.000 \t1524.000 \t1335.000 \t1226.000 \t975.000 \t422.000 \t348.000 \t282.000 \n',
'MIO_EUR,200,CREDIT,ACP,BG\t20.800 \t15.630 \t5.338 \t8.436 \t11.249 \t5.624 \t3.988 \t3.686 \n',
'MIO_EUR,200,CREDIT,ACP,CY\t112.000 p\t100.060 \t40.900 \t35.440 \t22.320 \t20.220 \t22.450 \t62.628 \n',
'MIO_EUR,200,CREDIT,ACP,CZ\t40.426 \t31.435 \t22.831 \t25.142 \t19.235 \t5.791 \t12.810 \t2.844 \n',
'MIO_EUR,200,CREDIT,ACP,DE\t2943.000 \t2845.000 \t2489.000 \t2962.000 \t2759.000 \t2754.000 \t2168.000 \t1865.000 \n',
'MIO_EUR,200,CREDIT,ACP,DK\t947.709 \t960.348 \t774.489 \t992.355 \t955.762 \t944.752 \t816.715 \t915.738 \n',
'MIO_EUR,200,CREDIT,ACP,EA12\t: \t: \t: \t: \t: \t13868.604 \t11944.563 \t10195.702 \n',
'MIO_EUR,200,CREDIT,ACP,EA13\t: \t: \t: \t: \t17463.867 \t13879.280
@TomAugspurger
TomAugspurger / paper_repo.py
Last active December 11, 2015 11:48
Processing papers for entry into repo
import os
import re
import sys
import subprocess
import pathlib
class Parser(object):
def __init__(self, path,
@TomAugspurger
TomAugspurger / fetch_citations.py
Last active December 11, 2015 19:29
Fetching BibTeX files for a paper repository from ideas.repec.org. Doesn't have much in the way of error-checking or validation yet; that comes next
"""
Want to take a file and fetch the BibTeX info from ideas.
"""
import re
import sys
import requests
import pathlib
from bs4 import BeautifulSoup
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
@TomAugspurger
TomAugspurger / add_rec_bars.py
Created April 16, 2013 14:50
Adding recession bars to matplotlib axes.
import pandas as pd
def add_rec_bars(ax, dates=None):
if dates is None:
dates = pd.read_csv('/Users/tom/bin/rec_dates.csv',
parse_dates=['Peak', 'Trough'])
for row in dates.iterrows():
x = row[1]
y1, y2 = ax.get_ylim()
@TomAugspurger
TomAugspurger / date_parsers.py
Created May 9, 2013 17:57
Various date parsers for use with pandas' read_csv.
import datetime as dt
def year_month(x):
ym = (int(str(x)[:4]), int(str(x)[-2:]))
return dt.datetime(ym[0], ym[1], 1)
def year(x):
y = int(str(x)[:4])