sbt.version=0.12.0
import com.typesafe.sbt.SbtStartScript
| // scala | |
| def receive = { | |
| case Counter.Inc(by) => count += by | |
| case Counter.Current => sender ! Counter.CurrentReply(count) | |
| } | |
| // java lamda | |
| @Override | |
| public PartialFunction<Object, BoxedUnit> receive() { | |
| return ReceiveBuilder. |
| navigateTo(url) { | |
| in(form having id("form1")) { | |
| in(input having id("iLogin")) { | |
| typeIn(username) | |
| } | |
| in(input having id("iPassword")) { | |
| typeIn(password) | |
| } | |
| in(input having name("doLogin")) { | |
| click ==> |
| import com.typesafe.config.Config; | |
| import com.typesafe.config.ConfigFactory; | |
| import java.util.Map; | |
| import java.util.HashMap; | |
| public class ConfigOverrideFromCode { | |
| static public void main(String[] args) { | |
| String config = "system {\n" + | |
| " administrator = ${who-knows}\n" + |
| // place this in src/main/java/ | |
| public class Main { | |
| public static void main(String[] args) { | |
| System.out.println("Hello world"); | |
| } | |
| } |
| scala> Stream.from(3).takeWhile(_ => new Random().nextDouble() > 0.1).force | |
| res9: scala.collection.immutable.Stream[Int] = Stream(3, 4, 5, 6, 7, 8, 9) |
| package stackable | |
| import akka.actor.{Props, ActorSystem, Actor} | |
| object Main extends App { | |
| val sys = ActorSystem("stackable") | |
| val act = sys.actorOf(Props[EchoActor]) | |
| act ! "BooHoo" | |
| act ! "BooHoo" |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <opml version="1.1"> | |
| <head> | |
| <title>BeyondPod Feeds</title> | |
| <dateCreated>Sun, 24 Aug 2014 12:39:43 GMT+03:00</dateCreated> | |
| <dateModified>Sun, 24 Aug 2014 12:39:43 GMT+03:00</dateModified> | |
| </head> | |
| <body> | |
| <outline text="Security"> | |
| <outline text="Security Now (MP3)" xmlUrl="http://leoville.tv/podcasts/sn.xml" type="rss" /> |
| case class Request(valid: Boolean, impressions: Seq[Impression]) | |
| case class Impression(rules: Seq[Rule]) | |
| case class Rule(valid: Boolean) | |
| case class Bid(money: Double) | |
| // generate some random requests | |
| val requests = Vector.fill(5) { | |
| Request( |