This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python -i | |
# -*-python-*- | |
def partitions(s): | |
"""return a list of all paritions of a string s into palindromes""" | |
def prependToAll(element, lists): | |
"""takes an element, and a list of lists, and returns a new list of lists with | |
the given element prepended to each one""" | |
return [[element] + lst for lst in lists] | |
memo = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro if-nonneg [a b] | |
"Eval the 1st arg, and if it's nonnegative, return it without evaling the 2nd arg. | |
If the 1st arg evals to negative, eval and return the value of the 2nd arg." | |
`(let [v# ~a] (if (>= v# 0) v# ~b))) | |
(defn inc-if-nonneg [x] | |
"Return a value that is 1 more than x if x is nonnegative; otherwise return x." | |
(if (>= x 0) (inc x) x)) | |
(defn find-needle-end [n h] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="http://multigraph.github.io/download/multigraph-min.js"></script> | |
</head> | |
<script type="text/javascript"> | |
window.multigraph.jQuery(document).ready(function() { | |
window.multigraph.jQuery('#graph').multigraph({ | |
mugl : 'naoi.xml' | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mugl> | |
<horizontalaxis type="datetime" min="20120920" max="20120927"/> | |
<verticalaxis min="0" max="100"/> | |
<data> | |
<variables> | |
<variable id="x" type="datetime"/> | |
<variable id="y"/> | |
</variables> | |
<service location="http://acis.multigraph.org/acisdata/13881-1/maxt/"/> | |
</data> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<mugl> | |
<data> | |
<values> | |
0, 3 | |
1, 2 | |
2, 4 | |
3, 5 | |
4, 3 | |
5, 6 |