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
val result: Stream[Task, Prediction] = specimenStream.flatMap((spec: Document) =>{ | |
modelStream.fold(List.empty[TopN]) { case (topNVec, mod) => | |
val res = calcDistance(spec, mod) | |
val newTopN = TopN(res.modelElm.label.get, res.distance) | |
(topNVec :+ newTopN).sortBy(res => res.confidence).take(nearest) | |
}.map(topNVec => Prediction(spec.text, topNVec.toList) ) | |
}) |
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
case class Yard(yardId: Id[Yard], clientId: Id[Client], yardName: String, deleted: Boolean) extends Location with ClientManaged |
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
- name: Simple test for raw + environment. | |
hosts: localhost | |
connection: local | |
tasks: | |
- name: Issue a warning | |
raw: echo hello world | |
environment: | |
foo: bar | |
- name: Don't issue a warning | |
raw: whoami |
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
val content = StreamConverters.asOutputStream().mapMaterializedValue { os => | |
writeXlsDataToStream(os) | |
os.close() | |
} | |
Ok.chunked(content).as("application/xls").withHeaders( | |
"Mime-Type" -> "application/xls", | |
"Content-disposition" -> s"attachment; filename=Report${DateTimeFormat.forPattern("_ddMMMYYYY_HHmmss").print(new DateTime)}.xls" | |
) |
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.libs.json.Json | |
val j= """ | |
|[ | |
| { | |
| "_key": "A1", | |
| "name": "Foo and Bar", | |
| "contents": [ | |
| { | |
| "Android Wear": [ | |
| "Notifications", |
NewerOlder