TIL – Today I learned

Get all findings with grep but without path or line-number: git grep -h "de

Sometimes a warning about "Prior to the resolution of a defect report against ISO C++11 .." a warning by the code-model of QtCreator is given (due to -Wreturn-std-move-in-c++11 ), which can be suppressed by adding a std::move(returnValue) to the return.

Fucked something up? Revert all changes and make sure no artifacts (which are not version-controlled) remain:

Ifdef in InnoSetup-scripts are possible and usable. StackOverflow also mentions that setting their value by commandline should be possible: call with "/DUSE_SPECIALCOMP 1"

C# bootcamp continues - learning things the hard and fast way.
Yesterday I broke a lot of tests by just converting structs to classes and adding default inits to the values. Could mbe due to the mix with C-functions ..
Found a way around: keep as struct, but add the default ctor for the struct with optional params for each field. Like:

Special characters for the XML-comments have to be HTML-escaped (or use CDATA): < would be < ..

handling of the IDE (Visual Studio 2015):

  • auto-format code with Visual Studio 2015: CTRL+K, CTRL+F
  • close the current file: CTRL + F4
  • go to the last view: CTRL + -

I made it my task to acquire as much C#-knowledge as possible, because a tiny part of the project is some C# SDK and we needed a volunteer to groom it. Guess who raised his hand? ;)

Before it was applied to a struct, does it work for class too? Documentation says: "You can apply this attribute to classes or structures.
Typically, the common language runtime controls the physical layout of the data fields of a class or structure in managed memory. However, if you want to arrange the class or structure needs in a certain way, you can use StructLayoutAttribute. Explicit control of a class layout is important if the class is to be passed to unmanaged code that expects a specific layout."

Visual Studio (2015) quick help:
F12 : jump to implementation
CTRL + "-" : go back to last view

More later - maybe I make a real blog-entry out of it.

Even big corporate repositories are not shiny and polished: but this is just another opportunity for me to participate. Found some typos in the documentation of Microsoft's SymCrypt. Solved it and created a pull request :)

Even Qt 5.11 (5.12 is latest, I know) treats big chunks of data with the idea "Oh, size of an object won't be bigger than what fits into 31 bit" and boom, here hits you the well-known 2 GiByte-limit. This is super annyoing if you use a QByteArray or QDataStream::writeRawData / QDataStream::readRawData.
So I rewrote those calls to separate the data into chunks of 1 GiByte and write/read them sequentially. Works, but somehow felt slower and the code becomes uglier. Bit it works, yay!

Win, Cmake, MinGW, Qt 5.12: suddenly after switching from Qt 5.11 an errror while starting the app popped up: "This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: direct2d, minimal, offscreen, windows."
Copying the "platforms"-folder to the location where the executable is, did not help (like it should). The Cmake already deploys properly.
Workaround was found via one hidden stackoverflow-comment, because I can't use the windeploy-tool here.
So: create a file names "qt.conf" with content inside the exe-directory:
Prefix = .

How to reset the state of the filesystem of the git-repo to "just like after checkout": $ git clean -xfd

QtCreator: Alt+Enter on a member opens the context-menu for refactoring ("Create Setter/Getter functions"). Better this than RMB + clicks for each member.

Parsing XML files with Qt/C++: QXmlQuery was not my way to go - QDomDocument/QDomNodeList and QDomElement were my friends. Example: read node P and put as double into a QVariant.
QDomElement const elemP = node.firstChildElement("P");
QVariant vP = elemP.text().toDouble();

C++ has (now) a quite nice way to determine the supported number of threads: std::thread::hardware_concurrency();
See: https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency

Experienced first time in QtCreator "FTH: (15020): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***"
Better explanation than I could provide here: https://forum.qt.io/topic/94341/fault-tolerant-heap-shim-error

There is a map where you can check where which SSID (wifi identifier) was found: https://wigle.net/

Visual Studio 2013 (at least) has an integrated ico-file-editor which is quite convenient for painting application-symbols. Integrating it to some qmake-project (Cullendula) was simple.

* C plus equal: the feminist version of C++. Not sure if this is nice, obscure or a joke? I had some good laughs while reading the manual and the examples. https://github.com/TheFeministSoftwareFoundation/C-plus-Equality

* github.io - and how to create my own (https://marcelpetrick.github.io/)
* The void operator()() for C++. Nice for iteration of containers.
* boost::accumulators for easier data-collection: nice for min, max, mean, etc.

20180913: Use a lambda-expression for delayed triggering of a function-call.

20180904: the online-installers for Qt5.11 and Visual Studio 2017 Community Editon will download 18 GiByte during installation :')

20180903: how to configure and use cmake for an originally qmake-based project. And even the linking works now. More later 🙂

20180826: std-lib has some pretty nice random-number-generators (Mersenne-twister), which can be seeded properly with system-time:

20180824: Lambda-expressions in Qt-slots are quite nice for "one liner"-functions. Saves much space.