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
| !SLIDE | |
| # gist-slideを試してみる | |
| [これ](http://gist-slide.appspot.com/1191887/gist-slide) | |
| !SLIDE | |
| ## どーよ |
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
| package iteratee.practice | |
| import scalaz._ | |
| import Scalaz._ | |
| import effects._ | |
| import java.io.File | |
| /** | |
| * http://code.google.com/codejam/contest/1343486/dashboard | |
| * の問題ファイルを読み込んでみる練習 |
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
| package iteratee.practice | |
| import scalaz._ | |
| import Scalaz._ | |
| import IterV._ | |
| import effects._ | |
| import java.io.File | |
| /** | |
| * scalazのIterateeを使ってファイルを読み込む練習 |
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 Hello extends App { | |
| println("Hello World!") | |
| } |
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 java.io.{ BufferedReader, FileReader } | |
| import scalaz._, Scalaz._ | |
| import scalaz.effects._ | |
| import IterV._ | |
| object App { | |
| def main(args: Array[String]) { | |
| val br = new BufferedReader(new FileReader("test2.txt")) | |
| val io = byEnumerator(br) |
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 scalaz._, Scalaz._ | |
| trait ControllerHelper { | |
| // Seq[String]から型Tのデータを抽出する型クラス | |
| trait Extractor[T] { | |
| def extract(data: Seq[String]): Option[T] | |
| } | |
| // Extractorを簡単に生成できるようにする |
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
| // Chrome、FF、IE9 | |
| "4321".substr(-2); // → "21" | |
| // Windowsガジェット | |
| "4321".substr(-2); // → "4321" |
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
| case class Person(name: String, age: Int) |
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
| sealed trait Carrier | |
| case object PC extends Carrier | |
| case object Mobile extends Carrier | |
| case object Smartphone extends Carrier |
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
| package controllers | |
| import play.api._ | |
| import play.api.mvc._ | |
| object SendmailTest extends Controller { | |
| def index = Action { | |
| sendmail | |
| Ok(views.html.index("ok")) |
OlderNewer