Skip to content

Instantly share code, notes, and snippets.

View cgranade's full-sized avatar

Cassandra Granade cgranade

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cgranade
cgranade / conf.py
Created March 21, 2016 06:24
Bug in IPython.sphinxext.ipython_directive.
# -*- coding: utf-8 -*-
#
# IPython Bug Report documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 21 17:17:53 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
@cgranade
cgranade / dnorm-known-cases-qu-matlab.ipynb
Created March 17, 2016 06:45
Known Cases for the Diamond Norm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cgranade
cgranade / Animations.ipynb
Last active January 16, 2016 04:37
Practical Bayesian Tomography: Supplementary Material
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cgranade
cgranade / gist:dc7bca3d990412b8543e
Created July 15, 2015 01:29
Defeating {revtex4-1} and @control with the power of unforgivable hacks.
\documentclass[aps,pra,twocolumn,superscriptaddress,nofootinbib]{revtex4-1}
%=============================================================================
% BEGIN UNFORGIVABLE HACKS
%=============================================================================
\makeatletter
\def\@bibdataout@aps{%
\immediate\write\@bibdataout{%
@CONTROL{%
apsrev41Control,author="08",editor="1",pages="0",title="0",year="1"%
(*Suppose that data is stored in a CSV-like format, with newline-delimted rows of comma-separated fields.*)
StringSplit[#, ","]& /@ StringSplit["a,b,c\nd,e,f", "\n"]
(*If certain fields are missing, then let's suppose this is represented by an empty string as the contents for that field.*)
StringSplit[#, ","]& /@ StringSplit["a,,c\nd,e,f", "\n"]
(*This is inconvienent, so let's write a function to parse that as the special values Missing[].*)
MarkMissingValues[dataStr_] := Map[
Function[row, StringSplit[row, ","]],
StringSplit[dataStr, "\n"]