Just a quick note: I’ve written an article outlining features of the upcoming C++17. It’s available in the freshly published issue of the “Programista” magazine (available in subscription, Empik stores and probably somewhere else, too). If you can read in Polish you might find it interesting :)
Author: krzaq
Code doodles #4 – obfuscating code, it’s logical!
Let’s start with some standardese:
As you can see, the alternative tokens are defined to behave exactly the same as their counterparts. So the following code is perfectly well-defined and legit, despite the opinion of your fellow reviewer
Writing C++17 for 16-bit x86
A few weeks ago Gynvael Coldwind announced a contest (I’m sorry, the link is in Polish) related to his excellent OS dev streams (again, in Polish, but if you do understand it, definitely consider watching them). The task was simple: make a BIOS-bootable diskette image with the prettiest graphical effect; all in 16-bit text mode, with binary size limit of 512 bytes.
An erase/remove idiom gotcha
I was investigating a crash in my application recently. Despite working in the production environment, I was able to launch the debug version in a debugger (yay). Soon enough, I got a promising SIGSEGV in the expression implementing the erase-remove idiom:
vec.erase(std::remove_if(vec.begin(), vec.end(), [&orig](auto const& msg){ return orig.id == msg.id; })); |
Can you spot the bug already?
How to tell if a fraction can be finitely represented in binary (or any other base)
If you found this post, something has gone wrong, it should be accessible by a direct link only (like unlisted youtube videos). I would like to apologize to all professional mathematicians reading this for my clumsy approach to explaining the subject. I really am doing my best. It is often said that one cannot represent …