Skip to main content

Posts

Showing posts from January, 2014

C++ in 2014 - Predictions

Today I would like to share with you interesting article about prediction of development C++ programming languages (and its well-known frameworks and libraries) in 2014. It is written by Jens Weller and I think it is very interesting for every C++ programmer and user. You can open this article by clicking on the image below: Enjoy!

Advanced C++ - Effective C++ - cheatsheet

I would like to share with you my summary of the "Effective C++" book by Scott Meyers . It is very interesting book for everyone who would like to improve C++ developments skills to be every effective. I highly recommend it. Quick summary of that book, which I prepared you can download after by clicking on below image. Summary of Effective C++ book by Damian Ziobro

Blog's new layout

As you noticed this blog has new layout from today. I hope you like it. I think new layout looks better and more modern than previous one. Please, write you opinion about new layout in comments. If you have some ideas how to make this blog better, all ideas are welcomed. Enjoy new layout and blog articles.

QT - foreach algoriithm with const references performance improvement

Today I would like to show you optimal way of using foreach QT algorithm . I will show you why we should pass elements of foreach algorithm by const reference instead of passing them by value. Let me explain it on the below example: Output of this example is: In point I we are creating 3 objects of MyClass class and push them to myClasses QList element. In point II we are using QT foreach algorithm to invoke getValue() method for each object from myClasses list. As you can see on output text for that part of code we are invoking copy constructor before and destructor after invoking getValue() function. It is because we are passing each myClasses list element to foreach algorithm by value. Therefore we are copying that element at the beginning of foreach loop step and removing them (destructing) at the end. This is inefficient solution, especially when class of object being copied is big. It decreases performance. of our application. Solution for that i

C++ Multithreading - Basic thread creation

C++11 standard introduces integrated sublibrary for multithreading . It has been moved from Boost library. However because multithreading is very important topic in software development I decided to make multithreading tutorial as separate section of this blog. I will not explain here theory about multithreading, but I will try to explain usage of multithreading based on thread library from C++11 standard. If theory explanation will be required for some aspects I will try to put links to separate articles explaining them. Introduction theory about multithreading you can find on Wikipedia article here This article will present basic threads creation and usage in C++. Code of example you can find here: Output of the example is (it can be little other - depends how thread will be invoked by OS): In point I we are creating new thread where print() function will be invoked. This thread will work in parallel to the main function (main application is second thread called main

Boost.DateTime - Selected date operations

Today I would like to present you operations related to date and time using Boost.DateTime library. This library contains set of classes, templates and algorithms prepared for date and time related tasks. This article focuses on date operations . Time operations will be presented in one of the future articles. Example of usage some basic Boost.DateTime date operations you can see here: Output of this example is (for day 2 January 2014): All below operations will be based on boost::gregorian namespace. We created alias dateTime for that namespace for more convenient use. In point I we are using universal_day() method for getting current day according to UTC time zone. Of course output of this and other date-related functions depends on date of invoking. Therefore you will get other output of your application every day you will invoke it. universal_day() function returns Boost   date class object which has lot of functions for date manipulation and displaying. In p