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 sample | |
| import akka.actor._ | |
| import akka.http._ | |
| class SampleService extends Actor with Endpoint | |
| { | |
| self.dispatcher = Endpoint.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
| /** | |
| * Copyright Kazuo KASHIMA 2011 | |
| * k4200 [at] kazu [dot] tv | |
| * Licensed under the same license as Lift framework (Apache 2.0) | |
| */ | |
| package code.model | |
| import net.liftweb._ | |
| import mapper._ |
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"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>org.mongodb.mongod</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/mongodb/bin/mongod</string> | |
| <string>run</string> |
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.amqp.AMQP._ | |
| import akka.amqp._ | |
| import akka.actor._ | |
| import akka.util.Logging | |
| object LoadBalancingTest extends Logging { | |
| val connection = AMQP.newConnection() | |
| val exchangeParameters = ExchangeParameters("my_direct_exchange", Direct) |
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 scalaz._ | |
| /** | |
| * playing with some of the ideas from the Haskell fclabels library | |
| * using the new Lens functionality in scalaz | |
| * | |
| * http://hackage.haskell.org/package/fclabels | |
| */ | |
| object LensTest { |
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 scalaz._,Scalaz._ | |
| import akka.scalaz.futures._ | |
| import akka.dispatch._ | |
| import System.{currentTimeMillis => now} | |
| object Pi extends App { | |
| val nrOfElements = 10000 | |
| val nrOfMessages = 10000 |
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 Aggregator(recipients: Iterable[ActorRef]) extends Actor{ | |
| def receive = { | |
| case msg @ Message(text) => | |
| println("Started processing message `%s`" format(text)) | |
| val result = Promise[String]() | |
| val promises = List.fill(recipients.size)(Promise[String]()) | |
| recipients.zip(promises).map{case (recipient, promise) => |
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
| val test = j_var ("test") := j_true | |
| val test2 = j_var ('test2) := j_false | |
| 1 j_< 2 | |
| JsVar("k") j_<= 10 | |
| val a: JsVar = 'a | |
| a++ | |
| val clause1 = j_if (j_true) { |
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
| require 'zmq' | |
| context = ZMQ::Context.new | |
| pub = context.socket ZMQ::PUB | |
| pub.setsockopt ZMQ::IDENTITY, 'ping-pinger' | |
| pub.bind 'tcp://*:5555' | |
| i=0 | |
| loop do | |
| pub.send "ping pinger #{i+=1}" ; sleep 1 | |
| end |
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 | |
| class A2 extends A | |
| class B | |
| trait M[X] | |
| // | |
| // Upper Type Bound | |
| // | |
| def upperTypeBound[AA <: A](x: AA): A = x |