Skip to content

Instantly share code, notes, and snippets.

View danmackinlay's full-sized avatar

dan mackinlay danmackinlay

View GitHub Profile
@danmackinlay
danmackinlay / gist:1954656
Created March 2, 2012 01:36
gpu kernel panic report
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
/*
* 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({
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
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
@danmackinlay
danmackinlay / bezier_smooth_plot.py
Created January 16, 2012 08:02
pure python bezier smoothing for matplotlib
"""
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:
@danmackinlay
danmackinlay / run_script_with_args.sh
Created November 3, 2011 05:12
Submit jobs with arguments to openPBS
#!/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
@danmackinlay
danmackinlay / gdmp.py
Created October 18, 2011 10:24 — forked from tkf/gdmp.py
Command line tool for google-diff-match-patch
#!/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"

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@danmackinlay
danmackinlay / ArrawyWarp.sc.patch
Created October 8, 2011 06:37
autoGui ArrayWarp vs PresetInterpolator
--- quarks/autogui/Classes/ArrayWarp.sc 2011-09-30 21:01:01.000000000 +1000
+++ /Volumes/dan/src/sc/mmExtensions/interpolator/ArrayWarp.sc 2011-10-08 14:29:22.000000000 +1100
@@ -1,3 +1,3 @@
-// by Martin Marier
+// Copyright 2010 Martin Marier
ArrayWarp : LinearWarp {
@@ -36,5 +36,5 @@
w.addFlowLayout( 10@10, 5@2 );
ms = MultiSliderView(w, 330@330)
# a messy hack written by Edd Dumbill. http://twitter.com/edd
# You may need to rerun this script if you hit a Twitter Error because you
# use up API rate limiting. That's why we pickle the results, so we can resume
# where we left off.
# get the twitter module using 'easy_install twitter'
from twitter.api import Twitter, TwitterError
from twitter.oauth import OAuth