Category Archives: C++

How does car physics work in the original Death Rally? Part one, background extraction, background position tracking. (C++, OpenCV)

Likely the original Death Rally is my favourite game of all time. Okay, maybe I loved other games too, I grew up with Lara Croft and I played through all the classic Tomb Raider games at least three times (by … Continue reading

Posted in C++, OpenCV | Tagged , , , , ,

Approaches to optimize a small program (C++)

Imagine we have to work on the following problem (because it is our new assignment, our boss is obsessed with this problem, etc.): We have a text file that’s a few hundred megabytes long. We knows that this text contains … Continue reading

Posted in C++ | Tagged , , , , , , ,

My five most common programming mistakes in C++

I’m a junior programmer. Junior means I don’t have industrial experience, sad, but coding at home and working at a company are entirely different things. Strict deadlines, teamwork with a lots of smart guys, really big source codes and the … Continue reading

Posted in C++ | Tagged , , , ,

Macro, with or without you (C++)

“Macros are the bluntest instrument of C and C++’s abstraction facilities, ravenous wolves in functions’ clothing, hard to tame, marching to their own beat all over your scopes. Avoid them.“ C++ Coding Standards: 101 Rules, Guidelines, and Best Practices by … Continue reading

Posted in C++ | Tagged , , , ,

C++ templates and Kung Fu training (C++)

Maybe you like martial arts movies as much as I do. (Or even more than me. I never watched a Sonny Chiba triple feature, for example.) When you do, likely you remember these great training montages with cool warm up … Continue reading

Posted in C++ | Tagged , , , ,

Five weird features in C++ that you likely use when you are a great OOP developer

The syntax of C++ seems pretty weird sometimes. Think about the function pointers (int (*ptr) (int, int) = myFunction;), think about functions that return function pointers (int (* func(int a, int b))(int, int)), think about the keyword “const” (const int* … Continue reading

Posted in C++ | Tagged , ,

A C++ programming exercise: Calculate the first 4000 digits of PI in one second! (C++)

In these days, to me the hardest part of C++ practice is finding good and interesting programming practice problems. I learn the theoretical background of C++ programming day by day from various books, but it is not enough, I have … Continue reading

Posted in C++ | Tagged , , , ,