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
""" | |
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
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
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
Steps | |
(Chrome) | |
#. Login (via google) | |
#. Go to register | |
#. Do not select the conference registration radio (corporate/hobbyist/etc) and only buy 1 t-shirt | |
#. Pay for the t-shirt | |
#. Land on summary page and it says you are not registered for conference (register here button) | |
#. Click "register" button. |
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
% ansible-playbook pb.yml -i h -e "BOOL=that" | |
PLAY [all] ******************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [wtf] ******************************************************************* | |
ok: [localhost] => { | |
"msg": "that" |
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
> python | |
Python 2.7.3 (default, Dec 4 2013, 11:24:08) | |
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import billiard | |
>>> billiard.VERSION | |
(2, 7, 3, 31) | |
>>> ^D | |
> pip install -U billiard |
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 ctypes | |
>>> ctypes.CDLL('libSystem.dylib') | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/.../lib/python2.7/ctypes/__init__.py", line 365, in __init__ | |
self._handle = _dlopen(self._name, mode) | |
OSError: dlopen(libSystem.dylib, 6): image not found |
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
""" | |
https://brilliant.org/community-problem/loser-keeps-bieber-we-stood-no-chance/ | |
?group=4cgSapeNTVXO&ref_id=115277 | |
""" | |
import random | |
def play_defensive(them): | |
if random.random() <= 0.04: |
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
OSX - 10.8.5 | |
❯ virtualenv-2.7 --version | |
1.11.5 | |
❯ ./jython/dist/bin/jython | |
Jython 2.7b2+ (default:f6f7196d27a5, May 15 2014, 20:10:22) | |
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_55 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> |