Panchatcharam Mariappan | 29 Aug 17:21 2014
Picon

Building With MSVC

I am developing a newproject say myproject, with the help of cmake and MSVC 2010.
I want to include protobuf into my project.
So far, I am compiling protobuf separately and linking them with my cmake. But I dont want this.

I have the following questions.
Is it possible to include protobuf/vsprojects/protobuf.sln into myproject?
protobuf.sln has to be built at first and the produced .lib or .dll should be loaded into my cmake, Is it possible to do this
using cmake?


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

Serializing in C then deserializing in python

Hi

I have a bit of issue for serializing in C and deserializing it in python,

I defined a message to carry data, serialize it into array in C, then send it over to python (via ctype).

I noticed that since the serialized array may contains 0 (zero) values, It is better of to send as array of int to python,
otherwise truncated message would be transferred ( python expects strings are NULL terminated ). In this case
when I receive an array of int values in python, I don't know how to reconstruct a string from those values and feed it to ParseFromString()
because ParseFromString() does not accept array_of_int, because it does not have len(). I can not build a string in python especially some of the values are negative and python does not let me convert negative value to char.

Any comment ?

Codes:


message siftOut{
message keypoint {
required float x = 1;
repeated float descr= 2 [packed=true];
}
repeated keypoint keypoints= 1;
} ; 
 
When I filled a message such as:

siftOut vFrmDescr;
siftOut_keypoint *frmDescr = vFrmDescr.add_keypoints();
int l ;
frmDescr->set_x ( (float) k -> x );
for (l = 0 ; l < 128 ; ++l) {
frmDescr->add_descr (   (512.0 * descr [l]) ) ;
}

Then   
  
char * charOut = new char[vFrmDescr.ByteSize()];

vFrmDescr.SerializeToArray( charOut , vFrmDescr.ByteSize()); 

and send it to python

in python
           LIB = cdll[_loc]
            LIB.protoBufFunc.argtypes =[c_char_p , c_int32 ]
            LIB.protoBufFunc.restype  = POINTER(c_int32)
            stDescriptors = LIB.protoBufFunc( " A sample dataa in string format " , 50 );

 Now how can I use parsefromString() in python to read  stDescriptors  ?

Appreciate your help in advance.

Regards
Mani

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

Serializing in c and deSerializing in python

Hi all,

I have a problem serializing a message in C and deserializing it in python.

The problem is that when I serialize a message in C, some of the values are 0 (zero) or negative (e.g. -150).
Thus I can not send the serialize message as char* to python.
Because, ctype of python expect string as null terminated.
Even if I send it as array of int, then I dont know how to reconstruct the original string in python. 
Apparently str() does not let me assign each element directly aslo, chr() does not let me convert negative values to character. 

Any comment ? 

Thanks in advance for your help.
Mani

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

Issue 665 in protobuf: Getting Error when merging Request to Protobuff format

Status: New
Owner: liujisi <at> google.com
Labels: Type-Defect Priority-Medium

New issue 665 by veer... <at> gmail.com: Getting Error when merging Request to  
Protobuff format
https://code.google.com/p/protobuf/issues/detail?id=665

What steps will reproduce the problem?
1. Python script test is successful
2. production request is having some issues
3.

What is the expected output? What do you see instead?
Successfully should be parsed

What version of the product are you using? On what operating system?
Windows

Please provide any additional information below.
error is

com.google.protobuf.TextFormat$ParseException: 84:5: Message  
type "BidRequest.AdSlot.MatchingAdData" has no field named "7".
         at  
com.google.protobuf.TextFormat$Tokenizer.parseExceptionPreviousToken(
TextFormat.java:923)
         at com.google.protobuf.TextFormat.mergeField(TextFormat.java:1125)
         at com.google.protobuf.TextFormat.mergeField(TextFormat.java:1156)
         at com.google.protobuf.TextFormat.mergeField(TextFormat.java:1156)
         at com.google.protobuf.TextFormat.merge(TextFormat.java:1062)
         at com.google.protobuf.TextFormat.merge(TextFormat.java:1008)
         at  
com.adtheorent.customfunction.GoogleAdX.AdXRequest(GoogleAdX.java:103
)
         at  
be.gen.Bidder.RuleFunctions.HTTPFront.AdExchanges.Request2Concept_AdX
$oversizeName.Request2Concept_AdX(Request2Concept_AdX$oversizeName.java:25)
         at  
be.gen.Bidder.RuleFunctions.HTTPFront.AdExchanges.nullAction_AdXObjec
t$.Action_AdX(nullAction_AdXObject$.java:28)
         at  
be.gen.Bidder.RuleFunctions.HTTPFront.AdExchanges.Action_AdX.invoke(A

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

--

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

protobuf | 28 Aug 22:57 2014

Issue 664 in protobuf: Patch for /trunk/python/setup.py

Status: New
Owner: ----
Labels: Type-Patch

New issue 664 by rwelln... <at> gmail.com: Patch for /trunk/python/setup.py
https://code.google.com/p/protobuf/issues/detail?id=664

Add Python 3 classifier for PyPI

Attachments:
	setup.py.patch  391 bytes

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

--

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

Feng Xiao | 27 Aug 01:59 2014
Picon

We are moving protobuf to github.

Hi all,

Finally, we are moving protobuf to github. The new home of protobuf is:
  https://github.com/google/protobuf

All future code changes will be made in github. We will continue fix/clean-up issues filed in protobuf Google Code site but for new issues please file it in the github site.

I'm not sure whether I got all the configurations right for our protobuf github site. If you find any problems, please post it here. This google group will continue to be the place to discuss protobuf related questions.

Thanks,
Feng


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

Bug in python CPP backend (version 2.6.0)

Is the below a bug?


Python 2.7.5 |Anaconda 2.0.0 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from google.protobuf.internal import cpp_message
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build\bdist.win-amd64\egg\google\protobuf\internal\cpp_message.py", line 39, in <module>
ImportError: cannot import name _net_proto2___python
>>>
>>> import os
>>> os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION']
'cpp'
>>> os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION']
'2'
>>>
>>> import google.protobuf as pb
>>> pb
<module 'google.protobuf' from 'C:\dev\bin\Anaconda\lib\site-packages\protobuf-2.6.0-py2.7-win-amd64.egg\google\protobuf\__init__.pyc'>
>>>


It seems _net_proto2___python has been left over from a previous implementation?

Note: To get it to compile with VS2008 which is required for Python2 I had to change the iterator below to a const_iterator

https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/compiler/command_line_interface.cc#1562


Let me know if there's any other information you need to help debug the problem.


Thanks,
Dave

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

Python CPP backend bug: cannot import name _net_proto2___python

Hi,

I get the aforementioned error message when trying to use the cpp backend for python with the new version 2.6.0:

Python 2.7.5 |Anaconda 2.0.0 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.protobuf.internal import cpp_message
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build\bdist.win-amd64\egg\google\protobuf\internal\cpp_message.py", line 39, in <module>
ImportError: cannot import name _net_proto2___python
>>>
>>> import os
>>> os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION']
'cpp'
>>> os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION']
'2'
>>> import google.protobuf as pb
>>> pb
<module 'google.protobuf' from 'C:\dev\bin\Anaconda\lib\site-packages\protobuf-2.6.0-py2.7-win-amd64.egg\google\protobuf\__init__.pyc'>
>>>


Is this a bug? It seems _net_proto2___python may be a leftover from a previous version?

Also, to compile with VS2008 (required for Python 2.7) I had to change the iterator below to a const_iterator

https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/compiler/command_line_interface.cc#1562


Regards,
Dave

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

2.6.0 released

Hi all,

The final release of Protobuf 2.6.0 is now available:
https://code.google.com/p/protobuf/wiki/Download?tm=2

Documentation will be updated soon.

CHANGES
========
2014-08-15 version 2.6.0:

General
* Added oneofs(unions) feature. Fields in the same oneof will share
memory and at most one field can be set at the same time. Use the
oneof keyword to define a oneof like:
  message SampleMessage {
    oneof test_oneof {
      string name = 4;
      YourMessage sub_message = 9;
    }
  }
* Files, services, enums, messages, methods and enum values can be marked
as deprecated now.
* Added Support for list values, including lists of mesaages, when
parsing text-formatted protos in C++ and Java.
For example: foo: [1, 2, 3]

C++
* Enhanced customization on TestFormat printing.
* Added SwapFields() in reflection API to swap a subset of fields.
Added SetAllocatedMessage() in reflection API.
* Repeated primitive extensions are now packable. The
[packed=true] option only affects serializers. Therefore, it is
possible to switch a repeated extension field to packed format
without breaking backwards-compatibility.
* Various speed optimizations.

Java
* writeTo() method in ByteString can now write a substring to an
output stream. Added endWith() method for ByteString.
* ByteString and ByteBuffer are now supported in CodedInputStream
and CodedOutputStream.
* java_generate_equals_and_hash can now be used with the LITE_RUNTIME.

Python
* A new C++-backed extension module (aka "cpp api v2") that replaces the
old ("cpp api v1") one. Much faster than the pure Python code. This one
resolves many bugs and is recommended for general use over the
pure Python when possible.
* Descriptors now have enum_types_by_name and extension_types_by_name dict
attributes.
* Support for Python 3.

Thanks,
Jie

--

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

2.5.0 released

Hi all,

The final release of Protobuf 2.6.0 is now available:
https://code.google.com/p/protobuf/wiki/Download?tm=2

Documentation will be updated soon.

CHANGES
========
2014-08-15 version 2.6.0:

General
* Added oneofs(unions) feature. Fields in the same oneof will share
memory and at most one field can be set at the same time. Use the
oneof keyword to define a oneof like:
  message SampleMessage {
    oneof test_oneof {
      string name = 4;
      YourMessage sub_message = 9;
    }
  }
* Files, services, enums, messages, methods and enum values can be marked
as deprecated now.
* Added Support for list values, including lists of mesaages, when
parsing text-formatted protos in C++ and Java.
For example: foo: [1, 2, 3]

C++
* Enhanced customization on TestFormat printing.
* Added SwapFields() in reflection API to swap a subset of fields.
Added SetAllocatedMessage() in reflection API.
* Repeated primitive extensions are now packable. The
[packed=true] option only affects serializers. Therefore, it is
possible to switch a repeated extension field to packed format
without breaking backwards-compatibility.
* Various speed optimizations.

Java
* writeTo() method in ByteString can now write a substring to an
output stream. Added endWith() method for ByteString.
* ByteString and ByteBuffer are now supported in CodedInputStream
and CodedOutputStream.
* java_generate_equals_and_hash can now be used with the LITE_RUNTIME.

Python
* A new C++-backed extension module (aka "cpp api v2") that replaces the
old ("cpp api v1") one. Much faster than the pure Python code. This one
resolves many bugs and is recommended for general use over the
pure Python when possible.
* Descriptors now have enum_types_by_name and extension_types_by_name dict
attributes.
* Support for Python 3.

Thanks,
Jie

--

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

Marvin Somebody | 25 Aug 17:30 2014
Picon

Support multiple parameters for rpc functions

Hello,
recently I started using protobuf for one of my projects, as I finished with defining my services I tried to compile but it didn't worked. That was because I defined my functions like at {2} , I did this because for me as programmer it is normal that functions can be defined with more than one parameter. In my opinion protobuf should support it because it improves readably and if I can omit the messages to encapsulate others so the codebase will be  also smaller.


message User {
    required bytes uuid
= 1;
    required
string name = 2;
}


message
ChatMessage {
    required
User sender = 1;
    required
string msg = 2;
}


message
StatusResponse {
    required int32 status
= 1;
}


//That's what I currently do {1}
message
MessageTransfer {
    required
User recipient = 1;
    required
ChatMessage msg = 2;
}


service
ChatService {
    rpc sendmessage
(MessageTransfer) returns (StatusResponse);
}


//That's what I want to do {2}
service
ChatService {
    rpc sendmessage
(ChatMessage msg ,User recipient) returns (StatusResponse);
}

Thanks for reading

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

Gmane