I hereby claim:
- I am dwijnand on github.
- I am dwijnand (https://keybase.io/dwijnand) on keybase.
- I have a public key whose fingerprint is BC85 E8D3 D426 748A 7DF5 1BD4 0D86 E659 4879 5693
To claim this, I am signing this object:
package ngrams | |
import org.specs2.matcher.MatchResult | |
import org.specs2.mutable.{Specification, Tables} | |
class NgramsSpec extends Specification with Tables { | |
import Ngrams._ | |
def expect[A](matchResults: MatchResult[A]*): MatchResult[A] = matchResults reduce (_ and _) |
I hereby claim:
To claim this, I am signing this object:
// sbt.version = 0.13.9 | |
lazy val dynver = taskKey[String]("Determine the dynamic version") | |
dynver := { | |
// Inspired by Mercurial's own self-versioning: | |
// http://www.selenic.com/hg/file/61b333b982ea/setup.py#l184 | |
// Outputs either: | |
// * v1.0.0 (if building on v1.0.0 tag, w/o local changes) | |
// * v1.0.0+20140707 (if building on v1.0.0 tag with local changes) | |
// * v1.0.0+3-1234abcd (if building on commit 1234abcd: 3 commits after v1.0.0 tag, w/o local changes) |
object Suit extends Enumeration { | |
type Suit = Value | |
val Spades, Hearts, Diamonds, Clubs = Value // Bridge ordering | |
} | |
import Suit._ | |
case class Card(rank: Int, suit: Suit) | |
abstract sealed class Command |
import collection.generic.CanBuildFrom | |
import collection.SeqView | |
class EitherSplit { | |
// Viktor Klang (@viktorklang), returns weird type | |
def split1(data: List[Either[String, Int]]): Either[SeqView[String, Seq[_]], SeqView[Int, Seq[_]]] = | |
data.partition(_.isLeft) match { | |
case (Nil, ints) => Right(for (Right(i) <- ints.view) yield i) | |
case (strings, _) => Left(for (Left(s) <- strings.view) yield s) | |
} |
import scala.collection.JavaConverters._ | |
object T { | |
def main(args: Array[String]): Unit = | |
java.security.Security.getProviders.iterator | |
.flatMap(p => p.keySet.asScala) | |
.map(_.asInstanceOf[String].split(" ")(0)) | |
.collect { | |
case k if k startsWith "MessageDigest." => k substring 14 | |
case k if k startsWith "Alg.Alias.MessageDigest." => k substring 24 |