How to get protobuf enum as string?

The EnumDescriptor and EnumValueDescriptor classes can be used for this kind of manipulation, and the the generated .pb.h and .pb.cc names are easy enough to read, so you can look through them to get details on the functions they offer. In this particular case, the following should work (untested): std::string requestTypeString = MyMessage_RequestType_Name(requestType);

How does Google Protocol Buffers compare to ASN.1

If you use ASN.1 with Unaligned PER, and define your data types using the appropriate constraints (e.g., specifying lower/upper bounds for integers, upper bounds for the length of lists, etc.), your encodings will be very compact. There will be no bits wasted for things like alignment or padding between the fields, and each field will … Read more

Google Protocol Buffers and HTTP

You can certainly send even a binary payload with an HTTP request, or in an HTTP response. Just write the bytes of the protocol buffer directly into the request/response, and make sure to set the content type to “application/octet-stream”. The client, and server, should be able to take care of the rest easily. I don’t … Read more

Is there an example on how to generate protobuf files holding trained TensorFlow graphs

EDIT: The freeze_graph.py script, which is part of the TensorFlow repository, now serves as a tool that generates a protocol buffer representing a “frozen” trained model, from an existing TensorFlow GraphDef and a saved checkpoint. It uses the same steps as described below, but it much easier to use. Currently the process isn’t very well … Read more

Thrift, Avro, Protocolbuffers – Are they all dead?

Protocol Buffers is a very mature framework, having been first introduced nearly 15 years ago at Google. It’s certainly not dead: Nearly every service inside Google uses it. But after so much usage, there probably isn’t much that needs to change at this point. In fact, they did a major release (3.0) this year, but … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)