Decode protobuf without proto files - protocol-buffers

I would like to decode protobuf data and running into some decoding challenges.
1> Example of the protobuf data: 0a06282c0241057a10011805220d080510bea3f493062a03010c1628f1a6f493063002382b4001481482010f383634333233303532343736343839
2> Decoding online (e.g. via https://protobuf-decoder.netlify.app/) works fine
3> Decoding via protoc.exe is not working
protoc.exe --decode_raw < measurement01_bin.txt (have tried HEX or BIN as input)
Result: Failed to parse input.
Question: What am I not doing correct?
4> Further I would like to add protobuf decoder in a cloud solution (in-memory) and ideally not be dependent on protoc (in my environment it is almost impossible to run an exe). So I am looking for a stand-alone parser / raw decoder in run-time and not using proto files.
Question: Do you have idea for me on how I could set this up?
Thanks a lot

Related

How to compile the assets to the VULKAN API using Harfang's asset compiler?

Trying to compile my graphics assets using assetc.exe (running Win10 64bits). The command line seems to be valid but I only get compilation errors.
Here's the commmand line :
assetc.exe resources -api VULKAN
first I get this feedback :
Harfang ASSETC 1.1
(4589:363:518:900) > Input dir: resources
(4589:363:659:500) > Output dir: resources_compiled
(4589:364:198:900)
(4589:364:655:800) > Target platform: windows
(4589:365:188:500) > Target graphics API: VULKAN
(4589:365:712:100) > Target pipeline: forward
but then it reports a lot of errors, as if none of the assets could be compiled :
557 input files
1240 output files
0 processed
585 failed
Saving compilation DB 'resources_compiled/assetc.cab'
Compilation done, took 965ms
what am I missing, here?
The correct syntax for the API switch is either DX11, DX12, GL, GLES or VK.
What you are looking for is VK that stands for Vulkan.
So, the command line shoud read like that :
assetc resources -api VK
Let me know if this works :)

V8 : Isolate is incompatible with the embedded blob

I am trying to create custom snapshot from some Javascript file. I was able to create a snapshot using the command
mksnapshot.exe snapshot11.js --startup_blob snap.bin
but when I was trying to create an Isolate with this snap.bin file I got this message
The Isolate is incompatible with the embedded blob. This is usually caused by incorrect usage of mksnapshot. When generating custom snapshots, embedders must ensure they pass the same flags as during the V8 build process (e.g.: --turbo-instruction-scheduling).
I am guessing that I need recreate the snapshot with the proper flags but I couldn't find which flags I need to use.
My args.gn
is_component_build=true
v8_static_library=false
is_official_build=false
is_debug=true
use_custom_libcxx=false
use_custom_libcxx_for_host=false
target_cpu="x64"
use_goma=false
v8_use_external_startup_data=false
v8_enable_i18n_support = false
symbol_level=2
v8_enable_fast_mksnapshot=true
Any lead will be helpful.
10x
You can invoke ninja with -v to have it print all the commands it executes; e.g. if you compile V8 with:
ninja -v -C out/... v8_monolith
then you'll find a line for the mksnapshot invocation in the output, and can copy the flags from there. (If you have already compiled V8, ninja will say "nothing to do"; in that case you can either clean out everything, or just delete snapshot_blob.bin and libv8_monolith.so.)

How can I specify a minimum compute capability to the mexcuda compiler to compile a mexfunction?

I have a CUDA project in a .cu file that I would like to compile to a .mex file using mexcuda. Because my code makes use of the 64-bit floating point atomic operation atomicAdd(double *, double), which is only supposed for GPU devices of compute capability 6.0 or higher, I need to specify this as a flag when I am compiling.
In my standard IDE, this works fine, but when compiling with mexcuda, this is not working as I would like. In this post on MathWorks, it was suggested to use the following command (edited from the comment by Joss Knight):
mexcuda('-v', 'mexGPUExample.cu', 'NVCCFLAGS=-gencode=arch=compute_60,code=sm_60')
but when I use this command on my file, the verbose option spits out the following line last:
Building with 'NVIDIA CUDA Compiler'.
nvcc -c --compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD -
gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_50,code=sm_50 -
gencode=arch=compute_60,code=sm_60 -
gencode=arch=compute_70,code=\"sm_70,compute_70\"
(and so on), which signals to me that the specified flag was not passed to the nvcc properly. And indeed, compilation fails with the following error:
C:/path/mexGPUExample.cu(35): error: no instance of overloaded function "atomicAdd" matches
the argument list. Argument types are: (double *, double)
The only other post I could find on this topic was this post on SO, but it is almost three years old and seemed to me more like a workaround - one which I do not understand even after some research, otherwise I would have tried it - rather than a true solution to the problem.
Is there a setting I missed, or can this simply not be done without a workaround?
I was able to work my way around this problem after some messing around with the standard xml-files in the MatLab folder. The following steps allowed me to compile using -mexcuda:
-1) Go to the folder C:\Program Files\MATLAB\-version-\toolbox\distcomp\gpu\extern\src\mex\win64, which contains xml-files for different versions of msvcpp;
-2) Make a backup of the file that corresponds to the version you are using. In my case, I made a copy of the file nvcc_msvcpp2017 and named it nvcc_msvcpp2017_old, to always have the original.
-3) Open nvcc_msvcppYEAR with notepad, and scroll to the following block of lines:
COMPILER="nvcc"
COMPFLAGS="--compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD $ARCHFLAGS"
ARCHFLAGS="-gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" $NVCC_FLAGS"
COMPDEFINES="--compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,$MATLABMEX"
MATLABMEX="/DMATLAB_MEX_FILE"
OPTIMFLAGS="--compiler-options=/O2,/Oy-,/DNDEBUG"
INCLUDE="-I"$MATLABROOT\extern\include" -I"$MATLABROOT\simulink\include""
DEBUGFLAGS="--compiler-options=/Z7"
-4) Remove the architectures that will not allow your code to compile, i.e. all the architecture flags below 60 in my case:
ARCHFLAGS="-gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=\"sm_70,compute_70\" $NVCC_FLAGS"
-5) I was able to compile using mexcuda after this. You do not need to specify any architecture flags in the mexcuda call.
-6) (optional) I suppose you want to revert this change after you are done with the project that required you to make this change, if you want to ensure maximum portability of the code you will compile after this.
Note: you will need administrator permission to make these changes.

Dump erlang's beam files to filesystem

I have a remsh to working Erlang application:
1> application:which_applications().
[{ssl,"Erlang/OTP SSL application","5.3.6"},
{public_key,"Public key infrastructure","0.22.1"},
{crypto,"CRYPTO","3.4.1"},
{asn1,"The Erlang ASN1 compiler version 3.0.2","3.0.2"},
{stdlib,"ERTS CXC 138 10","2.2"},
{kernel,"ERTS CXC 138 10","3.0.3"}]
My question is: How can I save beam files to another place at the file system?
For each module you want to save, call code:get_object_code/1 to get the module's object code as a binary, then use file:write_file/2 to save that binary to the file system.

Error in parsing mibs using build-pysnmp-mibs and loading mibs using pysnmp

I am trying to load some custom mibs using mibBuilder.
Initially, as per the pysnmp documentation, I used the build-pysnmp-mib utility for converting the mibs to pysnmp mib format. But I get the following error:
from pysnmp.smi import builder
Empty input
smidump -f python hpicfvg.mib | libsmi2pysnmp fails
Also, while using the -k option, smidump generates a file but the mibBuilder is not able to load the generated file.
I read somewhere that there are bugs in the implementation but I can't find enough documentation or examples on the Internet.
I've been able to compile ICF-VG-RPTR MIB (this is what the hpicfvg.mib file seems to contain) provided you also have the HP-ICF-OID MIB in the smidump search path.

Resources