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
case class User(name: String, addresses: List[Address]) | |
case class Address(street: String, city: String) | |
val f = Form( | |
mapping( | |
"name" -> text, | |
"addresses" -> list( | |
mapping( | |
"street"-> text, | |
"city" -> text |
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 controllers; | |
import java.util.Date; | |
import java.util.concurrent.Callable; | |
import play.data.Form; | |
import play.data.validation.Constraints.Required; | |
import play.libs.Akka; | |
import play.libs.F.Function; | |
import play.libs.F.Promise; |
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 controllers | |
import java.util.concurrent._ | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.Play.current | |
import play.api.libs.concurrent._ | |
object TimeoutController extends Controller { | |
def index(t:Long) = Action { |
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
public interface Function<T, R> { | |
R apply(T t); | |
} | |
public interface GroupBy<E> { | |
Map<Object,List<E>> groupBy(Function<E,Object> f); | |
} | |
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
body{ | |
margin: 0 auto; | |
font-family: 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック', Georgia, Palatino, serif; | |
color: #444444; | |
line-height: 1.2; | |
max-width: 960px; | |
padding: 5px; | |
} | |
h1, h2, h3, h4 { | |
color: #111111; |
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
jQuery.fn.swapClass = function(a, b){return $(this).removeClass(a).addClass(b)} |
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
object QueryParameter{ | |
def parse(query: String):Map[String, List[String]] = { | |
query | |
.split("&") | |
.map{_.split("=",2)} | |
.collect{ case p if p.length == 2 => (p(0), p(1))} | |
.foldLeft(Map.empty[String,List[String]])((z,n) => { | |
z + ( (n._1, (n._2 :: z.getOrElse(n._1,List.empty[String]))) ) | |
}) | |
} |
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
((BigInt(1) /: (2 to 100)){ _ * BigInt(_)}).toString.map(_.asDigit).sum |
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.jami | |
import com.ibm.icu.text._ | |
import com.ibm.icu.util._ | |
import scala.io.Source | |
case class Word(str:String)(implicit tr:Transliterator){ | |
lazy val countO:Int = tr.transliterate(str).count('o' == _) | |
} |
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
cls |
OlderNewer