Generate line graph for any benchmark? - performance

I had spent so many hours failing to find a line graph generator for my benchmark results that I just wanted to plug in. I tried quite a few like Google's chart API but it still seemed confusing or not graceful looking, I am clueless.
Examples of benchmark images I wished to make something like are this:
What specific applications /web services do you recommend for generating something even close to this? I want something "neat".

You can use python mathplotlib, which generates beautiful graphs like:
(Source code)

I use gnuplot. It is not a lib, but a separate executable file. You can output plotting data to one file, and plotting commands in another - script file, which refer to data file. Then call gnuplot with this script file.
Another way is to use qwt. It is a real library, but it depends on Qt. If you already use Qt in your project, it is very straigth way to plot graphs. If not, then just use gnuplot

Related

Globbing a bunch of .pkl files into one, then converting to .fbx (on Windows)

I'm experimenting with the beautiful frankmocap, feeding a video and getting a quite accurate hands and body tracking. This tool also outputs a .pkl file (which I'm not familiar with) for each frame.
I'd like to convert these files into a usable 3D file but 1. I've discovered I can't use glob.h with ffmpeg on Windows and 2. I cant' get them converted in .fbx.
Along with frankmocap, I've tried VIBE but I still end up with the same problem.
Using miniconda3.
I hope someone can help me! Thank you for your time.
Someone has taken a useful script made for VIBE and adapted it to work with FrankMocap keypoints.
The script takes a folder of PKL frames generated by FrankMocap and then uses Blender to animate them into an FBX rig. It doesn't currently include the hands though, which is something I'm currently trying to solve in it myself (and how I found your question).
Link to the script: https://github.com/facebookresearch/frankmocap/files/5750266/fbx_output_FRANKMOCAP.zip

How can one create a polyglot PDF?

I like reading the PoC||GTFO issues and one thing I found remarkable when I first discovered it, was the "polyglot" nature of their PDF files.
Let met explain: when you consider for example their 8th issue, you may unzip files from it; execute the encryption they are talking about by running it as a script and even better(worse?) with their 9th issue you can even play it as a music file!
I'm currently in the process of writing small scripts every week and writing each time a little one page PDF in LaTeX to explain the said scripts. So I would really enjoy being able to create the same kind of PDF files. Sadly they explained (partly) in their first issue how to include zip files, but they did so through three small sketches of cmd lines without actual explanations.
So my question is basically :
how can one create such a polyglot PDF file containing stuff like a zip as well as being a shell script which may be run using arguments just like normal scripts?
I'm asking here about the process of creation, not just an explanation of how this is possible. The ideal way for me would that there are already some scripts or programs allowing to create easily such PDF files.
I've tried to search the net for the keywords "polyglot files" and others of the kind and wasn't able to find any useful matches. Maybe this process has another name?
I've already read the presentation by Julia Wolf which explains how things works, but I sadly haven't had time to apply the knowledge there to real world, because I'm sadly not used to play with file headers and the way a PDF is constructed.
EDIT:
Okay, I've read more and found the 7th edition of PoC||GTFO to be really informative concerning this subject. I may end up being able to create my own scripts to do such polyglot PDF files if I have some more time to consider it.
I played around with polyglots myself after attending Ange's talks and also talking to him in person. You really need to understand the file formats to be able to nest them into each other.
However, long story short, here are some links I found extremely useful for creating polyglots:
Some older Google Code Trunk
PoC of the polyglot stuff
Especially the second link (to github) will help you creating polyglots, but also understanding how they are working and how they are implemented. Since it is mostly Python stuff and very well / clean written, it is very useful and easy to follow.
I feel dissecting some file formats would be a good place to start. You can find many file format specifications for different file types through Google, but they can be a tough read and will likely take you some time to translate into whatever language you are using.
PDF: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
ELF: https://www.cs.cmu.edu/afs/cs/academic/class/15213-s00/doc/elf.pdf
ZIP: http://kat.sdf.org/zip_file_format.txt
The language(s) you select will need a way to read and write raw bytes (not just ascii alphanumeric), so perhaps C would be good for more direct access to memory. Some Python tricks could help with open sourcing the scripts easily.
To dissect the files, you may want to build a tool kinda like https://github.com/kvesel/zipbrk/ to take them apart, then put them all back together in a polyglot format. For example, zip does not require the section headers to be at the start (or even contiguous for that matter), and PDF magic number can appear in multiple places within the file as well. I also believe I recall a polyglot tool being included in one of the PoC||GTFO publishings (maybe issue 8 or 2??) as a polyglot in the pdf file.
Don't forget the hackers bible! :)
https://nostarch.com/gtfo

How can I convert GOPixbuf strings to images

I have an XML file produced with Gnumeric that contains images, stored as GOPixbuf strings inside XML. They look like this:
eXyA/4KEiP9xcnf/f3+E/3l5ff9xb3L/jo2Q/29wdP+ [truncated]
For each string I have width and height, and a rowstride parameter, like in this example:
<GOImage name="Image(70)" type="GOPixbuf" width="151" height="135" rowstride="604">
Is there a reasonable way to convert that to an image - any format will do?
I'm conversant with perl and image conversion tools (imagemagick, gimp) but I have not found any documentation by googling beyond GTK or GOffice docs.
You have already found stuff that is helpful. But since there are no Perl bindings for this on CPAN, you would have to make your own if you want to use Perl.
Fortunately, you don't have to know XS to do that. You can use FFI::Platypus to create temporary bindings and only map what you need.
The docs you have probably already found have a Getting started with GOffice section. After a quick check I found that on my recent Ubuntu there is a package that contains that lib. It is called libgoffice-0.10-dev.
Now you can set that up and play around with the lib functions. Somewhere in https://developer.gnome.org/goffice/unstable/GOImage.html there probably is a method to read and convert it.
One of the good ones might be go-image-get-pixbuf, which returns a GdkPixbuf. That in turn has a very extensive documentation. Maybe what you need might be in this one.
Good luck.

ELF/DWARF Parser to Out Structure elements

Is there a way to extract the size and address of elements within a structure using an elf file? I am hoping there is a tool available that can do this and export it to a more readable format.
My end goal is to convert the ELF file to a ASAM A2L file. A open source/free tool that could do this would even be better but most companies that do this charge alot for their tools.
I don't know offhand of anything pre-canned, but it isn't very hard to modify an existing tool to do it.
The "pahole" program from the "dwarves" project does something similar. It prints a structure definition in a certain way.
There's also a "pahole.py" script for gdb that does pretty much the same thing. This would be trivial to modify to print things however you like.
If you want to get a little deeper you could write it yourself using one of the existing DWARF libraries. I like the one in elfutils, but YMMV.

reading and plotting txt file in autocad

I want to read a txt file in autocad and plot them (line/polyline).
it may looks like
1 x11 y11 z11.......x14, y14,z14 % polyline 1
..
n xn1 yn1 zn1.......xn4, yn4,zn4 % polyline n
I want to know what is best and easy way to do this. What programming language I should use.
What are useful links or is there somework already done in this direction.
Best regards,
No programming language required! Just create a text file and type AutoCAD commands in the file the same way you would at the AutoCAD command prompt. Save the file with the .scr extension and you can either drag the file onto the AutoCAD window, or use the script command in AutoCAD to find and run the command script.
More info: http://www.upfrontezine.com/tailor/tailor19.htm
I actually use Python to generate these command scripts. With the power of a modern language, and throwing in some AutoLisp, you can do surprisingly sophisticated things. I've used this to model a complex steel tower for a cablestay bridge, and for testing model geometry for Larsa modeling.
There are few ways you can do it.
Simple solution
Script file
Creating a script file is easier and quicker
http://docs.autodesk.com/MAP/2010/ENU/AutoCAD%20Map%203D%202010%20User%20Documentation/HTML%20Help/files/WS1a9193826455f5ff47b7aa4b11fbe75ecf1-65dc.htm
AutoLISP automation
This is also easier and quicker plenty of online resources available.
http://www.pixelgraphicsinc.com/AutoLisp_Tutorial01.html
Best but complicated solution
.NET C# plugin
This is the best option as it lets you do more than basic things.
If you like to do coding. This is fun. you can create a plugin using .NET C# and read the txt file to create the line segments.
Let me know how you go.
You can use ObjectARX in C# as well as C++.
C# will be a better choice.
Just read your text file using StreamReader using C# System.IO library.
Create a array of points specified in text file.
Finally create the Polyline using given points and Using Transient in ObjectARX you can display the Polyline.

Resources