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
| //Recursion | |
| // Use for synchronizing a background thread. | |
| -(void)init{ | |
| recursionSample(0); | |
| } | |
| -(void)recursionSample:(int)counter{ | |
| int limit = 10; | |
| if(counter < limit){ |
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 akka.actor._ | |
| implicit val system = ActorSystem("smdp") | |
| case class TestMessage(msg:String) | |
| class Dependency1 extends Actor{ | |
| def receive ={ | |
| case msg:TestMessage => println("MessageReceived") | |
| } |
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 akka.actor._ | |
| import scala.concurrent.duration._ | |
| implicit val system = ActorSystem("test") | |
| case class TestMessage(msg:String) | |
| class SchedulerController(receiveMessage:ActorRef) extends Actor{ | |
| import context.dispatcher |
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
| /* | |
| -------------------------------------- | |
| BASIC SHIT Test if fuction will work as filter | |
| -------------------------------------- | |
| */ | |
| val a = Seq("a","b","c") | |
| val b = a.filter(letter => { | |
| val localLetter = letter | |
| letter == "a" || letter == "b" |
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 akka.actor._ | |
| import akka.routing._ | |
| implicit val system = ActorSystem("smdp") | |
| case class TestMessage(msg:String) | |
| class Dependency1 extends Actor{ | |
| def receive ={ | |
| case msg:TestMessage => |
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
| /* | |
| * What I'm trying to do here is to check if | |
| * actorA { val test = context.ActorSelection("/user/Test") } | |
| * will test be a part of ActorA children and will it be part of the supervisor strategy of ActorA? | |
| */ | |
| import akka.actor._ | |
| import akka.routing._ | |
| import akka.actor.OneForOneStrategy | |
| import akka.actor.SupervisorStrategy._ |
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
| /* | |
| * If you use context.ActorSelection a relative path is valid as long as that actor/path is | |
| * really a child of the actor. | |
| */ | |
| import akka.actor._ | |
| import akka.routing._ | |
| import akka.actor.OneForOneStrategy | |
| import akka.actor.SupervisorStrategy._ | |
| import scala.concurrent.duration._ |
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 akka.actor._ | |
| import akka.event.LoggingReceive | |
| import akka.routing._ | |
| import akka.actor.OneForOneStrategy | |
| import akka.actor.SupervisorStrategy._ | |
| import scala.concurrent.duration._ | |
| implicit val system = ActorSystem("testSytem") | |
| object ViewChildren |
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 javax.xml.xpath._ | |
| import org.xml.sax.InputSource | |
| import java.io.StringReader | |
| import javax.xml.parsers._ | |
| import javax.xml.transform.dom.DOMSource | |
| import java.io.StringWriter | |
| import javax.xml.transform.stream.StreamResult | |
| import javax.xml.transform.TransformerFactory | |
| import javax.xml.namespace.NamespaceContext | |
| import java.io.ByteArrayInputStream |
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.{ Failure, Success } | |
| import scala.language.implicitConversions | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.Future | |
| val a = Future{println("a"); "a"} | |
| val b = Future{println("b"); "b"} | |
| val c = Future{throw new Exception("Test")} | |
| val d = Future{ | |
| Thread.sleep(3000) |
OlderNewer