protocol-buffers

How to use dart-protobuf

血红的双手。 提交于 2020-01-13 10:26:08
问题 I'm considering using dart-protobuf instead of JSON in one of my projects. The problem is that the library does not provide any example of how to use it, and the tests don't really help either. I'm also a bit confused on how the parsing of .proto files would work. So I'm looking for a simple example of how to use this library in dart. 回答1: I'm not too familiar with dart-protobuf, but it looks like you have to use the protobuf compiler and the dart-protoc-plugin project to generate your Dart

How to use dart-protobuf

我是研究僧i 提交于 2020-01-13 10:26:07
问题 I'm considering using dart-protobuf instead of JSON in one of my projects. The problem is that the library does not provide any example of how to use it, and the tests don't really help either. I'm also a bit confused on how the parsing of .proto files would work. So I'm looking for a simple example of how to use this library in dart. 回答1: I'm not too familiar with dart-protobuf, but it looks like you have to use the protobuf compiler and the dart-protoc-plugin project to generate your Dart

Using Protocol Buffers for implementing RPC in ZeroMQ

送分小仙女□ 提交于 2020-01-12 03:52:11
问题 I have a simple setup of one client and one server. The client wants to execute a method in the server using ZeroMQ for communications. I am going to use the REQ and REP sockets because they are suitable for this use case. Nevertheless I have a doubt about the protobuf definitions. I think these two options can be used for achieving the goal: message ControlService{ string control = 1; int32 serverId = 2; bool block = 3; double temperature = 4; } Where "control" contains the name of the

Importing caffe results in ImportError: “No module named google.protobuf.internal” (import enum_type_wrapper)

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-12 01:45:09
问题 I installed Anaconda Python on my machine. When I start the Python Interpreter and type "import caffe" in the Python shell, I get the following error: ImportError: No module named google.protobuf.internal I have the following files: wire_format_lite_inl.h wire_format_lite.h wire_format.h unknown_field_set.h text_format.h service.h repeated_field.h reflection_ops.h message_lite.h message.h generated_message_util.h extension_set.h descriptor.proto descriptor.h generated_message_reflection.h

Importing caffe results in ImportError: “No module named google.protobuf.internal” (import enum_type_wrapper)

£可爱£侵袭症+ 提交于 2020-01-12 01:44:07
问题 I installed Anaconda Python on my machine. When I start the Python Interpreter and type "import caffe" in the Python shell, I get the following error: ImportError: No module named google.protobuf.internal I have the following files: wire_format_lite_inl.h wire_format_lite.h wire_format.h unknown_field_set.h text_format.h service.h repeated_field.h reflection_ops.h message_lite.h message.h generated_message_util.h extension_set.h descriptor.proto descriptor.h generated_message_reflection.h

Importing protocol buffer definitions between Maven projects

只谈情不闲聊 提交于 2020-01-11 18:53:10
问题 I currently manage a few separate Maven projects in which I use Protobufs as a serialization format and over the wire. I am using David Trott's maven-protoc plugin to generate the code at compile time. All is good and well until I want those project to communicate between one another — or rather, use each other's protobufs. The protobuf language has an "import" directive which does what I want but I'm faced with the challenge of having project A exporting a ".proto" file (or possibly some

Importing protocol buffer definitions between Maven projects

浪尽此生 提交于 2020-01-11 18:52:02
问题 I currently manage a few separate Maven projects in which I use Protobufs as a serialization format and over the wire. I am using David Trott's maven-protoc plugin to generate the code at compile time. All is good and well until I want those project to communicate between one another — or rather, use each other's protobufs. The protobuf language has an "import" directive which does what I want but I'm faced with the challenge of having project A exporting a ".proto" file (or possibly some

PROTOBUFF INT64 check aganist previously entered data c++

纵然是瞬间 提交于 2020-01-07 06:57:36
问题 message HealthOccurrenceCount { required int64 HealthID=1; required int32 OccCount=2; optional bytes wci=3; } I would like to add data based on HealthID ; If HealthID is already entered then instead of adding a new entry, the program should instead just increment the existing entry's OccCount . HealthOccurrenceCount objHelthOccCount; if(objHelthOccCount.healthid() == healthID) // Is this right or do I need to iterate all the nodes? { occCount++; objHelthOccCount.set_occcount(occCount); } else

use caffe to train my own jpg datasets:type “caffe.ImageDataParameter” has no field named “backend”

為{幸葍}努か 提交于 2020-01-07 02:26:46
问题 when I run train_caffenet.sh , I get the following errors: I0906 10:56:42.327703 21556 solver.cpp:91] Creating training net from net file: /home/pris/caffe-master/examples/myself/train_val.prototxt [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 26:12: Message type "caffe.ImageDataParameter" has no field named "backend". F0906 10:56:42.327837 21556 upgrade_proto.cpp:79] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse

Protobuf Java To C++ Serialization [Binary]

佐手、 提交于 2020-01-07 01:21:51
问题 I have a program that serializes data with Protobuf in Java, by writing binary data in a byte[] Array and then saving it in ".txt" file. I am receiving that data on the C++ side in a stringstream. Now I want to parse that binary data with C++, but the Protobuf-Parsing-Method "parseFromString()" doesn't work! The fields from my Test Message are not set. I wrote a little test for that and I can show you some code: Java Serialization byte[] s = test.build().toByteArray(); //This is serialized to