Re: [protobuf] Clearing/Removing Repeated Fields in Python

2014-07-31 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jul 30, 2014 at 3:12 PM, Russell Holloway wrote: > 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

Re: [protobuf] Third-party ruby protobuf library

2014-07-30 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jul 30, 2014 at 8:42 AM, BJ Neilsen wrote: > 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

Re: [protobuf] Re: Portable protobuf compiler

2014-06-23 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jun 23, 2014 at 6:29 PM, John Calcote wrote: > I'm also interested in a portable protoc compiler - java would be nice, > but python would work too. No one has a comment on this? > osuciu@'s protoc-jar might be of interest to you: https://github.com/os72/protoc-jar > > > On Friday, Janua

Re: [protobuf] Deserializing Corrupted data

2014-06-23 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jun 23, 2014 at 4:17 AM, wrote: > Hello, > > I want to know how does protocol buffers handles corrupted data while > de-serializing stream. Is there any way to know if data has been corrupted. > The parsing code only checks whether the data conforms to protobuf wire format and whether th

Re: [protobuf] protoc-jar, protoc-jar-maven-plugin

2014-06-19 Thread 'Feng Xiao' via Protocol Buffers
uot; > > Thanks! > > On Thursday, June 19, 2014 10:37:13 AM UTC-7, Feng Xiao wrote: >> >> >> >> >> On Wed, Jun 18, 2014 at 9:49 PM, wrote: >> >>> Hello protobuf folks, >>> >>> Here's a simple convenience JAR that packages

Re: [protobuf] protoc-jar, protoc-jar-maven-plugin

2014-06-19 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jun 18, 2014 at 9:49 PM, wrote: > Hello protobuf folks, > > Here's a simple convenience JAR that packages pre-built protoc binaries > for Linux, Mac/OSX, and Windows. This gives a little bit of "platform > independence" to protoc (besides not having to build it on Linux and Mac). > The pa

Re: [protobuf] protobuf newbie questions

2014-06-18 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jun 18, 2014 at 1:04 AM, wrote: > Hi, > I'm new to protobuf library. I have generated a .h and .cc file out of a > sample .proto file by using protoc.exe on windows. > I want to know > 1. Can I use above generated files on MAC without any change? > Yes. > 2. Can I use the same files

Re: [protobuf] Possible C++ serialization issue with repeated fields

2014-06-18 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jun 18, 2014 at 10:10 AM, Justin wrote: > > > On Wednesday, June 18, 2014 12:36:27 PM UTC-4, Ilia Mirkin wrote: > >> On Wed, Jun 18, 2014 at 12:26 PM, Justin wrote: >> > My team and I noticed a potential bug in the serialization process, >> that >> > seems unintended. >> > >> > If I defi

Re: [protobuf] Add link to rust protobuf implementation

2014-06-17 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Jun 17, 2014 at 3:50 PM, Robert Edmonds wrote: > 'Feng Xiao' via Protocol Buffers wrote: > > On Tue, Jun 17, 2014 at 5:46 AM, Stepan Koltsov < > stepan.kolt...@gmail.com> > > wrote: > > > > > Hi, > > > > > > there

Re: [protobuf] Add link to rust protobuf implementation

2014-06-17 Thread &#x27;Feng Xiao' via Protocol Buffers
On Tue, Jun 17, 2014 at 5:46 AM, Stepan Koltsov wrote: > Hi, > > there's a protobuf implementation in Rust and for Rust (I'm the author): > > https://github.com/stepancheg/rust-protobuf/ > > Please, add this link to Third-Party Add-ons page: > https://code.google.com/p/protobuf/wiki/ThirdPartyAdd

Re: [protobuf] Deprecated field annotations in gcc

2014-05-30 Thread &#x27;Feng Xiao' via Protocol Buffers
On Thu, May 29, 2014 at 5:23 PM, Priyendra Deshwal wrote: > Hey guys, > > It seems like the deprecated field annotations in gcc are no longer > emitted by the protobuf compiler and the following commit removed this > functionality. > > > https://code.google.com/p/protobuf/source/diff?spec=svn425&

Re: [protobuf] Customizing protoc to support an existing wire format

2014-05-27 Thread &#x27;Feng Xiao' via Protocol Buffers
There are two ways to support custom wire format with protobufs. 1. Implement the parsing/serializing code as a runtime library. The text format support in protobuf can be seen as such a library. Support for Json/XML is also done using this approach. It relies on the protobuf reflection support w

Re: [protobuf] protobuf 2.5.0 lazy feature

2014-05-27 Thread &#x27;Feng Xiao' via Protocol Buffers
On Mon, May 26, 2014 at 12:17 AM, Yuexuan Chen wrote: > Hey, guys, >After download the new protobuf 2.5.0 version, i saw a lazy option in > descriptor.proto, is it an already-implemented feature or just an in-plan > feature? > It's already implemented in our internal branch but not included in

Re: [protobuf] Re: Bad data causes segmentation fault in google::protobuf::DescriptorPool::FindFileByName

2014-05-22 Thread &#x27;Feng Xiao' via Protocol Buffers
unsigned int) (in > /home/patrick/secure/repo/trajserver-internal2/build/trajhttpserv) > ==13935== Address 0x0 is not stack'd, malloc'd or (recently) free'd > ==13935== > [22/05/2014 19:55:47,646579] FATAL: CRASH HANDLED; Application has crashed > due to [SIGSEGV] sig

Re: [protobuf] Re: Bad data causes segmentation fault in google::protobuf::DescriptorPool::FindFileByName

2014-05-22 Thread &#x27;Feng Xiao' via Protocol Buffers
Can you try if the following code can produce any meaningful results? I suggest you try this once in your original binary and then create a simple program calling the following code only (and only linking the .proto file without anything else in your project). If both fail (segfault), it might be a

Re: [protobuf] C++11 for each loops with RepeatedField

2014-04-18 Thread Feng Xiao
On Fri, Apr 18, 2014 at 11:28 AM, Justin wrote: > I assume there is a simple answer to this, but I'm having trouble finding > it and my searches for similar questions have come up empty ... Perhaps it > being Friday afternoon is also reducing my ability to solve this :) > > I want to be able to u

Re: [protobuf] Stop reading at zero tag: possible?

2014-04-08 Thread Feng Xiao
On Sun, Apr 6, 2014 at 2:34 AM, Andreas Schildbach < andreas.schildb...@googlemail.com> wrote: > For our application, we chose a protobuf format without delimiting. We > thought the EOF that would occur when reading the file would suffice. (For > those interested: It's the Bitcoin wallet format fo

Re: [protobuf] string-valued enum needed when implementing OpenRTB2.1 proto file

2014-03-28 Thread Feng Xiao
On Fri, Mar 28, 2014 at 8:54 AM, Zhiqian Yuan wrote: > Hi all, > > I don't know if there's anyone trying to defining a proto following > OpenRTB2.1, and I have no idea why few people do this work, even google > doesn't. (It's unreasonable since protobuf is born to serve protocols > especially fo

Re: [protobuf] decode tripUpdates protocol buffer files using protoc.exe and the gtfs-realtime.proto

2014-03-26 Thread Feng Xiao
On Mon, Mar 24, 2014 at 4:46 PM, Daniel wrote: > Hi, > > I'm trying to decode some tripUpdates protocol buffer files into a text > file. > I downloaded the gtfs-realtime.proto and the tripUpdates.pb files from > http://gtfs.ovapi.nl/new/ as well as the protoc.exe into the directory > "C:\test". >

Re: [protobuf] Re: Issue 620 in protobuf: Concerting ByteString to String

2014-03-25 Thread Feng Xiao
On Mon, Mar 24, 2014 at 5:38 PM, wrote: > > Comment #4 on issue 620 by veer...@gmail.com: Concerting ByteString to > String > http://code.google.com/p/protobuf/issues/detail?id=620 > > Hi, > > I am not getting any error but not able to convert ID and IPAddress. > How did you convert? > > Let us

Re: [protobuf] help with protoc rpc code generation in Java (or Scala)

2014-03-21 Thread Feng Xiao
You can find a list of existing rpc add-ons in this page: https://code.google.com/p/protobuf/wiki/ThirdPartyAddOns#RPC_Implementations Some of them are using protoc plugins and some of them are simply writing their own compiler. On Fri, Mar 21, 2014 at 12:19 PM, P Osborne wrote: > > Hi All, > >

Re: [protobuf] [ANN] exprotoc - Elixir protobuffs compiler

2014-03-19 Thread Feng Xiao
Thanks. Added to ThirdPartyAddOns On Tue, Mar 18, 2014 at 3:29 PM, Jeremiah Ong wrote: > https://github.com/jeremyong/exprotoc > > Missing support for extensions and packed fields (although this is coming > soon) > > -- > You received thi

Re: [protobuf] On the wire compatibility with protoc options

2014-03-19 Thread Feng Xiao
On Wed, Mar 19, 2014 at 5:06 PM, Chris Large wrote: > Hi folks, > > I'm exploring the new javanano-out option available from the repository > since I have some big issues right now with the side of the generated java > code for the protobuf messages. > > My question is, is the wire format affecte

Re: [protobuf] [ANN] ProtoBuf.jl - A ProtoBuf library for Julia

2014-03-14 Thread Feng Xiao
On Tue, Mar 11, 2014 at 5:21 PM, Tanmay K. Mohapatra wrote: > Hi, > > I am pleased to announce the availability of a protobuf library for Julia > language users. > > https://github.com/tanmaykm/ProtoBuf.jl > > It will be great to have it listed in the ThirdPartyAddon page and get > feedbacks from

Re: [protobuf] python proto optimizations

2014-03-14 Thread Feng Xiao
On Sun, Mar 9, 2014 at 5:19 AM, liao liao wrote: > "new design/implementation in the next release" to significantly improve > python sdk's performance, when? > Probably in Q3. > the c++ binding has been experimental for years. > > > On Saturday, March 1, 20

Re: [protobuf] Build in 64bits

2014-03-14 Thread Feng Xiao
On Fri, Mar 7, 2014 at 11:09 AM, ProTobUS wrote: > Hi > > I want to build my solution that use Procol buffer in 64 bits do I have to > build protocol Buffers in 64 bits ? > Yes. > if Yes can I use > *protoc-2.5.0-win32.zip* > to bui

Re: [protobuf] python proto optimizations

2014-02-28 Thread Feng Xiao
For patch #1, you can submit it to the issue tracker. We don't have time to look at it immediately but will get to it in the next release. For patch #2, we don't accept patches to the experimental C++ binding support any more because it will be replaced by a new design/implementation in the next r

Re: [protobuf] What happens to submitted bugs with patches?

2014-02-25 Thread Feng Xiao
Hi Daniel, Thanks for contributing these patches and sorry for not being able to respond to these patches timely. The problem is that right now we have no one working on the open-source protobuf project. You can see from the svn change history that very few patches are applied to the repository si

Re: [protobuf] Python 3

2014-02-14 Thread Feng Xiao
On Fri, Feb 14, 2014 at 2:18 PM, Ram Rachum wrote: > Hi everybody, > > What's the status of Python 3 support? I'd like to use protocol buffers in > my new Python 3.4-based project. > The next major release will support python 3. It'll probably be released in Q3 as protobuf 2.6.0 > > > Thanks, >

Re: [protobuf] How to Create new Unknown Fields on a Message?

2014-02-09 Thread Feng Xiao
Protobuf UnknownFieldSet is used to store unknown fields in protobuf wire format. An unknown Json field doesn't contain protobuf wire information and therefore can't be converted to an unknown field. On Thu, Feb 6, 2014 at 11:52 PM, Gregory Hlavac wrote: > I'm rewriting a JSON <-> Protobuf bridg

Re: [protobuf] Reading .pb file

2014-02-05 Thread Feng Xiao
You need a .proto file to parse protobuf messages because otherwise you won't be able to know what's in the data file. On Wed, Feb 5, 2014 at 6:49 PM, Vijay Miriyala wrote: > I am new to ProtoBuff file formats. I received a zip file which contains > .pb file. I do not have .proto file. Is there a

Re: [protobuf] Error while trying to compile one of Chrome's proto files

2014-01-31 Thread Feng Xiao
On Thu, Jan 30, 2014 at 6:56 AM, Ik Si wrote: > Hi, > > I'm trying to compile one of Chrome's proto files: > > https://chromium.googlesource.com/experimental/chromium/src/+/master/sync/protocol/sync_enums.proto > using exe from "protoc-2.5.0-win32.zip" > and I get the following error: > > "sync_e

Re: [protobuf] Re: Issue 515 in protobuf: More intelligent enums

2014-01-31 Thread Feng Xiao
On Fri, Jan 31, 2014 at 4:36 AM, wrote: > > Comment #7 on issue 515 by peterhan...@yahoo.com: More intelligent enums > http://code.google.com/p/protobuf/issues/detail?id=515 > > The proposed solution doesn't work because: >>> 1. The name of the enum type is changed from "Foo" to "Foo::Enum" whic

Re: [protobuf] Max number of repeated fields

2014-01-30 Thread Feng Xiao
On Thu, Jan 30, 2014 at 6:48 AM, Øyvind Bakken wrote: > We have a protobuf message defined in the following way: > > message ModuleEntry > { > optional uint32 id = 1; > optional string name = 2; > optional uint32 type = 3; > repeated ParameterEntry parameter = 4; > repeated Mo

Re: [protobuf] Patch to restore Solaris support to Protocol Buffers

2014-01-21 Thread Feng Xiao
Hi Lars, We don't have people actively working on open-source protobuf right now and that's why you haven't seen these patches been applied. We have planed a major release in Q2/Q3 though. At that time we'll go through all the open issues. It's better to submit this patch to the issue tracker becau

Re: [protobuf] Logic to Parse Either a Message or a Size Delimited Series of Messages

2014-01-09 Thread Feng Xiao
On Mon, Jan 6, 2014 at 5:17 PM, wrote: > Hi All, > > Quick question (though it may be a little confusing). > > I currently have a Message that looks something like this > > message MyMessage { > > repeated float positions = 1 [packed = true]; > > repeated float normals = 2 [packed = true]; >

Re: [protobuf] Finding "ByteSize" of collection of messages

2014-01-09 Thread Feng Xiao
On Fri, Jan 3, 2014 at 12:59 PM, wrote: > Sorry if this has been covered before. I searched but couldn't find a > complete answer (or at least what I thought was complete). I'll give a > little background and some small example code as I believe it will help. > I'm using C++ and optimizing my pro

Re: [protobuf] Re: Dynamic messages in Python

2014-01-09 Thread Feng Xiao
On Thu, Dec 19, 2013 at 6:29 AM, Tomas Palenicek wrote: > Hello, > > 2.5.0 is out for a while and requested features are mentioned within the > changelog. > Is there any usage example anywhere please? > You can read the unit-tes

Re: [protobuf] Use default value for string field in protobuf 2.5

2013-12-11 Thread Feng Xiao
On Wed, Dec 11, 2013 at 3:03 AM, wrote: > Dears, > I have a test.proto file like this: > > message Test { > optional string str_1 = 1; > optional string str_2 = 2 [default="3.0"]; > } > > A default value is set for string field str_2. In the main file I defined > a global Test instance an

Re: [protobuf] Handeling large amount of data

2013-12-02 Thread Feng Xiao
On Mon, Dec 2, 2013 at 8:11 AM, Mathijs Jonker wrote: > Hi there, > > I'm using protobuf on a Embedded system. > While I'm trying to add large amount of data I'm running into the issue > that the container.add_data() for repeated fields takes long. > > I'm trying to add 8000 elements by calling ad

Re: [protobuf] Help?!

2013-11-25 Thread Feng Xiao
https://developers.google.com/protocol-buffers/docs/reference/python-generated On Fri, Nov 22, 2013 at 11:16 AM, Mihai Banulescu wrote: > Hi all, > > I'm new to protobufs and I could use some help. > We use them at work, in Python. > > I just need to access the data in a repeated field, and I'm

Re: [protobuf] SWIG c++ generated protobufs?

2013-11-17 Thread Feng Xiao
On Thu, Nov 14, 2013 at 1:13 PM, JT Olds wrote: > Hey all, > > In the generated cpp header files from protoc, there's an ifdef placed > near the end for SWIG. Is that cruft? I spent an hour or so today trying to > get SWIG to wrap a generated protobuf but it wasn't exactly > straightforward. On t

Re: [protobuf] claire-protorpc - New Protobuf RPC implemention

2013-11-11 Thread Feng Xiao
Done. On Sun, Nov 10, 2013 at 6:30 PM, 禹范 wrote: > Hi, claire-protorpc is new protobuf rpc implmetion in C++, repository is > https://github.com/robbinfan/claire-protorpc, could anyone add it to > "Third-Party Add-ons for Protocol Buffers" page "RPC Implemention" section, > thanks :) > > -- >

Re: [protobuf] Hard to understand message from protobu

2013-10-28 Thread Feng Xiao
On Mon, Oct 28, 2013 at 10:17 AM, Howard wrote: > Hi all > > When I run the server side of my protobuf enabled application I am seeing > a diagnostic message I am having a hard time understanding. Here is the > stdout including some diagnostic messages I have added: > > Parsing request in worker

Re: [protobuf] Please add 'Wire' to ThirdPartyAddOns page

2013-10-25 Thread Feng Xiao
Done. Added an entry under "Programming Languages": - Java/Android: https://github.com/square/wire On Fri, Oct 25, 2013 at 7:25 AM, Dan Rice wrote: > Hi - > > Please add a link to the > Wirelibrary on the > https://code.google.co

Re: [protobuf] How to set preallocated message field using reflection?

2013-10-23 Thread Feng Xiao
On Wed, Oct 23, 2013 at 8:01 AM, Ivan L wrote: > I have a code like: > > > TestMessage* output; > ::google::protobuf::Message* input; > auto reflection = output->GetReflection(); > > ... > auto extension_field = input->GetDescriptor->extension(i); > ... > > auto output_field = > reflection->FindK

Re: [protobuf] Compiling protobuf with GOOGLE_PROTOBUF_NO_THREAD_SAFETY macro

2013-10-21 Thread Feng Xiao
On Mon, Oct 21, 2013 at 1:05 AM, Safi Ali wrote: > Hi, > > I have been trying to compile google protocol buffers 2.5.0 on solaris > (sparc) environment. It seems I have to use > the GOOGLE_PROTOBUF_NO_THREAD_SAFETY macro in order to make it compile > properly. So I follow these steps to compile p

Re: [protobuf] Newbie question about union types

2013-10-08 Thread Feng Xiao
See the section of "Singular Embedded Message Fields": https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#fields On Tue, Oct 8, 2013 at 10:58 AM, Howard Lander wrote: > Hi all > > Please excuse this question from a newcomer; any assistance is greatly > appreciated. > >

Re: [protobuf] Can't get import "../

2013-10-03 Thread Feng Xiao
For each .proto file there is a canonical name and this name is used in the import statement. The canonical name is a relative file path name ("." and ".." is not allowed) and you can choose which directory to relative to by using the --proto_path argument properly. For example, suppose you have a

Re: [protobuf] Default repeated field list size

2013-10-03 Thread Feng Xiao
No, there isn't a way to set a default value for repeated fields. On Thu, Oct 3, 2013 at 1:15 AM, Robert Reeves wrote: > Hi, > > By default, when I call the 'getDefaultInstance' method of a Message, the > repeated fields are empty (list size = 0). Is there a way to change this > behaviour (set a

Re: [protobuf] Choosing between multiple protobuf messages

2013-09-20 Thread Feng Xiao
You should send the type of the message along with the actual message data and use it to tell what type is the message in the receiving side. Or you can define and send such a message: message FooOrBarOrLogon { optional Foo foo_value = 1; optional Bar bar_value = 2; optional Logon logon_value

Re: [protobuf] Is protobuf supported on Solaris10 64-bit system platform ? How to compile source code?

2013-09-12 Thread Feng Xiao
We don't test protobuf on these platforms but we accept patches that fix protobuf's problems on these systems. On Sun, Sep 8, 2013 at 5:31 PM, wrote: > Now, my group is planning to use protobuf on our own application, but when > I was compiling the source code on solaris10 64-bit Unix system, so

Re: [protobuf] protobuf_spec: RSpec matchers and Cucumber step defs for testing Protocol Buffers

2013-08-29 Thread Feng Xiao
On Wed, Aug 28, 2013 at 2:56 PM, Chris Busbey wrote: > Hi there! > > We've just released an open source library for inspecting and building > protocol buffers to be used in Cucumber scenarios. > > Check it out here: > > https://github.com/connamara/protobuf_spec > > We think this would be a great

Re: [protobuf] Debug assertion failed while attempting to set an object

2013-08-28 Thread Feng Xiao
On Wed, Aug 28, 2013 at 10:31 AM, Rajesh Khan wrote: > > > I currently have something like this. I get an error when i attempt to > store data in a message that has multiple message types in it. > >

Re: [protobuf] Re: a new lib of as

2013-08-27 Thread Feng Xiao
Are you requesting adding this to the ThridPartyAddons wiki page? I can help do that but can you provide more information on what this lib does and how to use it? On Tue, Aug 27, 2013 at 4:29 AM, 李志 wrote: > there is have manager? > why not add 2 list this lib? > > -- > You received this message

Re: [protobuf] Protocol Buffers RPC implementation - RCFProto

2013-08-24 Thread Feng Xiao
On Sat, Aug 24, 2013 at 5:36 AM, Jarl Lindrud wrote: > Hi all, > > Our company has developed a new product, RCFProto, which is a > cross-platform RPC implementation for Protocol Buffers. > > http://www.deltavsoft.com/RCFProto.html > > If possible, we would like to get RCFProto listed under "RPC >

Re: [protobuf] Protocol Buffers integrated with Eneter Messaging Framework

2013-08-15 Thread Feng Xiao
On Thu, Aug 15, 2013 at 1:16 AM, ondrej uzovic wrote: > I would like to let you know Protocol Buffers serialization is now > integrated with Eneter Messaging Framework. > > Eneter is a lightweight library for interprocess communication working on > multiple platforms. > It supports several communi

Re: [protobuf] can't build java files on mac

2013-08-07 Thread Feng Xiao
On Wed, Aug 7, 2013 at 11:42 AM, craig wrote: > Hello, > > I'm trying to build the java version of protobuf on mac and can't. I used > brew to download and install protoc fine, version 2.5.0 is running. But now > I'm trying to create the java files and can't. I've downloaded the > distribution an

Re: [protobuf] ByteString using N bytes from an InputStream?

2013-08-06 Thread Feng Xiao
On Tue, Aug 6, 2013 at 12:26 PM, Oliver Jowett wrote: > On Tue, Aug 6, 2013 at 7:18 PM, Feng Xiao wrote: > >> >> On Mon, Aug 5, 2013 at 9:31 PM, V.B. wrote: >> >>> ... Actually, I just now took a closer look at the readChunk() method. >>> Even that

Re: [protobuf] ByteString using N bytes from an InputStream?

2013-08-06 Thread Feng Xiao
redundant copy which can be eliminated (and should be). I don't understand why the wrapper has to contain an extra copy though. Isn't it just copying the data to the destination directly? > > > On Tuesday, August 6, 2013 12:28:56 AM UTC-4, V.B. wrote: >> >> Hi Feng

Re: [protobuf] ByteString using N bytes from an InputStream?

2013-08-05 Thread Feng Xiao
On Mon, Aug 5, 2013 at 3:23 PM, V.B. wrote: > Greetings all, > We are using version 2.5. What is the most efficient way (*i.e.*single > copy operation, no extra byte arrays) to construct a ByteString from > a specific number of bytes in an InputStream? The various versions of > ByteString.re

Re: [protobuf] Protocol Buffers Specification and the syntax keyword.

2013-08-05 Thread Feng Xiao
On Sat, Aug 3, 2013 at 2:18 AM, Peter Hultqvist wrote: > Hello > > Today I received a pull request on my implementation of protocol buffers > to support the "syntax" keyword. > This got me puzzled since I had not read it anywhere before. > > My main source has been this document > https://develo

Re: [protobuf] whose responsibility to delete the PB message which is added by set_allocated_xxx(xxx* ptr)?

2013-07-23 Thread Feng Xiao
After "aa->set_allocated_PB_b(bb)" aa will take the ownership of bb. It means aa will be responsible to delete bb, so you only need to delete aa. On Tue, Jul 23, 2013 at 5:42 AM, Icymaple Han wrote: > > Hi, I am using protobuf in C++ but confused by set_allocated_xxx. For > example, there is a me

Re: [protobuf] Protocol RPC for Go and C++

2013-07-22 Thread Feng Xiao
Done. On Sun, Jul 21, 2013 at 7:20 AM, ChaiShushan wrote: > Hi Feng Xiao, > > I changed the url to https://code.google.com/p/protorpc/ > > Now, go version can use `go get > code.google.com/p/protorpc`<http://code.google.com/p/protorpc>install pkg. > > C++ versio

Re: [protobuf] heap memory abuse in CodedInputStream.readRawBytes

2013-07-12 Thread Feng Xiao
On Fri, Jul 12, 2013 at 6:26 AM, Michael Howard wrote: > I am a protocol buffer newbie. > I have inherited a performance-critical application that reads some > high-volume data streams that are coded in protocol buffer format. > > byte[] org.google.protobuf.CodedInputStream.readRawBytes(int size)

Re: [protobuf] Casting of pb.h into regular header files and vice versa

2013-07-08 Thread Feng Xiao
On Sun, Jul 7, 2013 at 4:15 PM, wrote: > I currently have multiple classes in my project some of these classes use > boost serialization and these classes are used at various places in the > project. I now need to serialize some of these classes and send them across > the network as string. For t

Re: [protobuf] post-processing compiled artefacts in plugins

2013-07-08 Thread Feng Xiao
On Wed, Jul 3, 2013 at 6:59 PM, Motiejus Jakštys wrote: > Hi all, > > I am writing Python protoc plugin which wants to add some Python to > resulting artifacts. However, there is an issue. For it to work I must > do some acrobatics to get the file name in the plugin. The "name" of > CodeGeneratorR

Re: [protobuf] Accessing repeated fields in extensions from C++

2013-07-08 Thread Feng Xiao
On Tue, Jul 2, 2013 at 8:10 PM, wrote: > Hi, > > In the following protocol buffer, how does one access the repeated fields > in the extension from C++? > Use ExtensionSize(id), GetExtension(id, index) etc. to access repeated extensions. > > > Glenn > > base.proto: > > message Base { > optio

Re: [protobuf] Re: Issue 527 in protobuf: C++: Descriptor is set to null when loading more than one file.

2013-07-02 Thread Feng Xiao
On Tue, Jul 2, 2013 at 10:32 AM, wrote: > > Comment #2 on issue 527 by guillaum...@gmail.com: C++: Descriptor is set > to null when loading more than one file. > http://code.google.com/p/**protobuf/issues/detail?id=527 > > WRITE > fstream ou

Re: [protobuf] Fwd: Unable to build C++ protobuf

2013-07-02 Thread Feng Xiao
On Mon, Jul 1, 2013 at 10:54 PM, Jagmohan Singh wrote: > Dear All > > I was building protobuf on Cygwin, however, it failed at make check step. > Please suggest some work around to build it successfully. > Probably upgrade your Cygwin version? > > Makefile:2838: recipe for target `check-TESTS' f

Re: [protobuf] Adding numeric range options?

2013-07-01 Thread Feng Xiao
On Mon, Jul 1, 2013 at 3:20 AM, wrote: > Hi all, > > I wan't to add numeric range information to fields according to the > following syntax: > > message MyMessage > { > uint32 field1 = 1 > [default = 0, > (myext).min = 0, > (myext).max = 0x]; > > double field2 = 2 >

Re: [protobuf] Efficiently reading/writing multiple messages in C++

2013-06-27 Thread Feng Xiao
The fast path only works if the "optimize_for" option is set to "SPEED" in the proto file. If that's not the case, just use approach 2. If you enabled the "optimize_for" option and want to take advantage of the fast path, 3) seems to be a reasonable approach. The code should be similar to the imple

Re: [protobuf] Re: Python with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp

2013-06-25 Thread Feng Xiao
Yes, the package uploaded to PyPI only contains the pure python implementation. To use the cpp implementation you'll need to download the source tar from the download page and build it from source. On Mon, Jun 24, 2013 at 4:49 PM, William Rowan wrote: > I'm having the same problem. It looks like

Re: [protobuf] encoding question

2013-06-20 Thread Feng Xiao
On Thu, Jun 20, 2013 at 2:13 AM, Sébastien Muscat wrote: > Hi, > > I've got an encoding question about the following proto : > > message Property { > required string key = 1; > optional string value = 2; > } > > message SysDate { > required uint64 sec = 1; > required uint32 usec = 2; > } >

Re: [protobuf] [Patch] Fix short repeated format parsing error for protobuf-2.5.0-python

2013-06-13 Thread Feng Xiao
Thanks. Could you create an issue here: https://code.google.com/p/protobuf/issues/list and attach the patch file? Also it would be appreciated if you can add an unit test in text_format_test.py

Re: [protobuf] Unittest fails cross-compiling for ARM

2013-06-13 Thread Feng Xiao
On Wed, Jun 12, 2013 at 12:34 AM, Curzio Basso wrote: > Hi all, > > I've got some problem trying to cross-compile for ARM, apparently related > to the unit tests (but maybe related to wrong > configuration...). Sorry to bother but I did not find any hint in other > messages... which probably means

Re: [protobuf] Deserializing of protobf Message from JSON string in C++

2013-06-05 Thread Feng Xiao
On Wed, Jun 5, 2013 at 2:44 AM, Channakeshava S C < channakeshava...@gmail.com> wrote: > I am facing problem in getting protobuf Message with extension from JSON > string {"xyz": [1234,2345,3456],"extensions":{"bar": [1,11,111]}} which is > generated from Foo. > > message Foo { > repeated int32

Re: [protobuf] I have question about writeTo() method.

2013-06-04 Thread Feng Xiao
On Sat, Jun 1, 2013 at 11:58 AM, Byungnam Lim wrote: > Hi. I'm new to PB. > > I'm using java and want write data through socket. I was about to use > writeTo(*OutputStream*) method but it wasn't there and only writeTo(* > CodedOutputStream*) was found. > > I've googled for 2 hours and seems that

Re: [protobuf] Java Serialization: Extension goes "missing"

2013-06-03 Thread Feng Xiao
> pro to buf serialisation). > Where would i put the mergeFrom in such a case? > The Java serialization support in protobuf lacks this feature. You will have to do the parsing using protobuf mergeFrom()/parseFrom() API in order to recognize extensions. > > > > On Monday, 3 Ju

Re: [protobuf] Java Serialization: Extension goes "missing"

2013-06-03 Thread Feng Xiao
On Mon, Jun 3, 2013 at 11:54 AM, Stik kos wrote: > I'm using a protobuf java file inside a class which gets serialized (using > the default Java serialization) and I noticed that the extensions aren't > available after de-serializing the object. > > *This is my proto file:* > > message ExtensionT

Re: [protobuf] Re: New to Protocol Buffers-Question about versions

2013-05-31 Thread Feng Xiao
mine Little wrote: >> >> Any suggestions for windows >> >> On Friday, May 31, 2013 3:39:44 PM UTC-4, Feng Xiao wrote: >>> >>> Your system may have the 2.4.1 pre-installed. In that case, you need to >>> uninstall it using the package management tool p

Re: [protobuf] Re: New to Protocol Buffers-Question about versions

2013-05-31 Thread Feng Xiao
onger any instance of any > version of the protocol buffers on the computer but the version for protoc > still points to 2.4.1. > > > On Friday, May 31, 2013 1:55:37 PM UTC-4, Feng Xiao wrote: > >> Just uninstall whatever version you installed and check "protoc >>

Re: [protobuf] Re: New to Protocol Buffers-Question about versions

2013-05-31 Thread Feng Xiao
Just uninstall whatever version you installed and check "protoc --version". The expected output is something like "protoc: command not found". Install 2.5.0 after that. On Fri, May 31, 2013 at 10:51 AM, Jasmine Little wrote: > Does that mean I will need to re-install 2.4.1 and do a make uninstall

Re: [protobuf] New to Protocol Buffers-Question about versions

2013-05-31 Thread Feng Xiao
On Fri, May 31, 2013 at 7:10 AM, Jasmine Little wrote: > Hi > > I am just learning about protocol buffers. I installed 2.4.1, removed and > then installed 2.5.0. > > When I type protoc --version on cmd, it says libprotoc 2.4.1. > > How can I change the version to be 2.5.0? > Before installing 2.5

Re: [protobuf] Re: php bindings

2013-05-31 Thread Feng Xiao
Done. On Fri, May 31, 2013 at 4:40 AM, wrote: > Hi, > > Could you add my implementation to the Third Party Add-Ons wiki page too? > > Thanks, > Shuhei > > 2013年5月20日月曜日 3時35分18秒 UTC+9 shuhei...@gmail.com: > >> Hi there, >> >> I've nearly opened protocol buffers extension for PHP. >> it's not co

Re: [protobuf] Who needs "import public" ?

2013-05-23 Thread Feng Xiao
On Thu, May 23, 2013 at 8:48 AM, Ruffian Eo wrote: > I am currently updating my years old implementation of protocol buffers > for my company. Handwritten parser and code generators etc... > So while reviewing the current state of the art, I was taken by surprise > when I saw the (for me) new "imp

Re: [protobuf] New syntax for packed message elements: Example. packed uint32 my_element = 1;

2013-05-23 Thread Feng Xiao
On Thu, May 23, 2013 at 9:31 AM, Ruffian Eo wrote: > Ever since I first used protocol buffers, the construct [packed=true] > appeared like a temporary hack to me. > > Here my proposal: > Alternate syntax (with same constraints and semantics) > > Example Old: > repeated uint32 my_element = 1 [packe

Re: [protobuf] PHP Protobuf

2013-05-22 Thread Feng Xiao
On Wed, May 22, 2013 at 12:12 AM, Hubert Jagodziński < hubert.jagodzin...@gmail.com> wrote: > Hi, > > PHP Protobuf is another Protocol Buffers PHP implementation. It is written > as extension in C providing high performance. The project is on Github here: > > https://github.com/allegro/php-protobu

Re: [protobuf] usage of 'null' as a variable name in protobuf-2.5.0

2013-05-20 Thread Feng Xiao
On Thu, May 16, 2013 at 10:58 PM, wrote: > Version 2.5.0 has the following line in a couple of places in > repeated_field.h: > > MessageLite* null = NULL; > > > My gnu-based compiler doesn't like this as it thinks 'null' is a constant. > > If I rename 'null' as 'narl' then it's OK. > > Is 'null'

Re: [protobuf] Unit test fails on VS2010 -

2013-05-20 Thread Feng Xiao
On Mon, May 20, 2013 at 8:31 AM, Kopernik003 wrote: > Hi, > I run unit tests (tests.exe) on version 2.5.0. but 13 tests fail. > How did you run the tests? The error message below usually means you are not running the tests in the correct working directory. > > [--] Global test environmen

Re: [protobuf] Re: 2.5.0 released.

2013-05-16 Thread Feng Xiao
On Thu, May 16, 2013 at 8:33 AM, Tomas Palenicek wrote: > Dne středa, 27. února 2013 9:02:19 UTC+1 Feng Xiao napsal(a): > >> The final release of Protobuf 2.5.0 is now available: >> http://code.google.com/p/**protobuf/downloads/list<http://code.google.com/p/pr

Re: [protobuf] PATCH: Leading comments droppped when using --descriptor_set_out

2013-05-15 Thread Feng Xiao
On Wed, May 15, 2013 at 1:46 PM, Justin Bailey wrote: > Greetings! > > The protoc compiler will write a FileDescriptorProto protocol buffer > describing its input files when given the --descriptor_set_out flag. If > --include_source_info is also given, then comments (and other information) > for

Re: [protobuf] Performance aspect of submessage serialization

2013-05-15 Thread Feng Xiao
On Wed, May 15, 2013 at 3:16 AM, wrote: > Thanks for the input Marc! I cannot find the thread you refer to. Was it > developers from Google who gave you the answer? > > The "groups" alternative would really fix my problem. It is a pity that it > is deprecated and that the same mechanism cannot be

Re: [protobuf] CopyingOutputStreamAdaptor Not Writing to CopyingOutputStream?

2013-05-10 Thread Feng Xiao
On Fri, May 10, 2013 at 11:16 AM, wrote: > Hey All, > > I've stumbled upon something this is confusing me and need a little help. > I've made a message, compiled it (for C++) optimized for LITE_RUNTIME in > proto buffers 2.5.0. > > From my understanding, using the lite runtime means no default >

Re: [protobuf] Protocol RPC for Go and C++

2013-05-08 Thread Feng Xiao
Thanks, added to https://code.google.com/p/protobuf/wiki/ThirdPartyAddOns On Wed, May 8, 2013 at 6:33 AM, chai2010 wrote: > Hi, I have create a protorpc project, impl RPC for Go/C++: > > https://bitbucket.org/chai2010/protorpc > https://code.google.com/p/protorpc/ > > Some examples: > > https://

Re: [protobuf] protobuf 2.5.0 linux version mismatch

2013-05-07 Thread Feng Xiao
On Tue, May 7, 2013 at 2:20 AM, wrote: > I tried to build protobuf 2.5.0 on linux - ubuntu kernel 2.6.32 > but the protoc executable file with the command --version give the result > ver 2.2.0 You are probably calling the one coming with the system, not the one you built. > > > > > -- > You r

Re: [protobuf] Can I use int16 instead of int32 to verify a variable?

2013-05-07 Thread Feng Xiao
On Thu, Apr 25, 2013 at 9:36 PM, 王海龙 wrote: > Hi, > I have a question here, > I want use int16 (short) to verify a variable,because int32 is too big for > me , I want to reduce the length of my package. > What do you mean by "the length of your package"? I believe using int16 doesn't save you any

Re: [protobuf] 2.5.0 C++ performance summary

2013-04-22 Thread Feng Xiao
On Mon, Apr 22, 2013 at 2:27 PM, Stephen Townsend wrote: > Apologies if this is an FAQ but I see the release notes state C++ > optimizations were made, is there a list of those changes anywhere please? > is this the atomic opt stuff only? What's the expected (ballpark) > improvement over 2.4.x?

Re: [protobuf] new code generator: protobuf-nginx

2013-04-22 Thread Feng Xiao
de relies on nginx-specific types such as its typedefs for > strings, arrays, and rbtrees, and also its memory pools and so on. The > generated code is meant to be compiled into the nginx binary, which is > currently the way all module development is done with nginx. > > -dave > &g

Re: [protobuf] new code generator: protobuf-nginx

2013-04-22 Thread Feng Xiao
What's special for nginx? Can this code generator be used for not-nginx-releated projects? On Mon, Apr 22, 2013 at 9:27 AM, wrote: > Hi, > > I've written a Google Protocol Buffers code generator for nginx module > developers interested in using protobuf messages within nginx natively. > The proj

<    1   2   3   4   5   6   7   >