missing parseFrom(...) variants in generate Java code; and how to build your own parseFrom() equivalent

2009-08-18 Thread Oliver Jowett
Hi Using 2.2.0, the compiler doesn't seem to be generating Java code for the parseFrom(byte[],int,int) and parseFrom(byte[],int,int,ExtensionRegistryLite) static methods. The other variants e.g. parseFrom(byte[]) are present. Is this deliberate, or just an oversight? Also, it seems a bit awkwa

Building without RTTI support causes "make check" to hang (recursive call to pthread_once?)

2009-08-18 Thread Oliver Jowett
I'm trying to build 2.2.0 without RTTI support and running into some obscure problems. The environment is: $ g++ -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs

Re: Building without RTTI support causes "make check" to hang (recursive call to pthread_once?)

2009-08-18 Thread Oliver Jowett
Oliver Jowett wrote: >> #4 0x2b85e3ffb67a in google::protobuf::internal::ReflectionOps::Merge >> (fr...@0x262e320, to=0x268f0e0) at ./google/protobuf/message.h:311 >> #5 0x0071dc4a in protobuf_unittest::ComplexOpt6::MergeFrom >> (this=0x268f0e0, fr...@

optimize_for = LITE_RUNTIME and DebugString() / ShortDebugString()

2009-08-18 Thread Oliver Jowett
While experimenting with LITE_RUNTIME I noticed that the C++ methods DebugString() and ShortDebugString() are only present on Message, not MessageLite. I understand that DebugString()/ShortDebugString() are implemented via reflection, which isn't available in the lite runtime, but what about a si

Re: missing parseFrom(...) variants in generate Java code; and how to build your own parseFrom() equivalent

2009-08-19 Thread Oliver Jowett
Kenton Varda wrote: > On Tue, Aug 18, 2009 at 6:55 PM, Oliver Jowett <mailto:oliver.jow...@gmail.com>> wrote: > > > Hi > > Using 2.2.0, the compiler doesn't seem to be generating Java code for > the parseFrom(byte[],int,int) and > parseFro

Notes on building a 64-bit install on Solaris 10 x86

2009-08-21 Thread Oliver Jowett
I had some trouble getting 2.2.0 built in 64-bit mode on a Solaris 10 amd64 machine, and searching didn't turn much up. Here are my notes in case someone else ends up with the same problems. Environment: $ uname -a SunOS trouble 5.10 Generic_139556-08 i86pc i386 i86pc [prophetic machine name!]

2.2.0 "make check" failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-21 Thread Oliver Jowett
Environment: protobuf 2.2.0 $ uname -a SunOS arson 5.10 Generic_118833-23 sun4u sparc SUNW,Sun-Fire-280R $ g++ -v Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-lan

Re: Notes on building a 64-bit install on Solaris 10 x86

2009-08-21 Thread Oliver Jowett
Kenton Varda wrote: > I'm pretty sure #1 is not protobuf's fault. I've never heard of > libgcc_s which means it's probably something GCC links against > implicitly. And anyway, if libwhatever.so.1 exists, there should always > be a libwhatever.so symlink to it... right? I *think* so, but callin

Re: 2.2.0 "make check" failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-21 Thread Oliver Jowett
Oliver Jowett wrote: > The tests start failing here: > >> [--] 14 tests from IoTest >> [ RUN ] IoTest.ArrayIo >> [ OK ] IoTest.ArrayIo (4 ms) >> [ RUN ] IoTest.GzipIo >> google/protobuf/io/zero_copy_stream_unittest.cc:194: Failu

Re: Notes on building a 64-bit install on Solaris 10 x86

2009-08-21 Thread Oliver Jowett
Monty Taylor wrote: > Kenton Varda wrote: >> I'm pretty sure #1 is not protobuf's fault. I've never heard of >> libgcc_s which means it's probably something GCC links against >> implicitly. And anyway, if libwhatever.so.1 exists, there should always >> be a libwhatever.so symlink to it... right?

Re: 2.2.0 "make check" failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-22 Thread Oliver Jowett
Kenton Varda wrote: > (Is it just the gzip/zlib tests that are broken? Nothing else in the > library should depend on the zlib stuff.) I think so. Everything passed when I configured --without-zlib -O --~--~-~--~~~---~--~~ You received this message because you

Re: 2.2.0 "make check" failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-22 Thread Oliver Jowett
Kenton Varda wrote: > Run configure --without-zlib to disable zlib support. Alternatively, > fix it and send me a patch. :) I took a look at fixing it in gzip_stream.{cc,h} (conditionally removing GZIP format so you'd get compile errors if you tried to use that on a system with an old zlib), but

Re: protoc feature question

2009-09-10 Thread Oliver Jowett
Henner Zeller wrote: > And if you do it from an ant-buildfile (often used > in java projects) then it would be as well hard as ant has not really > a notion of file-dependencies (yeah, ant sucks as build-tool). Perhaps you are looking for or -O --~--~-~--~~~---~--~

Re: 2.2.0 "make check" failures on Solaris 10 sparc32 (problems with zlib?)

2009-09-14 Thread Oliver Jowett
Kenton Varda wrote: > I expanded on your patch a bit. Can you take a look? > > http://codereview.appspot.com/117047 I tried the updated patch on my system that has an old zlib, and it appears to work correctly (zlib support is disabled) -O --~--~-~--~~~---~--~~

Re: 2.2.0 "make check" failures on Solaris 10 sparc32 (problems with zlib?)

2009-09-14 Thread Oliver Jowett
Kenton Varda wrote: > Can you review the diff, too? At Google we have a policy of reviewing > all changes. Just tell me if it looks OK to you, or if there's anything > you'd recommend changing (probably not since it's quite short). I looked at the diff and it seemed ok, but I'm no autoconf expe

Re: ActiveMQ implementation of protobuf

2009-09-21 Thread Oliver Jowett
On Tue, Sep 22, 2009 at 5:57 AM, Kenton Varda wrote: > So Java users don't like relying on C++ code in their build process. On > the other hand, most C++ users would not accept Java in their build process > either. But if we wrote the C++ code generator in C++ and the Java code > generator in J

Re: [protobuf] 2.2.0a release -- fixes SONAME

2009-11-18 Thread Oliver Jowett
On Thu, Nov 19, 2009 at 2:07 PM, Kenton Varda wrote: > (Unless you are a Linux distribution maintainer, I'd strongly recommend > statically-linking any binaries which you intend to distribute to others in > binary form to avoid problems like this.) On that topic - what's the right way to do th

Re: [protobuf] Re: Java -using GPB -which type of stream should I be using over sockets?

2009-12-07 Thread Oliver Jowett
Nigel Pickard wrote: > Here's my sample code. In this code, everything works for me -however > when I change the GPBClient to use Data IO streams (just comment out > the Object IO references and uncomment the Data IO references in > GPBClient), that's when I get the > "com.google.protobuf.InvalidP

Re: [protobuf] Problem in installing protobuf-2.2.0a on Solaris 10

2009-12-08 Thread Oliver Jowett
mk wrote: > Hi > > Could someone please help me to install protobuf-2.2.0a on Sun Soalris > machine. I tried even to install it to /usr, but I am still getting > these same errors: > > ld: fatal: file .libs/common.o: wrong ELF class: ELFCLASS64 > ld: fatal: File processing errors. No output writt

Re: [protobuf] 2.3.0 release candidate

2009-12-22 Thread Oliver Jowett
Kenton Varda wrote: > Hi all, > > I've uploaded a release candidate of protobuf-2.3.0 here: > > https://groups.google.com/group/protobuf/files > > I have tested on Linux (gcc 3.3.6 and 4.2.4), Cygwin, MinGW, MSVC, and > OSX (Snow Leopard, latest Xcode). > > Monty, it would be great if you could

Re: [protobuf] 2.3.0 release candidate

2009-12-22 Thread Oliver Jowett
Oliver Jowett wrote: > Kenton Varda wrote: >> >> I've uploaded a release candidate of protobuf-2.3.0 here: > > I just tried it on a Solaris 10 x86 box and it's still suffering from > some 32/64-bit confusion: Here's a quick patch that fixes this for me. -O

Re: [protobuf] intern strings in java

2010-01-19 Thread Oliver Jowett
2010/1/20 Kenton Varda : > Are you suggesting that the parser should automatically intern every String > that it parses?  That sounds like it could be expensive for those who don't > need it. More than "expensive" - it's a permanent memory leak for any app that passes around many unique strings. I

Re: [protobuf] Re: Java Protocol Buffers classes serialization

2010-02-17 Thread Oliver Jowett
yahro wrote: > firstNameField.setAccessible(true); throws SecurityException -O -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email

[protobuf] Any sample messages/data for optimization out there?

2010-03-07 Thread Oliver Jowett
Some background: we started using a small set of protobuf messages in a couple of places in our software that aren't too performance-sensitive (essentially as a C++/Java bridging protocol). That's worked well. Now I'd like to start using it in more performance-sensitive places in our Java code to r

Re: [protobuf] Any sample messages/data for optimization out there?

2010-03-07 Thread Oliver Jowett
Evan Jones wrote: > On Mar 7, 2010, at 4:16 , Oliver Jowett wrote: >> Is there a set of message definitions / data that I could run benchmarks >> over while tweaking the implementation? Since the C++ implementation >> seems to be well tuned already, I was hoping something lik

[protobuf] Re: Any sample messages/data for optimization out there?

2010-03-07 Thread Oliver Jowett
Oliver Jowett wrote: > (For > example, I wonder if the Java code could benefit from the > switch-prediction tricks that the C++ code does?) FWIW, I hacked something together to test this, producing code that looks like this: > while (true) { > int tag

Re: [protobuf] modifying lists within a message

2010-03-17 Thread Oliver Jowett
Kenton Varda wrote: > well, here's a work-around - if you put a utility class into the > same package as the ProtobufMessages generated class it can access > the protected Builder.internalGetResult() - since package-level > access is higher than protected-level access... > > > Yi

Re: [protobuf] Version message converted from major.minor to gnu_dev_major.gnu_dev_minor

2014-09-30 Thread Oliver Jowett
I would guess that you are #including (perhaps indirectly) which looks like this on my system: /* Access the functions with their traditional names. */ #define major(dev) gnu_dev_major (dev) #define minor(dev) gnu_dev_minor (dev) #define makedev(maj, min) gnu_dev_makedev (maj, min) Oliver On 3

Re: [protobuf] Conversion between C structs and google protobufs

2014-10-08 Thread Oliver Jowett
On 8 October 2014 06:51, Konstantin Utkin wrote: > Ugly. And what if I have multiple nesting, arrays? It leads to tons of macro > with huge routine work, and It's simple to convert each C structure > manually. But it is so boring! Maybe anyone has found a better way? If the mapping between your

Re: [protobuf] Re: Message extensions cannot have required fields.

2014-10-25 Thread Oliver Jowett
Presumably this is because, if your example was allowed, a valid MyMsgA encoding would no longer be a valid MyMsgB encoding. Oliver On 25 October 2014 13:28, Anthony Sampton wrote: > > I'm pretty sure it's not only me who faced with this problem, BUMP. > > -- > You received this message because

Re: [protobuf] Re: Message extensions cannot have required fields.

2014-10-25 Thread Oliver Jowett
On 25 October 2014 14:15, Oliver Jowett wrote: > Presumably this is because, if your example was allowed, a valid > MyMsgA encoding would no longer be a valid MyMsgB encoding. Sorry, I mean, "would no longer be a valid encoding of MyMsgA as extended by the extension declared wi

Re: [protobuf] C++ modifying field without knowing field accessor at compile time

2014-10-27 Thread Oliver Jowett
On 24 October 2014 17:28, Peter Hubner wrote: > All I am trying to achieve is to modify a message on the fly with a set of > fields that are supplied to the program at runtime. > > simple case: > // message declared as - const google::protobuf::Message& message > auto x = reflection->GetDouble(mes

Re: [protobuf] Parse a .proto file

2014-10-30 Thread Oliver Jowett
On 30 October 2014 02:53, Pradeep Gollakota wrote: > I have a use case where I need to parse messages without having the > corresponding precompiled classes in Java. So the DynamicMessage seems to be > the correct fit, but I'm not sure how I can generate the DescriptorSet from > the ".proto" defi

Re: [protobuf] Parse a .proto file

2014-10-31 Thread Oliver Jowett
Basically, you can't do that in pure Java - the compiler is a C++ binary, there is no Java version. Still, working with the output of --descriptor_set_out is probably the way to go here. If you have the .proto file ahead of time, you can pregenerate the descriptor output at build time and store it

Re: [protobuf] Parse a .proto file

2014-10-31 Thread Oliver Jowett
You may be running into issues where the set of descriptors associated with your parsed DynamicMessage (i.e. the ones you parsed at runtime) do not match the set of descriptors from your pregenerated code (which will be using their own descriptor pool). IIRC they're looked up by identity, so even i

Re: [protobuf] Parse a .proto file

2014-11-01 Thread Oliver Jowett
On 1 November 2014 02:24, Pradeep Gollakota wrote: > Confirmed... When I replaced the "md" variable with the compiled Descriptor, > it worked. I didn't think I was mixing the descriptors, e.g. the > MessagePublish message is one that is produced via the compiled API and > parsed using the DynamicM

Re: [protobuf] Compilation errors with generated java file

2014-12-01 Thread Oliver Jowett
On 30 November 2014 at 00:08, Kenneth Miller wrote: > manual compilation produces 100 errors, here is the first: > > javac -cp > $HOME/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar > ServicecallPiqi.java > > ServicecallPiqi.java:535: error: cannot find symbol >

Re: [protobuf] Re: How to statically link "protoc" on linux?

2010-07-09 Thread Oliver Jowett
Jacky wrote: > Many thanks! sorry for the late reply - I've just went back. :) > > I tried this: > > ja...@alpha:~/workspace/protobuf-2.3.0/src$ ldd protoc > linux-vdso.so.1 => (0x7fff427ba000) > libz.so.1 => /lib/libz.so.1 (0x7fe2e1485000) > libstdc++.so.6 => /u

Re: [protobuf] Re: How to statically link "protoc" on linux?

2010-07-10 Thread Oliver Jowett
Kenton Varda wrote: > LDFLAGS=-static isn't good enough? Nope, something along the way eats it. -O -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this gro

Re: [protobuf] problem: protobuf (cpp) not serializing all fields to array?

2010-07-19 Thread Oliver Jowett
phelyks wrote: > if (!unp.ParseFromArray(buffer.c_array(), 0)) You are claiming that the array to parse from is zero bytes long. Unsurprisingly, trying to parse a zero-byte message doesn't give anything useful. Perhaps you meant to pass "usedBufLen"? -O -- You received this message becau

Re: [protobuf] Re: What's the point of Protocol Buffers?

2010-07-24 Thread Oliver Jowett
Christopher Smith wrote: > There is also the other end of the spectrum, where I am at. With a > large Hadoop cluster and terabytes of data, the efficient storage and > zippy parsing of protobufs is a huge deal. > > In many ways, protobufs allow you do do what XML promised, but much > more efficien

Re: [protobuf] Re: Why to reinvent the wheel ?

2010-11-11 Thread Oliver Jowett
On Wed, Nov 10, 2010 at 3:21 AM, Kalki70 wrote: > Maybe the ASN.1 compiler that you used used too many memory > allocations or was not too fast. There are some very good, like from > OSS Novalka. I've used both OSS Nokalva's ASN.1 to Java compiler and protobuf in anger. protobuf is at least as f

Re: [protobuf] using GzipOutputStream increases size

2011-12-01 Thread Oliver Jowett
On Thu, Dec 1, 2011 at 3:22 PM, Vinay Bansal wrote: >  void write() { >    int fd = open("myfile", O_WRONLY), O_APPEND); >    google::protobuf::io::ZeroCopyOutputStream *out = new > google::protobuf::io::FileOutputStream(fd); >    google::protobuf::io::GzipOutputStream *gzipOut = new > google::pr

Re: [protobuf] Incorrect encoding of protocol buffer message

2011-12-15 Thread Oliver Jowett
On Thu, Dec 15, 2011 at 10:56 PM, alok wrote: > (object 3 - corrupt) > 09 71 3d 0d 0a d7 c3 27 dc 40 12 07 30 30 32 33 2e 48 4b 19 00 00 00 > 00 00 00 3b 40 20 00 28 You have something that's opening the file in text mode and expanding newlines (see the 0d 0a in there - that's CR LF). Probably y

Re: [protobuf] proto files - user defined java objects as messages fileds

2012-04-22 Thread Oliver Jowett
On Thu, Apr 19, 2012 at 11:36 AM, kandji wrote: > Can i use a user-defined java class as a field type in a message > declared in a .proto file? > 2- I would like to serialize an instance of the class > "MyComplexClass.java". > As you can see, I would use "MyComplexClass" as a field type in the

Re: [protobuf] incompatible type changes philosophy

2012-05-09 Thread Oliver Jowett
On Wed, May 9, 2012 at 12:42 AM, Jeremy Stribling wrote: > I'm wondering if anyone has experience with a scenario like this, and > if there's a more elegant way to solve it. We do something a bit similar by advertising capabilities during a handshake at the start of each connection. If we need a

Re: [protobuf] Is there any possible way bind Protocol Buffer with Hibernate,MyBatis Or JDBC

2012-06-18 Thread Oliver Jowett
On Mon, Jun 18, 2012 at 3:07 AM, Jessen Gan wrote: > Recently,I used Protocol Buffer as a middleware to trans data between server > and mobile_client.Read data from database by hibernate into java > entities,then add into Protocol Buffer Object property one by one.It's a > very heavy method. > > B

Re: [protobuf] Private constructor in ByteString

2012-06-22 Thread Oliver Jowett
On Thu, Jun 21, 2012 at 7:08 AM, Anatoly Deyneka wrote: > Why ByteString has only private constructor? > Copying arrays is overhead in my case. I believe it's that way to guarantee the immutability of a ByteString. Oliver -- You received this message because you are subscribed to the Google Gr

Re: [protobuf] How to convert protobuf with same structure in java

2012-07-24 Thread Oliver Jowett
On Tue, Jul 24, 2012 at 3:55 PM, Tobias Neef wrote: > I try to convert the Java representation of a protobuf message into another > message with the same fields (ordering, names, types). I try to do it the > following way but this ends in a java.lang.InstantiationException: > > public static T c

Re: [protobuf] Merging a DynamicMessage into a GeneratedMessage

2012-08-23 Thread Oliver Jowett
On Wed, Aug 22, 2012 at 6:59 PM, Jason Hsueh wrote: > Is the descriptor you provide to to the DynamicMessage the same exact object > as the descriptor for the generated message? It looks like you are only > comparing against some descriptorMap, based on the name of the generated > type. > > If you

Re: [protobuf] CodedInputStream bufferSize is set incorrectly when reading from a byte[] slice

2012-10-10 Thread Oliver Jowett
On Tue, Oct 9, 2012 at 8:08 AM, Jack Punt wrote: > For example: CodedInputStream.newInstance("A".getBytes(), 5,5).isAtEnd() > --> false [when obviously the buffer is 'empty' at this point] > and readBytes() will likewise expect to find more bytes than are actually in > the byte[] The convent

Re: [protobuf] Change wire type

2012-12-13 Thread Oliver Jowett
On Thu, Dec 13, 2012 at 12:31 AM, Lilithfr wrote: > Hello, > > I'm looking to change the type of a field from uint64 to fixed64 to reduce > the encoding time but I want to keep the same id and some old application > will still use the old definition. > For my application, there is no different bet

Re: [protobuf] Re: Performance over socket?

2012-12-20 Thread Oliver Jowett
On Thu, Dec 20, 2012 at 2:40 PM, wrote: > True enough, but the marshalling/unmarshalling performance can be measured. > > I guess my question would have been better worded as... > > "I have a project that needs to send objects between a Java and a C++ > service at a rate of up to several thousand

Re: [protobuf] How do I check if a message is "complete"?

2013-01-13 Thread Oliver Jowett
On Sun, Jan 13, 2013 at 12:04 PM, Klaim - Joël Lamotte wrote: > > On Sun, Jan 13, 2013 at 9:54 AM, Feng Xiao wrote: >> >> >> With protobuf reflection you can easily write a function to check if all >> fields of a message are set. >> > > I see, thanks for pointing that, it's a good alternative. >

Re: [protobuf] GzipOutputStream does not work in ubuntu 12.10

2013-01-21 Thread Oliver Jowett
On Fri, Jan 18, 2013 at 9:58 PM, David Granados wrote: >GZipOutputStream gzip_stream(&file_stream, GzipOutputStream::Options()); > main.cpp:11:4: error: ‘GZipOutputStream’ no se declaró en este ámbito You have the wrong capitalization (GZip vs Gzip) Oliver -- You received this message be

Re: [protobuf] Re: Compress proto to string

2013-01-29 Thread Oliver Jowett
On Tue, Jan 29, 2013 at 11:23 AM, David Granados wrote: > this does not work :-( That's not really a useful description of the problem. > 229 google::protobuf::io::GzipOutputStream > gzip_stream(&arrayStream); > 230 if (!pProto.SerializeToZeroCopyStream(&gzip_stream)) > 231

Re: [protobuf] Re: Compress proto to string

2013-01-29 Thread Oliver Jowett
(Readding the list cc:) On Tue, Jan 29, 2013 at 4:32 PM, David Granados wrote: > Does not work :-( > > Size of proto before: 196, size of proto after gzip: 196 What measures this? Nothing in any code you quoted. > Now my code are: > 206 template int > 207 Proto::CompressProtoToString(std

Re: [protobuf] Re: Compress proto to string

2013-01-30 Thread Oliver Jowett
On Wed, Jan 30, 2013 at 8:06 AM, David Granados wrote: > This is all the code for the example. Thanks in advance. What is the output that you expect? What do you actually get? std::cout << gzip_stream.ByteCount()

Re: [protobuf] Re: Compress proto to string

2013-01-30 Thread Oliver Jowett
On Wed, Jan 30, 2013 at 12:45 PM, David Granados wrote: > > If i write the size and is 192, compress does not work. > In the code you attached, you are writing the *uncompressed* size to cout: std::cout << gzip_stream.ByteCount()

Re: [protobuf] lt-protoc

2013-01-31 Thread Oliver Jowett
That's part of how libtool handles execution of uninstalled binaries. http://www.gnu.org/software/libtool/manual/libtool.html#Linking-executables On Wed, Jan 30, 2013 at 11:19 PM, Mohit Jaggi wrote: > Hi All, > I am wondering what lt-protoc binary file is? It is in src/.libs when we > build pro

Re: [protobuf] Again about delimiting multiple messages in streams

2013-02-02 Thread Oliver Jowett
On Sat, Feb 2, 2013 at 12:02 PM, Roman wrote: > Hello! > > I read a lot about delimiting messages by VarInt32 number before each > serialized message. It requires some additional coding. In the same time I > guess that parsing code of GPB must understand when it must stop > deserialization. Maybe

Re: [protobuf] Again about delimiting multiple messages in streams

2013-02-02 Thread Oliver Jowett
On Sat, Feb 2, 2013 at 12:37 PM, Roman Simakov wrote: > Thanks, > > 2013/2/2 Oliver Jowett : > > Fields don't have to be encoded in any particular order, so you can have > a > > valid message encoding where the encoding of 'eom' is followed by other >

Re: [protobuf] Linker error

2013-03-05 Thread Oliver Jowett
On Tue, Mar 5, 2013 at 2:25 AM, Mohammad Husain wrote: > > g++ `pkg-config --cflags --libs protobuf` -o hello_protobuf > hello_protobuf.o user.pb.o > Probably just argument ordering. The library reference (which will come from pkg-config --libs) needs to appear after the object files that refer t

Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-14 Thread Oliver Jowett
On Thu, Mar 14, 2013 at 2:37 AM, Sumit Kumar wrote: > No you cant, on C++ bytes translates to string, wont allow for null. > std::string handles NULs just fine, and protobuf's use of it for bytes fields also works fine. (I have code that's been in production for a few years that relies on this)

Re: [protobuf] Question about internationalization and localization

2013-03-16 Thread Oliver Jowett
On Fri, Mar 15, 2013 at 11:59 PM, Feng Xiao wrote: > On Fri, Mar 15, 2013 at 8:23 AM, Joann Kent wrote: > >> Hi all, >> >> Within the code generated by GPB (I'm using Java btw) there are >> exceptions thrown and the messages are hard-coded and in English. Are >> there any plans to allow for int

Re: [protobuf] Re: Why to reinvent the wheel ?

2013-03-21 Thread Oliver Jowett
On Thu, Mar 21, 2013 at 8:04 AM, Vic Devin wrote: > This thread seems to be a bit old but anyway this topic became suddenly > important for me since I start to hear the "Protobuf" new magic word. > > Now I was a bit surprised to discover that it is actually the same idea as > CORBA! > No it's no

Re: [protobuf] Re: Why to reinvent the wheel ?

2013-03-21 Thread Oliver Jowett
On Thu, Mar 21, 2013 at 8:48 AM, Vic Devin wrote: > What I mean is that they all try to solve, leaving aside all tech details, > the same basic problem, i.e. remote communication between software entities. > There are plenty of applications of protobuf (and ASN.1 for that matter) that do not in

Re: [protobuf] Re: Awkward error. How can this be?

2013-03-22 Thread Oliver Jowett
On Fri, Mar 22, 2013 at 8:45 AM, kramer65 wrote: > I've been tinkering about this all night, but with a fresh view in the > morning I still can' t understand what is wrong here. The line where the > error originates is this: beat.ParseFromString(message) > Are you sure your callback is being giv

Re: [protobuf] Re: Awkward error. How can this be?

2013-03-22 Thread Oliver Jowett
in python: > http://www.hkramer.nl/opslag/infoPack_pb2.py > > Do you understand any of this? > > > > 2013/3/22 Oliver Jowett > >> On Fri, Mar 22, 2013 at 8:45 AM, kramer65 wrote: >> >>> I've been tinkering about this all night, but with a fre

Re: [protobuf] Re: Why to reinvent the wheel ?

2013-03-25 Thread Oliver Jowett
On Mon, Mar 25, 2013 at 11:25 AM, Vic Devin wrote: > Oliver, > yes, Protobuf can do many more other things than simply remoter > communication, but again my point is that these are all "low level" stuff > which is again in "the reinventig wheel territory"; if software industry > wishes to make a

Re: [protobuf] DecodeError (Truncated Message)

2013-03-28 Thread Oliver Jowett
On Thu, Mar 28, 2013 at 12:54 AM, W. David Jarvis wrote: > If I compare the len() of the two strings (pre-writing/reading v. > post-writing/reading) I tend to get two add'l chars on the reading, so I > guess I'm confused by how this is getting truncated? Is python running into > a newline char and

Re: [protobuf] protoc - how to generate code for proto and its imports

2013-04-12 Thread Oliver Jowett
On Fri, Apr 12, 2013 at 7:59 PM, Leonid G wrote: I am actually working on a build system and in my case all file names are > an absolute path, not relative. With absolute path method suggested above > (without -I) fails with > $ google/protobuf/2.3.0/gcc_4.1.2/64/bin/protoc --cpp_out=/mypath/test

Re: [protobuf] protoc - how to generate code for proto and its imports

2013-04-12 Thread Oliver Jowett
On Fri, Apr 12, 2013 at 8:43 PM, Leonid G wrote: > Thanks, Oliver. > > problem is that build system is such that those protos are necessarily > under common root. > Not quite sure what you mean. > I guess I'll figure it out. > Well, you can perhaps think of it this way: you have one or more n

Re: [protobuf] protobuf stringstream codedoutputstream issues

2013-04-14 Thread Oliver Jowett
On Sun, Apr 14, 2013 at 7:26 PM, Predator33 wrote: > The only thing I could think of is maybe the protobuf stream doesn't flush > itself out until the destructor is hit and since that never happens until > after the fact, it never gets flushed? > Yes, this will be what is happening. Arrange for

Re: [protobuf] PB Buffer Error Can't Parse Message with 3 String Fields in Sequence

2013-04-16 Thread Oliver Jowett
On Tue, Apr 16, 2013 at 4:43 PM, brsckap wrote: > > std::ifstream inputStream; inputStream.open(pbInput); Text-mode open is corrupting your encoded message, probably. Oliver -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubs

Re: [protobuf] accessor method for message type

2013-04-22 Thread Oliver Jowett
On Sat, Apr 20, 2013 at 4:38 PM, Oliver Wang wrote: > > So the from generated code, I would expect an access method such as > set_foo() set_bar and set_baz() so that I can connect Foo object to the > message. But I don't see it at all, there are methods such as has_foo() > has_bar() and has_baz()

Re: [protobuf] Re: how to calculate protocol buffer message size without parsing the full message?

2013-04-22 Thread Oliver Jowett
On Sun, Apr 21, 2013 at 9:48 PM, Oliver Wang wrote: > Can't you use ByteSize() method to get the size? Not when you're parsing - you don't have a message instance yet! Oliver -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscrib

Re: [protobuf] [java] serialize to the static buffer

2013-04-23 Thread Oliver Jowett
https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/CodedOutputStream.html#newInstance(byte[], int, int) On Tue, Apr 23, 2013 at 7:12 PM, adam.h wrote: > Hi Protobufs Apostles, > > There is nice function to deserialize from the buffer - mergeFrom(buf, > offs,

Re: [protobuf] Have issues on the design of protocol buffers...

2013-04-25 Thread Oliver Jowett
On Thu, Apr 25, 2013 at 2:13 AM, Christian Gross wrote: > So I am trying to wrap my head around protocol buffers and used it for a > few tests, however, I found it problematic in my case for the following > reasons: > > 1) Creating a multi message end point by mocking unions using optional > types

Re: [protobuf] Performance aspect of submessage serialization

2013-05-15 Thread Oliver Jowett
On Wed, May 15, 2013 at 11:16 AM, wrote: > > I think it is more of a bug in the protoc implementation that it fail's to > parse such a message. > Do you have some test code to share? (I got as far as eyeballing the C++ implementation and it looks OK at a first glance) Oliver -- You received t

Re: [protobuf] Performance aspect of submessage serialization

2013-05-15 Thread Oliver Jowett
On Wed, May 15, 2013 at 12:02 PM, Oliver Jowett wrote: > On Wed, May 15, 2013 at 11:16 AM, wrote: > >> >> > I think it is more of a bug in the protoc implementation that it fail's to >> parse such a message. >> > > Do you have some test code t

Re: [protobuf] InvalidProtocolBufferException

2013-07-23 Thread Oliver Jowett
On Wed, Jul 24, 2013 at 12:27 AM, Andreas Reuter < andreas.rou...@googlemail.com> wrote: > Hello, > > we are using Protobuf to communicate between two devices via Ad-hoc WiFi. > One of the devices is running a Java application and the other a Python > application. > [...] > 6. Upon closer inspe

Re: [protobuf] InvalidProtocolBufferException

2013-07-24 Thread Oliver Jowett
On Wed, Jul 24, 2013 at 8:22 AM, Lotte R. Leben wrote: > > *But* As far as I know readDelimited() only works with inputStreams, which > kind of contradicts the whole UDP thing. > Since adding the delimiter was a tad tricky, I wasn't confident that the > following would work: > > - add delimiter in

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

2013-08-06 Thread Oliver Jowett
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 method makes an internal copy, so it looks like readChunk() isn't >> what we are looking for after all. Hmmm.

Re: [protobuf] deserializing unknown protobuf message?

2013-08-19 Thread Oliver Jowett
On Mon, Aug 19, 2013 at 8:37 PM, Tom Ward wrote: > > Basically I'm trying to work out how to deserialize a protobuf message > without using the generated headers, as we're likely to get messages that > weren't generated at compile time. I've looked through the documentation, > but I only seem to b

Re: [protobuf] Problem parsing extended data dynamically

2013-08-20 Thread Oliver Jowett
On Mon, Aug 19, 2013 at 1:32 PM, Ivan Bazhenov wrote: > > // register extensions > ExtensionRegistry registry = ExtensionRegistry.newInstance(); > Foobar.registerAllExtensions(registry); > > final DescriptorProtos.FileDescriptorSet fds = > DescriptorP

Re: [protobuf] Where is the (meta) .proto file which describes .desc files?

2013-09-05 Thread Oliver Jowett
On Thu, Sep 5, 2013 at 1:52 PM, Chris Dew wrote: > Where is the (meta) .proto file which describes .desc files? > > I make .desc files with: "protoc --descriptor_set_out=foo.desc > --include_imports foo.proto". > https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descrip

Re: [protobuf] Issue with SerializeToArray output

2013-11-18 Thread Oliver Jowett
On 17 November 2013 22:21, Kiran Kumar wrote: > char const *rt_msg = (char *)malloc(512);; > > Rtmesg->SerializeToArray((void *)rt_msg, size); > > cout << rt_msg; << This prints absolutely junk. > You are trying to print the encoded form of the protobuf me

Re: [protobuf] Python windows adding erronous 0x0D bytes in message and then failing to parse

2013-12-11 Thread Oliver Jowett
Don't you want mode "wb"? Sounds like a classic case of opening a file in text mode and getting LF -> CRLF translation happening on Windows. Oliver On 11 December 2013 06:04, Andrew Beck wrote: > Using python 2.7.6 on darwin and windows, both using protoc 2.5.0 and libs > from 2.5.0, the pytho

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

2014-03-29 Thread Oliver Jowett
On 28 March 2014 15:54, Zhiqian Yuan wrote: > Those two fields are string type, but like other integer enumerations, > they both have a range to set value. So I decide they should be implemented > as string-valued enum type. But there's no such a thing either in C++ or in > proto. > There is no

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

2014-03-30 Thread Oliver Jowett
If the protobuf mapping is a new mapping, why can't you map the "string-valued enum" to a protobuf enum with the same names? I assume that the "string-valued enum" has a fixed set of possible values? Oliver On 30 March 2014 00:57, Zhiqian Yuan wrote: > I understand. I thought there might be a

Re: [protobuf] Sending serialized messages with repeated fields over a socket

2014-05-14 Thread Oliver Jowett
On 14 May 2014 08:12, Laura Macaddino wrote: > The size of the packet is obtained by calling > sizeof(serialized_protobuf_message). > That doesn't sound correct. Oliver -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from

Re: [protobuf] Sending serialized messages with repeated fields over a socket

2014-05-14 Thread Oliver Jowett
I think we'll need to see the exact code you're using on both sides. Probably the serialized message is being damaged in some way in transit (e.g. you calculated the length wrong) Oliver On 14 May 2014 20:51, Laura Macaddino wrote: > I have been looking through other posts, and it seems the re

Re: [protobuf] Use different encoding while serializing strings

2014-05-15 Thread Oliver Jowett
The primary protobuf serialization format is the binary format, not the text format. Is there some reason you can't use the binary form? Oliver On 15 May 2014 18:33, Ganesh Sangle wrote: > Let me clarify the question. > 1. I did not say that protobuf is affected by \r\n. > 2. The problem is th

Re: [protobuf] Python and Java: different byte sequences and tag errors

2014-05-23 Thread Oliver Jowett
On 23 May 2014 22:06, Alessandro Sivieri wrote: > > I don't think the communication channel is causing any problem, because the > array sequences are not simply truncated but really different (I would > expect them to be identical). > Check again; it looks like your Java path is mangling (only) b

Re: [protobuf] Python and Java: different byte sequences and tag errors

2014-05-23 Thread Oliver Jowett
On 24 May 2014 01:23, Oliver Jowett wrote: > On 23 May 2014 22:06, Alessandro Sivieri wrote: > >> >> > I don't think the communication channel is causing any problem, because >> the array sequences are not simply truncated but really different (I woul

Re: [protobuf] Performance differences when creating builder - why?

2014-06-24 Thread Oliver Jowett
On 24 June 2014 09:40, Klaus Kraft wrote: > > Is there any particular reason why the first invocation is "much" slower > than the second one? I used the most current version of protobuf for the > evaluation, if this is relevant for the answer. > Classloading, method resolution etc are the obviou