Skip to content

Instantly share code, notes, and snippets.

@iszlai
iszlai / gist:494128e7967ac0d475f9
Created December 28, 2014 20:31
Dot product calc
def dot(first: Array[Array[Double]], second: Array[Int]): Array[Double] = {
val result = new Array[Double](first.size)
for (i <- 0 to (first.size - 1)) {
result(i) = dotProduct(first(i), second)
}
return result
}
def dotProduct(first: Array[Double], second: Array[Int]): Double = {
require(first.size == second.size)
@iszlai
iszlai / FileAppendingActor.scala
Created December 13, 2014 20:17
Akka ETL load a folder full of images and save int arrrays to file line by line
package com.strike.etl
import java.io.FileWriter
import akka.actor.Actor
import com.typesafe.config.ConfigFactory
import org.slf4j.LoggerFactory
/**
* Created by Lehel on 12/13/2014.