Win

MPC: adding additional DEFINES

Written by  on May 25, 2018

Some weeks ago I noticed how the qDebug()-output could be enriched, so that in bigger solutions with a lot of different “unknown” components a reported error could be immediately pinned. And you save writing always __FILE__ and __LINE__. Referres to this post.
But the problem was that with the mpc-buildsystem it was unknown to me how to force it to put this DEFINE into the vcxproj-files.

It can be done via the “macros”-statement!

So I worked on my Python-skills and wrote a short script which iterates the given path recursively and fixes all mpc-files by checking for the position of the line with the last closingbrace “}” and then it adds before that position the line. Of course, the experts know several thousand ways to improve that script – but I am currently happy with it. It works, it is debug-able (.sh, I look at you!) and I will use the skeleton also for some other tasks.
It can be found (like most Python-snippets) at: https://github.com/marcelpetrick/pythonCollection

Preventing the crash of the performance-profiler from Visual Studio (2013-2017) due to Meltdown-/Spectre-patches

Written by  on May 24, 2018

I needed some analytical help from Visual Studio (due to the fact that MTuner and AQTimer could not work properly with our suite). So, I build my solution, fire up the “Performance Profiling” in VS2015 and *zump* computer reboots.
Discussions and investigations led to the thesis that some Windows-patches are the culprit, because they prevent that previously used hooks are usable.
So, setting those two lines in an admin-enabled cmd.exe (plus reboot) lead to alleviation:

static code analysis: PVS Studio

Written by  on May 4, 2018

I am using a new static code analysis-tool for some weeks now and it turns out quite handy: PVS Studio.
It integrates quite well into Visual Studio and you can run the analysis of projects or the whole solution. Doing this can take a while, because all includes are analyzed as well – which is nice. For a single developer a trial-license is for evaluation enough – if you can refrain from the really nice “jump to the culprit”-functionality.
It looks like it detects more errors than cppcheck (another tool which I use now for years on several platforms) and without doubt: none of the reported lines were false positives!

Of course, there is always the discussion with colleagues if those tools help. But I will repeat it again: why not buy & apply them and get a lot of troubleshooting for zero investment of creativity and time!
The screenshot hints out (for instance) that some breaks are missing in the switch-case – and yes, the resulting symptoms were already reported as bug in JIRA.

backup often, backup early: Duplicati

Written by  on May 1, 2018

I wanted an open source-solution which allows to backup locally and remote certain directories (or whole PC). I found some month ago duplicati and used it for good at work, where it currently backups the content of the whole SSD-partitions to some interal hard disk (not the most secure backup, I know. But given to the constraints still better than no backup at all.)
At home the content of the two home-directories (Linux) is transferred to a shared folder on the Synology-NAS.
duplicati on wikipedia // code under GNU LGPL

I can just repeat: working without a backup is the best path to failure.
In my history as “computer technician” I have ruined several drives and especially when you just want to do a default, simple operation (*cough* move a partion on a hard drive *cough*), everything fails and there is no way to revert back to the original state. Never again 🙂

QT_MESSAGELOGCONTEXT: more detailed qDebug()

Written by  on April 19, 2018

Add to your environment:

Windows: set either via “set” or via RapidEnvironmentEditor.
In case of a no-debug-build, add QT_MESSAGELOGCONTEXT to DEFINES in the pro-file.

(Open question: if there are just mpc/vcxproj-files, then how to trigger?)

related sources:
* https://woboq.com/blog/nice-debug-output-with-qt.html
* https://fecub.wordpress.com/2015/11/04/better-debug-output-using-qt_message_pattern/
* http://doc.qt.io/qt-5/qmessagelogcontext.html#details

robocopy: transfer huge repositories between PCs

Written by  on April 16, 2018

Average rates of 24% on 1 GBit-connected PCs with SSD were achieved! 🙂

############################

my favorite parameters:
/NP – no status
/ETA
/E – with subdirs
/MIR – mirros (like /E with /PURGE)
/MT – multithreading
/XD – exclude the subversion-metadata

resulting command

note: multithreading with 32 threads was slower than with just 8: 10 min vs. 7 min for 18 GiByte files of varying size

photo-backup:

Convert *.pro to *.vcxproj (qmake to Visual Studio-project)

Written by  on April 5, 2018

0. Change this particualar line inside the *.pro:

1. run qmake against that pro-file
2. load the vcxproj with Visual Studio

edit: or do it with the original pro-file just like the wiki.qt.io suggests:

Cullendula

Written by  on April 3, 2018

Small program to pick out the best shots of the vast amount of taken pictures per session (excursion). The name itself is a wordplay of the plant Calendula and the activity “to cull” (slang for sorting the photos).

url for the repository: https://github.com/marcelpetrick/Cullendula/
development time for fully usable version 0.1: one day
used technologies: C++ and Qt – my favorite ones <3

VS2015: after start the solution-explorer just shows error-messages ..

Written by  on March 29, 2018

Error message:
Exception details:
System.ComponentModel.Composition.ImportCardinalityMismatchException: No exports were found that match the constraint:
ContractName

Delete that folder:
%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache

Found via SO..

VisualStudio-Addin for Qt

Written by  on March 22, 2018

The source for the current downloads: https://download.qt.io/official_releases/vsaddin/ (for MSVC 2013, 2015 and 2017), because I had to (again) search for the installation-files.