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
import play.api._ | |
import play.api.mvc._ | |
import play.api.libs.ws.WS | |
import play.api.libs.concurrent.Execution.Implicits._ | |
import java.io.File | |
object Application extends Controller { | |
def index(email: String) = Action { | |
Async { |
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
def measures(user: User): List[Measure] = { | |
val prefs = UserPreferences.findByUser(user) // get my prefs | |
val request = generateRequest(prefs) // build up a WS request | |
val promise = WS.url(exportEndpoint).post(request) | |
promise.orTimeout(Nil, 100000).map { responseOrTimeout => | |
responseOrTimeout.fold( | |
response => { | |
val body = promise.value.get.body | |
val lines = body.split("\n").map(_.split(",")) | |
lines.map { |
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
def dashboard = Action { | |
val user = User.findByUsername("aczerwonka") | |
val prefs = UserPreferences.findByUsername("aczerwonka") | |
val config = Configuration.get(); | |
Ok(views.html.dashboard(user, prefs, config)) | |
} |
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 models | |
case class ProductionType( | |
key: String, | |
name: String, | |
blended: Boolean, | |
forecast: Boolean, | |
actual: Boolean, | |
field: Boolean, | |
financial: Boolean, |
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 euler | |
import scala.actors.Actor | |
import Actor._ | |
object Euler011 extends Actor { | |
type Matrix = Seq[Seq[Int]] | |
case class CalculateMaxRequest(matrix: Matrix, from: Actor) | |
case class CalculateMaxReply(matrix: Matrix, max: Int) |
NewerOlder