Russell Holloway | 31 Jul 00:12 2014
Picon

Clearing/Removing Repeated Fields in Python

I have come across an issue not quite sure how to solve in the best way

Setting a repeated list of strings to an empty list (to start fresh). The only solution I have

while True:
  try:
    object.repeated_list.remove(object.repeated_list[0])
  except IndexError:
     break;

I essentially loop through removing the first object until I hit an index error. I'm looking for the best equivalent of

object.repeated_list = []

Is this the best route, or is there an easier way? Thanks in advance.

--
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.
BJ Neilsen | 30 Jul 17:42 2014
Picon

Third-party ruby protobuf library

A few years ago I forked the now unmaintained ruby-protobuf gem and have built a very robust library that is used in production at companies like Square, MoneyDesktop, and Lookout. It has rpc support with raw sockets and zeromq transport layers, with a service discovery mechanism built-in. Somehow I've gone all these years forgetting to have the gem added to the third-party page on the protobuf wiki.

Would someone please add a link for me? https://github.com/localshred/protobuf

Thanks!
BJ

--
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.
Idan Noti | 29 Jul 15:05 2014
Picon

Protobuf message template

I have certain protobuf messages with the same structure. For example:
//filename foo.proto

message
Foo
{
    message
Bar
   
{
        optional int32 foo_bar_field1
= 1;
        repeated uint32 foo_bar_field2
= 2;
   
}
}

message
Baz
{
    message
Bar
   
{
        optional int32 field
= 1;
   
}
}

message
BetterFoo
{
    optional
Foo.Bar field = 1;
}

message
BetterBaz
{
    optional
Baz.Bar field = 1;
}

BetterFoo and BetterBaz both have internal Baz message with different fields. Instead of completely writing almost the same code for both messages I'd like to have the following:
//filename wanted_foo.proto
message
Foo
{
    message
Bar
   
{
        optional int32 foo_bar_field1
= 1;
        repeated uint32 foo_bar_field2
= 2;
   
}
}

message
Baz
{
    message
Bar
   
{
        optional int32 field
= 1;
   
}
}

message
Better(Foo);
message
Better(Baz);

Message Better(X) is kind of a macro/template which should be expanded before compiling the code.

Since sub message Bar is different in Foo and Baz I cannot create a common message and use it inside each one.

I don't know of any precompiler for protobuf or any other solution to achieve this.

Is it worthwhile creating such a precompiler which it's output is passed to protobuf compiler?


--
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.
S Roychowdhury | 28 Jul 20:38 2014
Picon

Re: zeromq, protobuf rpc

You may want to have a look at

https://github.com/sroycode/zqrpc

I tried to work with rpcz (you can see my efforts at https://github.com/sroycode/rpcz)  ... but it gives errors on mutex locking especially when used with other libraries.

My main requirement was  for sending multiple requests and getting replies in parallel ...

Regards
SRC




On Thursday, May 22, 2014 7:48:20 PM UTC+5:30, Michael Haberler wrote:
This might be interesting in case you haven't already seen it: https://code.google.com/p/rpcz/


On Friday, May 16, 2014 6:21:57 AM UTC+2, Alexandru Toader wrote:
Hello, 
I am interested in using the same setup. Has anyone found any maintained plugin that supports RPC over ZeroMQ?

Alex

On Tuesday, January 8, 2013 12:10:49 AM UTC+1, Mohit Jaggi wrote:
Hi,
According to ProtoBuf docs, the rpc service code generation is deprecated and use of plugins is recommended for RPC. I am using ZeroMQ as transport layer and am looking for a plugin that generates code for C/C++, Java, Python. Are there any available?

Mohit.

--
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.
Nidhi Madappa | 27 Jul 03:18 2014
Picon

Self describiing Messages

Hi,

Can anyone explain me (if possible with a small example) as to how self describing messages can be encoded and decoded.
I have worked on the standard way GPB works.

Thanks,
Nidhi

--
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.
Anthony Seo | 25 Jul 01:24 2014
Picon

Java and C++ using CodedOutputStram

Hi,

I don't see my post, so I am doing again.

I want my Java code to receiving a simple message that sent by C++

My C++:

  TestMsg *pbTestMsg = new TestMsg();
  pbTestMsg->set_acid("7777");
  pbTestMsg->set_name("Anthony");

  int varIntSize = google::protobuf::io::
        CodedOutputStream::VarintSize32(pbTestMsg->ByteSize());
  google::protobuf::io::ArrayOutputStream arrayOut(pbBodyBuffer,
        (pbTestMsg->ByteSize() + varIntSize));
  google::protobuf::io::CodedOutputStream coded_output(&arrayOut);
  coded_output.WriteVarint32(pbTestMsg->ByteSize());
  pbTestMsg->SerializeToCodedStream(&coded_output);
//Send 13 bytes over socket, and the header message also has the size of following.


My Java:

int totalBodyBytes = 13;
byte[] bodyBytes = new byte[maxMessageSize];
//BufferedInputStream in
bytesRead = in.read(bodyBytes, 0, totalBodyBytes);
if(bytesRead == totalBodyBytes){
     System.out.println("\nOK TotalBytesRead: " + bytesRead);
}else{ //Not reached the block
     System.out.println("\n bytesReads != totalBodyBytes");
     System.exit(0);
}

ByteArrayInputStream inStream = new ByteArrayInputStream(bodyBytes, 0, totalBodyBytes);
Test.TestMsg testMsg = Test.TestMsg.parseDelimitedFrom(bodyBytes);
//But here I have null testMsg.

Could you guys help me out?

Anthony

--
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.
Anthony Seo | 25 Jul 01:22 2014
Picon

Receiving Java Sending C++ using CodedOutputStream

Hi,

I don't see my post, so I am doing again.

I want my Java code to receiving a simple message that sent by C++

My C++:

  TestMsg *pbTestMsg = new TestMsg();
  pbTestMsg->set_acid("7777");
  pbTestMsg->set_name("Anthony");

  int varIntSize = google::protobuf::io::
        CodedOutputStream::VarintSize32(pbTestMsg->ByteSize());
  google::protobuf::io::ArrayOutputStream arrayOut(pbBodyBuffer,
        (pbTestMsg->ByteSize() + varIntSize));
  google::protobuf::io::CodedOutputStream coded_output(&arrayOut);
  coded_output.WriteVarint32(pbTestMsg->ByteSize());
  pbTestMsg->SerializeToCodedStream(&coded_output);
//Send 13 bytes over socket, and the header message also has the size of following.


My Java:

int totalBodyBytes = 13;
byte[] bodyBytes = new byte[maxMessageSize];
//BufferedInputStream in
bytesRead = in.read(bodyBytes, 0, totalBodyBytes);
if(bytesRead == totalBodyBytes){
     System.out.println("\nOK TotalBytesRead: " + bytesRead);
}else{ //Not reached the block
     System.out.println("\n bytesReads != totalBodyBytes");
     System.exit(0);
}

ByteArrayInputStream inStream = new ByteArrayInputStream(bodyBytes, 0, totalBodyBytes);
Test.TestMsg testMsg = Test.TestMsg.parseDelimitedFrom(bodyBytes);
//But here I have null testMsg.

Could you guys help me out?

Anthony

--
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.
Yonggoo Seo | 25 Jul 01:06 2014
Picon

Receiving Java from C++

Hi,

I have C++ code:
   
  TestMsg *pbTestMsg = new TestMsg();
  pbTestMsg->set_acid("7777");
  pbTestMsg->set_name("Yong");

  int varIntSize = google::protobuf::io::CodedOutputStream::VarintSize32(pbTestMsg->ByteSize());
  google::protobuf::io::ArrayOutputStream arrayOut(pbBodyBuffer, (pbTestMsg->ByteSize() + varIntSize));
  google::protobuf::io::CodedOutputStream coded_output(&arrayOut);
  coded_output.WriteVarint32(pbTestMsg->ByteSize());
  pbTestMsg->SerializeToCodedStream(&coded_output);
 //then send pbBodyBuffer over tcp/ip socket


Receiving C++ worked fine, but receiving Java give me null testMsg.

Receiving Java side code:

int totalBodyBytes =13;
byte[] bodyBytes = new byte[maxMessageSize];
//BufferedInputStream in
bytesRead = in.read(bodyBytes, 0, totalBodyBytes);
if(bytesRead == totalBodyBytes){
      System.out.println("\nOK TotalBytesRead: " + bytesRead);
}else{
      System.out.println("\n bytesReads != totalBodyBytes");
       System.exit(0);
}
//It could read all 13 bytes

ByteArrayInputStream inStream = new ByteArrayInputStream(bodyBytes, 0, totalBodyBytes);
Test.TestMsg testMsg = Test.TestMsg.parseDelimitedFrom(bodyBytes);
//Now I have null testMsg

Could anybody help me out?

Anthony,

--
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.
protobuf | 25 Jul 22:23 2014

Re: Issue 493 in protobuf: protobuf-java (2.5.0) GeneratedMessage#getUnknownFields() not implemented


Comment #20 on issue 493 by baca... <at> gmail.com: protobuf-java (2.5.0)  
GeneratedMessage#getUnknownFields() not implemented
http://code.google.com/p/protobuf/issues/detail?id=493

True, it's definitely equally applicable for other libraries. It's a shame  
when other libraries do that too :-)

Does the protobuf team publish a specific versioning/compatibility policy?  
It's important for library developers to understand that upgrade their  
dependency to a particular version may cause problems.

In this instance, is this the only breaking change, and if so is there a  
specific reason the break has to be there? It's not clear to me whether the  
submitted patch does an appropriate thing.

Thanks
Baris

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

-- 
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.

protobuf | 25 Jul 20:11 2014

Re: Issue 493 in protobuf: protobuf-java (2.5.0) GeneratedMessage#getUnknownFields() not implemented


Comment #19 on issue 493 by owen.oma... <at> gmail.com: protobuf-java (2.5.0)  
GeneratedMessage#getUnknownFields() not implemented
http://code.google.com/p/protobuf/issues/detail?id=493

Making the 2.4 generated code continue to work with the 2.5 library should  
not be a large burden. There was a patch up above to fix the problem that  
was submitted 4 months ago.

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

-- 
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.

protobuf | 25 Jul 19:29 2014

Re: Issue 493 in protobuf: protobuf-java (2.5.0) GeneratedMessage#getUnknownFields() not implemented


Comment #18 on issue 493 by xiaof... <at> google.com: protobuf-java (2.5.0)  
GeneratedMessage#getUnknownFields() not implemented
http://code.google.com/p/protobuf/issues/detail?id=493

Hi bacaruk,
It seems the problem you mentioned can be applied to any library. For  
example, suppose you open-sourced a library some_library version 1.0 and  
then upgraded it to some_library version 2.0. How would you combine a  
third-party library A using version 1.0 with another third-party library B  
using 2.0 in the same project?

I agree that making generated code of 2.4.1 compatible with runtime 2.5.0  
(or vice versa) will help in some ways, but it would requires a significant  
change/redesign of the protobuf library to guarantee such compatibility. In  
the future when we need to make significant changes to protobuf (or  
implement it for new languages) we can consider this but for now it's not  
worthwhile to re-architect protobuf implementation solely for this purpose.

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

-- 
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