Skip to content

Instantly share code, notes, and snippets.

@dgleich
dgleich / load_file.m
Created June 18, 2013 14:19
Command to call Matlab as a script
1
2
3
4
@dgleich
dgleich / minicards.tex
Created June 15, 2012 15:09
A latex file for SIAM mini-symposium hand-out cards
\documentclass[10pt]{article}
\usepackage{labels}
\usepackage{url}
\newcommand{\brk}{$\cdot$ }
%\LabelGridtrue % Enable this to
\LabelCols=2% Number of columns of labels per page
\LabelRows=6% Number of rows of labels per page
\begin{document}
\numberoflabels=12
@dgleich
dgleich / mexopts.bat
Created January 8, 2012 19:37
Mex opts file for mingw64 for C and C++
@echo off
rem MSSDK71OPTS.BAT
rem
rem Compile and link options used for building MEX-files
rem using the Microsoft Windows Software Development Kit.
rem
rem $Revision: 1.1.6.2 $ $Date: 2011/03/09 05:35:27 $
rem Copyright 2010 The MathWorks, Inc.
rem
rem StorageVersion: 1.0
@dgleich
dgleich / sidenotes-demo.tex
Created June 25, 2011 17:27
tufte sidenotes -- a tufte-latex ripoff
\documentclass{article}
\usepackage{booktabs}
\usepackage{geometry}
\usepackage{tabularx}
\geometry{lmargin=72pt,tmargin=72pt,textwidth=350pt,marginparwidth=144pt}
\usepackage{tufte-sidenotes}
\begin{document}
Here is demo of the \verb#tufte-sidenotes# style.
@dgleich
dgleich / exact_modularity.cc
Created May 26, 2011 19:29
A benchmark problem for enumeration of graph subsets
/**
* @file exact_modularity.cc
* Find the cluster of largest modularity in a small graph by exhaustive
* enumeration.
* @author David F. Gleich
*/
/**
* History
* -------
#if defined(_WIN32) || defined(_WIN64)
#pragma warning(disable:4996)
#include <random>
#define tr1ns std::tr1
#elif defined __GNUC__
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION < 40300
#include <tr1/random>
#!/usr/bin/env python
import sys
import array
import itertools
import random
def test(memsize):
print "allocating"
a = array.array('d')
#!/usr/bin/env python
"""
tweets.py
=========
Implement a cached tweet database with all the rate limiting
and message filting.
Usage
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Google Translate API code
Based on http://code.activestate.com/recipes/576890/ but heavily modified.
"""
__author__ = 'David F. Gleich'
__version__ = 1
# Two groups?
data[,3] <- as.factor(weekdays(data[,1]))
plot(data[,3],data[,2],main='Live Births by Day of Week')
png('dob-dayofweek.png',width=700)
plot(data[,3],data[,2],main='Live Births by Day of Week')
dev.off() # write it