DPDK is written in C and it is expected to be used in C environments. Yes I know, there are exports ready for C++ usage all over the lib, but if you ever tried to include DPDK code into your C++ application then you’ve already discovered that’s actually quite tricky to build DPDK with C++ toolchains. […]
C
Unexpected stuff!

Let’s have a look at this code: int main() { for(int i{0};i<500;i++) { std::cout<<“This is a big number: “<<i*20000000<<std::endl; } } And let’s compile it with g++ using the flag -O3, what’s going to happen? Before answering, let’s have a look at the assembly, shall we? L16: movsbl 39(%ebx), %eax L6: movl %esi, %ecx movl […]
- Algorithms
- ...
Segment tree

What is the best thing you may possible do when having a eight hours train trip? Writing a blog post of course! That’s actually an interesting story by itself: Where I was and why it take that long to come back home! Anyway! Let’s say you’ve an array of integers, as usual from index 0 to […]
Almost useless knowledge

Is almost useless because nobody is going to raise yours salary for that! Or maybe someone will?!? Let’s say we ignore all the benefits of all the optimizations our benevolent compiler is going to made on our code, and have a look at what happen when we execute some hundreds of thousands of times two very […]
- Algorithms
- ...
Solution space.

Certain problems required us to try all the possible solutions to find the one that best fit the given constraint, a very popular brute force way is to perform a complete search of the solution space by iterating over and over the data and changing each time the input variables. If the problem require to […]
Suffix trees.

An entire post covering both the theoretical part and the implementation is going to take too long, for this reason I’m splitting the material in two parts: A post with some theory introduction, and one post which will be focused on implementation details. The algorithm I would like to show you is the Ukkonen method for […]
String searching algorithms comparison.

With nature OPHELIA sick had. heel him my MARCELLUS the A with my in comes not sweet if! A means may too; that quantity prepare did! have would not thou But do; thirty fortune, lament And are A of and havior There and. QUEEN am What worse kind. at might at wears that as That […]
Summary for the week.

This was a very long week! Most of my free time I was at the gym or on my combinatorics book learning fancy details about the pigeonhole principle, which is very simple but with large implications in problem solving. The pigeonhole principle basically say that if you want to put three pigeon in two holes, […]
Subsequences and Fenwick tree’s

Let’s say that we have a sequence A of 1<=n<=10^5 elements, and that this sequence may or may not be ordered but all the numbers {1…n} are present exactly once. And now given 1<=k<=10, you’re asked to find all the increasing sub-sequences of A with exactly k+1 elements. This is a problem I get from a competitive programming […]
The real keyboard.

Back in the days, when computer were used by real computer users and nobody knew what a mouse is, the preferred input device was also the only input device: The Keyboard! When the hipster revolution began back in the seventies/eighties, the proliferation of the mouse users increased dramatically, the keyboard was still the preferred computer input […]