Skip to content

Instantly share code, notes, and snippets.

View hobo0cn's full-sized avatar
:octocat:
Digital world is the future.

hobo0cn

:octocat:
Digital world is the future.
View GitHub Profile
/* At run-time deserialization of a protobuf buffer to a C++ object example
* Based on https://cxwangyi.wordpress.com/2010/06/29/google-protocol-buffers-online-parsing-of-proto-file-and-related-data-files/
* @author: Floris Van den Abeele <floris@vdna.be>
*
* Starting from a protobuf definition, main() does the following:
* 1) Translate protobuf definition to FileDescriptorProto object using the
* Parser from protoc. FileDescriptorProto seems to be nothing more than an
* in-memory representation of the proto definition.
* 2) Use a DescriptorPool to construct a FileDescriptor. FileDescriptor
* seems to contain all necessary meta data to describe all the members of a
@hobo0cn
hobo0cn / gist:a3c17e1172c2c21e7dde63f273a0b452
Created February 3, 2019 12:29
python protobuf dynamic message
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@hobo0cn
hobo0cn / fix.md
Last active August 20, 2018 06:09
Fix pip install google assistant error

/usr/lib/python3/dist-packages/pkg_resources/init.py

... #orig_path.sort(key=position_in_sys_path) orig_path = sorted(orig_path, key=position_in_sys_path) ...

@hobo0cn
hobo0cn / gist:a3e303bb9cf42198970599e3c7ed7c69
Created August 20, 2018 06:05
Fix pip install google assistant error
#orig_path.sort(key=position_in_sys_path)
orig_path = sorted(orig_path, key=position_in_sys_path)
LP_server
LP_server