Skip to content

Instantly share code, notes, and snippets.

View daviscale's full-sized avatar
🏠
Working from home

Cale Davis daviscale

🏠
Working from home
  • Elemica
  • Bremen, GA
View GitHub Profile
def makeNextSequence(
previousSeq: List[Int],
currentSubSeq: List[Int] = List.empty,
accumulatedSeq: List[List[Int]] = List.empty
): List[Int] = {
previousSeq match {
case head :: tail if currentSubSeq.isEmpty =>
makeNextSequence(tail, List(head), accumulatedSeq)
case head :: tail if head != currentSubSeq.head =>
makeNextSequence(tail, List(head), accumulatedSeq :+ currentSubSeq)
#!/bin/bash
NO_ARGS=0
E_OPTERROR=85
if [ $# -eq "$NO_ARGS" ]
then
echo "Usage: `basename $0` -E <environment> <pattern>"
exit $E_OPTERROR
@daviscale
daviscale / outline.org
Created November 21, 2012 13:31
Akka intro presentation

Actor Based Concurrency

Why actors?

Problem: Shared mutable variables/state

One solution: Isolated Mutability

Threads/Locks
Lots of work writing/debugging the “plumbing” rather than application logic
Easy to create deadlock and hard to recover from

Another Solution: Actors

Allows you to write at a higher level than jvm concurrency tools
Most of the “plumbing” is taken care of for you – focus on application logic instead