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
/** Allen Institute for AI | |
* @author Jesse Kinkead | |
* @author Michael Schmitz | |
*/ |
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
object Unfold extends App { | |
def read(pos: Int, num: Int): Seq[Int] = { | |
val data = (0 to 100).toVector | |
data.drop(pos).take(num) | |
} | |
def unfold[A, B](seed: B)(f: B => Option[(B, A)]) = { | |
def loop(seed: B)(ls: Stream[A]): Stream[A] = f(seed) match { | |
case Some((b, a)) => loop(b)(a #:: ls) | |
case None => ls |
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
(for (line <- Source.fromFile(file) if someCondition(x)) yield { | |
(synonyms.toSet, canonicalForm) | |
}).toMap |
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 all[T : RootJsonFormat](esDocConf: ESDocConf, batchSize: Int = 100): Iterator[T] = | |
new Iterator[T] { | |
var i = 0 | |
private def read() = { | |
val items = read(esDocConf, i * batchSize, batchSize) | |
i = i + 1 | |
items | |
} | |
private var batch = read() |
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/sh | |
exec scala -savecompiled "$0" $@ | |
!# | |
// | |
// Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> | |
// Modified 2014 AI2 <http://www.allenai.org> | |
// | |
// This script will check that the commit is correctly formatted. It only checks files that are to be committed. | |
// To be run this file should be at `.git/hooks/pre-commit`. |
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
And := PatternTagger { | |
<string=/and|that|which/> | |
} | |
Help := PatternTagger { | |
<string=/(help|aid|allow|assist|enable)(s)?/> | |
} | |
EffectRel := TypePatternTagger { | |
// in order for | |
(?:<string="in"> <string="order"> <string=/for|that/> ) |
Programming in Scala. Written by the author of Scala, this is the authoritative source. Martin Odersky is very thorough and concise. The first edition is available for free online.
Scala Documentation. The community and Typesafe have done a much better job about aggregating knowledge about learning Scala. There is a tutorial for Java developers and they are working on tutorials for Ruby and Python developers.
Scala for Java Refugees. I remember this blog series being helpful.
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
sudo yum install jre-1.7.0-openjdk | |
# I don't know what 20000 is for | |
sudo alternatives --install /usr/bin/java java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java 20000 | |
# elect 1.7.0 | |
update-alternatives --config java | |
# test it out | |
java -version |
First make sure you have ssh access to your GitHub account. This will make all future interactions with GitHub much easier.
Next you can:
-
Create a new repository on github.com/vulcanhalo.
-
If you do not yet have a git repository: