protocol-buffers

Are there some better ways to address warnings when compiling protocol buffer generated source file?

馋奶兔 提交于 2019-12-03 23:39:46
问题 For a simple proto file: message Person { required int32 id = 1; required string name = 2; optional string email = 3; } It's been compiled by protoc.exe and the results are used in an also simple test project, which basically does nothing but including the protoc generated files. I'm using the msvc10 to build the test project (x64), then it gave me a lot of warning: Warning 1 warning C4244: 'return' : conversion from '__int64' to 'int', possible loss of data D:\Work\protobuf-trunk\src\google

How can I extract the audio embeddings (features) from Google’s AudioSet?

馋奶兔 提交于 2019-12-03 23:07:15
问题 I’m talking about the audio features dataset available at https://research.google.com/audioset/download.html as a tar.gz archive consisting of frame-level audio tfrecords. Extracting everything else from the tfrecord files works fine (I could extract the keys: video_id, start_time_seconds, end_time_seconds, labels), but the actual embeddings needed for training do not seem to be there at all. When I iterate over the contents of any tfrecord file from the dataset, only the four keys video_id,

Maven & Protobuf compile error: Cannot find symbol in package com.google.protobuf

十年热恋 提交于 2019-12-03 22:18:12
I'm new to Linux and Protobuf.. I need help. I'm trying to "mvn package" a project that contains many ".proto" files, and a pom.xml file of course... I'm working on Ubuntu ======================================= ERROR When I run "mvn package", I receive this error: after ... Compiling 11 source files to .../target/classes ... I get a bunch of these errors: [ERROR] .../target/generated-sources/...java:[16457,30] cannot find symbol [ERROR] symbol : class Parser [ERROR] location: package com.google.protobuf [ERROR] [ERROR] .../target/generated-sources/...java:[17154,37] cannot find symbol [ERROR]

How to add a int array in protobuf message

风格不统一 提交于 2019-12-03 22:08:26
I have to compose a protobuf message which should have 1 integer variables and a integer array. package protobuf; message myProto { optional uint32 message_id =1; optional int update = 2; //here I have to add a array of integers //can I write like optional int[] array =3; //or should I use optional repeated array; //where array is another message with int variable } Is my approach correct? Please help me Thanks Array is mapped via "repeated": repeated int32 data = 4; Note you might want sint32/uint32. Also note that in all three cases "packed arrays" can be used, which are more efficient;

weird ios libprotobuf.dylib cause crash

早过忘川 提交于 2019-12-03 21:11:15
i have my own protobuf compiled in the project (in the main target, not a lib), but I found a crash which is caused by protobuf code in libprotobuf.dylib ( which in my guess is a newly included lib in new version of device -- mine is ipad air). * thread #1: tid = 0x6598, 0x0027e96e TutorChat`void google::protobuf::internal::RepeatedPtrFieldBase::Destroy<google::protobuf::RepeatedPtrField<google::protobuf::UninterpretedOption>::TypeHandler>(this=0x1567158c) + 66 at repeated_field.h:814, queue = 'com.apple.main-thread, stop reason = breakpoint 2.41 frame #0: 0x0027e96e TutorChat`void google:

Protobuf3: How to describe map of repeated string?

本小妞迷上赌 提交于 2019-12-03 19:13:08
问题 The Official documentation about map type says: map<key_type, value_type> map_field = N; ...where the key_type can be any integral or string type (so, any scalar type except for floating point types and bytes). The value_type can be any type . I want to define a map<string, repeated string> field, but it seems illegal on my libprotoc 3.0.0 , which complains Expected ">" . So I wonder if there is any way to put repeated string into map. A Possible workaround could be: message ListOfString {

Handling null values in protobuffers

醉酒当歌 提交于 2019-12-03 18:57:28
问题 I am working on something which fetches data from database and constructs protobuff message. Given the possibility that null values can be fetched from the database for certain fields , I will get Null-pointer exception while trying to construct the protobuff message. Getting to know that null is not supported in protobuffs from the thread http://code.google.com/p/protobuf/issues/detail?id=57, I am wondering whether the only other way to handle NPE getting thrown is to insert manual checks

Problems using protobufs with java and scala

╄→尐↘猪︶ㄣ 提交于 2019-12-03 18:07:48
问题 I have a file xxx.proto . I downloaded the protobuf compiler and installed it. Then I issued this command protoc --java_out=./ xxx.proto and it generated my xxx.java Now I want to compile this file into a class file which I can use with Scala. javac xxx.java Which gives me this error xxx.java:7: package com.google.protobuf does not exist com.google.protobuf.ExtensionRegistry registry) { ^ xxx.java:12450: package com.google.protobuf.Descriptors does not exist private static com.google.protobuf

error with serialization with protobuf

旧巷老猫 提交于 2019-12-03 18:01:15
问题 I'm trying to serialize a structure with protobuf. after many hours trying to figure out what I'm doing wrong I decided to test the google's example and it didn't worked as well I have the following protocol from google (https://developers.google.com/protocol-buffers/docs/javatutorial): package tutorial; option java_package = "com.example.tutorial"; option java_outer_classname = "AddressBookProtos"; message Person { required string name = 1; required int32 id = 2; optional string email = 3;

What the best ways to use decimals and datetimes with protocol buffers?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 17:35:30
问题 I would like to find out what is the optimum way of storing some common data type that were not included in the list supported by protocol buffers. datetime (seconds precision) datetime (milliseconds precision) decimals with fixed precision decimals with variable precision lots of bool values (if you have lots of them it looks like you'll have 1-2 bytes overhead for each of them due to their tags. Also the idea is to map them very easy to corresponding C++/Python/Java data types. 回答1: The