

End of Year
Tuesday December 16, 2008
Well, this'll probably be my last blog post this year. It's going to be pretty busy from now on, and I probably won't have a computer while I'm up in Auckland.
Thanks to all of you who visit and post comments and drawings. You can read more of my rantings at my 2008 Summary.
And with that, have a Merry Christmas and a happy New Year, and I'll see you in 2009.

Google Friend Connect
Friday December 5, 2008
I installed Google Friend Connect for my site, which took 10 minutes, and spent another few hours or so thinking up some creative ways of displaying it on the site. It problem is that its minimum width is 200 pixels, but my right navigation bar on my blog is 160 pixels. So I tried to float it and have some animations for it to pop out onmouseover, and blahblah, those didn't go so well, so I settled for the immediate effect and that works quite well. What's surprising is that I didn't have to tweak it for IE at all.
Anyway, in the past week, I've been to Momo's three times, been busy at work doing menu and UI coding, played a pretty good amount of DotA and generally slacked off with that secret website that I am working on.
There's two more weeks until I leave for Auckland. It's going to be an awesome Christmas time \o/
Shameful
Monday December 1, 2008
As shameful as it is, I spent a while trying to help Mike with his C++ programs, attempting to read a particular format of characters from stdin.
The problem is that if this program is fed character data, it loops continuously:
bool valid = false;
int num;
while (!valid)
{
int num_reads = scanf("%02d", &num);
if (num_reads == 1)
{
valid = true;
}
}
Why? num_reads is 0 and upon reaching scanf for the second time, the buffer is still attempting to read something, but it can't and returns 0.. and so on and so forth.
So what's the solution? Simple. Use sscanf!
int num;
char buffer[1024];
bool valid = false;
while (!valid)
{
std::cin >> buffer;
int num_reads = sscanf(buffer,"%d",&num);
if (num_reads == 1)
{
valid = true;
}
}