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
| license: apache-2.0 |
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 TopAByBJob(args: Args) extends DailyJobWithKeep(args, classOf[ProtobufTypeForS3PathPartition]) with TypeAFilters { | |
| PailSource.source[FooProtobuf](rootpath, structure, directories).read | |
| .mapTo('pailItem -> ('b, 'a)) { e: FooProtobuf ⇒ e.b -> calculateA(e) } | |
| .filter('a) { n: String ⇒ n.nonEmpty } | |
| .groupBy(('b, 'a)) { _.size('count) } | |
| .groupBy('b) { _.sortedReverseTake[(Long, String, String)](('count, 'b, 'a) -> 'tcount, keep) } | |
| .flatMapTo('tcount -> ('count, 'b, 'a)) { t: (List[(Long, String, String)]) ⇒ t } | |
| .write(Tsv(outputdir)) | |
| } |
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.collection.JavaConverters._ | |
| import java.net.URL | |
| import java.util.Enumeration | |
| import com.typesafe.config._ | |
| import org.osgi.framework.Bundle | |
| import org.osgi.framework.wiring._ | |
| object OsgiConfigFactory { |
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
| /* A better way to tag types? | |
| * | |
| * 1) object Time: here we are distinguishing between different uses of a Long, | |
| * yet there is no boxing whatsoever. | |
| * | |
| * main calls start: ()J | |
| * main calls timed: (Function0, J) | |
| * Function0 gives up the result: ()J | |
| * timed calls now: ()J | |
| * timed calls elapsed$extension: (JJ)J |
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
| #!/bin/bash | |
| REMOTE=play@SERVER_IP | |
| REMOTE_APP=/home/play/PROJECT_NAME/ | |
| sbt stage || exit 1; | |
| rsync -va target/ $REMOTE:$REMOTE_APP/target; | |
| ssh $REMOTE "cd $REMOTE_APP; ./stop.sh"; | |
| ssh $REMOTE "cd $REMOTE_APP; ./start.sh"; |
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
| description "Cassandra is a distributed (peer-to-peer) system for the management and storage of structured data." | |
| author "nikola.petrov@ontotext.com" | |
| start on filesystem | |
| stop on runlevel[016] | |
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
| Welcome to Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_15). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> val opt: Option[Int] = Some(10) | |
| opt: Option[Int] = Some(10) | |
| scala> val typeCheckFail = opt map (_ + "2") getOrElse (3) | |
| typeCheckFail: Any = 102 |
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 spray.json._ | |
| import spray.http.HttpBody | |
| import spray.httpx.marshalling._ | |
| import spray.httpx.unmarshalling._ | |
| import spray.http.MediaTypes._ | |
| import spray.routing.directives._ | |
| import spray.routing._ | |
| import spray.http._ | |
| import spray.json.DefaultJsonProtocol | |
| import spray.httpx.SprayJsonSupport |
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 (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> | |
| */ | |
| package akka.contrib.pattern | |
| import language.postfixOps | |
| import scala.concurrent.duration._ | |
| import com.typesafe.config.ConfigFactory | |
| import akka.actor.Actor |
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 foo[A, B, C](a: SNat[A], b: SNat[B], c: SNat[C])(implicit ssum: SSum[A, B, C]) = ssum | |
| foo: [A, B, C](a: shapeless.SNat[A], b: shapeless.SNat[B], c: shapeless.SNat[C])(implicit ssum: shapeless.SSum[A,B,C])shapeless.SSum[A,B,C] | |
| scala> foo(2, 3, 5) | |
| res0: shapeless.SSum[Int(2),Int(3),Int(5)] = $anon$1@53d76e96 | |
| scala> foo(2, 3, 7) | |
| <console>:15: error: could not find implicit value for parameter ssum: shapeless.SSum[Int(2),Int(3),Int(7)] | |
| foo(2, 3, 7) | |
| ^ |