marcelpetrick

Retrospective view at 2018

Written by  on February 1, 2019

The first month of 2019 already passed. And we passed it with flying colors!
But let’s have a look at 2018 – a year full of challenges and success: I’ve worked full-time, organized and participated in advanced courses for Python and in Requirements Engineering (officially: IREB Requirements Engineering Foundation Level-approved) and pursued a new employment as software engineer.

And I wrote some software in my spare-time, as you can see in the graph for the public github-repositories. The gaps in the commits can be explained with the birth of my daughter and the time where I acquired the new job and moved nearly 900 km across the country. Yay! Nice personal projects were and are Cullendula and the Daily Coding Challenges, which I solve mostly with fully Unit-tested Python (3).

More new, hands-on knowledge was gained in the area of CMake and Qt-charts.
Well – 2018 was great. Let me make 2019 greater! 💪

Pick a random reviewer

Written by  on January 30, 2019

Most teams have a certain code-review-process. But most of the time there is no “round robin”-implementation who will be the reviewer, but the coder itself should select the reviewer. Because of domain-knowledge, etc. And then you her lots of times “I am currently busy. Not me!”

Solution: random and fair selection via bash.

Current version of the script can be found at: https://github.com/marcelpetrick/bashCollection/blob/master/randomReviewer.sh

Inspired by a stack-overflow answer.

find the fattest files of certain type

Written by  on January 30, 2019

creates something like

Fixing ~crappy~ no-good Qt-includes

Written by  on January 29, 2019

How to locate all includes of that style:

with proper

Fired up https://regex101.com/ and set it to PHP and created an expression, which matches:
starting with slash, then a q, then characters, then . then h

(Replace & check has to be done by YOU ;))

Fix whitespace

Written by  on January 24, 2019

Sometimes there is too much whitespace and tabs in my last commit.
In former times I used a VisualStudio-plugin, but this is not helpful there. So I wrote a small script (see on my github) which:
• replaces all tabs with four spaces
• removes all trailing whitespace
• converts line-endings to CRLF

I invoke it on the list of all changes files in my last commit in the git-repo with:

(first part gives you a list of changed files and then feeds it to the script for execution)

Overview of author-activities for the git-repo

Written by  on January 16, 2019

If some ‘sophisiticated’ tool like git-stats is too cumbersome to configure, just do some git-log and shell-magic:

Ok, just noticed that git has something built-in:

from: https://coderwall.com/p/pek-yg/git-statistics-for-repo-per-author – Thanks Marcin Olichwirowicz!

Enable Profiling on Windows even with Meltdown-patches

Written by  on September 25, 2018

Helped with Visual Studio 2015. Should also work for 2013 and 2017.

Cppdepend: measure defects (code smells), cyclomatic complexity …

Written by  on September 21, 2018

As every one knows: I am a fan of objective measurements in the quality and quantity of code. Another nice statistics-generator for such a task is: cppdepend (trial is free for the first month).

It can detect some mistakes and deviations from common coding guidelines (like MISRA) and supports your judgment with some figures.
Cullendula for instance has the estimated development effort of 13 days (right now, v0.4.1) and a technical debt-rating of A. Which is great! 🙂


Qt5: connect: How to use ‘connect’ in case the slot has less parameters than the signal

Written by  on September 18, 2018

Task is to connect from one signal with one parameter to a slot with zero parameters. With the “old” Qt4-way of connect it works like this

But what if I want to use the type-safe Qt5-connects?

The documentation just mentions the cases with:
* connect to default parameters in slot
* and (for example) using the above-mentioned way of the string-based connect.

My idea was to use a lambda to fix this:

But it turned out in in this thread that

is possible! 🙂

new section: page for “TIL – today I learned”

Written by  on September 18, 2018

TIL or real post? Questions over questions.
Sometimes some newly acquired enlightenment is too “small” or my new knowledge is just the start for the future journey. Or just some news.
Then I think that a full fledged post is a bit “breaking a butterfly on a wheel”. Therefore I introduced the page: TIL – today I learned.

*tadaa*