2010-06-17: Type Casting

Even though I star­ted pro­gram­ming more than 16 years ago and got to used to sev­eral dif­fer­ent pro­gram­ming lan­guages in the mean­time, this is the first time I came across the beha­viour shown below.

Assume the fol­low­ing 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 expec­ted some­thing like

-20
-12

but instead it returns

4294967276
4294967284

Obvi­ously, this is a type cast­ing issue. Well, more a kind of pecu­li­ar­ity caused by the C/C++ type hier­archy: The signed integer is pro­moted to an unsigned int, caus­ing the whole cal­cu­la­tion to be handled this way. Noth­ing new but quite inter­est­ing for me and some col­leagues, though :)

For more inform­a­tion in C/C++ type cast­ing issues, have a look at the fol­low­ing web page: http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/

2010-04-26: Scheduled Downtime

All ser­vices will be unavail­able between 2010-05-10 (22:00) and 2010-05-11 (08:00) because Het­zner reor­gan­ises their infrastructure.

This server will be moved to the new Het­zner Online Data Cen­ter Park in Falkenstein/Germany and hope­fully be avail­able again on Tues­day morn­ing — I won’t be avail­able so I’ll take care of some replace­ment admin just in case some­thing goes wrong :)

Edit 2010-05-04: Due to some other issues, we had to switch over to a new server. Hence, we expect no fur­ther downtime.

2010-04-25: LXC Scripts for Ubuntu Lucid

In his blog, Nigel McNie provides a nice hands-on intro­duc­tion to LXC. Along with this, he provides us with a set of scripts that do the work quite nicely. I cloned that repos­it­ory and added a script for Ubuntu Lucid. It’s quite handy to me, sup­posedly also for some­body else out there?

A git repos­it­ory is avail­able at Git­Hub: http://github.com/phbaer/lxc-tools

2010-04-23: RoboCup GO 2010 Pictures

RoboCup German Open 2010, Magdeburg, Germany

Rob­oCup Ger­man Open 2010

It took a while but I finally man­aged to upload the pic­tures we took dur­ing the Rob­oCup Ger­man Open 2010 in Mag­de­burg. Just as usual, they are avail­able in my gal­lery.

Actu­ally, these pic­tures show only what happened dur­ing the week­end; I joined them on Sat­urday. We (they) fin­ished just as every year, ranked fourth. No mat­ter, have fun! :)

2010-04-04: Facebook Experiment

The Face­book exper­i­ment I star­ted exactly one year ago ended almost ended yes­ter­day. I decided to delete my account because of Facebook’s pri­vacy policy. It’s just ridicu­lous, far bey­ond com­mon sense and I really don’t see a reason for accept­ing some­thing that stupid.

Read the rest of this entry »

You are currently browsing the archives for the Excitements category.

Bookmarks

Meta