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...
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.
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...
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...
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...
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...
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...
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-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...
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++ 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...
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...
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...
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...