夏をエンジョイするためにやりたいことをリストアップしよう!!!(だいぶ時期遅め)
2015/10/1まで
- 読書
- 『話し方入門』
- 『ドキュメント戦争広告代理店』
package momijikawa.exercisezmq | |
import scala.concurrent.ExecutionContext | |
object Main extends App { | |
import akka.actor._ | |
import akka.zeromq._ | |
import akka.util.ByteString | |
import concurrent.duration._ | |
import collection.immutable.Seq |
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.data._ | |
object Application extends Controller { | |
def hoge = Action(parse.tolerantText) { request ⇒ // 生の文字列で受け取る。 | |
// 修正したリクエストでimplicit宣言する。 | |
// あたかも最初からパースされたフォームデータが渡されたような状態にする。 |
pointer = default | |
! shift_r -> @ | |
clear Shift | |
add Shift = Shift_L | |
!remove Shift = Shift_R | |
keycode 62 = at |
#include <stdio.h> | |
/* 定数定義 */ | |
#define CHAR_ZERO 0x30 | |
#define CHAR_ONE 0x31 | |
#define CHAR_NINE 0x39 | |
#define CHAR_NULL 0x00 | |
/* cが0から9までのcharのとき真 */ | |
int isZeroToNine(char c) { |
import scalaz.std.stream._ | |
import scalaz.syntax.id._ | |
unfold(0)(failable(_).map(_.squared)).force // => Stream(1, 2, 3, 4, 5, ..., 99, 100) | |
unfold(0)(failable(_).map(n => (s"n=${n}", n))).force // => Stream("n=1", "n=2", ... "n=100") |
val failable: Int => Option[Int] = { | |
(n: Int) => | |
n match { | |
case n if 0 until 100 contains n => Some(n + 1) | |
case otherwise => None | |
} | |
} |
object StreamT extends StreamTInstances { | |
// 略 | |
def unfoldM[M[_],A,B](start: B)(f: B => M[Option[(A,B)]])(implicit M: Functor[M]): StreamT[M,A] = | |
StreamT[M,A](M.map(f(start)) { | |
case Some((a, b)) => Yield(a, unfoldM(b)(f)) | |
case None => Done | |
}) |
def check = { | |
val cond1 = (_: String) => if (1==2) Left("cond1") else Right("not matched") | |
val cond2 = (_: String) => if (2==2) Left("cond2") else Right("not matched") | |
val cond3 = (_: String) => if (3==2) Left("cond3") else Right("not matched") | |
val condList = List(cond1, cond2, cond3) | |
condList.reduce(_.flatMap) | |
} |
diff -ru play-2.2.1 2/framework/project/plugins.sbt play-2.2.1/framework/project/plugins.sbt | |
--- play-2.2.1 2/framework/project/plugins.sbt 2013-10-30 16:44:48.000000000 +0900 | |
+++ play-2.2.1/framework/project/plugins.sbt 2013-11-08 02:13:56.000000000 +0900 | |
@@ -6,6 +6,8 @@ | |
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.0") | |
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0") | |
+ | |
libraryDependencies <+= sbtVersion { sv => |