Diary: November 2003

Yay For Leakage

Spot the intentional *cough* error in the following C code:

mystruct *create(int bar) {

mystruct *a;

a = (mystruct *) malloc(sizeof(mystruct));

a->foo = bar;

return a;

}

mystruct *add(mystruct *a, mystruct *b) {

return create(a->foo + b->foo);

}

int main() {

mystruct *leaky_goodness;

leaky_goodness = add(create(1), create(2));

printf("I leaked all over myself: ", leaky_goodness->foo);

return 0;

}

If you don't do C, all you need to understand is that I'm very stupid.

If you do do C and you still don't see it, take a look at what happens to the three mystructs I create... Oh ...

Read full entry

SEMI-VICTORY!

My ray tracer works!

Well, it works in that it renders spheres to the console. It's a start. And it also means that my data structures work, and should be ready for more complicated things once I've added them. Which is nice :)

Oh, and I found out why I didn't win the lottery last weekend - it's a rollover today, they're saving it up.

Read full entry

Hello and Good Morning

For those of you who enjoy reading about the minutia of my life, I have just had a shower and am about to have a shave, and for some unknown reason, my shower has decided that it would be a good idea for the water to flow out of a small plastic tube in the bottom of the heating unit, rather than the more conventional manner of flowing, from the shower head.

For the rest of you, apologies, there will be no entry at this time.

That is all.

Read full entry

I have new clothes!

It happened again.

I went and got new clothes, the old stuff was getting dirty. Apologies to those of you who attend university with me, you may not recognise me for a while. What am I saying, you should be thanking me, now you can pretend you haven't seen me :)

I have a new pair of trousers, three new jumpers and six new pairs of socks, and they are cool. And, more importantly, they don't suck as much as my current trousers, jumpers or socks when I wear them. Fantastic!

Many thanks to Leela, who took me to ...

Read full entry

Ray Tracey Goodness

Finished my ray tracer last night. For some reason (damn you, mihtjel), I thought it would be a good idea to then add cubes, rather than doing the writeup.

This was at 5pm.

There was a film on at bufs which I had wanted to see. However, coursework must come first, I said to myself...

Cubes can be defined in 3d space by defining planes and then bounding them.

By 11pm I was starting to think that maybe implementing cubes wasn't such a great idea. My planes worked, but the bounding, uh, didn't.

By 2am I decided it ...

Read full entry