protocol-buffers

Using Google 'Protocol Buffers' in Arduino

戏子无情 提交于 2019-12-03 12:27:32
问题 Is it possible to make Google Protocol Buffers work in Arduino? I have been trying for about a week and can't make it work, and I would like to know if it's even possible. 回答1: This should fit on an Arduino: https://github.com/nanopb/nanopb 回答2: I've managed, after several attempts, to compile google protocol buffers for Arduino (using lite runtime), and still, the resulting code size was way over the 32k limit. So, for now, GPB isn't a viable option for Arduino projects. (maybe on Arduino

tf.SequenceExample with multidimensional arrays

試著忘記壹切 提交于 2019-12-03 12:02:50
问题 In Tensorflow, I want to save a multidimensional array to a TFRecord. For example: [[1, 2, 3], [1, 2], [3, 2, 1]] As the task I am trying to solve is sequential, I am trying to use Tensorflow's tf.train.SequenceExample() and when writing the data I am successful in writing the data to a TFRecord file. However, when I try to load the data from the TFRecord file using tf.parse_single_sequence_example , I am greeted with a large number of cryptic errors: W tensorflow/core/framework/op_kernel.cc

protobuf-net enum serialization

时间秒杀一切 提交于 2019-12-03 11:48:55
What needs to be done in order to serialize enums with protobuf-net? I'm getting the below error when serializing a class having an enum property, if the DataMember attribute is removed from the property declaration it works fine. "System.InvalidOperationException: Only data-contract classes (and lists/arrays of such) can be processed" I suspect they are actually 2 different scenarios, but with regard to the code sample added by Andrew, this is because it can't figure out (in advance) what it is going to do with regards to default values (by default, data is treated as optional at the receiver

Extending Protobuf Messages

若如初见. 提交于 2019-12-03 11:33:39
I have many different schemas, however there are a set of fields which every schema contains. I was wondering if there was a way to have a different schema extend a parent schema and inherit its fields. For example this is what I want: message Parent { required string common1 = 0; optional string common2 = 1; } message Child1 { // can we extend the Parent? // I want common1, common2 to be fields here required int c1 = 2; required string c2 = 3; } message Child2 { // can we extend Parent? // I want common1, common2 to be fields here repeated int c3 = 2; repeated string c4 = 3; } Such that

How to determine message type in protobuf so that I can use that type.parsefrom(byte[ ])

守給你的承諾、 提交于 2019-12-03 11:29:05
I am trying to send protobuf data from cpp side to java side. I have multiple message types defined in .proto On Cpp side, I have enums for every message type and I am adding it to the buf output as follows: uint8_t* __temp = (uint8_t*)(buf); *__temp++ = (type) >> 8; *__temp = (type) & 0x00FF; How do I get this 'type' that I have added to the buf, so that I can achieve something like MessageType parseFrom(byte[] data); It is not clear what is the exact requirement. But I assume you are trying to send different types of messages and the the receiver should be able to parse the correct object

Protocol message end-group tag did not match expected tag

孤街醉人 提交于 2019-12-03 11:21:41
问题 I keep getting the following stack trace and am not sure what it means. Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag. at com.google.protobuf.InvalidProtocolBufferException.invalidEndTag(InvalidProtocolBufferException.java:73) at com.google.protobuf.CodedInputStream.checkLastTagWas(CodedInputStream.java:124) at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:189) at com.google

Making a small change to a Java protocol buffers object

試著忘記壹切 提交于 2019-12-03 11:15:17
问题 I want to make a small change, deep in tree of Java protocol buffer objects. I can use the .getBuilder() method to make a new object that is a clone of an old one with some changes. When this is done at a deep level, the code becomes ugly: Quux.Builder quuxBuilder = foo.getBar().getBaz().getQuux().toBuilder() Baz.Builder bazBuilder = foo.getBar().getBaz().toBuilder() Bar.Builder barBuilder = foo.getBar().toBuilder() Foo.Builder fooBuilder = foo.toBuilder() quuxBuilder.setNewThing(newThing);

How to visualize data from google protocol buffer?

浪子不回头ぞ 提交于 2019-12-03 11:04:20
问题 I would like to store data using google protocol buffers (another serialized format would work, too), and then have an UI to browse that data. Is there a C++ framework/API that would allow me to do this? For example, it could use the reflection interface of protobuf, and then fill in the data into Qt's QTableView (or from another toolkit). I could write such code myself -- however, much rather I would re-use existing code, which is why I am asking for advice here! Or are there more general UI

Serialize C++ object to send via sockets to Python - best approach?

陌路散爱 提交于 2019-12-03 10:09:10
问题 I need to create a network communication between two different frameworks, one written in C++ and the other in Python . To exchange data, I want to create some kind of flexible structure (basically a struct) in C++ , which is serialised, sent through sockets to Python and then deserialised. What is the most common way to do this? I'm sure that Boost could do it on either side, since there is boost python , but I don't want to blow up the project requirements that much. So is there maybe a

protobuf-net v2 and Monotouch : How does it mix?

无人久伴 提交于 2019-12-03 09:56:56
问题 I have been trying to use protobuf-net with MonoTouch but I have no idea how, and despite having heard that it is possible, I haven't been able to find any tutorial or any example that actually work. It was confirmed by Marc Gravell on his blog that it does work on MonoTouch. I have also looked through the blogs of the two people he states in this article, but I haven't found anything related to protobuf. Having no lead on the subject, i decided to download protobuf-net and try it out anyway.