This file contains hidden or 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
i=0 | |
for file in $(ls ~/files/); do | |
if [ $(( $i % $1 )) -eq 0 ]; then | |
wait | |
fi | |
~/runner.sh $2 $3 & | |
i=$(( i + 1 )) | |
done |
This file contains hidden or 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
sealed trait Trie[+A] | |
case class Node[+A](key: A, kids: List[Trie[A]]) extends Trie[A] | |
case class Leaf[A](key: A) extends Trie[A] | |
object TriePreorder extends App { | |
val trie = Node("c", List( | |
Node("a", List( | |
Leaf("r"), | |
Leaf("t"))), |
This file contains hidden or 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
# To run: | |
# 1) Open Praat | |
# 2) Click Praat | |
# 2.1.1) Click-> New Praat script | |
# 2.1.2) Paste code | |
# 2.2.1) Click -> Open Praat script... | |
# 2.2.2) Select file | |
# 2.3) Run -> Run | |
# Given vowels phonemes are in tier 2: |
This file contains hidden or 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 identity[A]: A => A = a => a | |
def compose[A,B,C](x: A)(f: A => B)(g: B => C): C = g(f(x)) | |
def compose2[A,B,C] = (x: A) => (f: A => B) => (g: B => C) => g(f(x)) | |
val inc: Int => Int = (x: Int) => x + 1 | |
assert(compose(12)(identity)(inc) equals compose(12)(inc)(identity)) | |
assert(compose2(12)(identity)(inc) equals compose2(12)(inc)(identity)) |