protocol-buffers

Protocol buffers in C# projects using protobuf-net - best practices for code generation

做~自己de王妃 提交于 2019-12-20 08:43:58
问题 I'm trying to use protobuf in a C# project, using protobuf-net, and am wondering what is the best way to organise this into a Visual Studio project structure. When manually using the protogen tool to generate code into C#, life seems easy but it doesn't feel right. I'd like the .proto file to be considered to be the primary source-code file, generating C# files as a by-product, but before the C# compiler gets involved. The options seem to be: Custom tool for proto tools (although I can't see

Unable to build protobuf to go endpoint

核能气质少年 提交于 2019-12-20 08:24:35
问题 using protobuf version 2.6.1 ( which i installed via homebrew) I am trying to run $ protoc --go_out=../cloud/ *.proto I keep receiving this error. $ protoc-gen-go: program not found or is not executable $ --go_out: protoc-gen-go: Plugin failed with status code 1. I have the protoc-gen-go installed in my go path. Anyone else have this issue? 回答1: protoc-gen-go needs to be in your shell path, i.e. one of the directories listed in the PATH environment variable, which is different from the Go

How to bring a gRPC defined API to the web browser

白昼怎懂夜的黑 提交于 2019-12-20 07:59:12
问题 We want to build a Javascript/HTML gui for our gRPC-microservices. Since gRPC is not supported on the browser side, we thought of using web-sockets to connect to a node.js server, which calls the target service via grpc. We struggle to find an elegant solution to do this. Especially, since we use gRPC streams to push events between our micro-services. It seems that we need a second RPC system, just to communicate between the front end and the node.js server. This seems to be a lot of overhead

Getting segfault due to string data type variable in PROTOBUF server and client communication through sockets on recv end in cpp

无人久伴 提交于 2019-12-20 07:14:06
问题 When I am sending a protobuf variable through socket communication on recv end I am trying to display the string variable of protobuf I got segmentation in this remaining Data type other than String they are working fine but string variable case I got segmentation How can I over come in Protobuf string datatype segmentation fault other than we have any other data type for store the string data type. I create a example.proto with in string variable name is there I am compile example.proto with

Google protobuf and Android NDK

我们两清 提交于 2019-12-20 05:47:15
问题 How to build Google protobuf (c++ version, https://github.com/google/protobuf/releases/latest ) with Android target? 回答1: I compiled protobuf without ndk-build. Here's the script (not very clean but it works): rm -rf /tmp/protobuf-3.3.0/ tar xzvf ~/Downloads/protobuf-cpp-3.3.0.tar.gz -C /tmp/ cd /tmp/protobuf-3.3.0/ export NDK_ROOT=/home/user/SDKS/ANDROID/NDK/android-ndk-r13b export SYSROOT=$NDK_ROOT/platforms/android-9/arch-arm export PREBUILT=$NDK_ROOT/toolchains/arm-linux-androideabi-4.9

Program with protocol-buffers don't compile with MinGW-w64: “undefined reference to google::protobuf:: …”

懵懂的女人 提交于 2019-12-20 04:28:09
问题 I have installed the libprotobuf-dev=2.6.0-4 and protobuf-compiler=2.6.0-4 packages from Debian Jessie repository. Now I'm trying to compile a program that use the 'addressbook.proto' file from the Google Developers example with the MinGW-w64 compiler. I'm using Ubuntu 14.04. With this command the program works: $ g++ main.cpp addressbook.pb.cc -lprotobuf But I want to compile for Windows too. I added the symlink: /usr/include/google -> /usr/i686-w64-mingw32/include/google . $ i686-w64

installing TensorFlow on the IBM power8

天涯浪子 提交于 2019-12-19 10:32:19
问题 I have access to a large IBM Power8 machine, and would like to install TensorFlow on it. Naturally, I tried the quick pip install, but it failed: sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.6.0-cp27-none-linux_x86_64.whl tensorflow-0.6.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform. Storing debug log for failure in /home/pv/.pip/pip.log Unfortunately, pip.log cotains little useful info. /usr/bin/pip run on Sat Feb 6 17:29:34 2016

Converting a Protocol Buffer to a POJO

怎甘沉沦 提交于 2019-12-19 03:15:14
问题 Is there a tool or library that can map a Protobuff object to a POJO. I would like to have the pojo implement other interfaces that I can not with the ProtoBuff object. Or would I have to manually do this conversion? 回答1: Maybe too late, but you can try protobuf-converter library. It is easy to use. Convert POJO object to related protobuf message: POJOClass pojoInstance = new POJOClass(); ... ProtobufClass protoInstance = Converter.create().toProtobuf(ProtobufClass.class, pojoInstance ); Code

Converting a Protocol Buffer to a POJO

a 夏天 提交于 2019-12-19 03:15:10
问题 Is there a tool or library that can map a Protobuff object to a POJO. I would like to have the pojo implement other interfaces that I can not with the ProtoBuff object. Or would I have to manually do this conversion? 回答1: Maybe too late, but you can try protobuf-converter library. It is easy to use. Convert POJO object to related protobuf message: POJOClass pojoInstance = new POJOClass(); ... ProtobufClass protoInstance = Converter.create().toProtobuf(ProtobufClass.class, pojoInstance ); Code

Google Protocol Buffers: parseDelimitedFrom and writeDelimitedTo for C++

冷暖自知 提交于 2019-12-19 02:37:34
问题 Sorry to ask this again, but could we please once and for all post some C++ functions that match the Java ones here? They don't seem to be getting added by google, and it is a quite a pain to write them yourself. Below answer using some of this and this. 回答1: Here are the two basic versions with boost asio. Notice that to make this work properly, technically, in the second version, one would need to look at how much data is in the buffer, work out how big the header was (VarInt is not a fixed