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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
import numpy as np | |
from math import pi, log | |
import pylab | |
from scipy import fft, ifft | |
from scipy.optimize import curve_fit | |
i = 10000 | |
x = np.linspace(0, 3.5 * pi, i) | |
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 * | |
np.random.randn(i)) |
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
Fri Mar 2 11:04:59 2012 | |
panic(cpu 0 caller 0xffffff7f80a87907): NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xc0000000 0xffffff8115c2d000 0x0a5480a2, D0, P3/4 | |
Backtrace (CPU 0), Frame : Return Address | |
0xffffff811560ae70 : 0xffffff8000220702 | |
0xffffff811560aef0 : 0xffffff7f80a87907 | |
0xffffff811560af80 : 0xffffff7f80b77a64 | |
0xffffff811560afd0 : 0xffffff7f80b77b24 | |
0xffffff811560b030 : 0xffffff7f80e24749 | |
0xffffff811560b170 : 0xffffff7f80b96bad | |
0xffffff811560b1a0 : 0xffffff7f80a91282 |
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
/* | |
* file-based loggers, because logging to a GUI window is no good when SuperCollide does its segfault thing. | |
*/ | |
NullLogger { | |
/* this parent class provdes a black hole logger so that you can stop | |
logging without changing code. */ | |
formatMsg {|msgs| | |
var stampedMsgs = msgs; | |
//A nil in the first msg argument will be replaced by a datestamp | |
msgs[0].isNil.if({ |
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
information and Phase Transitions in Socio-Economic Systems | |
Terry Bossomaier, Dan Mackinlay, Lionel Barnett... | |
\section{Introduction} | |
\label{sec:intro} | |
Diamonds are not a good very long term investment! They are steadily turning into graphite. It will take millions of years, but the most stable form of carbon at room temperature and pressure is graphite. Thus diamonds will undergo a phase transition to graphite, albeit over a very long timescale. | |
When we normally think of phase transitions we think of the states of matter, ice melting to water or water turning to steam. They are order/disorder transitions. In graphite the carbon atoms are linked together in layers. The layers can slide over one another giving graphite its excellent lubricant properties. In diamond the carbon atoms are linked together in a three dimensional structure with each carbon at the centre of a tetrahedron linked to carbons at all four corners. Thus carbon has to go through a major structural reorganization to change from diamond t |
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
information and Phase Transitions in Socio-Economic Systems | |
Terry Bossomaier, Dan Mackinlay, Lionel Barnett... | |
\section{Introduction} | |
\label{sec:intro} | |
Diamonds are not a good very long term investment! They are steadily turning into graphite. It will take millions of years, but the most stable form of carbon at room temperature and pressure is graphite. Thus diamonds will undergo a phase transition to graphite, albeit over a very long timescale. | |
When we normally think of phase transitions we think of the states of matter, ice melting to water or water turning to steam. They are order/disorder transitions. In graphite the carbon atoms are linked together in layers. The layers can slide over one another giving graphite its excellent lubricant properties. In diamond the carbon atoms are linked together in a three dimensional structure with each carbon at the centre of a tetrahedron linked to carbons at all four corners. Thus carbon has to go through a major structural reorganization to change from diamond t |
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
""" | |
For http://stackoverflow.com/q/5255932 | |
""" | |
def tangent_interpolate(index, x_array, y_array, dist=0.5): | |
before_index = max(index - 1, 0) | |
after_index = min(index + 1, len(x_array)) | |
chord_vector_x = x_array[after_index] - x_array[before_index] | |
chord_vector_y = y_array[after_index] - y_array[before_index] | |
if dist>0: |
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
#!/bin/bash | |
# copied from http://www.tatome.de/bliki/doku.php?id=projects:shrinkpdf | |
if [ $# -lt 2 ] || [ $# -gt 3 ]; then | |
echo usage: shrinkpdf \<filename\> \<resolution\> \[\<output\>\] | |
exit | |
fi | |
if [ ! -e "$1" ]; then | |
echo "$1" does not exist. Exiting. |
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
#!/bin/sh | |
# Because OpenPBS is fucked, it cannot pass arguments to scripts, but only set environment variables. | |
# So we build this sophisticated functionality for ourselves, using a tottering monolith of subtle and | |
# hairy code that shows how functionality such as this might be accomplished despite | |
# the fierce difficulty, and yet how it is clearly such a shambolic affair that it can not possibly have seemed | |
# reasonable to provide as a service to users | |
# | |
# Usage: | |
# qsub run_script_with_args.sh -v 'PBS_COMMAND=ls -l' | |
exec $PBS_COMMAND |
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/env python | |
""" | |
Command line tool for google-diff-match-patch | |
""" | |
from diff_match_patch import diff_match_patch | |
HTMLTEMP = '''\ | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" |