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 com.supersonicads.utils.spray | |
import com.supersonicads.utils.OptionUtil._ | |
import play.api.libs.json.Json | |
import spray.http.HttpHeaders.RawHeader | |
import spray.http.{HttpMethods, HttpProtocols, HttpRequest} | |
case class LeanHttpRequest(entity: String, | |
headers: List[RawHeader], | |
protocol: 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 com.typesafe.config.ConfigFactory | |
import org.joda.time.DateTime | |
import com.datastax.spark.connector._ | |
implicit val config = ConfigFactory.load() | |
//val rdd = RawEventsReader2.getDataFromRange(sc)(new DateTime(2015, 5, 15, 4, 0), new DateTime(2015, 5, 15, 4, 0)) | |
val keySpace = "offlinedb" | |
val tableName = "raw_events_2015_20" | |
val keys = "201505150400001976" |
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
consulData <- Try(ConsulData(base64Value, modifyIndex)) match { | |
case Success(cd) => JsSuccess(cd) | |
case Failure(throwable) => JsError(throwable.toString) | |
} |
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
object ReversePolishNotation { | |
type Operand = Double | |
type BinaryOp = (Operand, Operand) => Operand | |
val parseOp: String => Double = _.toDouble | |
val opMap: Map[String, BinaryOp] = Map( | |
"+" -> (_ + _), | |
"-" -> (_ - _), | |
"*" -> (_ * _), |