Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 21:07
    scala-steward synchronize #139
  • Jan 26 14:33

    mpilquist on v1.11.0

    (compare)

  • Jan 26 14:32

    mpilquist on 1.11.x

    Setting version to 1.11.0 Updated version to 1.11.1-SNAPS… (compare)

  • Jan 25 10:28
    billpcs starred scodec/scodec
  • Jan 22 22:01
    benhanna starred scodec/scodec
  • Jan 21 20:36
    scala-steward opened #139
  • Jan 21 14:51
    mpilquist closed #130
  • Jan 21 14:48
    mpilquist closed #119
  • Jan 21 14:48
    mpilquist commented #119
  • Jan 21 14:48

    mpilquist on 1.11.x

    Scala 2.13.0-M4 Merge branch 'series/1.10.x' in… Upgraded to latest scala-collec… and 2 more (compare)

  • Jan 21 14:48
    mpilquist closed #138
  • Jan 21 14:40
    mpilquist opened #138
  • Jan 21 14:37

    mpilquist on 1.11.x

    Created 1.11 branch (compare)

  • Jan 21 14:31

    mpilquist on xuwei-k

    Upgraded to 2.13.0-M5 (compare)

  • Jan 21 14:19

    mpilquist on xuwei-k

    Scala 2.13.0-M4 Merge branch 'series/1.10.x' in… Upgraded to latest scala-collec… (compare)

  • Jan 21 14:03

    mpilquist on 1.10.x

    Update sbt-scalajs, scalajs-com… Merge pull request #129 from sc… (compare)

  • Jan 21 14:03
    mpilquist closed #129
  • Jan 21 14:03
    mpilquist closed #126
  • Jan 21 14:03

    mpilquist on 1.10.x

    Pad-left on pbcd codec. Fixes #… Using padLeft in pbcd instead o… Merge pull request #133 from lJ… (compare)

  • Jan 21 14:03
    mpilquist closed #133
Martijn Hoekstra
@martijnhoekstra
you can't encode that in utf-8, because it's doesn't encode a valid code point
Colt Frederickson
@coltfred
@martijnhoekstra Ok. Putting in code that deals with that obscure case didn't make things much more ugly, but better safe than sorry. Thanks for the info
Rob Norris
@tpolecat
@mpilquist is there something in particular holding up a release for 2.13? something I can help with?
Michael Pilquist
@mpilquist
2.13 builds are out - have been for a long while
What’s missing?
Rob Norris
@tpolecat
hmm
scodec-cats_2.13 v 0.8.0
seems not to exist
Michael Pilquist
@mpilquist
Ah, yeah missed that one
I can do that today
Rob Norris
@tpolecat
cool, thanks!
i'm actually not sure i'm using it. let's turn it off and see what happens
Michael Pilquist
@mpilquist
:)
Rob Norris
@tpolecat
ah, yeah i'm using it
Decoder.replicateA :fire:
Michael Pilquist
@mpilquist
ha
It’s probably time to just add a cats-core dependency to scodec
Rob Norris
@tpolecat
sounds good to me! :+1:
Michael Pilquist
@mpilquist
scodec-cats 1.0.0 is out for 2.11, 2.12, and 2.13
May fold it in to scodec-bits and scodec-core at some point in the future but not today
Luciano
@lJoublanc

It’s probably time to just add a cats-core dependency to scodec

:grin:

kushtal
@kushtal
Please can someone help me convert BigInt to bytes(16) or give a link with an example?
Oron Port
@soronpo
Perhaps BitVector(bigInt.toByteArray)
Oh you wanted ByteVector. Sorry, haven't used it.
kushtal
@kushtal

@soronpo
Thanks for the answer.
Can I create this conversion in codec?
I'm trying to write something like
val codeBigInt: codec [BigInt] = bytes16.as [BigInt]
but I need to create a Transformer [ByteVector, BigInt]
I try to look at the source code of Transformer, but I did not understand how I can create my own Transformer.

Transofrms also says TODO in documents
http://scodec.org/guide/scodec-bits.html

Paul Snively
@paul-snively
Isn’t a BigInt unbounded?
Paul Snively
@paul-snively
OK, so: BigInt can easily round-trip to/from its 2s-complement representation as an Array[Byte]. So I'm not sure what the question is.
Luciano
@lJoublanc
@kushtal you can use scodec.codecs.bytes and call xmap on it.
kushtal
@kushtal

Thanks for answers
Please, can someone explain to me how to create the necessary Transformer to initialize the Codec?
When I check this code, I take the exception: "No implicits arguments of type: Transformer[Int, Route[A]"

class Route[A](value: Int)
object Route {
def codec[A]: Codec[Route[A]] = int32.as[Route[A]]
}

Paul Snively
@paul-snively
What is that code trying to do?
Michael Pilquist
@mpilquist
Change Route to be a case class and it will work — or if you don’t want a case class, use int32.xmapc(new Route(_))(_.value)
But like Paul asked, it would be good to know what you are trying to do to help advise if that’s the right solution
Paul Snively
@paul-snively
I'm mostly thinking A is left abstract there, so I'm not sure what the semantics of Codec[Route[A]] would (be intended to) be.
It may really be true that a Codec[Route[A]] is isomorphic to Codec[Int] for all A, but that seems like it should be more explicit somehow, if so.
kushtal
@kushtal
Thanks for answers
int32.xmapc(new Route(_))(_.value)
This code is very suitable for my purposes. But after implementation, I see that I do not need to use this approach. And can solve this problem with a simple Codec[Route]
Thanks again for your responsiveness.
Igal Tabachnik
@hmemcpy
Evening all! I'm trying to (as a toy) to parse the redis protocol using fs2 sockets and scodec. The problem is, I'm not sure how to read the stream, because for some messages I don't have the length specified anywhere. For example, the basic ping/pong message returns a string like this: +PONG\r\n. The protocol states that redis strings are always terminated with \r\n, but I'm not sure how to read "just enough", until I reach there. I may be entirely holding it wrong :)
As reference points, I'm looking at how @tpolecat's skunk reads messages, as well as fs2-chat, but in skunk's case it always reads 5 bytes to detect the length, so it knows how much to read... and in fs2-chat it always reads 1024 bytes, but I'm not sure if it's a good default or just a sample value.
Any hints appreciated!
Christopher Davenport
@ChristopherDavenport
@hmemcpy Take a look at ember in http4s.
Basically a custom pull looking for the seperator.
Igal Tabachnik
@hmemcpy
Awesome! I opened the Parser, looks promising :)
Thank you, I'll look into it some more tomorrow. 2:30 am, time to sleep :)
Paul Snively
@paul-snively
Hi @hmemcpy!
Igal Tabachnik
@hmemcpy
Oh hey Paul! Long time!
Miss you on twitter :)
Paul Snively
@paul-snively
That’s kind of you. Your “I’m sure he doesn’t miss gestures broadly at everything” completely cracked me up.
Ondra Pelech
@sideeffffect
hello, is there a way to compare ByteVectors lexicographically? Is there an Ordering[ByteVector] instance? thanks :pray:
Rob Norris
@tpolecat
@mpilquist do you have a macro to map generically from a ~ b ~ ... to/from an isomorphic case class? I don't want to write it myself ;-)
going via shapeless is a hassle because HList associates the other way.
Michael Pilquist
@mpilquist
No, not without going through Generic