Erasing Vector The Smart Way
In the C++ world, std::vector is a sequence container that encapsulates dynamic size arrays. One of the main perks of the vector is the fact that elements are stored contiguously. In other words, a...
View ArticleHow Not To Write a Signal Handler
Back in the day, I was reading a book about UNIX® programming and have learned how to write a signal handler. It was a long time ago and I don’t remember the book, but to this day the way described in...
View ArticleMarvell 88E1111 Reset Sequence
If you are one of the lucky owners of one of the Altera’s development kits with Marvell’s software-programmable 88E1111 Ethernet PHY then you know it’s a bitch. The problem is not really in a PHY...
View ArticleC++11 Final Override
The alternative name for this post is “How to protect yourself from others when it comes to polymorphism.” That is pretty much the primary purpose of the two brand new C++ keywords — the override and...
View ArticleAutomatic Resource Management in Programming Languages
Many high-level programming languages provide software developers with the ability to automatically cleanup resources — automatically closing an open file when it is no longer used, freeing dynamically...
View ArticleUsing Python in Electronic Trading
Today I was going through some stuff in my desk’s locker and ran into this nice toy — a big red electronic panic button. It has been there for years but I never had a chance to use it because a company...
View ArticleParanoid Programming Disorder: Use free() and delete correctly.
The Internet is full of programming jokes. This is one of my favorites: <@joosa> how do you say float in java? just 1.5f? <@Gliptic> FloatFactoryFactory.getInstance...
View ArticleFIX Message Checksum Calculation
The WordPress has a nice built-in stats for every blog. One of the things it shows is “Search Engine Terms”. In other words, it is what people were searching for before they ended up reading your blog....
View ArticleObject-Oriented Programming with ANSI C
What if I told you that Linux kernel is object-oriented? Would that surprise you? Or maybe you would think I am a lunatic, and I would understand that. After all, the Linux kernel is mostly written in...
View ArticleStranded
One of the things I really love about WordPress.com is its community. The Daily Prompt movement is especially great — it helps to connect so many people together, share so many great stories, and...
View ArticleThe Evolution of Computer Networking
Do you remember 56k modems? Me too. The sound it used to produce when connecting still gives me a warm fuzzy feeling and a bit of excitement. The last time I have used that modem was in 2003. Fifty six...
View ArticleAsk Smart Questions And You Will Succeed
Asking is ultimately one of the most important ways for you to succeed. You shall not be afraid to ask. You shall ask often. Ask for help and for a raise, ask for an advice and ask questions. Asking is...
View ArticleC and C++ are two different languages
Good news everyone, we are looking for a C/C++ developer! Wait, that’s not good news at all! You see, the term «C/C++» is likely to piss off those who actually know both C and C++. On the other hand,...
View ArticleC++ Exceptions, Stack Trace and GDB Automation
The tricky part about any exception is that the stack is already unwinded by the time exception is caught and there is no easy way to figure out from which part of the code it was thrown. Have you ever...
View ArticleWhat happened to the world’s first Linux monument
The first Linux monument in history was unveiled in Tyumen, Russia back in 2010. It was quite an interesting story that I have stumbled upon in the Russian speaking Linux community and translated it...
View ArticleWhy C++ Member Function Pointers Are 16 Bytes Wide
When talking about pointers, we generally assume it is something that can be represented by “void*” pointer which has a size of 8 bytes on the x86_64 architecture. For instance, here is an excerpt from...
View ArticleHow constant is a constant?
Do you remember those good old days of DOS when programmers used to write code like this? This trick was working like a champ back then. Today, however, you will only see this kind of code in questions...
View ArticleThoughts on Python, C++, Variadic Templates and Tail Recusion
Today I ran into a somewhat classy piece of code that was analyzing user’s answer to a Yes or No question. The idea was to compare input to various possible answers disregarding the case. The code...
View ArticleRead it aloud to yourself
Once in a while I like to learn a new technology, a programming language or a trick to entertain myself and, hopefully, keep the mind open. To shift the perception on programming languages a little,...
View ArticleObject-Oriented Programming with ANSI C
What if I told you that Linux kernel is object-oriented? Would that surprise you? Or maybe you would think I am a lunatic, and I would understand that. After all, the Linux kernel is mostly written in...
View Article