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 scalera.twitter | |
import org.apache.spark.streaming.dstream.DStream | |
import twitter4j.Status | |
object Boot extends Analytics{ | |
// Set checkpoint dir | |
ssc.checkpoint("/tmp") |
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 TypeClassApproach extends App { | |
// The logic ... | |
trait StreamT[T]{ | |
def values: Stream[T] | |
} | |
object StreamT { |
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 scalera | |
package object card { | |
sealed trait Suit | |
object Suit { | |
lazy val values = List(Spades, Diamonds, Hearts, Clubs) | |
} | |
case object Spades extends Suit | |
case object Diamonds extends Suit |
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 TupleSum extends App { | |
// Monoids aren't démodé and thursday are the new fridays | |
val l = List( | |
1 -> 1, | |
2 -> 3, | |
3 -> 3) | |
//println(l.sum) |