[protobuf] Some Questions about protocolbuffers

2015-06-15 Thread Douglas Deodato
Hello Guys, i am new here, i would like know ask some questions if you 
don't mind :).

i follow all steps from github and worked well for me.

i got stuck to make it load on my php, can u guys help me with that?

i did:

git clone https://github.com/chobie/php-protocolbuffers.git
cd php-protocolbuffers
phpize
./configure
make
make install
# please add following line to your php.ini
# extension=protocolbuffers.so

i tried run that in my project and i get that line:

i am doing a volunteer job, so i am trying run that website in my 
localmachine and pb is one of the dependecies, i contact one of the 
developers and he said its because i am not loading that on my php.ini , 
but the line is there so he said have no idea what is going on.

[12-Jun-2015 10:49:33 Europe/Berlin] PHP Fatal error:  Class 
'ProtocolBuffers\Message' not found in 
/Applications/MAMP/htdocs/www/Common/protobufs/models/MembershipRequest.php 
on line 22


looks like i am not loading that module on my php.ini but i inserted the 
line there, i tried many times but i got stuck, can u guys help me?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Protobuf Buffers v3.0.0-alpha-1

2015-06-15 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Jun 12, 2015 at 12:40 PM, Darin Gordon dar...@gmail.com wrote:

 Hi Feng

 What would you say is a reasonable ETA for the protobuf 3 full release?
 Are you going through a series of RC's first?

We will have a series of alpha releases followed by a series of betas. The
3 full release may be in Q4 this year.





 On Wednesday, December 10, 2014 at 11:51:01 PM UTC-5, Feng Xiao wrote:

 Hi all,

 I just published protobuf v3.0.0-alpha-1 on our github site:
 https://github.com/google/protobuf/releases/tag/v3.0.0-alpha-1

 This is the first alpha release of protobuf v3.0.0. In protobuf v3.0.0,
 we will add a new protobuf language version (aka proto3) and support a
 wider range of programming languages (to name a few: ruby, php, node.js,
 objective-c). This alpha version contains C++ and Java implementation with
 partial proto3 support (see below for details). In future releases we will
 add support for more programming languages and implement the full proto3
 feature set. Besides proto3, this alpha version also includes two other new
 features: map fields and arena allocation. They are implemented for both
 proto3 and the old protobuf language version (aka proto2).

 We are currently working on the documentation of these new features and
 when it's ready it will be updated to our protobuf developer guide
 https://developers.google.com/protocol-buffers/docs/overview. For the
 time being if you have any questions regarding proto3 or other new
 features, please post your question in the discussion group.

 CHANGS
 ===
 Version 3.0.0-alpha-1 (C++/Java):

   General
   * Introduced Protocol Buffers language version 3 (aka proto3).

 When protobuf was initially opensourced it implemented Protocol
 Buffers
 language version 2 (aka proto2), which is why the version number
 started from v2.0.0. From v3.0.0, a new language version (proto3) is
 introduced while the old version (proto2) will continue to be
 supported.

 The main intent of introducing proto3 is to clean up protobuf before
 pushing the language as the foundation of Google's new API platform.
 In proto3, the language is simplified, both for ease of use and  to
 make it available in a wider range of programming languages. At the
 same time a few features are added to better support common idioms
 found in APIs.

 The following are the main new features in language version 3:

   1. Removal of field presence logic for primitive value fields,
 removal
  of required fields, and removal of default values. This makes
 proto3
  significantly easier to implement with open struct
 representations,
  as in languages like Android Java, Objective C, or Go.
   2. Removal of unknown fields.
   3. Removal of extensions, which are instead replaced by a new
 standard
  type called Any.
   4. Fix semantics for unknown enum values.
   5. Addition of maps.
   6. Addition of a small set of standard types for representation of
 time,
  dynamic data, etc.
   7. A well-defined encoding in JSON as an alternative to binary proto
  encoding.

 This release (v3.0.0-alpha-1) includes partial proto3 support for C++
 and
 Java. Items 6 (well-known types) and 7 (JSON format) in the above
 feature
 list are not implemented.

 A new notion syntax is introduced to specify whether a .proto file
 uses proto2 or proto3:

   // foo.proto
   syntax = proto3;
   message Bar {...}

 If omitted, the protocol compiler will generate a warning and
 proto2 will
 be used as the default. This warning will be turned into an error in a
 future release.

 We recommend that new Protocol Buffers users use proto3. However, we
 do not
 generally recommend that existing users migrate from proto2 from
 proto3 due
 to API incompatibility, and we will continue to support proto2 for a
 long
 time.

   * Added support for map fields (implemented in C++/Java for both proto2
 and
 proto3).

 Map fields can be declared using the following syntax:

   message Foo {
 mapstring, string values = 1;
   }

 Data of a map field will be stored in memory as an unordered map and
 it
 can be accessed through generated accessors.

   C++
   * Added arena allocation support (for both proto2 and proto3).

 Profiling shows memory allocation and deallocation constitutes a
 significant
 fraction of CPU-time spent in protobuf code and arena allocation is a
 technique introduced to reduce this cost. With arena allocation, new
 objects will be allocated from a large piece of preallocated memory
 and
 deallocation of these objects is almost free. Early adoption shows
 20% to
 50% improvement in some Google binaries.

 To enable arena support, add the following option to your .proto file:

   option cc_enable_arenas = true;

 Protocol compiler will generate additional code to make the 

[protobuf] Interface definition and Implementation - Protocol Buffer

2015-06-15 Thread reetesh
I have some  Query

1.How interface definition and implementation takes place in Protocol 
Buffer.
2. How to define static final variable in protocol Buffer i.e. If I have 
some static constant variable in java file how can we define these in 
.proto file.
3. Can we import java file in .proto file. Like if I have following 
scenarios

Example:-

Class Reetesh{

private ListIBooks books;
static final age= 50;

}

IBooks is a interface.

Can somebody help us to define .proto file for that.?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Java Interface Definition and Implementation

2015-06-15 Thread reetesh
Hi ,

We need help on the following queries.

1. How to define and implement java interface in .proto file.
2. How to define Java Constant in .proto file.
3. Can we import java file in .proto file.

Example:-

Reetesh {

private static final int age = 40;
private ListIBook book;

}

IBook is the interface.

Can somebody help us to create .proto file?

Regards,
Reetesh

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Streaming results from a repeated field in Java

2015-06-15 Thread dan bress
If I have a protobuf that looks like this

message Table{
  required Schema mySchema= 1;
  repeated Row myRows = 2;
}

And the sender is sending me a Table structure with thousands of rows, I would 
like to be able to read the Schema structure into memory, then read each Row 
into memory one at a time, instead of all of them at once.  Is there a way to 
do this using the Java API?  If so can you share an example of how to do so?

Thanks!

Dan


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Protobuf Buffers v3.0.0-alpha-1

2015-06-15 Thread Darin Gordon
Hi Feng

What would you say is a reasonable ETA for the protobuf 3 full release? 
 Are you going through a series of RC's first?



On Wednesday, December 10, 2014 at 11:51:01 PM UTC-5, Feng Xiao wrote:

 Hi all,

 I just published protobuf v3.0.0-alpha-1 on our github site:
 https://github.com/google/protobuf/releases/tag/v3.0.0-alpha-1

 This is the first alpha release of protobuf v3.0.0. In protobuf v3.0.0, we 
 will add a new protobuf language version (aka proto3) and support a wider 
 range of programming languages (to name a few: ruby, php, node.js, 
 objective-c). This alpha version contains C++ and Java implementation with 
 partial proto3 support (see below for details). In future releases we will 
 add support for more programming languages and implement the full proto3 
 feature set. Besides proto3, this alpha version also includes two other new 
 features: map fields and arena allocation. They are implemented for both 
 proto3 and the old protobuf language version (aka proto2).

 We are currently working on the documentation of these new features and 
 when it's ready it will be updated to our protobuf developer guide 
 https://developers.google.com/protocol-buffers/docs/overview. For the 
 time being if you have any questions regarding proto3 or other new 
 features, please post your question in the discussion group.

 CHANGS
 ===
 Version 3.0.0-alpha-1 (C++/Java):

   General
   * Introduced Protocol Buffers language version 3 (aka proto3).

 When protobuf was initially opensourced it implemented Protocol Buffers
 language version 2 (aka proto2), which is why the version number
 started from v2.0.0. From v3.0.0, a new language version (proto3) is
 introduced while the old version (proto2) will continue to be 
 supported.

 The main intent of introducing proto3 is to clean up protobuf before
 pushing the language as the foundation of Google's new API platform.
 In proto3, the language is simplified, both for ease of use and  to
 make it available in a wider range of programming languages. At the
 same time a few features are added to better support common idioms
 found in APIs.

 The following are the main new features in language version 3:

   1. Removal of field presence logic for primitive value fields, 
 removal
  of required fields, and removal of default values. This makes 
 proto3
  significantly easier to implement with open struct 
 representations,
  as in languages like Android Java, Objective C, or Go.
   2. Removal of unknown fields.
   3. Removal of extensions, which are instead replaced by a new 
 standard
  type called Any.
   4. Fix semantics for unknown enum values.
   5. Addition of maps.
   6. Addition of a small set of standard types for representation of 
 time,
  dynamic data, etc.
   7. A well-defined encoding in JSON as an alternative to binary proto
  encoding.

 This release (v3.0.0-alpha-1) includes partial proto3 support for C++ 
 and
 Java. Items 6 (well-known types) and 7 (JSON format) in the above 
 feature
 list are not implemented.

 A new notion syntax is introduced to specify whether a .proto file
 uses proto2 or proto3:

   // foo.proto
   syntax = proto3;
   message Bar {...}

 If omitted, the protocol compiler will generate a warning and proto2 
 will
 be used as the default. This warning will be turned into an error in a
 future release.

 We recommend that new Protocol Buffers users use proto3. However, we 
 do not
 generally recommend that existing users migrate from proto2 from 
 proto3 due
 to API incompatibility, and we will continue to support proto2 for a 
 long
 time.

   * Added support for map fields (implemented in C++/Java for both proto2 
 and
 proto3).

 Map fields can be declared using the following syntax:

   message Foo {
 mapstring, string values = 1;
   }

 Data of a map field will be stored in memory as an unordered map and it
 can be accessed through generated accessors.

   C++
   * Added arena allocation support (for both proto2 and proto3).

 Profiling shows memory allocation and deallocation constitutes a 
 significant
 fraction of CPU-time spent in protobuf code and arena allocation is a
 technique introduced to reduce this cost. With arena allocation, new
 objects will be allocated from a large piece of preallocated memory and
 deallocation of these objects is almost free. Early adoption shows 20% 
 to
 50% improvement in some Google binaries.

 To enable arena support, add the following option to your .proto file:

   option cc_enable_arenas = true;

 Protocol compiler will generate additional code to make the generated
 message classes work with arenas. This does not change the existing API
 of protobuf messages and does not affect wire format. Your existing 
 code
   

[protobuf] Cannot build any version in specific RH6 environment

2015-06-15 Thread Val Goldring


Hi, I tried to build version 2.6.1 and 3.0.0 alpha 2 Linux in C++ using:
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15) , g++ (GCC) 4.8.2 20140120 (Red 
Hat 4.8.2-15)
and the same error seems to prevent installation from generating the 
Makefile, so later make returns:
make: *** No targets specified and no makefile found. Stop.
./configure output shows these strange missing features of C++ environment, 
that frankly are hard to believe:

checking for working memcmp... no
checking for working strtod... no
checking for pow... no
checking for pow in -lm... no
configure: WARNING: cannot find library containing definition of pow
checking for ftruncate... no
checking for memset... no
checking for mkdir... no
checking for strchr... no
checking for strerror... no
checking for strtol... no
checking zlib version... headers missing or too old (requires 1.2.0.4)
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to check for GCC pthread/shared inconsistencies... yes
checking whether -pthread is sufficient with -shared... yes
checking whether what we have so far is sufficient with -nostdlib... no
checking whether -lpthread saves the day... yes
checking the location of hash_map... 
checking for library containing sched_yield... no
configure: error: in /root/source/protobuf-2.6.1': configure: error: 
sched_yield was not found on your system Seeconfig.log' for more details.

About zlib missing headers, yum reports:
Package zlib-1.2.3-29.el6.x86_64 already installed and latest version
which means the installation is not found by ./configure script.

But sched_yield seems to be the final blow. I attached full config.log.

Can someone please help me understand and/or fix this?

Thank you.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


config.log
Description: Binary data


[protobuf] Interface definition and Implementation - Protocol buffer

2015-06-15 Thread reetesh
Hi ,

We need help on the following queries.

1. How to define and implement java interface in .proto file.
2. How to define Java Constant in .proto file.
3. Can we import java file in .proto file.

Example:-

Reetesh {

private static final int age = 40;
private ListIBook book;

}

IBook is the interface.

Can somebody help us to create .proto file?

Regards,
Reetesh

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Odd problem with protobuf implementation in C++

2015-06-15 Thread Thomas ASTIER
Hi!

After a small research, I ended up on this group, that discussed the exact 
problem I am currently experiencing.
Unfortunately, the solution could not be applied to my case.

By posting on this old thread, I am hoping somebody could give me some more 
hints in order to resolve my situation.

Please, find bellow the message I posted on another dev forum:
 

 Currently using protobuf under its 2.5.0 version, I am stuck with a 
 problem I am struggling to resolve. First of all, the following .proto 
 files represent the messages I am dealing with :

 MacroMission.proto
 message MacroMission{
 required int32 timeWithoutCom=1;
 required string name=2;
 required Phase failSafePhase=3;
 repeated Phase phases=4;}
 message Phase{
 optional Survey survey=1;}
 message Survey{
 repeated Segment trajectory=1;
 required string sonarPreset=4;}
 message Segment{
 required WayPoint start=1;
 required WayPoint end=2;}Common.proto
 message WayPoint{
required GeoPoint pos = 1;   // Not relevant
optional string label = 2 ;}

 The aim of the software is to fill a MacroMission message. I am working 
 under Windows 7, with C++/Qt and minGW compiler, using the protobuf library 
 within Qt Plugin projects (a message is shared between two distinct 
 plugins, a « creator » and a « filler »).

 My problem is : whenever I try to assign a value to a field of string 
 type, all the other string fields are taking the same value. My first guess 
 was that, somehow, all these fields had the same address in memory, which 
 turned out true. Concerned about the good initialization of the messages, I 
 double checked all the process for creating the MacroMission. It could be 
 best described by the following lines :

 Classe A – Plugin 1
 ::pb::MacroMission mission;

 mission.set_name(rMissionName.toStdString());


 mission.set_timewithoutcom(timeWithoutCom);


 foreach(MissionClass)
 {
 ::pb::Phase * missionPhase = mission.add_phases();
 MissionClass-FillPhase(missionPhase);
 }
 MissionClass – Plugin 2
 FillPhase methode (TnamedSegment is a support class for segment data 
 access)

 ::pb::Survey * survey = missionPhase-mutable_survey();  

 for(int segmentRank = 0 ; segmentRank  
 surveyParams.getSegments().count() ; ++segmentRank)
 {
 TNamedSegment segment = surveyParams.getSegments()[segmentRank];

 qDebug()  Adding one segment :;

 ::pb::Segment* pb_segment = survey-add_trajectory();

 
 pb_segment-mutable_start()-set_label(QString(WP_%1_start).arg(segmentRank).toStdString());
 
 pb_segment-mutable_start()-mutable_pos()-set_latitude(segment.startWP.latitude);
 
 pb_segment-mutable_start()-mutable_pos()-set_longitude(segment.startWP.longitude);

 
 pb_segment-mutable_end()-set_label(QString(WP_%1_end).arg(segmentRank).toStdString());
 
 pb_segment-mutable_end()-mutable_pos()-set_latitude(segment.endWP.latitude);
 
 pb_segment-mutable_end()-mutable_pos()-set_longitude(segment.endWP.longitude);
 }

 survey-set_sonarpreset(surveyParams.getSonarPreset().toStdString());

 In the end, nothing comes out of the blue in this code. But, as I 
 previously said, all the protobuf labels/names in the messages have the 
 same address. Therefore, they will all end up with the same value, the one 
 of the last field set (in this case, the value of SonarPreset). I have been 
 able to solve a little tiny part of the problem by using the 
 set_allocated_var method, but in the end, the major part of the problem 
 remains unchanged.

 After several hours of internet researches, many regenerations/rebuilds of 
 the protobuf messages and of the project in which they are used, memory 
 allocation double checks, and protobuf library help documentation readings, 
 I come to you in order to know if, by any change, someone would have the 
 beginning of a solution to my problem.

 I did a small unit test program which only fill the protobuff message in a 
 single main.cpp file, and everything works fine...

 Thank you in advance for any answer.

 PS : Please let me know if you need any further information in order to 
 clarify the problem.


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.