About Me - The Short Story

I was initialized as a pure C++ programmer and believed there is nothing better than that. Then I reimplemented myself into a Python coder and somehow ended up as a Java backend developer. I am currently working as an application engineer in a multinational company that specializes in the trading of energy commodities. My background is in finance. I got a diploma in financial management and before I became a developer I used to trade futures on CME derivative exchanges. I am interested in art, sport, meditation, hi-tech, nature and everything in between.

I will use this website both as a blog and as a hub to some of my work (project or demos). This web is written from scratch in Python Flask, my favourite web-framework.


Into to Python Unicode

ASCII table has 128 code points, which is not sufficient for all the languages and accents, that is why Unicode was invented. It can have up to 1.114.112 code points. The first 128 code points are ASCII making in backward...

python 
unicode 
strings 


Find N largest or lowest values with heapq

You have a collection of items and you need to keep the N highest or lowest of them. Instead of writing your own algorithm, use build-in heapq module.

This module has two handy functions, nlargest(), and nsmallest().

This is...

python 
data-structures 
algorithms 


Map function to a particular value in C++

Imagine a simple task. You have a bunch of values, for example, strings (but it can be any other object, int, float, whatever..) and you a have a bunch of functions, (more generally callables, so it can be a functor, lambda.. etc.) and you...

c++ 
stl 
map 
function 
bind 


Copy constructors and copy assignement operators in inheritance

Let us see how copy and move constructors and overloaded operator= work with inheritance. The first thing to remember is that copy and move constructors and copy and move assignment operators are not automatically inherited from the base...

c++ 
object-orientation 
inheritance 


Convert decimal to a different numerical system

Humans use decimal numbers, computers use binary numbers. A common testing task is to write a function that converts a decimal number to a binary. There is no stl algorithm for that.

But why to stop here, why not to write a function...

c++ 
algorithms 
recursion 


Normalize strings in a container effectively

Having a container of string (vector of emails) and you need to make all the letters uppercase or lowercase or perform whatever else. 

You want to do it as effectively as possible, no copying, no raw loops. Quite a typical use...

c++ 
stl 
algorithms 


Append an element to a C-style array

C-style arrays might be tricky. Even such a trivial task like appending an element might surprise you. It actually surprised me a few times. I do not use raw array in day-to-day programming, I always prefer vector or std::array if I need a...

c++ 
array 
algorithms 


Deep copy constructor and assignment operator

This is something I have seen at almost all C++ coding interviews I had. 

Having a raw pointer in a class, there is a need for a constructor that copies not only the pointer but the data it points to as well. The same applies to...

c++ 
object-orientation 
constructor 


Demystifying dynamic polymorphism

C++ supports a dynamic (run-time) polymorphic behavior. Polymorphism simply means: one form, many different behaviors – meaning the same line of code, can have completely different outcomes. It is done using pointers

Here I have...

c++ 
object-orientation 
polymorphism 


Use std::map to calculate density of elements

Often there might be a need to calculate how many times each element from a particular collection appears in that collection. For example, having a string, we might want to how many times each letter appears, or how many times each word...

c++ 
stl 
map 


Getline using std::string vs getline using C-style strings

I have been always fairly confused when dealing with input streams, reading characters, words, or whole lines of text. I was not sure which of the function to use, and why.

One of the things that confused me most was, that there are...

c++ 
string 


Find the value of the n-th element in the Fibonacci sequence

One thing I happen to see many times in interviews, coding challenges, or tutorials on recursion is the Fibonacci sequence. It is a coding evergreen. Fibo is a famous series of numbers where each element is the sum of the two previous. The...

c++ 
algorithms 
recursion