[error] {file:/C:/home/nakamura/workspace/hoge/}hoge/compile:sources: java.lang.ExceptionInInitializerError
[error] application -
! Internal server error, for request [GET /] ->
play.api.UnexpectedException: Unexpected exception [ExceptionInInitializerError: null]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:233) ~[na:na]
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 com.yuroyoro.websocket | |
import javax.servlet.http._ | |
import org.eclipse.jetty.websocket._ | |
import org.eclipse.jetty.websocket.WebSocket.Outbound | |
import java.util.concurrent.atomic._ | |
class ChatServlet extends WebSocketServlet { | |
val clients = new AtomicReference[Set[ChatWebSocket]](Set()) |
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 scala.annotation.tailrec | |
import scala.util.control.Exception._ | |
@tailrec | |
def hoge: A = { | |
allCatch opt { | |
なんか失敗するかもな処理 | |
} match { | |
case Some(a) => a | |
case None => hoge |
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
implicit def cas[A](reference: AtomicReference[A]) = new { | |
def compareAndSet(f: A => A): Unit = { | |
val current = reference.get | |
if (reference.compareAndSet(current, f(current))) () | |
else compareAndSet(f) | |
} | |
} |
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 views.html.helper | |
import play.api.templates.Html | |
import play.api.data.Field | |
object repeatWithIndex { | |
def apply(field: Field, min: Int = 1)(f: (Field, Int) => Html) = { | |
val idSeq = if (field.indexes.size >= min) { | |
field.indexes |
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> def add(i: Int)(words: String) = words.map({x: Char => x + i - 'a'} andThen Stream.continually(Range.inclusive('a', 'z')).flatten andThen {_.toChar}) | |
add: (i: Int)(words: String)String | |
scala> add(2)("abcdz") | |
res16: String = cdefb |
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
class A { | |
final def foo(x: Int, y: Int): Int = x + y | |
def useFoo = { | |
println(foo(100, 200)) | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<ehcache> | |
<diskStore path="{your storage path}"/> | |
<defaultCache | |
diskPersistent="true" | |
maxEntriesLocalHeap="1000" | |
/> | |
</ehcache> |
これは百合・ガールズラブ Advent Calendar 2012の3日目の記事です。
天槍の下のバシレイス〈1〉 〈2〉 伊都工平/瑚澄遊智(電撃文庫) の紹介です。
この作品を百合・ガールズラブでカテゴライズすると怒る人もいるかもしれません。なぜなら同性を愛することに対する葛藤だとか、恋愛感情による心の機微とかは一切無いからです。なのでそういったものを求めてる場合にはお勧めしません。