Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tom Robinson
@tlrobinson
no i think that makes sense
BJ Neilsen
@localshred
you can even extend Change from it’s own definition (message Change { extend Change { … } })
but again, not sure why
extensions are useful for published protos where you want others to be able to add their own fields to the type because they can’t change the original definition
otherwise they behave just like normal fields
so there isn’t much reason to use them for structural reasons
BJ Neilsen
@localshred
haha, my last example is completely wrong
message Change {
  optional DocumentType document_type = 1;
  extensions 200 to max;
}

extend Change {
  optional Foo foo_previous = 200;
  optional Foo foo_current = 201;
}

extend Change {
  optional Bar bar_previous = 300;
  optional Bar bar_current = 301;
}
that’s better
Tom Robinson
@tlrobinson
is there much difference in efficiency between serializing the documents separately and putting them in bytes fields vs including the document type specific fields?
BJ Neilsen
@localshred
serialization efficiency?
Tom Robinson
@tlrobinson
yeah, i assume space used is almost identical?
BJ Neilsen
@localshred
it’d be pretty close
you’re still encoding the submessage either way, just in two steps instead of one
Tom Robinson
@tlrobinson
and the other difference would be you'd have to manually serialized/deserialize the documents
BJ Neilsen
@localshred
I’m pretty sure bytes and messages are encoded as varints, so they should be almost identical
correct
R. Tyler Croy
@rtyler
Doesn't look like i've missed all that much
gitter is weird about messages
Tamir Duberstein
@tamird
@localshred did i misunderstand you on localshred/protobuf#204
Vaibhav Yenamandra
@vaibhav-y
I recently forked the repo, can someone confirm if the current rspec output is this: http://puu.sh/cRHdP/ce2333bd7a.txt
Vaibhav Yenamandra
@vaibhav-y
I also wanted to add the varint C extension to Protobuf::Field::VarintField, any thoughts on if this might help out?
Manthan Mallikarjun
@nahtnam
Hey!
I am new to protobufs
I want to parse a Counter Strike Demo File and apparently its made using protobufs
and I dont know where to start
The extension of a demofile is .dem and not .proto which is confusing me a bit
Manthan Mallikarjun
@nahtnam
Any help/pointers would be appreciated
R. Tyler Croy
@rtyler
@nahtnam i'm assuming you don't have the original protobuf schema file?
Manthan Mallikarjun
@nahtnam
@rtyler no, but is it required? If it is, I'm sure I can find one online because a few other sites also parse protobufs files
R. Tyler Croy
@rtyler
@nahtnam well, reverse engineering a serialized protobuf is possible but incredibly tedious
without the schema files deserializing and working with protobufs are pretty tedious
Manthan Mallikarjun
@nahtnam
@rtyler is it supposed to be a .proto file?
Benoit Tigeot
@benoittgt
hey
any tips ? specialy for package name ?
Brandon McCulligh
@XXChester
This message was deleted
JustusLauten
@JustusLauten
Hey guys, Is there a method which lets me parse the output of to_json on a protobuf object back to the protobuf object? Best regards!
Mikkel Hvilshøj Funch
@MikkelFunch

Hello, I have a question regarding best practices. I have a proto which need to be able to take a list questions, and all questions are different protos, and not all questions are returned everytime, so I have a field

repeated any questions

So in my code to figure out which question it is I am looking at, I check a string all the questions have. But it seems to me like there would be a better way to handle that, anybody have some good idea? =)

MaDuo
@SeriousMa
hey guys! is there a way to validate parameter in protobuf messages? like NOTNULL SIZE(min = 2, max = 14)
Norman Link
@Norman0406
@MikkelFunch What you need is a oneof
Alessandro D'Armiento
@axelSync_gitlab
Hello
I am new to protobuf, I would like to ask a question
In my solution, I have a generic parser object which has to contains the rules to deserialize the payload I receive. Until now, I only supported CSV and JSon, so every Parser instance was implementing its own json (or csv) schema. This way I could deserialize many different objects with 1 class.
Now I want to extend the support to Protobuf, and I defined a Parser which contains the protobufOuterClass, so when it receives a serialized payload is able to deserialize it and return me a result which is a standard map I create from the deserialized object
Is it possible to create many different OuterClasses which extends a common interface in order to support with this approac different protobuf with my parser class?
Alessandro D'Armiento
@axelSync_gitlab
Here's is an example of what I would need
image.png