Skip to content

Instantly share code, notes, and snippets.

@cmaes
cmaes / index.html
Last active August 29, 2015 14:27
Chord layout
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 1em sans-serif;
}
.chord path {
fill-opacity: .67;
@cmaes
cmaes / Makefile
Last active August 29, 2015 14:26
capecod
GENERATED_FILES = \
capecod.json
all: $(GENERATED_FILES)
.PHONY: clean all
clean:
rm -rf -- $(GENERATED_FILES) build
@cmaes
cmaes / maes-ismp.pdf
Last active August 29, 2015 14:24
ISMP 2015 talk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cmaes
cmaes / index.html
Last active August 29, 2015 14:24
Yahoo Stock Data
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
</head>
<style>
body {
font: 10px sans-serif;
@cmaes
cmaes / README.md
Last active December 4, 2017 18:56
Great Circles and Loxodromes

Suppose you want to fly from Honolulu to JFK. What path should you take?

Navigators use something called a Great Circle, which is defined as the shortest path connecting two points on the surface of the Earth. The Great Circle connecting Honolulu and JFK is shown in blue above.

There is another path you can take called a loxodrome (or

@cmaes
cmaes / cubic_driver.m
Created October 7, 2011 07:40
Small cubic spline implementation in Matlab
function cubic_driver(num_points)
% cubic_driver(n) computes a cubic spline
% interpolant of the runge function
%
% f(x) = 1/(1+25*x^2)
%
% based on n linearly spaced
% points in the interval [-1,1]
runge = @(x) 1./(1+ 25*x.^2);
@cmaes
cmaes / find_elem_circuits.m
Created October 3, 2011 20:31
Find all the elementary circuits of a directed graph
function [numcycles,cycles] = find_elem_circuits(A)
if ~issparse(A)
A = sparse(A);
end
n = size(A,1);
Blist = cell(n,1);
@cmaes
cmaes / condense.m
Created September 27, 2011 00:18
Compute the condensed graph of A
function [B,compindex,ci]=condense(A)
% CONDENSE Construct the condensed graph of A
%
% [B,compindex,ci] = condense(A) returns the
% condensed graph of A.
%
% Example:
% A = zeros(5,5);
% A(1,2) = 1; A(2,3) = 1; A(3,4) = 1; A(4,2) = 1; A(4,5) = 1;
% [B,compindex] = condense(A)