protocol-buffers

Python importing Module that does not exist?

旧街凉风 提交于 2019-12-10 16:40:03
问题 So I was running: import google > <module 'google' (built-in)> In python prompt. google. path ['/Library/Python/2.7/site-packages/google'] I want to delete the google module. So I : rm -rf /Library/Python/2.7/site-packages/google IT'S GONE! But When I go back into python shell I get the same results as above. (FYI, The python module was for protobuf I believe.) Any ideas? 回答1: You need to uninstall the 'protobuf' module. sudo pip uninstall protobuf 来源: https://stackoverflow.com/questions

How to write a custom Protobuf CodeGenerator in Java

时光怂恿深爱的人放手 提交于 2019-12-10 14:25:01
问题 I'm trying to write a custom code generator for an in-house proprietary programming language. I figured I could write the generator in Java, using the protoc plugin guide. My main() does something like this: public static void main(String[] args) throws IOException { CodeGenerator gen = new CodeGenerator(); PluginProtos.CodeGeneratorRequest codeGeneratorRequest = PluginProtos.CodeGeneratorRequest.parseFrom(args[0].getBytes()); codeGeneratorRequest.getProtoFileList().forEach(gen::handleFile);

Is there a way to create a type alias in protobuf (proto2)?

北城余情 提交于 2019-12-10 13:42:10
问题 Is it possible to create aliases of protobuf's scalar types? For example, I'd like to use Sequence in lieu of string , even though they would be binary equivalent. My immediate goal is to make documentation (generated with protoc-gen-doc) more readily understandable. Ideally, this type would be represented in languages that support type checking, but that's not necessary. 回答1: Well this will be a bit dull answer but: No, I'm not aware of such feature existing or having been planned. You can

Tensorflow import error on Pycharm (Mac)

北城以北 提交于 2019-12-10 13:39:21
问题 Error msg (check the screenshot picture please): ImportError: cannot import name symbol_database Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there. Process finished with exit code 1 Thanks a lot ! 回答1: I tried to reproduce the problem you're running into using this sample code: import tensorflow as tf hello = tf.constant('Hello,

File extension for serialized protobuf output

拜拜、爱过 提交于 2019-12-10 12:53:27
问题 Seems odd that I can't find the answer to this, but what file extension are you supposed to use when storing serialized protobuf output in a file? Just .protobuf? The json equivalent of what I am talking about would be a .json file. 回答1: I just use .bin, but there's no actual standard here AFAIK. If protoc -o (which emits a .proto schema in protobuf binary format as a FileDescriptorSet ) had taken a directory like all the other output options do, we could have used that as a de-facto answer,

protobuf.net Unexpected subtype

[亡魂溺海] 提交于 2019-12-10 12:49:24
问题 I'm encountering this Exception in my project using Protobuf.net: InvalidOperationException "Unexpected sub-type: foo" I have a class which I'm sending which looks like this: class message { list<bar> listOfBars; } foo inherits off bar, However protobuf seems to choke on this and generate the exception above. Is there some way around this? I need to be able to hold all different subtypes of bar in the list, so a more type constrained solution would be difficult/impossible. 回答1: I may be

Eclipse build loop caused by protobuf generated code (related to Maven Project Builder)

China☆狼群 提交于 2019-12-10 12:30:56
问题 Development Environment I am working on a Maven Java client/server project that relies on Protocol Buffers (protobuf) for sending RPCs between the clients and server. I use Eclipse for Java EE as my primary IDE. Since I use Maven in my project, I am using the m2eclipse plugin for Eclipse. I configure my project in Eclipse to use the "Maven Nature". The Problem Basically, with the workspace setup described above, I am running into INFINITE BUILD LOOPS if Eclipse is configured to Build

Protocol Buffers MIME problem

萝らか妹 提交于 2019-12-10 11:35:12
问题 Help! Trying to implement Protocol Buffers via Rest (Jersey), but get this exception. class com.util.ProtobufMessageBodyReader class com.util.ProtobufMessageBodyWriter Jul 6, 2010 3:43:37 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-9102 Jul 6, 2010 3:43:37 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 45485 ms Jul 6, 2010 3:49:00 PM org.apache.catalina.connector.CoyoteAdapter convertURI SEVERE: Invalid URI encoding; using

PROTOBUF_INLINE_NOT_IN_HEADERS

对着背影说爱祢 提交于 2019-12-10 11:16:23
问题 I'm trying to install Open Transactions, the open-source project, on a debian 8. I've installed all the dependencies and am having an issue when compiling (make). The following error is showing at my terminal, even though i made sure to install the protobuf project: In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:64:0, from /root/opentxs/src/core/OTStorage.cpp:47: /root/opentxs/build/src/core/otprotob/Generics.pb.h:501:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS"

Protobuf C# Message Translation to JAVA

你。 提交于 2019-12-10 10:53:31
问题 I am trying to translate a message generated using C# to JAVA. As a first step, i generated proto file and this is what i got package Om.Business.Scanner; message ScannerActivityDetail { optional string ActivityId = 1; optional string ContextId = 2; optional int32 ActivityStart = 3; optional bcl.DateTime ActivityEnd = 4; } How do i interpret bcl.DateTime in java world? I am using protobuf-net and trying to de-serialize message generated by C# app. Thanks in advance for your help. 回答1: Looking