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
// now refactored as jquery plugin | |
(function($) { | |
$.fn.extend({ | |
packedMultiImage: function(width, height) { | |
return this.each(function() { | |
var k = 4; // FIXME hardcoded | |
var $this = $(this); | |
// set up the rectangle packer | |
var rootNode = new Node(); | |
rootNode.rect = new Rect(0, 0, width, height); |
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
<resolvers> | |
<resolver name="pid"> | |
<var name="root">/mnt/svalbard/dives</var> | |
<match var="pid" pattern="((([A-Z]+)\.)?((\d{6})\d\d)\.(\d+)\.(\d+))(\.(\w+))?" | |
groups="lid _ pfx ymd ym ts1 ts2 _ ext"> | |
<!-- high-priority cruises --> | |
<match var="ym" value="200303"> | |
<path var="dir" match="${root}/200303_OC387/processed/color_corrected/*"> | |
<path match="${dir}/${lid}.jpeg"/> | |
</path> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
( | |
Routine({ | |
SynthDef("buzz", {arg bufnum; | |
var dust, pitch, density, amp, env, pan, osc, gate; | |
var brown1, brown2, brown3, brown4, brown5; | |
var pitch1, pitch2; | |
pitch1 = IRand(10,128); | |
pitch2 = IRand(10,128); | |
brown1 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs; | |
brown2 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs; |
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
DIGITS='0123456789ABCDEF' | |
k=34587 | |
n=16 | |
result = '' | |
while k > 0: | |
digit = k % n | |
result = DIGITS[digit] + result | |
k = (k-digit) / n |
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.
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/sed -e | |
1i digraph foo { | |
s/\([[:alnum:]]*\) \([[:alnum:]]*\) \([[:alnum:]]*\)/\1 -> \3 [label="\2"];/ | |
$a } |
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
from StringIO import StringIO | |
import xml.etree.ElementTree as ET | |
mvco_ns = 'http://ifcb-data.whoi.edu/mvco/' | |
lid = 'IFCB5_2011_033_041857' | |
nsmap = {'mvco': mvco_ns} | |
def parse_id(pfx_id, nsmap={}): | |
ns_statements = ' '.join(['xmlns:%s="%s"' % (k,v) for k,v in nsmap.items()]) | |
xml = '<%s %s/>' % (pfx_id, ns_statements) |
OlderNewer