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
object LogParser { | |
import java.net._ | |
import org.joda.time.DateTime | |
import org.joda.time.format.DateTimeFormat | |
case class Access( | |
ipAddress: InetAddress, | |
ident: String, | |
user: String, |
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
// obj ::= "{" [members] "}". | |
// arr ::= "[" [values] "]". | |
// value ::= obj | arr | stringLiteral | floatingPointNumber | "null" | "true" | "false". | |
// values ::= value { "," value }. | |
// members ::= member { "," member }. | |
// member ::= stringLiteral ":" value. | |
object Main { | |
import util.parsing.combinator._ |
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
// *** S-99: Ninety-Nine Scala Problems *** | |
// http://aperiodic.net/phil/scala/s-99/ | |
// | |
// wget http://www.scala-tools.org/repo-releases/org/scalatest/scal.test_2.9.0-1/1.6.1/scalatest_2.9.0-1-1.6.1.jar | |
// scala -cp scalatest-*.jar s99-21-28.scala | |
import org.scalatest.matchers.ShouldMatchers._ | |
import scala.annotation._ | |
class NotImplementedYet extends RuntimeException |
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
// *** S-99: Ninety-Nine Scala Problems *** | |
// http://aperiodic.net/phil/scala/s-99/ | |
// | |
// wget http://www.scala-tools.org/repo-releases/org/scalatest/scalatest_2.9.0-1/1.6.1/scalatest_2.9.0-1-1.6.1.jar | |
// scala -cp scalatest-*.jar s99.scala | |
import org.scalatest.matchers.ShouldMatchers._ | |
// P01: Find the last element of a list. | |
def last[T](list: List[T]): T = { // TODO } |