Skip to content

Instantly share code, notes, and snippets.

Dougal J. Sutherland dougalsutherland

Block or report user

Report or block dougalsutherland

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dougalsutherland
dougalsutherland / patch_biblatex.sty
Created Oct 12, 2017
Patch to workaround biblatex oddities with the natbib option in versions < 3.5
View patch_biblatex.sty
% biblatex authoryear with natbib does a million stray commas in versions < 3.5
% see: https://tex.stackexchange.com/q/312539/
% this works around it for versions 3.3 and 3.4
\ifthenelse{\equal{\abx@version}{3.4}}{%
\DeclareDelimFormat[cbx@textcite]{nameyeardelim}{\addspace}
}{\ifthenelse{\equal{\abx@version}{3.3}}{%
% Workaround following http://golatex.de/neue-biber-version-ploetzlich-komma-bei-zitierung-t17005.html
% (in German...), which changes \nameyeardelim / \nonameyeardelim to \addspace
% in the citation style's textcite macro.
% sigh....
View two-sample tests via set classification.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View two-sample tests via set classification.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View autoencoder_stuff.py
from __future__ import division
import json
import numpy as np
import keras
from keras.datasets import mnist
from keras import backend as K, layers as L
from keras.models import load_model, Model, model_from_config
View set_wallpaper.py
#!/usr/bin/python
'''
Script to set the OSX or Unity desktop background to the top picture from a
given subreddit.
NOTE: on OSX, sets it for the current space (on all monitors), but not other
spaces. There doesn't seem to be an AppKit API to change it for all spaces.
'''
from __future__ import division, print_function, unicode_literals
View gmail_hammer.py
#!/usr/bin/env python
from email.utils import parseaddr
import re
from imapclient import IMAPClient, SEEN
DEFAULT_SEARCH = "(from:*@*.gov OR from:*@*.edu OR from:*@*.mil OR from:*@tiaa-cref.mkl-et.com) AND NOT label:!!!unspam"
DEFAULT_RE = '(.*\.(gov|edu|mil)$)|(.*@tiaa-cref\.mkl-et\.com$)'
DEFAULT_TARGET_LABELS = '!!!unspam'
@dougalsutherland
dougalsutherland / fix_paths.sh
Last active Feb 13, 2016
Patch up Caffe's paths to avoid need for DYLD_FALLBACK_LIBRARY_PATH on OSX El Capitan, which doesn't really support it anymore
View fix_paths.sh
#!/bin/bash
CUDA_LIB_DIR=/usr/local/cuda/lib
CUDA_VERSION=7.5
CUDA_LIBS="cublas cudart curand"
CUDNN_LIB_DIR=/usr/local/cuda/cudnn-3/lib
CUDNN_VERSION=7.0
CUDNN_LIBS="cudnn"
View cosine basis linear classifier with normal noise.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Cosine, sine of normal distribution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sigmoid normal approximation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.