start new:
tmux
start new with session name:
tmux new -s myname
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
// Copyright James Daly 2014 | |
// Compile with: gcc farkle.c -std=c99 -o farkle | |
typedef struct Leader | |
{ | |
char name[16]; |
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X) | |
(if you aren't using version 9.1.5, change line 6 with the correct version) | |
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
2. mv /usr/local/var/postgres /usr/local/var/postgres91 | |
3. brew update | |
4. brew upgrade postgresql | |
5. initdb /usr/local/var/postgres -E utf8 | |
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres | |
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ |
[ | |
// Modified Sublime-REPL keybindings for an "R-friendly" set of shortcuts. | |
// Copy and paste this text into the Key Bindings - User (under Preferences menu). | |
// For more information, see http://tomschenkjr.net/2012/05/17/using-sublime-text-2-for-r/ | |
// Executes a selection of text in REPL, latter only displays code and does not execute | |
{ "keys": ["ctrl+shift+r"], "command": "repl_transfer_current", "args": {"scope": "selection"}}, | |
{ "keys": ["ctrl+shift+r", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}}, | |
// Executes the entire file (build) in REPL, latter only displays code and does not execute |
"""Chirp z-Transform. | |
As described in | |
Rabiner, L.R., R.W. Schafer and C.M. Rader. | |
The Chirp z-Transform Algorithm. | |
IEEE Transactions on Audio and Electroacoustics, AU-17(2):86--92, 1969 | |
""" | |
import numpy as np |
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_dir = '.' |
#!/usr/bin/env python | |
# Trivial GARCH implementation in python | |
# | |
# From Peter Tessin's http://www.petertessin.com/TimeSeries.pdf | |
# |
This script has been adapted from a post on LA Times
# standard compile options for the c++ executable | |
FLAGS = -fPIC | |
# the python interface through swig | |
PYTHONI = -I/usr/include/python2.6/ | |
PYTHONL = -Xlinker -export-dynamic | |
# default super-target | |
all: | |
g++ -fPIC -c kitty.cc -o kitty.o |