Tuesday, 25 March 2008

Comic Collector: it seemed like a good idea at the time

Comic Collector main menuIt’s a commonly held – and almost entirely inaccurate – belief that I am somehow a technically apt person. I think this is because I wear glasses. Ever since school, I have often been mistaken for someone who knows about computers. I have even fooled my employers: somehow, I work for a company that builds internet and intranet sites.

Truthfully, however, I am never going to be properly computer literate, mostly because I need to take my socks off whenever I count above ten. I once tried to update Windows 98 on my PC, with the help of a friend. We ended up having to rebuild the computer from scratch. After that, Windows displayed error messages in Czech.

I still have no home internet connection. Even my grandparents have broadband.

A couple of years ago – almost to the day, in fact - I decided that I needed a database to hold information on my rapidly growing array of comics. I trawled the internet for a few weeks, but didn’t have much success: all of the programs I found were ugly or simplistic, or just did something in a fashion I found counterintuitive.

Then I split up with my girlfriend, in part because she didn’t want to be going out with the sort of person who catalogued his comic collection. I went home after the break-up, and while I was there my dad gave me a copy of Microsoft Access.

I learned to use Access at school, during my Computing A-Level. It’s a pointless skill to have, as no one in the entire world uses Access for anything. I built a database that organised magazine articles for my A-Level coursework. It was my dad’s idea; I couldn’t think of anything else to do. While I was home, I dug out my old project and decided to use it as a template for a new, home-grown comic database.

This exercise has taught me that I don’t really build programs so much as grow them, much like I do mould in tea cups – an attitude that is going to get me in trouble at work very soon. My database, which started off as two tables and a simple query, now contains seven tables, nine queries and a user interface that would confuse a submarine operator. Including the inputted data, it stands proud at over 220 megabytes in size. And it’s still growing.

I haven’t even finished inputting all of my comics. It’s been two years.

The problem with my organic approach is that, because I have no plan and because I tend to put the project down and leave it for months at a time, I keep forgetting how it works. For example, there is a nifty feature that displays a random comic cover on the main menu screen. All of the comic covers are scanned in, so when you open the program it will show one of them with the title and issue number. I programmed this feature, and am rightly proud of it. But I have no idea how it works. I checked recently, and my methodology makes no logical sense. For all I know, the database offers a prayer to the fire rabbits of Pluto, who tell it what cover to display.

Yet I still keep dreaming up and adding new features. This weekend, I figured it would be a good idea to be able to assign categories to the comics, so you could search for which ones you have on subscription, or for anything in the Marvel Ultimate Universe, or whatever. It didn’t take too long to add the categories, but I haven’t even started building the relevant searches yet: that’s the work of another weekend. Just adding the categories required me to break and fix the program no less than four times.

It feels like I’ve built the damn thing out of lard. Sooner or later, I’m going to add something slightly too heavy and the whole program will slop into a melted, useless lump. God forbid I try and remove anything. A year ago, in the name of testing, I built a backup table that isn’t connected to anything important. I tried to delete it yesterday, and the whole database crashed. I don’t understand why, and probably never will.

I’m catching up with the data entry; I now have 498 comics logged, out of maybe seven hundred. I have decided that, in order to count this project as ‘complete’, I need to input the rest of the comics, finish the category search and add the functionality to print search results. And then I need to rejig the user interface, simply on a cosmetic level.

This may take some time.

Just one of my queries!
A sample search result

Tuesday, 11 March 2008

Up in flames: When real life burns out fiction

Image credit: http://www.sfgate.comThe most important hallmark of being a good writer isn’t necessarily being good with words. James Joyce proved that you don’t even have to be particularly good with grammar. If your story sucks, all the long words, run-on sentences and semi-colons in the world won’t save it. A good writer needs to be able to put together a top-notch plot.

Most good stories – even across genres such as sci-fi and fantasy – have strong roots in reality, which is why a good writer should be looking at real life for material. Real life mostly consists of the drudge of daily life, but it does throw up some gems if you search hard enough.

Take this, for example. True story.

A couple of nights ago, a guy – let’s call him Dave – had a bad day and got drunk. He had a few spliffs; not uncommon for him. He went home to his flat, where he lived with his girlfriend and a couple of others. One of these others – Dean – had been pretty loud over the last few weeks. Dave, in his drunken state, decided tonight was going to be the night when he pounded Dean into the ground. He had a theory that Dean was a crackhead, and who wants to live with a crackhead?

Of course, Dean wasn’t in. Dave, not to be put off, banged on Dean’s door. He then called up the landlady, accused her of forcing him to live with crackheads, and handed in his notice. He convinced his girlfriend to make the same call, and then continued pounding on Dean’s door. He accused everyone in the world of being a cunt, and threatened to beat anyone he saw. He wasn’t really angry with Dean; he just wanted a fight.

The landlady was somewhat surprised with the accusations of drug taking on Dean’s part, so called up her son and asked to be taken round to the flat. By the time she got there, Dave and his girlfriend were passed out in bed, and Dean’s door had a big hole in it.

It took ten minutes to wake Dave and his girlfriend. Instantly, Dave was throwing his weight around again, hurling insults at all and sundry. And then he took a swing at his seventy-five year old landlady.

Thankfully, the punch didn’t connect. The landlady’s son, a placid but big fella, stepped in the way and floored Dave.

There followed a few minutes of huffy, drunken walking around by Dave and his girlfriend, the latter being thoroughly pissed off by her hubby’s mood. The landlady and her son, feeling the situation was as resolved as it was going to get at half-midnight, started to drive home.

The peace didn’t last. Within ten minutes of being left alone, Dave started his ranting again. He threw things around, started on a second door – his girlfriend’s – and then decided that the only thing to do was set light to his mattress.

His girlfriend, giddy with fear, pleaded with him to stop. She tried to pour water over the mattress, but Dave wouldn’t let her. Instead, he took her by the neck and got her out of his room.

Meanwhile, the last housemate – the one who wasn’t Dean; the one who was in his room the whole time, and who had been on Dave's corncopia of people to beat, called the police. And then he smelled smoke, and called the fire brigade as well. He escaped the flat through his window, got help from upstairs, and went to find the girlfriend.

The girlfriend was on her own. Dave had skipped out, leaving her to douse the flames. The hall was full of smoke. The fire brigade turned up, dragged Dave’s still smouldering mattress and quilt out of the flat and turned on the hoses.

Dave wandered back while the firemen worked, and stood calmly to one side. Eventually, the police turned up and talked to everyone present, including the returned landlady and her son. Dave was duly arrested, and put in a cell overnight to detox.

Thus far, Dave has admitted causing wilful destruction of property. There’s every chance he’ll get done for trying to hit the landlady. He denies arson, claiming that he was drunk and just left a cigarette to burn by accident. The police do have a statement that the fire was deliberate, but it’s from the housemate who called the police. He heard everything, but didn’t see it.

So, yeah. Life chucks out some good old stories. The difference between real life and fiction, of course, is that the characters act differently. In a story, that last housemate would have rocketed out of his room and saved the day, doused the flames and brought Dave to some kind of justice. Frankly, though, I was fucking terrified.

Dean's door

Doused mattress