These are chat archives for nrinaudo/kantan.csv

12th
Feb 2016
Nicolas Rinaudo
@nrinaudo
Feb 12 2016 11:17
@/all tabulate is now officially kantan.csv, and v0.1.8 has been released.
Örjan Lundberg
@oluies
Feb 12 2016 12:02
^^surprised by the name change, good I looked in here :shipit:
Nicolas Rinaudo
@nrinaudo
Feb 12 2016 12:31
I know it's inconvenient and I apologize, this shouldn't happen in the future
I was just getting tired of coming up with names for all my projects - tabulate, grind, fetch... where having a common base and more explicit qualifier makes things easier
kantan.xpath, kantan.csv, kantan.regex, kantan.mongo...
Örjan Lundberg
@oluies
Feb 12 2016 12:32
looks good, just surprised :)
Nicolas Rinaudo
@nrinaudo
Feb 12 2016 12:34
v0.1.8 doesn't bring much that v0.1.7 didn't have, so feel free to stay on the old version for a while if migrating is problematic, you're not really missing out on anything important
what happened for people to start paying attention to kantan.csv though? This room has existed for months without anyone joining, and then all of sudden bam, two people in a matter of hours
Örjan Lundberg
@oluies
Feb 12 2016 15:53
How would you deconstruct the result with a for comprehension, i got stuck on the decoderesult
    case class Channels(b11: Float, b12: Float, b21: Float, b22: Float, b31: Float, b32: Float, b41: Float, b42: Float)
    val reader: CsvReader[DecodeResult[Channels]] = rawData.asCsvReader[Channels]('\t', false)

    val firstInsert = System.currentTimeMillis()
    var delta = 0
    val points = for {
      result: DecodeResult[Channels] <- reader if result.isSuccess
      channel <- result
      delta += 50
    } yield Point("bearing", (firstInsert + delta))
      .addTag("s", "1")
      .addField("1:1", channel.b11)
   ….
Nicolas Rinaudo
@nrinaudo
Feb 12 2016 15:55
mmh... could you explain what you're trying to achieve here?
what do you want the type of points to be, CsvResult[DecodeResult[Point]]?
I need to log off, but the syntax of your for-comprehension seems odd to me. I'd suggest first trying to write the desugared version
Nicolas Rinaudo
@nrinaudo
Feb 12 2016 16:00
something like reader.collect { case DecodeResult.Success(c) => Point("bearing"), firstInsert + delta).addTag("s", "1").addField("1:1", c.b11) }
Örjan Lundberg
@oluies
Feb 12 2016 16:01
yeah, I got a desugered version working, but I tried to move it into a for-c
Nicolas Rinaudo
@nrinaudo
Feb 12 2016 16:02
the thing is you're mixing two monads in the same for-comprehension, which is never a good idea
you have both CsvReader and DecodeResult
I really need to be off or I'm a dead man, but I'll log back in later today. If you're still around and haven't worked it out, I'll take a shot at it.
Örjan Lundberg
@oluies
Feb 12 2016 16:05
cs, have a good one - bonne fin de semaine