Tomato Sauce

An easy tomato sauce recipe to make in the microwave.

Slice one onion and put it in a microwaveable dish. Add one tablespoon of olive oil and microwave on high for three minutes.

Add one tin of chopped tomatoes, some tomato puree (one tablespoon or one of those little tins). If you don’t have tomato puree, ketchup is fine but not too much. If the tinned tomatoes are budget supermarket ones, add one tsp sugar. Add pepper, salt and herbs (basil is good) and microwave for three more minutes.

If you have a hand-blender, “zuzz” the mixture until it is coarse rather than actually chunky. Leave to stand as long as you like, then when you are serving up the food, pop it back in the microwave for another minute.

Extending DokuWiki’s Authentication Classes

DokuWiki is a fine product, and its extensibility is a big element of that. I’ve known for a while that it has different authentication classes, and I’ve even used some of the different ones it comes with. Recently I had cause to write my own, to marry up with some user information stored in an Oracle database table, and used to access the company intranet. Working with DokuWiki’s skeleton classes to create my own was much easier than I expected and here’s my experience.

Choosing the class to extend

Since my requirements are pretty simple, my new class extends auth_basic – and I used the plain.class.php that comes with DokuWiki (for plain text authentication) as a template to guide me.

The first step was to chop out most of the functionality. This is done by setting the class’ cando properties to false, which was quick. My system has all its user maintenance and so on done elsewhere so I don’t want users to be able to change passwords or anything. My declaration now reads:

class auth_symphony extends auth_basic {
    var $users = null;
    var $_pattern = array();
    /**
     * Constructor
     *
     * Carry out sanity checks to ensure the object is
     * able to operate. Set capabilities.
     *
     * @author  Christopher Smith <[email protected]>
     */
    function auth_plain() {
  $this->cando['addUser']      = false;
  $this->cando['delUser']      = false;
  $this->cando['modLogin']     = false;
  $this->cando['modPass']      = false;
  $this->cando['modName']      = false;
  $this->cando['modMail']      = false;
  $this->cando['modGroups']    = false;
      $this->cando['getUsers']     = false;
      $this->cando['getUserCount'] = false;
    }

Getting the information to dokuwiki

I included the standard library that we use here with all PHP pages, that handles things like database connection setup and so on. Then I altered the function _loadUserData(), creating a new empty array for $this-users and then then running a select statement and populating the array with the results. I found it useful to get the wiki working with plain text authentication first and just a couple of users set up so I could observe the output of the various functions. Here’s the altered function:

    function _loadUserData(){
    $this->users = array();
	

$L_sql = "
SELECT u.user_name
,u.extranet_pass
, d.dept_code
,u.full_name
,u.email
FROM vis_users u
, vis_subdepts d
WHERE d.subdept_code = u.subdept_code
AND u.extranet_valid = 'Y'
";

$L_bind_in = array();

$L_results = exec_sql($L_sql,$L_bind_in);

foreach($L_results as $L_result) {
$this->users[$L_result['USER_NAME']]['pass'] = md5($L_result['EXTRANET_PASS']);
$this->users[$L_result['USER_NAME']]['name'] = $L_result['FULL_NAME'];
$this->users[$L_result['USER_NAME']]['mail'] = $L_result['EMAIL'];
$this->users[$L_result['USER_NAME']]['grps'] = array('user',$L_result['DEPT_CODE']);
}
}

if anyone can make any suggestions about pasting clean code snippets in textpattern, I’d be grateful! In the meantime, I apologise for the state of the above example

I removed the functions for creating, modifying and deleting users as I had already told my class it couldn’t use those.

The results

All in all this was quite simple to get working, and DokuWiki is designed to have its authentication functions replaced in this way which is invaluable. We also created a new template for the site and hey presto we’re ready to go with no further modifications1 and no hassle when upgrades come around.

1 OK so actually I added some class definition to the breadcrumb hyperlinks because I changed the bar colour, but that’s almost no modification!

Mortgage Application

This whole house buying lark is progressing quite well, or at least it feels like it right now. Since I last posted we’ve been to the bank and made the final mortgage application, passed the final credit checks and had the thing approved. Next they send us the final paperwork to us through the post to sign. Filling in the forms was pretty tedious – as was talking about income protection provision and pensions and so on but we got there in the end.

We’ve instructed a solicitor and they sent us a big complicated letter yesterday. Actually, calling it a letter is a bit of an understatement, a novel is nearer the mark. I waded through it last night and had to sign all sorts of bits of paper about modifications made to the house, searches required and who knows what else. The language makes it seem big and complicated, but once you read through it and see past the sheer volume of paper then it isn’t too bad.

The surveys should be happening next week some time so we’re waiting for those and the searches now … fingers crossed for everything being in order!

Offer Accepted

Well, we had an offer accepted on a house yesterday which is very exciting! This morning we instructed a solicitor, he will do all the legal stuff for us. I’ve also spoken with the mortgage provider and we’re off to see them on Saturday morning. We have to provide a load of paperwork like payslips, bank statements, ID and proof of address so something tells me that tomorrow night will be a frantic root through the flat to find all the relevant documents!

All in all I’m quite excited but trying not to be too excited as there is plenty of scope for it all to fall through! It will be really great to have a place of our own though – all our stuff is in storage at the moment and I can’t even remember what furniture we really have. One thing is for sure, its going to look quite lost in the new house as all our stuff was bought for a small, modern 2-bedroom terraced house. Now we’ve got a 1930s 3-bed semi and its on quite a different scale!

Arranging a Mortgage

Well, we’ve taken the first step and been to see a few banks about getting a mortgage. I have to admit that we did stick to the big names – Halifax, HSBC and Yorkshire Building Society. My partner is a contractor with short-term contracts, which on paper makes him look quite unemployed! Yorkshire Building Society said they couldn’t recognise his income which ruled them out but the other two were very helpful.

An appointment at HSBC later [1] and we’ve got an agreement in principle for way more than we intend to borrow and its off to the estate agents.

We’ve now seen a house we like but its a bit (very) dilapidated inside so we’re just thinking of a number now and will be offering later today or tomorrow.

edit: update! see offer accepted

1 That was 29th August, 2006, for reference. We might want dates when its all over!

Crochet Love-Knot Wrap

You might think that I’ve been a bit quiet on the crochet front recently … and you’d be right. What’s actually happening is that I have been working on a surprise project for my sister’s birthday and didn’t want to post about it until I had given her the present1!

So here goes. I made for my little sister’s 21st birthday last month a wrap. Its rectangular, the dimensions of one of those pashmina scarves. The stitch is a “lover’s knot” which is much easier than it looks. I had a hard time getting started with it but once you learn the stitch its quite easy. The hard part was easily keeping all the loopy stitches the same amount of “loopiness” so the grid stayed the same size. Here’s a closeup:

The pattern was originally for a triangular shawl, it starts from a point and grows out diagonally, but it worked perfectly well to put corners in and work it that way instead. The result is much more versatile too – here it is folded in half:

For the trimmings, some basic beads with tassels. I chose irregularly shaped and non-matching beads which worked really well. The wrap itself is cotton DK plus a fluffy 4ply mohair type yarn together and the slightly mismatched beads stop it from looking too tidy:

Any questions please just add a comment and I’ll reply as best I can.

Diet Oracle – working with Oracle eXpress Edition

I’m a big oracle fan, which might seem a bit strange in a world dominated with the LAMP stack and its exclusive use of MySQL or, at a push, Postgresql. That’s not the entire world obviously, that’s my world and it is definitely MySQL-orientated. In the world of work however, I’ve had extensive exposure to Oracle and think its great, so I was very excited when I saw the free mini-Oracle be released earlier this year. These are my first experiences of working with it.

Installing Oracle XE on Windows.

OK so I’m not actually going to use this on windows really but when I tried to install this on Linux I had a major problem right at the outset. There is a choice of either a .rpm or a .deb file to install from and since I had sent my sysadmin to the supermarket, I had no idea which I needed! The windows installer promised to be point-and-click and since I’m actually running Windows on one machine at the moment (grr wireless drivers grr) I was tempted by the idiot-proof windows installer so I grabbed that.

Well, idiot-proof was a gross understatement! I ran the installer, it asked me where I’d like the files put and then to input a root password, and the next thing I know its all done and inviting me to log in. I’ve installed Oracle many times on Windows and believe me, its not supposed tobe this easy. Anyway it works, I’ve been chattering to it on command line and everything is cool. The next step is to get it installed under Linux – it turns out that our Ubuntu server would like the .deb file best, so I’ll try that out and keep updating here.

My Brush With RSI

RSI (Repetitive Strain Injury) is the bogeyman of software developers’ worst nightmares. I think everyone knows someone, or of someone, who was once a great programmer and is now a primary teacher, porter or some such, and all because of this RSI thing. So here’s my experience, because it came true and happened to me.

My experience

I have typed for in excess of ten hours a day, for weeks at a time, at a number of times in my life. Since graduating three years ago I’ve worked exclusively in development of different kinds. Since long before that I have been able to touch type and took jobs as a temporary secretary and typist during my university holidays. So I’ve had a fair amount of exposure to serious typing requirements in the past and no problems.

I first noticed a problem about three months after starting a new job, I had aches and tingles in my fourth and little fingers in both hands. This turned into a feeling of having my hands attached to my arms wrongly – I kept trying to “click” my wrist joints into place all the time and it was getting quite painful. We do have funny furniture at work since the company’s main business is manufacturing furniture, unfortunately not for offices1, and I just couldn’t make it fit me.

I requested a review of my workstation and over the next few weeks a series of people came and measured the space, prodded me and my chair around, fidgeted with my keyboard and generally wrung their hands in despair. It took five weeks for any modification to be made to my desk and by that time I was on some very strong anti-inflammatory medication following a diagnosis of tendonitis and eventually had to call in sick for a few days as my hands were so painful I couldn’t even put the mon the keyboard. I’d like to point out at this stage that I am not in any way criticising my employer, my work area is hard to modify and it is a large organisation which by definition means that it takes time for the bureaucracy to get its internal cogs turning.

When I went to see the doctor I had pains in my fingers, wrists, elbows and also kind of between the two bones in my arm (like what you get after playing badminton when you haven’t for ages). I also lost all grip in my hands, I couldn’t get the top of a bottle of milk or squash or hold anything heavy (like a pan of water). It was horrible but he assured me that I was unlikely to suffer lasting damage and prescribed anti-inflammatories and as much rest as was possible. By this time I wasn’t posting to this site, working on any of my other coding projects, or even doing any crochet. Even holding a book to read was quite painful!

After my desk had been modified, my hands immediately became much less painful although discomfort remains today (two months later). My employer had me see their doctor and he advised that the damage to the tendons was likely to take some time to recover and I might expect some discomfort for a couple of months. In fact this is the case and I am now finding that an ordinary wrist support helps quite a bit, but my hands are painful after a few days of typing. Coding and sql-querying are much worse than straightforward prose, such as this article, I think because the keyboard is laid out to make words easy and punctuation not necessarily so!

At home I use the laptop and sit wherever I like – usually on my feet, sounds daft but I’ve coded for years curled into a ball and it seems to work! I use an external shallow action keyboard (like a laptop one, the keys don’t go down very far) placed on my knee on a cushion which seems to bring it to a comfortable height. I use Opera which can be controlled pretty much entirely from the keyboard, its got plenty of keyboard shortcuts and also spatial link navigation where you just hold down shift and press the arrow keys to navigate a page’s links. Its great and means I don’t have to use a mouse – I don’t think its the mouse that’s the problem but switching between the two certainly provokes a twinge.

In Conclusion

Well I’ll update this article as things improve but for now I think its enough to say that I’m still programming and feel that I can continue to do so as a full-time occupation. I am still suffering the same pains but I was warned it might take time to heal so fingers crossed (I can still do that!) that’s all it is. I wanted to write about this as its a big issue for programmers and other keyboard-users and I really felt I benefitted from their stories and honesty. I almost feel like the whole thing was a bad dream, and hopefully that’s all it will be in the future – just a dream.

1 Actually we make kitchens, bedrooms and bathrooms, so the offices are miscellaneous drawers with a kitchen worktop on top – it works a lot better than it sounds!

A Tale of Two Jobs

Well, not an actual tale, exactly, but some general anecdotes.

Since moving “oop north” (to Leeds, West Yorkshire, UK), my partner and I have job-hunted once each. Once for me when I relocated up here, and once for him just at the moment as the fixed-term contract that brought him here in the first place has ended. In both instances, we’ve ended up with two good offers and no real way of choosing between them.

The trouble with jobs is that you can never really know how they will turn out until you’ve been there six months. This isn’t an option when you have 24 hours to make a decision that will affect your day-to-day life for the next two years or so, so how can you pick?

Criteria for choosing

This can be straightforward. If you have large credit card or mortgage payments to keep up with, or an expensive habit like an extreme sport, then probably you want the one with the biggest paycheck. If one job is a step on the ladder or uses skills for a job you want to do one day, then take it, even if its less money. If one job is an hour-long commute and the other is a walk across the park, question yourself whether any benefit from the further one can outweight the sense of self you will lose from that kind of journey. If the recruiter annoys you enough then you might allow that to help you decide (I have turned down interviews before purely because I couldn’t face talking to the recruiter again!). If one company is straight with you and calls when they say they will, then that will probably give you a good feeling that you mean what you say the rest of the time. If you just have a good feeling about one job, environment or set of people, then follow your instinct – in this case that is your best indicator.

Once you’ve made your choice, train your brain to stop wondering “what if”? Even if the job you chose doesn’t work out the way you wanted, you get there and the people who were so friendly when you were shown round seem to have had their personalities surgically removed, or the training and development policies have been allowed to mysteriously evaporate, you must never wonder what might have been. For down that path leads despair.

Difficult choices

Personally, I couldn’t really tell you why I chose the way I did this time around. The two jobs used different subsets of my skill set and neither had any obvious progression with them although both would be great stepping stones for when I grow up and decide what I want to be. I can give lots of pros and cons for either choice. Wake up in the morning, and see what you feel, then act on it immediately. After six months in this job, its working out OK, and who’s to say what would have happened if I’d chosen differently? It is our instinct to think that we might be missing out, that the grass is greener elsewhere, that’s what makes us take risks and move on to the next place at all!

I spoke to a guy in a bar last night who told me that when he left university, he’d had two job offers – one for a web company and one for a games company. The web company offered more money and he took that job, but he’s always wondered what it would have been like to make games for a living. My advice: just don’t wonder! [1]

1 Actually I told him he had made the right choice, I did work in games for a while and although it was fun, it is hard work and totally different to the “normal” software industry, I’m glad I did it but I’m also glad I’m doing something else now.