Scala streaming library differences (Reactive Streams/Iteratee/RxScala/Scalaz…)

PS: I wonder why Play Iteratees library has not been choosed by Martin Odersky for his course since Play is in the Typesafe stack. Does it mean Martin prefers RxScala over Play Iteratees? I’ll answer this. The decision of which streaming API’s to push/teach is not one that has been made just by Martin, but … Read more

Using Scalaz Stream for parsing task (replacing Scalaz Iteratees)

A scalaz-stream solution: import scalaz.std.vector._ import scalaz.syntax.traverse._ import scalaz.std.string._ val action = linesR(“example.txt”).map(_.trim). splitOn(“”).flatMap(_.traverseU { s => s.split(” “) match { case Array(form, pos) => emit(form -> pos) case _ => fail(new Exception(s”Invalid input $s”)) }}) We can demonstrate that it works: scala> action.collect.attempt.run.foreach(_.foreach(println)) Vector((no,UH), (,,,), (it,PRP), (was,VBD), (n’t,RB), (monday,NNP), (.,.)) Vector((the,DT), (equity,NN), (market,NN), (was,VBD), … Read more

How do I replace a program written as a sequenced stream of state transitions with scalaz-stream?

import io.FilePath import scalaz.stream._ import Process._ import scalaz.concurrent.Task import Task._ import scalaz.{Show, Reducer, Monoid} import scalaz.std.list._ import scalaz.syntax.foldable._ import scalaz.syntax.bind._ import scalaz.stream._ import io._ import scalaz.stream.text._ import Processes._ import process1.lift import control.Functions._ /** * A Fold[T] can be used to pass over a Process[Task, T]. * * It has: * * – accumulation, with an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)