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.misterbell.shed.models.travellers | |
import shapeless.ops.record.Merger | |
import shapeless._ | |
object OpenBaseCopyDemo extends App { | |
import openCopySyntax._ | |
import mergeSyntax._ |
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 perf | |
import play.api.libs.json.Json | |
import io.circe._, io.circe.generic.auto._, io.circe.jawn._, io.circe.syntax._ | |
import io.circe._ | |
import io.circe.generic.auto._ | |
import io.circe.jawn._ | |
import io.circe.syntax._ | |
//use 0.1.1 circe | |
//use play 2.3.8 |
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.datastax.spark.connector.rdd | |
import org.apache.spark.metrics.InputMetricsUpdater | |
import com.datastax.driver.core.Session | |
import com.datastax.spark.connector._ | |
import com.datastax.spark.connector.cql._ | |
import com.datastax.spark.connector.rdd.reader._ | |
import com.datastax.spark.connector.util.CqlWhereParser.{EqPredicate, InListPredicate, InPredicate, RangePredicate} | |
import com.datastax.spark.connector.util.{CountingIterator, CqlWhereParser} |
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.{\/, \/- ,-\/} | |
implicit final class SeqOps[A](seq : Seq[A]) { | |
def \/>[T](t : T) : T \/ Seq[A] = if (seq.isEmpty) -\/(t) else \/-(seq) | |
} | |
//usage | |
val right = Seq(1,2) \/> "Oh a nel!" | |
val left = Nil \/> "!#& a Nil !!" |
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.GenTraversableOnce | |
implicit class ImplicitGetOrElse[T]( seq: Seq[T] ) { | |
def getOrElse[B >: T]( or: => GenTraversableOnce[B] ) = { | |
if ( seq.isEmpty ) or else seq | |
} | |
} |
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.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
def time[T](f: => T, message: String = "" ): T = { | |
val a = System.currentTimeMillis() | |
val r = f | |
val b = System.currentTimeMillis() | |
Future { println(message + " elapsed time :"+ (b - a) + "ms" + Console.RESET )} | |
r | |
} |
NewerOlder