I hereby claim:
- I am brianlondon on github.
- I am brian_london (https://keybase.io/brian_london) on keybase.
- I have a public key ASAjyELly-bKkQQFSz8rRxx9xDFAWneymyWrwmlO4brTWwo
To claim this, I am signing this object:
// Returns Some((user_id, email_content)) if an email should be | |
// triggered None otherwise | |
def eventTriggeredEmail(userId: Int, eventDescription: String): | |
Option[(Int, String)] = ??? | |
object Emailer extends App with MyConfigurationMixin { | |
val sparkConf = new SparkConf() | |
.setAppName("Emailer") | |
.setMaster("local[4]") | |
val ssc = new StreamingContext(sparkConf, Seconds(1)) |
import org.apache.spark._ | |
object PartitionTest extends App { | |
class MyParitioner() extends Partitioner { | |
override def numPartitions = 3 | |
override def getPartition(x: Any) = x match { case n: Int => n % 3 } | |
override def toString = s"MyPartitioner" | |
} |
// Compile time validated builder pattern using type level programming | |
sealed trait Fur | |
case object Short extends Fur | |
case object Long extends Fur | |
case object Curly extends Fur | |
case class Dog(name: String, age: Int, fur: Fur) |
// resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" | |
// libraryDependencies += "com.github.ichoran" % "thyme_2.12" % "0.1.2-SNAPSHOT" | |
import ichi.bench._ | |
import java.util.UUID | |
object OrderingByDemo extends App { | |
println(util.Properties.versionString) |
I hereby claim:
To claim this, I am signing this object:
import java.io._ | |
import com.esotericsoftware.kryo.Kryo | |
import com.esotericsoftware.kryo.io._ | |
sealed trait Gen[T] { | |
def reader: GenReader[T] | |
} | |
sealed trait GenReader[T] { | |
def toGen: T |
# This is not good because it's unclear | |
if elapsed_seconds > 86400: | |
return 'expired' | |
# While less opaque the comment is a crutch to | |
# get around the unclear code | |
if elapsed_seconds > 86400: # seconds in a day | |
return 'expired' | |
# This is better, but still not great. It necessitates |