Demo entry 3938350



Submitted by anonymous on Mar 08, 2016 at 10:50
Language: Scala. Code size: 997 Bytes.

import{PrintWriter, File}
import java.text.SimpleDateFormat
import java.util.Locale


object Engine {

  def main(args: Array[String]) {
    //Read the file with all events indexed
    val eventIndex = Source.fromFile("EventIndex")
      .map(x => x(1) -> x(0).toInt)
    //Get and parse all events files then sort the events by timestamp
    val eventsFiles = getFiles(new File("L3P3/Totta_ES"))
    val events = eventsFiles
      .flatMap(x => parseEvents(x))
    val eventFiltered = events
    //For each time in the events, look 5 previous minutes and 5 next minutes 
    //and create the window with the events that occurs in those intervals
    val windows = events

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).