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
package misc | |
class PhoneMnemonics(words: Set[String]) { | |
val codeToChars: Map[Char, String] = | |
Map( | |
'2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", | |
'6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ" | |
) |
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 sbt._ | |
import sbt.Keys._ | |
import com.typesafe.sbtscalariform.ScalariformPlugin._ | |
object Build extends Build { | |
lazy val scalatrain = Project( | |
"scalatrain", | |
file("."), | |
settings = |
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
package org.scalatrain | |
object TestData { | |
val List(munich, nuremberg, essen, cologne) = | |
List("Munich", "Nuremberg", "Essen", "Cologne") map { Station(_) } | |
val (t722, t724) = ("722", "724") | |
val times: Map[String, Map[Station, Time]] = Map( | |
t722 -> Map( |
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
/* | |
* Copyright 2011 Typesafe Inc. | |
* | |
* This work is based on the original contribution of WeigleWilczek. | |
* | |
* Unless otherwise agreed, training materials may only be used for | |
* educational and reference purposes by individual named participants | |
* in a training course offered by Typesafe or a Typesafe training partner. | |
* Unauthorized reproduction, redistribution, or use of this material is prohibited. | |
*/ |
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 sbt._ | |
import Defaults._ | |
libraryDependencies <++= (scalaVersion, sbtVersion) { | |
case (scalaVersion, sbtVersion @ "0.11.0") => Seq( | |
sbtPluginExtra("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT", sbtVersion, scalaVersion), // corresponds to addSbtPlugin("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT") | |
sbtPluginExtra("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0-SNAPSHOT", sbtVersion, scalaVersion) | |
) | |
case (scalaVersion, sbtVersion @ "0.11.1") => Seq( |
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 sbt._ | |
import Default._ | |
libraryDependencies <++= (scalaVersion, sbtVersion) { | |
case (scalaVersion, sbtVersion @ "0.11.0") => Seq( | |
sbtPluginExtra("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT", sbtVersion, scalaVersion), | |
sbtPluginExtra("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0-SNAPSHOT", sbtVersion, scalaVersion) | |
) | |
case (scalaVersion, sbtVersion @ "0.11.1") => Seq( |
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
java -Xmx512M -jar $SBT_LAUNCHER "$@" |
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
http x((:/ ("www.mysite.com") / "upload") << | |
("file", new java.io.File("""path\to\file\""")) as_str) | |
} |
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
optional[String, Int](S.param("optional"), Helpers.asInt(_)) |
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
/* http://blog.trondbjerkestrand.no/post/1114624297/automated-kindle-epub-delivery */ | |
import scala.xml._ | |
import scala.xml.transform._ | |
import scala.xml.factory.XMLLoader | |
import javax.xml.parsers.SAXParser | |
/* Avoid loading dtd for contents.xml */ | |
object MyXML extends XMLLoader[Elem] { | |
override def parser: SAXParser = { |