[protobuf] Issue 232 in protobuf: Standard way of commenting protobuf files

2010-11-02 Thread protobuf

Status: New
Owner: 
Labels: Type-Defect Priority-Medium

New issue 232 by sampo.niskanen: Standard way of commenting protobuf files
http://code.google.com/p/protobuf/issues/detail?id=232

Request for enhancement:

A specific format should be defined for message/field comments in protobuf  
files (similar to for example Javadoc).  Code generators could then include  
these comments as part of the comments of the generated code, allowing IDEs  
to display context help while coding.


For example a field might be commented by

/**
 * The ISO 3166-1 alpha-2 country code of the user.
 */
optional string country = 12;

This might be converted into Java as:

/**
 * The ISO 3166-1 alpha-2 country code of the user.
 * @return the country field
 */
public java.lang.String getCountry() { return country_; }

It should be considered what features would be desireable in such  
comments.  For example a @deprecated notation could be useful in many  
situations.  The code generators could of course implement these only to  
the extent that the target language supports them.


(An alternative would be to implement context-help directly into the IDE,  
but implementing it in the protobuf language would allow all existing IDEs  
to benefit from the comments automatically.  At least Eclipse automatically  
detects the .java file and could provide context help if the file had  
Javadoc in it.)



--
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 232 in protobuf: Standard way of commenting protobuf files

2010-11-02 Thread protobuf


Comment #1 on issue 232 by sampo.niskanen: Standard way of commenting  
protobuf files

http://code.google.com/p/protobuf/issues/detail?id=232

Only after submitting this I noticed this is a duplicate of #148.

--
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] CodedInputStream on top of sockets

2010-11-02 Thread Jesper
I'm trying to implement the writeDelimitedTo/parseDelimitedFrom
methods in C++, but getting stuck on how to create a CodedInputStream
on top of a socket in a portable manner. Can CodedInputStream work
with windows sockets as well?

-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Fantastic

2010-11-02 Thread Doodle
I figure not all the emails you get should be problems. This thing is
great took 3 hours to make it do what it I wanted it to(serialization
on Java) and I bet I do not even have a clue yet what it can do. Hell
now I am not even committed  to staying in one language on the back
end now I guess thats quite the added bonus for a serialization
library !...@*!

-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Odd behavior while deserializing PB

2010-11-02 Thread Jason Hsueh
You can't just parse any message type into *DescriptorProto. Those are
protocol buffers which represent the type definition of other protocol
buffers (e.g. your Request msg). You want to use DynamicMessage in order to
operate on generic messages.

On Wed, Oct 27, 2010 at 9:55 AM, maninder batth batth.manin...@gmail.comwrote:

 I have a PB like
 message Request {
required int64 supplierId  = 1;
optional string message_type = 2;
 }

 Then i constructed the message as follows :-
Request request = Request.newBuilder()
.setSupplierId(100L)
.setMessageType(blah).build();

 Then i check the values by parsing it from the known Request type
 as
Request request1 = Request.parseFrom(request.toByteArray());
System.out.println(request1.getSupplierId());

 It correctly responds with 100.

 Then i try to parse it via generic fashion

FileDescriptorProto fdp =
 FileDescriptorProto.parseFrom(request.toByteArray());
FieldDescriptor supp =
 fdp.getDescriptor().findFieldByNumber(1);
System.out.println(fdp.getField(supp)); // Nothing prints

FieldDescriptor supp1 =
 fdp.getDescriptor().findFieldByNumber(2);
System.out.println(fdp.getField(supp1)); // Prints correctly
 the
 value blah

 1. My question is what happened to my supplierId field in the above
 case?
 FieldDescriptorProto gives me a correct FIeldDescriptor for field
 number 2, but it acts like it has no awarness of field name 1.

 2. Given a FieldDescriptor, how can i find the name of the field? I
 would like to see field names such as supplierId or message_type.
 FieldDescriptor.getName() returns the value package... i dont
 understand why it returns the word package

 --
 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 to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: 2.4 release?

2010-11-02 Thread Zachary Turner
Just wanted to follow up on this and see if this is still on target to
be released within a month or so, and still include a beta of the
python C++ work.

Thanks,
Zach

On Sep 14, 11:28 am, Kenton Varda ken...@google.com wrote:
 Petar mostly finished this work, but then left the company.  We're trying to
 tie up the loose ends so that we can get it out, but everyone is pretty
 busy.  We'll probably do 2.4.0 within a month or two as we have a new team
 member who needs to learn the release process, and it should at least
 include a beta of this work.

 On Tue, Sep 14, 2010 at 10:36 AM, Zachary Turner 
 divisorthe...@gmail.comwrote:







  Reading through old threads, I found one that said that the next
  release would probably include Petar's python wrapper for native C++
  protobufs, greatly increasing speed of protubufs when calling from
  Python.

  Another post mentioned that this was expected to be done sometime this
  summer.

  Now that summer has come and gone, does anyone have an update about
  when this release might be ready?  We're considering re-inventing a
  python / C++ wrapper just because the performance is such a blocker on
  what we're working on at the moment, but given how long it's been in
  the works, it seems like it's such a black hole of work that we're
  going to embark on, whereas the magic hammer solution might only just
  around the corner.

  --
  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 to
  protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.c 
  om
  .
  For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.

-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] CodedInputStream on top of sockets

2010-11-02 Thread Evan Jones

On Nov 2, 2010, at 10:37 , Jesper wrote:

I'm trying to implement the writeDelimitedTo/parseDelimitedFrom
methods in C++, but getting stuck on how to create a CodedInputStream
on top of a socket in a portable manner. Can CodedInputStream work
with windows sockets as well?


You can certainly make it work one way or another. You'll need to  
create an implementation of ZeroCopyInputStream that makes the  
appropriate Windows socket calls to read data from the socket. Note  
that it may be easier to implement the CopyingInputStream interface,  
then wrap it in the CopyingInputStreamAdaptor. This is typically  
easier since CopyingInputStreamAdaptor then implements the appropriate  
buffering logic.



See:

http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream_impl_lite.html#CopyingInputStreamAdaptor

Good luck,

Evan

--
Evan Jones
http://evanjones.ca/

--
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: 2.4 release?

2010-11-02 Thread Kenton Varda
To be clear, there is no target release date.

However, we just pushed this code out to SVN earlier today.  It's still
experimental and may or may not be working, but feel free to give it a try.

On Tue, Nov 2, 2010 at 10:02 AM, Zachary Turner divisorthe...@gmail.comwrote:

 Just wanted to follow up on this and see if this is still on target to
 be released within a month or so, and still include a beta of the
 python C++ work.

 Thanks,
 Zach

 On Sep 14, 11:28 am, Kenton Varda ken...@google.com wrote:
  Petar mostly finished this work, but then left the company.  We're trying
 to
  tie up the loose ends so that we can get it out, but everyone is pretty
  busy.  We'll probably do 2.4.0 within a month or two as we have a new
 team
  member who needs to learn the release process, and it should at least
  include a beta of this work.
 
  On Tue, Sep 14, 2010 at 10:36 AM, Zachary Turner 
 divisorthe...@gmail.comwrote:
 
 
 
 
 
 
 
   Reading through old threads, I found one that said that the next
   release would probably include Petar's python wrapper for native C++
   protobufs, greatly increasing speed of protubufs when calling from
   Python.
 
   Another post mentioned that this was expected to be done sometime this
   summer.
 
   Now that summer has come and gone, does anyone have an update about
   when this release might be ready?  We're considering re-inventing a
   python / C++ wrapper just because the performance is such a blocker on
   what we're working on at the moment, but given how long it's been in
   the works, it seems like it's such a black hole of work that we're
   going to embark on, whereas the magic hammer solution might only just
   around the corner.
 
   --
   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 to
   protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 protobuf%2bunsubscr...@googlegroups.c om
   .
   For more options, visit this group at
  http://groups.google.com/group/protobuf?hl=en.

 --
 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 to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Fantastic

2010-11-02 Thread Kenton Varda
Thanks!

You're right, we usually only hear when things don't work.  It's nice to
hear a success story from time to time.  :)

On Tue, Nov 2, 2010 at 3:57 AM, Doodle totheleftpa...@gmail.com wrote:

 I figure not all the emails you get should be problems. This thing is
 great took 3 hours to make it do what it I wanted it to(serialization
 on Java) and I bet I do not even have a clue yet what it can do. Hell
 now I am not even committed  to staying in one language on the back
 end now I guess thats quite the added bonus for a serialization
 library !...@*!

 --
 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 to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: Message missing required fields exception when parsing a message that has required fields defaulted

2010-11-02 Thread Kenton Varda
On Wed, Oct 27, 2010 at 8:55 AM, locky true.n...@gmail.com wrote:

 The producers of the message are actually C# and not C++ as I first
 mentioned (I only deal with the Java implementation).  The scenario
 however, is the same.


It is possible that the C# implementation (which is not written by Google)
accidentally interpreted default values differently.  You should ask the
author.


 @Kenton, I thought default values were never sent over the wire.
 According to the 'Updating A Message Type' section of the language
 guide ...Changing a default value is generally OK, as long as you
 remember that default values are never sent over the wire

 Are you saying this is not the case?


What the documentation means is that the value you write in the .proto file
is never used directly when serializing a message.  However, if you
explicitly set a field to a value that happens to be equal to the default
value, it *is* sent.  In this case we don't think of the value as being the
default value.

Seems like the wording of that text needs to be improved to avoid ambiguity.

-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 230 in protobuf: Documentation of the import behavior

2010-11-02 Thread protobuf

Updates:
Status: Accepted

Comment #1 on issue 230 by ken...@google.com: Documentation of the import  
behavior

http://code.google.com/p/protobuf/issues/detail?id=230

(No comment was entered for this change.)

--
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Migration from 2.0.3 to 2.3.0 problem on Mac OS –arch ppc

2010-11-02 Thread Kenton Varda
No ideas here.  Let us know if you find a solution.  A google search for
___floatundidf shows other people seeing this error in other contexts.

On Wed, Oct 27, 2010 at 12:33 PM, Irene Georgieva irened...@gmail.comwrote:

 Hi,

 I would like to migrate from 2.0.3 to 2.3.0. Everything looks ok
 except that I can’t link my existing projects on Mac OS with gcc 4.0 –
 arch ppc (only, i386 works fine).

 I receive:

  Undefined symbols:
  ___floatundidf, referenced from:


 google::protobuf::DescriptorBuilder::OptionInterpreter::SetOptionValue(google::protobuf::FieldDescriptor
 const*, google::protobuf::UnknownFieldSet*)in
 libprotobuf.a(descriptor.o)

 google::protobuf::TextFormat::Parser::ParserImpl::ConsumeDouble(double*)in
 libprotobuf.a(text_format.o)
  ___floatundisf, referenced from:


 google::protobuf::DescriptorBuilder::OptionInterpreter::SetOptionValue(google::protobuf::FieldDescriptor
 const*, google::protobuf::UnknownFieldSet*)in
 libprotobuf.a(descriptor.o)
 ld: symbol(s) not found

 It looks like this code in SetOptionValue isn’t changed from 2.0.3.
 What is then? Any ideas?

 Thanks,
 -i

 --
 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 to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 231 in protobuf: python SerializePartialToString raises 'Required field missing' in case of nested required fields

2010-11-02 Thread protobuf

Updates:
Status: Accepted

Comment #1 on issue 231 by ken...@google.com: python  
SerializePartialToString raises 'Required field missing' in case of nested  
required fields

http://code.google.com/p/protobuf/issues/detail?id=231

(No comment was entered for this change.)

--
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 232 in protobuf: Standard way of commenting protobuf files

2010-11-02 Thread protobuf

Updates:
Status: Duplicate
Mergedinto: 148

Comment #2 on issue 232 by ken...@google.com: Standard way of commenting  
protobuf files

http://code.google.com/p/protobuf/issues/detail?id=232

No worries.

--
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Newbie questions

2010-11-02 Thread Kenton Varda
On Tue, Nov 2, 2010 at 5:06 AM, Ofir Ben-Ezra ofir.bene...@gmail.comwrote:

 Hi,
 I'm rather new to protocol buffers and to protobuf-net.
 I have 2 questions:
 1. I'm trying to find out how can I generate XML file from a
 given .proto file and vice versa?


I'm not aware of any tool for this.


 2. I know this is done automatically in VS2008 plug in, but how can I
 generate C# classes from a given .proto file?


Google does not provide a C# implementation, but there are a couple
third-party ones.  You would have to follow the documentation for one of
those projects.


 Thanks,
 Ofir

 --
 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 to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Re: 2.4 release?

2010-11-02 Thread Pherl Liu
It's on the SVN head now, see
http://code.google.com/p/protobuf/source/detail?r=349
Will make a release candidate soon.

On Wed, Nov 3, 2010 at 1:02 AM, Zachary Turner divisorthe...@gmail.comwrote:

 Just wanted to follow up on this and see if this is still on target to
 be released within a month or so, and still include a beta of the
 python C++ work.

 Thanks,
 Zach

 On Sep 14, 11:28 am, Kenton Varda ken...@google.com wrote:
  Petar mostly finished this work, but then left the company.  We're trying
 to
  tie up the loose ends so that we can get it out, but everyone is pretty
  busy.  We'll probably do 2.4.0 within a month or two as we have a new
 team
  member who needs to learn the release process, and it should at least
  include a beta of this work.
 
  On Tue, Sep 14, 2010 at 10:36 AM, Zachary Turner 
 divisorthe...@gmail.comwrote:
 
 
 
 
 
 
 
   Reading through old threads, I found one that said that the next
   release would probably include Petar's python wrapper for native C++
   protobufs, greatly increasing speed of protubufs when calling from
   Python.
 
   Another post mentioned that this was expected to be done sometime this
   summer.
 
   Now that summer has come and gone, does anyone have an update about
   when this release might be ready?  We're considering re-inventing a
   python / C++ wrapper just because the performance is such a blocker on
   what we're working on at the moment, but given how long it's been in
   the works, it seems like it's such a black hole of work that we're
   going to embark on, whereas the magic hammer solution might only just
   around the corner.
 
   --
   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 to
   protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 protobuf%2bunsubscr...@googlegroups.c om
   .
   For more options, visit this group at
  http://groups.google.com/group/protobuf?hl=en.

 --
 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 to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
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 to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.