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 random | |
import operator | |
from itertools import permutations | |
from bl.scheduler import clock, Tempo # , Meter | |
from bl.arp import RandomArp, OrderedArp, ScheduleArp # , ArpSwitcher | |
from bl.orchestra.midi import Player | |
from tutor.complib import drums_f |
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 itertools import cycle | |
from bl.arp import RandomArp, OrderedArp, ArpSwitcher | |
from bl.orchestra.midi import Player, ChordPlayer | |
from bl.utils import getClock | |
from tutor.complib import piano_f | |
piano = piano_f() |
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
""" | |
1 2 3 4 | |
tekaTa Ta Ka tktkTA | |
16 16 8 4 4 32 32 32 32 8 | |
0 6 12 24 48 72 75 78 81 84 | |
""" |
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
isSubSet = function(ar1, ar2) { | |
// Test if ar1 is a subset of ar2 | |
ar1 = _.uniq(ar1); | |
ar2 = _.uniq(ar2); | |
if (ar1.length > ar2.length) { | |
return false; | |
} | |
_.each(ar1, function(el){ | |
if (ar2.indexOf(el) === -1){ | |
return false; |
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
{% exec %} | |
try: | |
f = durs[duration] | |
f.field.widget.attrs['placeholder'] = duration | |
print f | |
except KeyError: | |
pass | |
{% endexec %} | |
OR |
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
s = """ | |
Extensions are not supported. | |
Alphabetic phonenumbers eg 1888-FOR-RILZ are not supported. | |
Of course, you'll want to prevent injection by stripping html tags first. | |
It switches the numbers to international format (or sth) - suggestions welcome! | |
706 555 5001put some | |
ill formed(404) 555-1397text in here | |
+34712938479 to make it interesting...5 | |
404.555.1239. |
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
# | |
# templatetags/kwacros.py - Support for macros in Django templates | |
# | |
# Based on snippet by | |
# Author: Michal Ludvig <michal@logix.cz> | |
# http://www.logix.cz/michal | |
# | |
# modified for args and kwargs by Skylar Saveland http://skyl.org | |
# |
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 urllib | |
import requests | |
exposure_liability_map = { | |
"people": [ | |
#("RESDQ", "All residents Day"), | |
("RESNQ", "Night Residents"), | |
("RESFDQ", "Female residents Day"), | |
("RESN4Q", "Night residents < 4yo"), | |
], |
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
minmax = (value, low, high) -> Math.min Math.max(low, value), high | |
class ImageProcessor | |
constructor: (@img, parent=document.body) -> | |
@canvas = document.createElement("canvas") | |
@context = @canvas.getContext("2d") | |
@canvas.width = @img.width | |
@canvas.height = @img.height | |
parent.appendChild @canvas |
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
In [61]: l | |
Out[61]: [1, 2, 3, False] | |
In [62]: i | |
Out[62]: 1 | |
In [63]: not i in l | |
Out[63]: False | |
In [64]: (not i) in l |