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
partial alphanumeric_keys | |
xkb_symbols "altgr-gb" { | |
name[Group1]= "English (UK, international AltGr dead keys)"; | |
include "latin" | |
key <TLDE> { [ grave, notsign, dead_grave, bar ] }; | |
key <AE01> { [ 1, exclam, exclamdown, onesuperior ] }; | |
key <AE02> { [ 2, quotedbl, dead_diaeresis, twosuperior ] }; |
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
#_(defdeps [[net.htmlparser.jericho/jericho-html "3.1"]]) | |
(ns foo.preprocess | |
(:import [java.io File BufferedInputStream FileInputStream] | |
[net.htmlparser.jericho Source TextExtractor HTMLElementName])) | |
(defn my-text-extractor [source] | |
(proxy [TextExtractor] [source] | |
(excludeElement [tag] | |
(= (.getName tag) HTMLElementName/PRE)))) |
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 | |
import argparse | |
from nltk.tokenize import wordpunct_tokenize | |
def split_parts(fulltext, entities): | |
text = fulltext | |
shift = 0 | |
done = 0 | |
parts = [] |
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
(def testset (for [a (range 20) | |
b (range 20) | |
c (range 20) | |
d (range 20)] | |
(conj #{[a b]} [c d]))) | |
(def testvec (for [a (range 20) | |
b (range 20) | |
c (range 20) | |
d (range 20)] | |
[[a b] [c d]])) |
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 python3 | |
import sys | |
def get6bits(bytes, offset): | |
"Get 6-bit value from offset in bits in a string" | |
byte_offset = offset // 8 | |
bit_offset = offset % 8 | |
if bit_offset <= 2: | |
# The 6 bits of input are all in the same byte: |
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
;; Doesn't work... | |
;; TODO: allow (truncate n (t/minutes 10)): "2014-06-27 12:34:56.789" -> "2014-06-27 12:30:00.000" | |
(defmacro mutator [method val] | |
`(fn [^MutableDateTime mdt#] (~method mdt# val))) | |
(defn truncate [^DateTime dt units] | |
(loop [^MutableDateTime mdt (.toMutableDateTime dt) | |
[[unit method] & more] [[t/years nil] | |
[t/months (mutator .setMonthOfYear 1)] |
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
use_bpm 130 | |
live_loop :tick do | |
root, type = [[:d4,:m7],[:g4,:dom7],[:c4,:M7],[:f4,:M7],[:b4,:'m7+5'],[:e4,:dom7],[:a4,:m7]].tick(:tick) | |
cue :boom, root: root, type: type | |
with_fx :reverb, amp: 2 do | |
sample :drum_cymbal_closed, amp: 3 | |
sleep 0.5 | |
3.times do | |
sample :drum_cymbal_closed |
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
use_bpm 120 | |
use_synth :dsaw | |
p = [[:c4,:M7],[:a4,:m7],[:d4,:m7],[:g4,:dom7],[:e4,:m7],[:a4,:dom7],[:d4,:m7],[:g4,:dom7]] | |
in_thread do | |
sleep 8 | |
12.times do | |
sample :loop_breakbeat, rate: sample_duration(:loop_breakbeat)/4 | |
sleep 4 |
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 os | |
try: | |
sc | |
except NameError: | |
from pyspark import SparkContext, SparkConf | |
sc = SparkContext(conf=SparkConf().setAppName("lol")) | |
dirs = ['/home/hadoop/.versions/spark-1.4.0.b/classpath/emrfs/', | |
'/home/hadoop/.versions/2.4.0-amzn-5/share/hadoop/common/lib/'] |
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
use_bpm 180 | |
use_random_seed 42 | |
live_loop :drum do | |
a,b = [[:Ab,:major], [:F, :minor], [:C, :minor], [:G, :minor]].choose | |
cue :key, a: a, b: b | |
if true then | |
with_fx :reverb do | |
4.times do | |
sample :drum_tom_mid_hard, amp: ring(4,2,3,2).tick |
OlderNewer