Emmanuel Decitre | 3 Sep 02:34 2015
Picon

Cython wrapping

I just finished the wrapping of some protobuf C++ generated code into Cython classes.
The development costs were pretty low compared to the performance gain.
Would it make sense to extend the Python tutorial with a Cython one ?

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
TheAceInfinity | 31 Aug 03:49 2015
Picon

Question about data type from binary stream

Say we take the bytes from the example in the docs.

0x08, 0x96, 0x01

For 0x08, the wire_type is 0, which indicates VarInt, the message before encoding the data shows that the VarInt is a type int32. The field_number from 0x08 is 1 though. Where does this 1 come into play when it comes to decoding the data from the binary stream?

I read this: "As you know, a protocol buffer message is a series of key-value pairs. The binary version of a message just uses the field's number as the key"

What is the definition of *key* in this context? Does it mean that I can use this to determine the type from the specific wire_type as a key to be used for a 1-based associative array? (i.e. 1 = int32, 2 = int64, etc...)

If someone could just clarify how I would determine the specific VarInt out of these 3 bytes, that would be much appreciated!

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
srikanth.gunduboyina | 26 Aug 11:57 2015
Picon

Contriibuting Dockerfile to Protobuf v2.6.1

Hi All,

I have Dockerfile for Protobuf v2.6.1 for ppc64le platform with all the test-cases running successfully. Can you please let me know how to contribute this file.

Thanks & Regards,
Srikanth. G

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
tomcat | 26 Aug 09:26 2015
Picon

Protocol Buffer for parsing binary message format

In my application, I need to parse a relatively complex binary message exchange format, i.e. I receive messages in a binary format and need a parser to parse the messages to bring it into a Java object representation.
Is protobuf suitable for this kind of task?

kind regards


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Ross Black | 26 Aug 10:40 2015
Picon

nano in java package name even if package specified

Hi,

I have been using protobuf 3.0.0-alpha-3 and recently updated to using the latest code from repo.

When using the javanano output, the output package is now postfixed with 'nano' even if the package name is explicitly specified in the proto file.

My proto file looks like:

syntax = "proto3";
package com.example.generated;
option java_multiple_files = true;

The output now ends up in the package 'com.example.generated.nano'

Is this intentional, or is this a bug?
(I can understand adding it to an automatically created package, but it seems a bit strange to override an explicit package setting in the proto file).


Thanks,
Ross

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Austin Schuh | 26 Aug 05:42 2015

Error checking with arena allocators

I discovered while writing some code that if you pre-allocate an arena that is too small, you get an out of bounds access, and then (if you are lucky), a crash.  The following pull request adds a check.

https://github.com/google/protobuf/pull/727

Thanks,
  Austin

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Ryan Wilson | 25 Aug 03:41 2015
Picon

Feature Request: Transient member variables

I'm not sure if anyone else has run into this or how people have solved this previously, but I think it'd be helpful to have a transient member variable in a Message that doesn't serialize with the rest of the object. For instance, in a chat application you could have an `is_typing` property on a chat that wouldn't need to persist between app launches or saves since it's very UI dependent. 

With this, you'd be forced to provide a `default` value as well so when a Message is deserialized, it has an initialized value. 

Is there any other way to do this easily? Any thoughts or suggestions extremely welcome!

Thanks,
Ryan

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
sijith james philip | 24 Aug 13:24 2015
Picon

Check and add data into protobuff using C++

message HealthOccurrenceCount { required int64 HealthID=1; required int32 OccCount=2; optional bytes wci=3; }

I would like to add data based on HealthID, If HealthID is already entered then shouldnot add the new entry instead should just increment the "OccCount".

HealthOccurrenceCount objHelthOccCount; if(objHelthOccCount.healthid() == healthID) // Is this right or I need to iterate all the nodes. { occCount++; objHelthOccCount.set_occcount(occCount); } else occCount = 1;

Is this code correct or I should convert "HealthID" into string. Please give some input.

Generated Code

// required int64 HealthID = 1; inline bool has_healthid() const; inline void clear_healthid(); static const int kHealthIDFieldNumber = 1; inline ::google::protobuf::int64 healthid() const; inline void set_healthid(::google::protobuf::int64 value);

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
陈宗志 | 23 Aug 21:10 2015
Picon

multiple different protobuf messages in a socket

I use protobuf wich my c++ server. But I have a problem with multiple messages with socket

I define many proto messages, such as

message SdkHGetRet {
  required int32 opcode = 1;
  required bytes value = 2;
}

message SdkHPut {
  required bytes table = 1;
  required bytes hname = 2;
  required bytes key = 3;
  required bytes value = 4;
  optional int32 writesrc = 5 [default = 0];
}

message SdkSet {
  required bytes table = 1;
  required bytes key = 2;
  required bytes value = 3;
  optional int32 writesrc = 5 [default = 0];
}

message SdkSetRet {
  required bool status = 1;
  optional string master = 2;
}

As you can see from here, I add every message with an opcode, so every time I got a message,

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
陈宗志 | 23 Aug 21:06 2015
Picon

multiple different protobuf messages in a socket

I use protobuf with my c++ server. But I have a problem with multiple different protobuf messages in a socket
I define many proto messages, such as

message SdkHGetRet {
  required int32 opcode = 1;
  required bytes value = 2;
}

message SdkHPut {
  required bytes table = 1;
  required bytes hname = 2;
  required bytes key = 3;
  required bytes value = 4;
  optional int32 writesrc = 5 [default = 0];
}

message SdkSet {
  required bytes table = 1;
  required bytes key = 2;
  required bytes value = 3;
  optional int32 writesrc = 4 [default = 0];
}

message SdkSetRet {
  required bool status = 1;
  optional string master = 2;
}

message SdkInvalidOperation {
  required int32 what = 1;
  required bytes why = 2;
}
....

So every time I send the message by socket, I will add 8 bytes, 4 for the total socket len, 4 for the opcode, opcode mean the message type.

So in the server side, I receive the message, I read the first 4 byte, and I got the message's length, then I will read another 4 bytes to get the message's type, at last I read the message's length bytes. Then I will use message type to method map ( such as 404 => "sdkset", 405 => "sdksetret") to decode the message.

I find this way work well, but I wonder is there any elegance way to identify the message without the 4 byte message type.
I have read the message history, one method is add the entire message in a big message, like this way
message BigMessage
{
enum Type { sdkset = 0, sdksetred = 1}
require Type t = 1,
optional  string key = 2,
...
}

Since I have more than 40 types of message, I think this way may affect performance, and in my opinion, this way looks ugly.

So can you give me any good suggestion..

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
wuhao3379 | 19 Aug 08:20 2015
Picon

something wrong happen when parsing protobuf binary files in windows

I make a binary protobuf files in linux and it can well be parsed in linux,


in windows 
but after i copy this file to windows, it can be parsed but it is not complete, it just has some information,  using mycode to parse.
the code is just as below:
int fd = open(filename, O_RDONLY);


 
ZeroCopyInputStream* raw_input = new FileInputStream(fd);
 
CodedInputStream* coded_input = new CodedInputStream(raw_input);
  coded_input
->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
 
bool success = proto->ParseFromCodedStream(coded_input);

but I use protoc.exe to parse it to the text format, it is parsed successfully with complete message.
if i parse this text format, it can be parse with complete message .

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Gmane