Category «Programming»

Disable OpenCV Logging

When we use OpenCV from command line process, sometimes OpenCV will print internal logging messages such as: This might be useful while debugging OpenCV problems but it is a noise if we want to print our own messages to the console. In this case, it is desirable to disable the internal OpenCV logging using the …

History of All Visual C++ Versions

Product Release date C++ version _MSC_VER Visual Studio 2019 16.11 10-Aug-21 14.29 1929 Visual Studio 2019 16.10 25-May-21 14.29 1929 Visual Studio 2019 16.9 02-Mar-21 14.28 1928 Visual Studio 2019 16.9 10-Nov-20 14.28 1928 Visual Studio 2019 16.7 05-Aug-20 14.27 1927 Visual Studio 2019 16.6 19-May-20 14.26 1926 Visual Studio 2019 16.5 16-Mar-20 14.25 1925 …

Git Command Reference

Git Config Git Branch Git Checkout Git Diff Git Commit Git Stash Git Log Git Reset Git Ignore Patterns The rules for the patterns you can put in the .gitignore file are as follows: Blank lines or lines starting with # are ignored. Standard glob patterns work, and will be applied recursively throughout the entire …

Center/Right Align a Widget in QTreeWidget

Qt comes with a QTreeWidget class which can be used to show data in a tree view. It can be used to show hierarchical data using either Model/View framework or by manually creating the hierarchy. The QTreeWidget supports multi-columns for each row and also allows editing of the individual cells. However, sometimes we need to …

Display FPS for VTK on Python

In the last post, I discussed how to get started with VTK on Python. In this post, I will show how to add support to show frames per second (FPS). The idea to calculate FPS is straight forward: keep track of the number of frames (N) that were rendered in last T seconds. Then fps …

Getting Started with VTK for Python

The visualization toolkit (VTK) is a open source library displaying scientific data. VTK is maintained by Kitware, the same company which gave us CMake. VTK is written in C/C++ but it comes with Python bindings and can be installed from https://pypi.org/project/vtk/. In this post, I am going to show how to start using VTK from …

QWidgetLogger: A Qt logging device for SLogLib

SLogLib is a flexible logging library written in C++. It comes with three logging devices: console, file, and memory but often there is a need to show log directly on the user interface. I heavily use Qt for all projects requiring user interface, so I wrote a logging device for QWidget. It is available in …

Added Multi-threading Support in SLogLib

Recently, I worked on a project which made heavy use of C++ threads. To use SLogLib in this project I added multi-threaded support in SLogLib with the help of c++ 11 std::mutex and std::lock_guard. Over the last few months multi-threaded support in SLogLib has been extensively tested and there are no known bugs. All threading …

Error loading numpy arrays

If you received “Object arrays cannot be loaded when allow_pickle=False” while loading a numpy array using numpy.load() it is because numpy has changed the default loading behaviour since version 1.16.3. If you are using numpy version newer than this, at many places on internet it is advised to simply downgrade the numpy version. This is …

String Selection Widget for Qt5

Some time back, I developed a data entry application in Qt5. One of the requirements was to let the user select a single string from a predefined list of string. I developed a custom widget called SStringSelector for this purpose. SStringSelector has two views: display and selection. The display view presents the currently selected string …