Thursday, July 12, 2007

The Case of the Missing Semicolon

If this was a crime fiction murder mystery, we'd begin in a mysterious fog shrouded alley with a distant silhouette of a man in a fedora hunched over a lit cigarette - but surprise, this isn't a murder mystery =] The Missing Semicolon I speak of is one on the end of a line - on the end of a line of Javascript.

This might make a bit more sense if I actually explain it. After I finished my NLP Question Answering system for Dr Curran, he basically said it was good, but wasn't good enough - some more work was needed. To do the stuff he wanted, I'd basically have to use Javascript. Luckily I'm a quick learner, and I filled in the gaps of my knowledge and got underway. Only major gripes - Javascript debuggers don't tell you anything! I sat there looking the code over and over, nearly going mad, trying to find some sort of error - and - oh look at that, a single missing semicolon... So yes, other than the lacking thorough debugging support for the language, and a slight annoyance at the way it handles the scope of variables (that may just be being silly though ^_^)
It only works with Firefox (only needed to work with Firefox) and there's a chance it may work with Opera/Safari but next to no chance with IE.
NLP QA Quick Answer System
I could learn to live with Javascript if browser interoperability was less of an pain =]

Other than that I haven't done a lot the last few days... Huzzah for the lazy =]
Smerity

Monday, July 09, 2007

Ray? Sphere? Intersection?

It was at about this point that a strange Pommy walked up to me holding a cup of tea, and with his high strung accent he said to me - "Why hullo there dear chap, I must say, can I have your ray-sphere intersection when you're done with it?"
Strange delusions... many... =]

Anyway, over this weekend I have accomplished one of those little dreams I've had since I started 3D all those years ago. A raytracer that is one hundred percent mine all the way from the ground up!

I started off writing a 3D vector library which makes handling a lot of tasks (creating and normalizing the original viewing vectors etc) and make them simpler. A short while after that, I implemented the ray-sphere intersection code and ended up with -

"Oh... Hmm..." says Smerity.
Oh hmm indeed - much to my annoyance it appears one of my spheres decided to go elliptical on me...
I thought it was an error in my ray-sphere intersection code so I redid the entire ray-sphere intersection code to use vectors... Much prettier - but didn't change anything...
Eventually I discovered I was an idiot and that, just like real life, I had the 'camera' too close to the spheres so that you end up with a depth of field effect - when you go that close it ends up with a smudge basically...
USER ERROR BY THE GUY WHO MADE THE PROGRAM :(
Silly Smerity =]

Anyway, after I got my bearings with the depth component I ended up with a thing of beauty... Nearly =]


That concluded late Saturday night. Sunday I went to work on diffuse shading, which came out quicker than I thought. By the end of the day I ended up with -

My attempt at adaptive antialiasing failed... Horrifically... Teaches me to try and come up with my own theory flying in the face of convention - this is just me cheating with low supersampling ^_^


My 'ghostray', the results of the failed adaptive AA =]

Today however I ended up going into the University of Sydney. Yes, the coding sprint that I thought was off was in fact back on =] A disturbingly short email alerted me to its re-occurrence but luckily Cat filled in the gaps... Got there today, extra early as I was expecting trouble on the Bridge (the Tunnel went toll free) and freaked out for most of the morning as no-one was there =] After a while a guy or two appeared and the day got underway. A bunch less people that I expected, but that was as they were either overseas or they were panicking about a commercial project due in some time last week =]
I ended up working on a web interface to help users classify questions. I won't say too much about it as I'm not exactly sure how open/closed it is, but here's the result of day one of two -

Obviously the question has the answer in it, but that's only as we haven't done our own questions yet and are running on previously tagged corpus questions.

Anyway, until next time, NLP FTW!
Smerity

Monday, July 02, 2007

The world could be one very lonely place indeed

That was my general thought patterns of tonight. Long story - ready for a stroll?

It was around midnight, and I'd just finished seeing Knocked Up with a few friends, so I was heading to Robyn's place to drop her off and my car hit a really really strange object on the road - gave it quite a good thumping - so I decided that after I dropped her off I'd go back and fix up whatever the issue was there. So I got back to that spot of road, now about 12:30 and looked at what it was...

Quite strange ... There are doorknobs... dozens of doorknobs all over the road... So I went to work, collecting them, with some cars driving past who I no doubt think must have decided I was a drunk loon, and finally ended up with a quite reasonable stash.

I moved the stash off the road to a grassy side area and called it a night. Just for more of an indepth focus, those doorknobs were huge!


Anyway, as I was driving home, I became more and more depressed, for reasons I won't go into. Having arrived home, I decided that it was time to go for a walk - which is basically what I do when I have melancholy thoughts. So wandering out and about in the moonlight at 1:30, thoroughly defeated and cursing the world, I was saved by a shooting star. Shooting stars are wonderful things - truly truly truly. I mean, they might not fix the problems, but they give you that tiny glimmer of hope that the world is much larger than you reckon it to be - that there's a chance, that infinitesimally small chance that things may happen for a reason.

So that's where I'm at =] With this clear state of mind I may confront a few issues, and then round it off by what I did for WC #5.

First issue, I'm starting to become a bit of a running joke with my group of friends from school, and my best friend seems to be drifting off. Really not a good thing to start happening as I'm about to enter my last term of school with these guys. Such happens I guess. I'm sure they mean it in jest - or at least I hope they do - but it's really starting to get to me. I don't know what I can do to fix it - I don't know if there is anything that can...

Second issue, girls. But they're always an issue, so best left unsaid.

Third issue, academic. School is pulling away from me - I need to do some major catch up. This is the last holiday I really have to finish everything - three weeks from now is when the world starts to implode. Extension Two needs to be completed, math needs to be revised, Latin needs to be (majorly) relearnt and music needs to be finished. And it's worrying...

Fourth issue, avoid the deus ex machina mode. It's a lovely feeling to imagine that someone will come down and pluck you out of your meager life as it stands and place you high above the reach of mortal man - but sorry, it's unlikely to happen. Malcom Reynolds says it best - "That's a long wait for a train that don't come."
I fell into that trap again. A Doctor invited me to an academic venture in the holidays, and I thought it was a great opening, and it would have been I guess, but it didn't come to a point of fruition. You just have to realise that if you're going to get anywhere from the point you are at now, you have to work for it yourself. You can't bank on anyone else helping you - the world's not so kind.

That's my major whine at least. Hopefully I'll look back on that and laugh =]

On a much happier note, this weekend Weekend Challenge #5 launched - Game On ^_^ I didn't actually end up finishing a game, but I did a fair amount.

Above is an image from a homebrew game I made a while for the PSP - based on a game called Airstrike. I decided I wanted to try something like it, but more complex, involving projectile motions and gravity etc. The major thing I wanted to go for was a 'gravity bomb' ^_^ Only problem is that it all involved vectors, and no-one ever taught me vectors - I unfortunately couldn't take physics at school due to a subject clash :( Anyway, I taught myself vectors, didn't end up being as difficult as I'd imagined, and ended up with -

Projectiles ^_^ I simulated gravity. The picture above is just with the computer firing projectiles off in random directions and at random velocities. I later on refined it and made it user definable by calculating the vector from the mouse cursor's location. Moving on from that, I then decided I wanted to do gravity full stop and reacquainted myself with Kepler's laws of planetary motion, and also with gravity generally itself.

So I finally ended up with gravity =] Oh gravity, how sweet you are. The point of gravity is also user definable via right clicking ^_^ Makes for some fun in flinging objects around. And finally, if you leave the objects trailing around long enough they begin to eerily resemble the Spirographs of my youth ;)

How this will actually end up a game of any kind I'm still not entirely sure ^_^

So yes... That's how I've been - how about you?
Smerity