Even though I started programming more than 16 years ago and got to used to several different programming languages in the meantime, this is the first time I came across the behaviour shown below.
Assume the following piece of code:
int main(int argc, char *argv[]) {
int x = -2;
unsigned int y = 10;
std::cout << (x * y) << std::endl;
std::cout << (x - y) << std::endl;
}
I’d have expected something like
-20
-12
but instead it returns
4294967276
4294967284
Obviously, this is a type casting issue. Well, more a kind of peculiarity caused by the C/C++ type hierarchy: The signed integer is promoted to an unsigned int, causing the whole calculation to be handled this way. Nothing new but quite interesting for me and some colleagues, though :)
For more information in C/C++ type casting issues, have a look at the following web page: http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/
All services will be unavailable between 2010-05-10 (22:00) and 2010-05-11 (08:00) because Hetzner reorganises their infrastructure.
This server will be moved to the new Hetzner Online Data Center Park in Falkenstein/Germany and hopefully be available again on Tuesday morning — I won’t be available so I’ll take care of some replacement admin just in case something goes wrong :)
Edit 2010-05-04: Due to some other issues, we had to switch over to a new server. Hence, we expect no further downtime.
In his blog, Nigel McNie provides a nice hands-on introduction to LXC. Along with this, he provides us with a set of scripts that do the work quite nicely. I cloned that repository and added a script for Ubuntu Lucid. It’s quite handy to me, supposedly also for somebody else out there?
A git repository is available at GitHub: http://github.com/phbaer/lxc-tools

RoboCup German Open 2010
It took a while but I finally managed to upload the pictures we took during the RoboCup German Open 2010 in Magdeburg. Just as usual, they are available in my gallery.
Actually, these pictures show only what happened during the weekend; I joined them on Saturday. We (they) finished just as every year, ranked fourth. No matter, have fun! :)
The Facebook experiment I started exactly one year ago ended almost ended yesterday. I decided to delete my account because of Facebook’s privacy policy. It’s just ridiculous, far beyond common sense and I really don’t see a reason for accepting something that stupid.
Read the rest of this entry »