A piece of supposedly well-written multi-threaded code was giving me a headache the other day. I briefly explore a common(?) pitfall in the use of RAII-driven locking mechanisms.
A piece of supposedly well-written multi-threaded code was giving me a headache the other day. I briefly explore a common(?) pitfall in the use of RAII-driven locking mechanisms.
Like any half-assed amateur system administrator worth his Sainsbury's Basics table salt, I've been searching for a decent backup/restore solution for a while now. Then, just recently, I found it.
Tempted to count the passage of CPU time with the clock() POSIX call? Be careful.
Keeping it low-key this week, let's re-iterate (lol) the conventional map-erase idiom in C++.
In an unprecedented feat of miraculousness, Freenode's ##C++ discussion channel saw — in the space of no more than twenty minutes — the same question asked twice of one of C++'s more subtle features. Just how do you declare a friend
from the global namespace? I find out.
Right or wrong, it's still trendy in some C++ circles to use the singleton pattern for defining a type that can only be instantiated at most once in an execution run. However, this can cause problems when you bring more static data into the mix.
This week I explore how, after struggling with my Windows 7 grinding to a halt over the last few months, I finally managed to get it up to speed again.
One of the evilnesses of the C++ Standard Library is that implementations — be they GCC's libstdc++ or the Dimkumware implementation used by MSVC — are free to have their headers include other standard headers as much as they like. This can lead to confusion.
One of the most well-known "web 2.0" buzzwords is AJAX ("Asynchronous Javascript And XML") which, properly known as XMLHttpRequest is a mechanism to provoke the retrieval of data from a webserver at times other than the initial loading of a webpage. You see it when your Gmail inbox refreshes, or when you turn the page in a Facebook photo album. Unfortunately, AJAX is somewhat misunderstood.
I'm occasionally asked why C++ programmers conventionally use .cpp and .hpp files, what they use them for and what happens if they don't. On the spot I'll usually come out with the template answer that conventions exist for a reason, but I thought I might as well take a moment to explain more fully the reasoning behind this one.