- JDKがinstall済みであること
- java コマンドに環境変数Pathが通っていること
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
libraryDependencies ++= Seq( | |
"com.github.seratch" %% "scalikejdbc" % "[1.3,)", | |
"org.slf4j" % "slf4j-simple" % "1.6.4", | |
"org.hsqldb" % "hsqldb" % "[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
# --- !Ups | |
CREATE TABLE users( | |
email VARCHAR(255) NOT NULL PRIMARY KEY, | |
name VARCHAR(255) | |
); | |
CREATE TABLE subjects( | |
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
title LONGTEXT NOT NULL, |
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
// Comment to get more information during initialization | |
logLevel := Level.Warn | |
// The Typesafe repository | |
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" | |
// Use the Play sbt plugin for Play projects | |
addSbtPlugin("play" % "sbt-plugin" % "2.0") | |
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/" |
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
scala> val a: Either[Exception, Either[Exception, Int]] = Right(Right(10)) | |
a: Either[Exception,Either[Exception,Int]] = Right(Right(10)) | |
scala> a.joinRight | |
res0: Either[Exception,Int] = Right(10) | |
scala> val b: Either[Exception, Either[Exception, Int]] = Right(Left(new Exception("a"))) | |
b: Either[Exception,Either[Exception,Int]] = Right(Left(java.lang.Exception: a)) | |
scala> b.joinRight |
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
import play.api.WS | |
import play.api.mvc.Controller | |
object Posts/*名詞複数形*/ extends Controller { | |
/** | |
* "Hello Play 2.0!"という文字列を返すアクション | |
* argがパラメータとして指定されていなければ、Playにより400 BAD REQUESTが返される。 | |
*/ | |
def index/*アクション名*/(arg: String /*リクエストパラメータ*/) = Action { |