protocol-buffers

Protobuf-net: Using Hidden Members does not work

我与影子孤独终老i 提交于 2019-12-08 06:45:47
问题 Using types with hidden fields leads to an "Unable to determine member" Exception (V2 via RuntimeTypeModel without any attributes). Removing the Length check in this line in MetaType.cs solves the problem for this special use case. if(members != null && members.Length == 1) mi = members[0]; But I fear there is a reason for the length check, so simply removing it might not be an adequate solution. Using members[0] works in this case, because the hidden base class members go at the end of the

Protocol buffer deserialization and a dynamically loaded DLL in Compact Framework

末鹿安然 提交于 2019-12-08 06:09:11
问题 I saw a question related to this on the full framework here. Since it seems to have stayed unresolved for quite a while and this is for the compact framework, I though it would be better to create a new question for it. I want to deserialize types for which I am loading assemblies dynamically (with Assembly.LoadFrom) and I am getting a "Unable to identify known-type for ProtoIncludeAttribute" error. In the related question I mentioned, it was hinted that hooking AppDomain.AssemblyResolve

How to use the Spatial Pyramid Layer in caffe in proto files?

[亡魂溺海] 提交于 2019-12-08 04:28:35
问题 Hi I would like to know how to use the SPP Layer in a proto file. Maybe someone could explain to me how to read the caffe docs, as it is sometimes hard for me to understand it directly. My attempt is based on this protofile, but I think it differs from the current version? I defined the layer like this: layers { name: "spatial_pyramid_pooling" type: "SPP" bottom: "conv2" top: "spatial_pyramid_pooling" spatial_pyramid_pooling_param { pool: MAX spatial_bin: 1 spatial_bin: 2 spatial_bin: 3

How to capture and modify Google Protocol Buffers in a Django view?

旧时模样 提交于 2019-12-08 03:56:17
问题 Here is a link to the proto file. Please can someone help me understand how to make this work: from django.views.decorators.csrf import csrf_exempt from bitchikun import payments_pb2 @csrf_exempt def protoresponse(request): xpo = payments_pb2.Payment.ParseFromString(request) t = type(xpo) xpa = request.PaymentACK xpa.payment = xpo.SerializeToString() xpa.memo = u'success' return HttpResponse(xpa.SerializeToString(), content_type="application/octet-stream") All input appreciated :) 回答1: OK so

How to compile google-fhir proto files

六眼飞鱼酱① 提交于 2019-12-08 03:21:26
Looking at the readme for google-fhir it says to run bazel build , which works, however none of the protocol files have been compiled. Running protoc --proto_path=. --java_out=. proto/stu3/resources.proto returns a bunch of error about other protos not being found. This goes backwards until 'descriptor.proto' which is not a proto in the folder. None of the protocol files in that directory will manually compile into java files. *On another note, I was able to take other example protos from other sources and compile those successfully. UPDATE Running the command protoc --proto_path=proto/stu3/ -

protobuf-net Inheritance & Field Numbers

末鹿安然 提交于 2019-12-08 03:18:45
问题 I am trying to construct a serialisation system for our application that must be able to handle inheritance. To further complicate matters the application is extensible so types might are very unlikely to be known at compile time. I have read through a previous stackoverflow question that was answered and that helped me get a long way to my goal but I have hit a stumbling block that is probably more of a lack of understanding than any real issue! So this is the code that I have currently...

Serializing and Sending a Protocol Buffers Message

元气小坏坏 提交于 2019-12-08 02:27:29
问题 I have written this protobuf message in c# C# client: public AddressBook InitializeAdressBook() { Person newContact = new Person(); AddressBook addressBookBuilder = new AddressBook(); Person john = new Person(); john.id=1234; john.name="John Doe"; john.email="jdoe@example.com"; Person.PhoneNumber nr = new Person.PhoneNumber(); nr.number="5554321"; john.phone.Add(nr); addressBookBuilder.person.Add(john); TextBox.Text += ("Client: Initialisiert? " + addressBookBuilder.ToString()) + "\t" + "\n";

Is it possible to serialize a list of System.Object objects using protocol buffers

青春壹個敷衍的年華 提交于 2019-12-08 01:59:47
问题 I have a list of objects of various data types (DateTime, int, decimal, string). List<object> myObjects = new List<object>(); myObjects.Add(3); myObjects.Add(3.9m); myObjects.Add(DateTime.Now); myObjects.Add("HELLO"); I was able to serialize this list using protobuf-net, but deserialization always throws the exception: "Additional information: Type is not expected, and no contract can be inferred: System.Object". using (var ms = new MemoryStream()) { Serializer.Serialize(ms, list2); var bytes

Protobuf backward compatibility and proto3 vs proto2

风格不统一 提交于 2019-12-08 00:11:46
问题 One of selling points of Protobuf was backward compatibility, i.e. developers can evolve format, and older clients can still use it. Now with new Protobuf version called proto3, the IDL language itself is not compatible as such things as options , required where dropped, new syntax for enuns, no extention. Does it mean that using proto3 there's no way to produce binary that older proto2 would read/understand also? It is like you have to continue to use proto2. If you start using proto3, you

Google Protocol buffers in client/server when have different packet type [closed]

删除回忆录丶 提交于 2019-12-07 22:47:56
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I want to use protocol buffers in tcp/ip communication, but i may have different packets to send/receive, how can i differentiate the package types over protocol buffers, it seems I have to know the next packet