This file contains 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 mdfive | |
import java.security.MessageDigest | |
import akka.actor.{Props, Actor, ActorSystem} | |
import org.apache.commons.codec.binary.Hex | |
import scala.annotation.tailrec | |
class RangeWorker(from:Array[Byte], to:Array[Byte]) extends Actor { | |
val digest = MessageDigest.getInstance("MD5") |
This file contains 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 ListAvg { | |
implicit class ListWithAverage(val list:List[Int]) { | |
def avg:Int = list.sum / list.size | |
} | |
} | |
import ListAvg._ | |
val list = List(1,2,3) | |
print(list.avg) |