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 helpers.action | |
import play.api._ | |
import http.HeaderNames | |
import libs.iteratee.Iteratee | |
import play.api.mvc._ | |
trait Logging extends ActionComposition { | |
override def Action[A](bodyParser: BodyParser[A])( |
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
private[this] def picker[Question, Yes, No, Value]( | |
question: Question, onSuccess: Yes => Left[Value, Unit] | |
)( | |
implicit mYes: Manifest[Yes], mNo: Manifest[No] | |
): Future[Either[Value, Unit]] = { | |
// Promise for fallbacking that we're never going to fulfill. | |
val unfulfilledPromise = Promise() | |
val questions = actors.map { actor => actor ? question } |
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
intermediateLocations match { | |
case Nil => | |
f(oDeparture, tArrival) | |
case intermediate :: Nil => | |
f(oDeparture, iArrival(intermediate)) | |
f(iDeparture(intermediate), tArrival) | |
case _ => | |
f(oDeparture, iArrival(intermediateLocations.head)) | |
val last = intermediateLocations.sliding(2). | |
foldLeft(intermediateLocations.head) { |
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 parse(file: File): ListBuffer[Schedule] = { | |
val reader = new BufferedReader(new FileReader(file)) | |
try { | |
val schedules = ListBuffer.empty[Schedule] | |
var basicSchedule: BasicSchedule = null | |
var origin: OriginLocation = null | |
var intermediateLocations = ListBuffer.empty[IntermediateLocation] | |
var line: String = reader.readLine() |
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
$ head -n 50 ../api/data/sources/atoc.mca | |
HDTPS.UCFCATE.PD1210050510122309DFTTISD FA051012180513 | |
TIAACHEN 00081601LAACHEN 00005 0 | |
TIABCWM 00385964VABERCWMBOI 78128 0 | |
TIABDAPEN00398202VPENYWAUN BUS 00000 0XPZ | |
TIABDARE 00398200TABERDARE 78100 0ABAABERDARE | |
TIABDATRE00398203ATRECYNON BUS 00000 0XTO | |
TIABDO 00909000ZABERDOUR 03295 0AURABERDOUR | |
TIABDVY 00443500EABERDOVEY 64409 0AVYABERDOVEY | |
TIABER 08381300LABER 78371 0ABEABER |
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
private[this] def ignored(prefix: String) = | |
log(prefix)("Ignored: " + prefix) ~ any(80 - prefix.length) | |
/** Header **/ | |
def header = ignored("HD") ~ nl | |
/** Ignored record types - these have no meaning for us **/ | |
def tiplocInsert = ignored("TI") ~ nl |
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
<configuration> | |
<conversionRule conversionWord="coloredLevel" | |
converterClass="play.api.Logger$ColoredLevel"/> | |
<appender name="FILE" class="ch.qos.logback.core.FileAppender"> | |
<file>${application.home}/logs/application.log</file> | |
<encoder> | |
<pattern>%date - [%level] - from %logger in %thread | |
%n%message%n%xException%n</pattern> | |
</encoder> |
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
class TimeFilterTest extends ProjectSpec { | |
lazy val time = 200 | |
lazy val mode = Graph.ConnectionsMode.Driving | |
lazy val origin = Node.DegreeCoords(1.4, 7.8) | |
lazy val threshold = 500000 | |
describe("instance") { | |
lazy val isochroneMock = mock[Isochrone] | |
lazy val instance = new TimeFilter( | |
time, mode, origin, threshold = threshold |
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
inputTask[Unit] { argTask => | |
(argTask, scalaVersion) map { case(args, sv) => Map.empty[String, String] } | |
} |
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 sbt._ | |
import sbt.Keys._ | |
object PluginDef extends Build { | |
override lazy val projects = Seq(root) | |
lazy val igeoliseLib = RootProject(file("../../lib")) | |
lazy val root = Project( | |
"plugins", file("."), | |
settings = Defaults.defaultSettings ++ Seq( |