As some of my friends already know, I was diagnosed with OCD relatively recently. One of the things it has been suggested I should work on, aside from the obvious compulsions themselves, are my feelings of shame. So in that spririt I’m trying to bring myself to publically blog about it a bit.

Most, if not all, people experience times when they go to bed and cannot stop thinking about something(s). They are suffering, at that time, from anxiety – normal, everyday (in the sense of “common” – hopefully not daily!) stress/anxiety that is manifesting as “something on one’s mind”. If that anxiety persists one may decide that, rather than continue to try and forget about it for now (which is probably most people’s first “go to” response to the situation I describe – it’s certainly mine), they need to actually do something about it in order to put it to one side for now and relax enough to sleep. That could be a simple thing, like noting the thing down so you know it’ll be there to remind you in the morning, or checking something is done (e.g. if you can’t shake the feeling you didn’t lock the door before bed) or even spending 20 minutes doing some reasearch on whatever it is so you feel like you’ve done something and can pick it up in the morning. And after this, all being well, you will feel better about whatever it is and go back to bed, feel relaxed and able to allow your mind to drift freely and easily away from whatver it was that was bothering you, hopefully to sleep. This certainly works for me, most of the time, at least.

Now imagine that your mind drifts off and you’re feeling nice and relaxed, and then suddenly after only a few minutes that exact same thing, which was keeping your mind preoccupied earlier, pops back into your head. Now, you’ve already dealt with it, and you tell yourself that, but despite the absolute knowledge that the item in question is done with for tonight you can’t get it out of your head. So you end up, after trying unsuccessfully again to drift off, and again do something to put your mind at rest. Which it does, for a short while. Then it begins again. This is OCD, certain specific thoughts (“The fact these thoughts and their triggers are so specific is what makes this OCD, rather than something else”, to quote the Psychiatrist who made the diagnosis) doing this causing great torment, and this is also the reason I had no sleep last night. It is also bitterly disappointing after a very long spell of having my OCD symptoms largely under control, however life has been extraordinarially stressful for me over the last month or so (somethings that I hope will start resolving themselves in the coming weeks) – so I’m trying to focus my disappointment on the situation rather than myself.

This is the 4th post I’ve written so far, none of the others of which got as far as being published, trying to explain it using a variety of real-life examples (“difficulties”, if you’re a psychiatrist) of mine and analogies. And then today happened, my second (slight, compared to where I was a couple of years ago) relapse this year, and it seemed easier to just write about that.

Plus lack of sleep lowers inhibitions, apparently enough for me to just hit “publish” on this.

About time for another post.

Having written nothing on my blog since the 1st of September I feel it’s about time to flex my inability to spell (made worse by the fact that my sister has stolen“borrowed” the dictionary I keep by my computer) again and write something.

Since my last post:

  • I have quit my job.
  • I have started a new job (“IT Services Specialist”) at Loughborough University, part time.
  • I have returned to my job at Startin Tractors for the other half of the week.
  • my sister has been moved to a more secure secure ward – she’s now locked up with the likes of mentally ill prisoners.

Still it’s all good.

I only wish I had something interesting to put here, but I can not think of anything so instead I’m just going to provide a link to http://bash.org, to annoy anyone trying to work at this point.

…and then there were two (posts)

Having survived another day at work, I’ve now gotten round to writing the final few things I missed off this mornings blog post.

One thing I forgot to mention this morning was that, although MSSQL deleted over 1,000 records from a table by a cascaded delete, the output says “4 rows affected” as only four were deleted from the first table. If a higher number had been reported anywhere in the output it might have allerted to us that there was a problem earlier than the customer calling support because their site no longer functioned correctly.

Rant aside, since my last blog post (in May, this is just an extension of this morning’s) my Grandfather, who was formerly a Commando and then a coal miner, died. He’d been ill for sometime but we did not expect him to die quite so suddenly. Fortunately he died peacfully, in A&E where he’d been taken after coughing up some blood at home.

Yesterday Pete wrote about a document on maintainable code he found at work. The document makes some very good points for writing “maintainable code”. However I would dispute the suggestion that “Every function should be most 20 lines of code”. The rule where I work is that a function should be the length necessary to perform its given task, no more and no less. Usually this means that the function will fall well within the 20 line limit suggested, however it is not uncommon for a complex function which performs a very specific task (such as manipulating the contents of a particular input file, from a manufacturer, to fit the database schema)  to be 100 or more lines in length. Setting a hard and fast limit on the length of a region of code, be it an if block, a function/method, a class, etc. is not, in my opinion, conducive to maintainable code.

Another interesting item I saw noted on Planet Compsoc was this BBC article about Lenovo (who made my wonderful T60) preparing to sell laptops with Linux pre-installed on them. At the bottom of the article it says “Analysts believe that approximately 6% of computers users run Linux, similar to the numbers choosing Apple Macs”. I find this fact extreemly interesting as the company I previously worked for, in the holidays, had a statistics analyiser (which I installed) for their web logs, which showed approximately 6% of visitors to the site used Linux. The Mac quotient of Visitors was significantly less than that, however, and a full 90% of Visitors used Windows XP. Another random fact I found interesting was that use of IE 7 and IE 6 to visit the site was evenly split at 45% each. It makes me wonder how many of those have IE 7 simply because Windows Automatic Updates have installed it for them, and how many of the IE 6 users only have that because they never run the Automatic Updates.

Finally; At christmas I undetook the task of re-writing the stock management system I had previously written for my then employer. The re-write was necessary as the system had started out as a very small and simple thing, which had then had bits and pieces botched onto it as and when my boss decided that it would be nifty to have feature X (or Y or, more commonly, X, Y and Z. By lunchtime.). The result, as always with projects which develop like this, was a hideous mess with, for some reason, worked. Until it stopped working. And then something would hit the fan and land on my desk.

As a result I decided to dump the hacked-to-death php code, and re-write it using an MVC framework. I settled on Rails as it promised great productivity and allowing the developer to concentrate on writing functionality while it worried about the nittity-gritty, such as interfacing with the database. I completely re-wrote a system which had taken over 2 years to develop in 3 months, and Rails did deliver on its promises. Since I’ve stuck to the (somewhat enforced) MVC seperation of the Rails framework adding functionality is a doddle, as is maintaining the code. I have, however, found a small flaw in my approach.

The rails URL scheme opperates on the theme of ‘[controller]/[action]/[id]’, where the controller is the name of the controller (duh!), action is the method within that controller which is being called (and is also the name of the view) and id is an identifier (intended for identifing a db record, for example). I am aware this can be hacked somewhat with the Rails cofiguration, but deviating from the intended path for such frameworks often leads to problems down the line when the framework developers decide to fundamentally change the framework such that these hacks no longer work as intended. Anyway, back to the URL scheme. This is all fine and dandy when I have a stock management system with a ‘browse’ controller, which has such actions as ‘list’, ‘view’, ‘pdflist’ and so on, and an ‘edit’ controller which (also) has a ‘list’, ‘edit’, ‘uploadimages’, ‘uploadpdf’ etc. . (I know it looks like the two list actions violated the DRY (Don’t repeat yourself) philosophy, but they operate in fundamentally different ways, the browse one only operates on a specific subset of the database limited, among other things, to just what is in stock.)

My problem is that, although this is fine for a stock management system, I also need to integrate the old parts management system in as well (on the old system this was a HORRIFIC kludge). There are two obvious solutions, neither of which I’m keen on. One is to create a ‘parts’ controller in the existing app, which contains ‘editlist’, ‘viewlist’, ‘edit’, ‘view’, ‘uploadphotos’ etc. . This could possibly extended to move all of the stock stuff into a ‘stock’ controller. I do not like this as it a) feels too much like bolting the thing on, like the old mess which I’m obviously keen to avoid recreating, and b) the controllers would then get very large and the maintainability provided by seperating out these systems will vanish. The second alternative is to create a seperate rails app to do the parts management. As I mentioned I’m trying to integrate these systems, so creating a seperate app for it seems like a bad move towards that end. It would also mean hacking the Rails config to not assume it is at the root url, and setting up the webserver to rewrite urls. It is all hassle I’d like to avoid.

I’m now wondering if I should have use Django instead, where a project (or site) is supposed to be a collection of apps and I suspect that, as a result, the integrated stock and parts management system would be a lot easier to realise. I’m now back into the realm of trying to justify, either way, another rewrite of the system. I will add that Rails has given me some major performance headaches, and I’ve had to re-write portions of my code to not use the Rails helper functions, which I view as bad, as my code now relies of certain aspects of the Rails framerwork not changing, where as the helper functions should (I would hope) be updated to reflect changes made in the future, in order to achieve something of the order of an acceptable performance.

It’s been a while…

I’ve not posted to my blog since the end of May, so after two-and-a-bit months it’s high time wrote something.

Whilst I’ve not been writing, I’ve also not been checking the comments. Due to the amount of spam, I require all comments to be approved by me before appearing on the site, so appologies to all the people who had comments stuck in moderation.

I’ve now been working in my new job for 2 months and it is generally okay. Windows, VisualStudio (2003) and Sourcesafe are all colluding to slowly drive me insane but for the time being I’m keeping the urge to take a Linux LiveCD into work at bay with healthy doses of Ruby and Debian in the evenings.

The one major cock-up I’ve made at work was a MS-SQL script to delete four rows from a table. Another, related, table had been corrupted and every row had been altered to point to the same (one) record in the first table. I had written a script to delete four faulty record and then fix the data in the associated table. Since I was deleting data I, as I make a point to always do, only used the primary key column of the table I was deleting from to ensure only the specific record which needed deleting was dropped. Unfortunately I was not aware of SQLServers ability to cascade delete record, nor was I aware that this feature was in use of the tabels in question. As a result the related table ended up with nothing in it. Whoops! We are waiting for the backup tape to be sent from Derby to Nottingham in order to restore the data to a point before the script was run. Fortunately all scripts which are run on live database servers have to be peer-reviewed, both for syntactic correctness and that they perform the task intended, before they are run so I have someone to share the blame with. I am, as the script writer, ultimately responsible for this mistake (through my own ignorance) however my colleague who reviewed the script should have been aware of the cascade delete and he did not spot the potential problem either. Nevermind.

For the past week I have also been shadowing another colleague who is left the company yesterday to learn about the systems where he was the only person with any knowledge. Last night hosting services, in their infinite wisdom, decided to move all of the servers involved in these systems from one location to an entirely different part of the country. The one thing that could possibly break everything should have now been performed the very night after the last day of the only person who knew these systems! Go go gadget forward planning.
I have a number of other things to write about, but I have to go to work early today in order to be there should the server move cause any problems. Maybe I’ll find time to write some more tonight (I wouldn’t hold your breath, though).

“Life is just one damned thing after another.” (Elbert Hubbard)

Since my last post I have received, filled in and returned all of the paperwork required for my job, which I am now starting on June 10th, one week after my exams finish.

My first exam, neural computing, went well – I had little problem completing the required number of questions without struggling for content, in the case of the essay portions, or forgetting the required equations in the case of the maths. I was quite encouraged by how the exam went, having had severe doubts about my ability to complete the exams satisfactorially in the weeks leading up to it.

My sister, who is still in a secure mental health unit in hospital, now seems to be moving from one crisis to another. In the past few weeks, she had taken a potentially fatal overdose (despite being in a ‘secure’ unit) and has been unable to eat properly until recently as a result. My mother, one of my other sisters and I went to visit her today (my parents have been visiting her almost daily since she was first taken to the unit) where we took her to a bookshop and bought her some hot chocolate in Sinsbury’s cafe. Since leaving her at the unit this afternoon, she has apparently tried to force her way out and has now been sectioned under the mental health act to prevent her from leaving (presumably due to the threat she poses to herself outside of the unit).

The ongoing situation is putting massive stress on the family at home to the extent that my mother now feels unable to go to work and I eventually fled back to Coventry last week (I felt unable to leave earlier in the week because of the state of my mother) as I could no longer cope, despite the fact that it ment leaving my mother sobbing on the doorstep. I feel terrible as a result.

At Church this morning we also found out that the husband of one of the members of the clergy team died suddenly yesterday afternoon, with no apparent cause or warning. As a result the entire service was very subdued and we are all thinking of his wife and children at the moment.

“Life is like an onion: You peel it off one layer at a time, and sometimes you weep.” (Carl Sandburg)

A lot has happened to me recently, so this is going to be a long post mostly about my miserable life – hence the quote.

The third year project report was completed and handed in on time (after much blood, sweat and tears) as was the neural computing coursework.

During the holiday three members of my family ended up in hospital with various ailments, and I am still receiving ongoing treatment for my missing teeth. One of the implants I had failed quite soon after it was inserted, however when the consultant came to fit the false teeth on the other one it too came loose. It has now been removed and the consultant has decided that I am to have bridgework done instead (I was offered the alternative of being refered elsewhere for a more substantial bone graft than was done the first time around followed by a repeat attempt at the implants).

My grandfather ended up in hospital after coughing up blood, has been diagnosed with lung cancer and is shortly to begin radiotherapy. My father has been in hospital to investigate if he has bowel cancer (fortunately the samples which were taked showed he did not) and my sister is in a secure mental unit after attempting suicide at home.

On Tuesday, during the evening, I was returning home (from hospital) when my car was hit from behind by a 4×4 whilst I was waiting to pull onto a round-a-bout. At the time the damage seemed minimal, just a broken tail light (the 4×4 got off without a single scratch to the paintwork!). Further examination at home revealed a dent to the corner of the boot, multiple broken bulbs and a significant bulge to the inside of the boot where, presumably, the bumper on my car has been pushed in. Life’s a bitch. The driver of said 4×4 has admitted liability for the accident so his insurance is paying and Endsleigh (who my car is insured with) have been fantastic. I’m going to be sorry when I have to return the 07-reg courtesy car and get my little P-reg Peugeot 106 back.

On the plus side, I had a phone call at 17:20 on Tuesday asking if I could be in Birmingham the following day for a job interview. I quickly changed my plans and made the necessary arrangements to attend. Following an unexpected test (all programming related questions – what does this code do, what’s the output of this, etc.) I was invited to another room for the interview. At the beginning of the interview the panel of three explained their normal recruitment process, with a first inverview followed by a second interview for candidates they think are suitable possibly followed by a job offer. I proceded to have the interview, in which I discussed the system I have been developing for my holiday job as well as explaining the concept of ‘LAN Parties’. Following the interview I was led to another room whilst the panel chatted among themselves and was then led upstairs to a side room where they proceded to offer me a job on the spot! :)

I am yet to see any paperwork for this job, but it is entirely possible that I may be working straight after my exams. Yay!

People suck…

About two months ago a coworker of mine suggested that I implement a Palm-based data entry program for our stock database system (which I wrote). As I had no experience at all of writing applications for anything more (physically) portable than a laptop I was not overly keen on the idea, and a few hours of me being less than enthusiastic seemed to have kept him quiet. At least until a few weeks later when I was presented with a brand new palm (the company’s (of course!), and now in the less than safe hands of one of my other coworkers) and told to write said application.

Last week I had finished implementing a storage and retrieval system and was just starting work on the facility to edit stored data (a fairly trivial task once it was possible to save a new record and view existing ones). The coworker who initially requested the system duely demanded a progress report, which I gave. I was promptly told that editing existing data was not needed, so I deployed the application. Fast forward to yesterday, when another coworker (the one who actually uses the shiney new palm, and my app) says, “You know what’d be really useful? The facility to store part of the data and to come back and edit it and fill in the blanks later, without returning to the office to use the PC-based frontend.” (or words to that effect). People suck, in this case because they don’t know what they want (or, rather, they think they know what they want and then demand that you provide what you thought they wanted after they told you they did not want that (still with me?)).

On a completely unrelated topic, Vista is still going strong on my laptop with only 2 major gripes at the moment. The first is that it uses well over 1.5GB of memory (of which less than half seems to be accounted for by Task Manager’s process list – and yes that is running with administrator rights, my user alone seems to only be using ~200MB although IE7 doubles that when running) which means doing anything (from loading an application to compiling a test build of a program) involves waiting about 3 minutes for Vista to swap enough stuff to disk(the laptop has 1GB physical RAM) to perform the task it was asked to do. The second is that I can not seem to lay my hands on a decent free archiver which works with Vista, my usual choice (IZarc) has major issues, as does 7Zip and several other ones I’ve never heard of before but tried. At the moment I’m using the WinRAR trial and hopefully IZarc’s issues will be resolved before the trial expires. I have not yet had chance to play about with getting WMP11 or MPC to play my music collection due to work, coursework, a sister in hospital and other bits and pieces I have to do to survive and pass my degree. I will probably have to activate Vista soon too, hopefully it will require less effort than the 5 calls to Microsoft it took to activate (pre-installed!) XP on my old laptop.