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.util.{Try, Random} | |
def retryLoop[A](count:Int, interval:Int)(f: =>A) = { | |
def sleep:A = { | |
println(s"wait:$interval[ms]") | |
throw new Exception | |
} | |
def retryStream:Stream[Try[A]] = Try(f) #:: Try(sleep) #:: retryStream |
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.util.Calendar | |
/** | |
* 指定した年(デフォルトは今年)以降で、 | |
* 指定した月の一覧(デフォルトは1,3,5,7,8,10,12月)の中で | |
* 1ヶ月に金土日が5回ある月を保持するストリームを返す関数 | |
* 例)fiveTimesWeekend().take(10).toList | |
* | |
*/ |
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
/** | |
https://github.com/jberkel/android-plugin/raw/master/script/create_project | |
をobjectに定義した | |
https://gist.github.com/486306 | |
にさらに、 | |
・スクリプト起動に変更 | |
・sbt-android-pluginのバージョンを0.5.1に変更 | |
・scalatestのバージョンを1.2に変更 | |
・デフォルトレイアウトの main.xml を作成 | |
・デフォルト値の変更 |