addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: Re: [lsug] Tomorrow's DOJO

From: Etuka O.
Sent on: Friday, April 27, 2012 9:28 AM
I'm up for that.  I've just bought the book.

Meanwhile, I had another go at the exercise for a more Scala-ish solution than my first effort...

object Weather extends App {
  val lines =­File("data/weather.d­at").getLines.toList­.drop(8)
  val cleanLines = lines.take(lines.len­gth - 2)
  val diffs = => s.trim.split("""\*?\­s+""").take(3).map( _.toInt)).map(s => (s(0), s(1)-s(2)))
  println(diffs.foldLe­ft(diffs(0))( (l, r) => if(l._2 > r._2) r else l ))

Our Sponsors

  • Scala Dojo

    Web site for monthly Scala Dojo

  • Scala Jobs

    Google Group of Scala Jobs in the London Area

  • _.underscore

    Scala consultants, trainers, and developers, based in London, UK

  • Springer

    Help and supporters of the monthly dojo

  • Skills Matter

    Provide the venue for many of our meetings.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy