Month: February 2018

Design Pattern – Singleton c++ with mutex to avoid many instance doing same work on critical section

Design pattern helps you make your code cleaner and reusable. And this blog is to show you a technique in which we can apply singleton design pattern and mutex to guarantee the access into crtical section. 1. in header file .h class A { public: ¬†… static A* getInstance(); … private: … ¬†static boost::mutex Amutex; …


Git – Author’s experience – Part 1

This series of Git handy blogs is continuously updated. During my work, I have learned/collected several git commands and I would like to share them with you. Hope they are useful for your career as well. 1- Common commands git status git log git log –all –decorate –graph : You are able to see, full …


Compress/Extract files with Linux command lines

This blog will be updated frequently to give you as many as possible way to work with compressed files in Linux. A- Compress B- Extract 1 – .7z tientham@tientham:/tmp$ sudo apt-get install p7zip-full tientham@tientham:/tmp$ 7z x /home/tientham/Downloads/tito.7z 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs) Processing archive: /home/tientham/Downloads/tito.7z Enter …


C++ learning experience – part 1

During my c++ study, I have collected some definitions, explanations about topics that I have not known or not master yet. I would like to write down here to share my studying with you. 1 – Volatile key word: You use “volatile” when define a variable so that the compiler will not try to optimize …


Install Qt for Linux

Qt is a good IDE for C++ development. It also offers you freely many apis for your software development. Following is the way to install qt in Linux Ubuntu: sudo apt-get install build-essential qtcreator qt5-default qt5-doc qt5-doc-html qt5-doc-html qtbase5-examples Some hints: 1- For applying ident: Ctrl + I 2 – To include a folder One …