Friday, October 12, 2007

Sunday, September 23, 2007

Nothing ever happens outside our house...

...until something like this.
I'm not one of the ones trapped inside, but we can only leave out the back.
The first I new about it was some people crying loudly and someone on the floor outside next door.
I just hope the girl's alright.

Monday, September 17, 2007

The law of ringtones

Ringtones seem to work off an x2 formula. x is the importance of the person, and x = 0 means the person is neither particular important or particularly unimportant.
It's worthwhile noting, however, that the ringtone of x < 0 is more likely to be some kind of pop music, whereas the for x > 0 it's more likely to be one that's built into the phone.

Sunday, August 19, 2007

stop the car

I've just seen this page of south park people animating some philosophy by Alan Watts. The first one of the page seems to offer a solution about some the "what am I doing with my life questions" I've been having - that is, rather than worrying about the end result, we should be concerned with the process of getting there.
Obviously, this is not an endorsement of hedonism, but rather a reminder to myself that, rather than concentrating on the target, I need to be more concerned with what's going around it.
It's a bit like when you're driving through a beautiful part of the country, and you're concentrating so much on the driving that you miss the beautiful scenery. You just need to stop the car and look around to see how magnificent it is.

Sunday, July 22, 2007

Seven Days

That how many days I've worked in my new job. I getting a little tired of typing "new job", and I probably wouldn't have even looked at this one if Gary hadn't pushed me forward for it, and I got it simply by having a chat with someone who's not even my boss.
It's gone quite well, although I do feel a bit overwhelmed by it. I think Gary's been running the office, and so it may not have been the best idea to start when he was away.
Since he's been back in the office, I've kind of discovered I've been left to pick up one project whilst he goes off and rescues the other one. This is fine, but with a few exceptions.

Firstly, it would have been nice to be given time to get to grips with what the project is, what the technical constraints on it are, and some idea of deadlines before the day before a customer visit (and two days before an apparent payment deadline, which may in fact not be for another four days).

Secondly, the codebase was, and still is, in a mess.
The Data Access Layer is a mish-mash of some code generated stuff (which I have nothing against, just if you're going to code-gen stuff, make the code-gen part of the build), which is quite comprehensive but very difficult to change, some copy-and-pasted components, which to me seem buggy and, in some cases, wrong, and some hand-written stuff to try and hide the mess from the application.
The UI layer is a nasty mess - mostly prototype code which has been altered to use the Data Access. Lots of messing around with values in a datagrid, rather than using the business objects.
The "business layer" is the prototypical Anemic Domain Model.
Overall, there's quite a bit of duplicated code, long methods, and comments explain the what, not the why. Worst of all, this is all legacy code (no tests, and not factored for easy testing). I'm so glad I bought a license for Resharper.
In fact, as I think about it, I'm going to put together my library to take in tomorrow.
Goals for the rest of the week are:

  • Finish the removal of some of the heavy weight code-generated stuff I started on friday.
  • Refactor out some of the business logic from the UI.
  • Educate the team on how to write loosely coupled code. Simple things like CODE TO INTERFACE, LAW OF DEMETER and INVERSION OF CONTROL - perhaps even start a page-a-day club on Jeremy D. Miller's excellent Write Your Own CAB series. (I know I could do with getting the chance to catch up with about half of it all of it).

Saturday, June 30, 2007

Too Quick To Judge


Marbles, originally uploaded by b3ardman.

So, anyway, about the marbles...
Turns out that the parcel that they tried to deliver on my birthday was a tub (with a sack included) of marbles.
I've not been able to confirm that this was from the offender, but all the clues are there.
So, I retract my accusation, and my thanks go out to the purchaser of the marbles.

Friday, June 29, 2007

Beardy Box: Welcome To Beardy Box

I've started a separate blog for all my nerdy programming stuff. If you want to see it, it's over here: Beardy Box: Welcome To Beardy Box

Thursday, June 28, 2007

Marbles

Many years ago, a friend, and colleague at the time, promised me a sack of marbles if I did a job for him. The marbles never appeared, despite polite reminders.
I met this friend recently for a drink and chat, and, what with my birthday approaching, he said he had a great idea for a present. He also told me that, if I had a good enough memory, I'd be able to guess what it was. I didn't get it at first, but I soon realised he meant the marbles. He confirmed this, and said he'd seen some good ones.
Anyway, my birthday has been and gone and there are no marbles.
I'm not going to tell you the offender's name, but those who know about this will know who he is. Needless to say, if he offers you a sack of marbles in return for you doing something, don't believe you'll ever get those marbles.

Monday, June 25, 2007

Umbrellas

I don't usually an umbrella, because I think they are a complete waste of time. Instead, I'll don my waterproof jacket and over-trousers and face the weather with impunity.
However, because my over trousers have got a bit muddy (the sign of genuine use), I've been using an umbrella for my commute.
There are a number of reasons why this isn't going to happen any more:

  1. On the train, there's nowhere to store a wet umbrella.
    I usually end up having it crushed against me.
  2. Umbrellas only keep your head and shoulders dry.
    Whilst I don't get rain in my face, the rest of me get soaked.
  3. Umbrellas don't protect you from cars, one of which will inevitably drive through a massive puddle you're cautiously passing. Bastards.
  4. Umbrellas have a distinct design flaw in that they don't turn inside out without breaking.
    Usually, and this is anecdotal observation, when there's rain enough to use an umbrella, there's also a strong breeze. All you need is to walk past the end of a building that has been protecting you from the wind, and your umbrella's fucked.
  5. Umbrellas are too easy to forget.
    It rains on the way into work, then it's sunny on the way home, so you forget about your brolly until the next morning when it's raining again, and you're cursing yourself because you left your brolly at work.
So, anyway, that's a brief overview of why I'll be binning the brolly and wearing my wet-weather gear again.

Monday, June 11, 2007

Taking Money

No owning a credit card, I'm often disappointed when web stores accept neither debit cards nor on-line payments (such as PayPal).
I think it's a bloody disgrace, especially as you only usually get to find this out when you've been through the tortures of registering on a site, and you're just about to pay.
Most recently, this experience was with Expedia.co.uk. They say the take Switch/Maestro, but not for all purchases. So, when it came to buying flights to Thailand (these cost > £1k for Amy + I), I was disappointed when I got through their procedures, entered passport numbers, set up meal preferences, only to find they didn't want my money.
Anyway, we ended up buying them from someone else.
The point being that if your site doesn't serve your (potential) customers, they will go somewhere else. I know I did.

Tuesday, June 05, 2007

Shuffling a List in C#

Inspired by this post:

static Random random = new System.Random();
public static IList<T> Shuffle<T> ( IList<T> deck )
{
  int N = deck.Count;
  
  for ( int i = 0; i < N; ++i )
  {
     int r = i + (int) ( random.Next( N - i ) );
     T t = deck[r];
     deck[r] = deck[i];
     deck[i] = t;
  }
}

Monday, June 04, 2007

Lazy Reporting

I was looking at this news story on the BBC's Website (my brother lives in North Tawton). However, the last few lines of the story are some of the laziest reporting I have seen lately (probably because I don't read a local paper):

Another neighbour, who would only give her name as Jo, said: "It is always a tragedy when kids are involved."

So, looking at this, there was some lady who wouldn't give her name who said something really generic, and frankly wrong.

Cambridge Dictionaries define tragedy as
  1. a very sad event or situation, especially one involving death or suffering, or a play or literature about death or suffering.
  2. a play about death or suffering with a sad end, or this type of play generally.
So, it's not always a tragedy when kids are involved, it's a tragedy when someone dies or suffers.
I pay a license fee for this rubbish.
 


Wednesday, May 30, 2007

What do your objects do?

I was thinking about how most of the system at work has objects that don't do anything (yes, this is the Anaemic Domain Model code smell).
Last week I broke up a control and refactored it into a Model-View-Presenter, as it allowed the right amount of code reuse for what I was trying to do. Also, I extracted some interfaces (including one for the presenter).
Today, I've been trying to explain this to a colleague. I think I missed the point about programming to interfaces rather than implementations, and also the colleague got rather confused about why he couldn't reuse the interface to do his different control. I think mentioning something about intent.
I need to remember that even when following established patterns I need think about what I'm coding.

When you work in a city

it's easy to forget that other people might be on your train for something other than work.

Tuesday, May 29, 2007

Seven Ages of Rock

On saturday, I saw the "Art Rock" episode of Seven Ages of Rock. Apart from the fact that some of it was progressive rock (which put me off entirely!), I wasn't that taken by it. Primarily, it seemed to praise Pink Floyd and David Bowie. Fair enough, I think Sid Barrett and the Bowster have some influence, but Bowie himself, on the program, admitted that he followed Barret very closely.
Then, at the end, after spending a sizeable chunk of the program on Floyd's Wall (the one they built during their shows), they bought on Genesis. Again, worthy of a mention, if only for Peter Gabrielle's  outstanding contribution to music, but really.
The other problem I have with the series is that it completely ignores Post-rock. Imagine a one-hour show charting stuff like Slint, Godspeed You Black Emperor, and Mogwai. Now that would be worth watching, rather than all the Dad-rock chart tunes that the shows have so far covered.

Bank Holiday

Well, that was a reasonably uneventful bank holiday weekend.
Highlights:

  • Failed Chocolate Truffles (that instead made delicious chocolate mousse like dessert)
  • Vegan Moussaka - perhaps not exactly a "light bite", but a filling meal, especially with home cooked bread.
  • This is England - disturbing and slightly lightweight film about skinheads in the 1980s.
  • Walk up to see Eastergate Bridge - the bridge itself was a bit disappointing, but the walk was really beautiful. Got really close to some swallows who didn't seem to mind us at all.

Friday, May 25, 2007

Some days...

Some days I can really focus and get lots done. Other days, like today, I find it really hard to focus, and I end up writing lots of blog posts and surfing lots.

Lunch

've got sushi for lunch. I made masses of it last night, so I've got 12 pieces. That should see me through 'til next week.

Wednesday, May 23, 2007

2 Screens

I've been given the use of an extra monitor at work - so now I have one 19" and one 17" monitor on my desk. I've been given a bigger desk too, but that's by the by.
I have to admit that, mostly, I still use the 19" for the majority of my work, and, as I'm doing web work at the moment, use the 17" as a preview screen.
Windows XP works flawlessly with more than one monitor, and there are a few utilities you can use to add a few niceties. Of these, I've been trying UltraMon out, and it rocks. As well as giving each monitor it's own task bar, it allows you to do things like have one background across both monitors (making a massive panorama), have separate screen savers, and a host of things I've not even tried. I wouldn't say it's essential, but it's definitely worth the tiny cost.
I really like having two monitors - it allows things like having two versions of code next to each other, VS2003 + VS2005 visible simultaneously, and generally a lot less swearing when trying to find the right window - with more of them visible, I can find the one I want more easily.
Despite this, I think that if I were to buy a second monitor at home I'd try and make sure it was exactly the same model as the one I've currently got (or buy two new ones of a different model). At the moment, the 17" at work is just showing colours differently to the 19" and, although with the different pixel size (they're both 1280x1024), it's not easy to switch back and forth quickly.
That aside, I'd definitely recommend - I really didn't think it would make as much difference as it does.

Wednesday, May 16, 2007

My Glasses Need Cleaning

I'm surprised I can see anything at all.

Monday, May 14, 2007

Oh rennet

From chris: http://www.vegsoc.org/news/2007/mars.html
Amy's very pissed off, as Minstrels are her comfort food.

Tuesday, May 08, 2007

Why Comments are Evil

 return false// raise exception

Wednesday, May 02, 2007

Oh shit...

...I actually wrote the words "creative avenues" in an email I just sent.
I laughed at myself when I wrote it, but now I'm worried other people will think I meant it.
Oh shit.

Wednesday, April 18, 2007

Vegan beers.

Here's a really great list of vegetarian beers.

Black Sheep Ale...Is it veggie/vegan?

Well, after a quick email to the brewers (who replied in a couple of minutes), it conspires that Black Sheep's bottled is veggie, but cask isn't.
For the technically minded, this is because the bottled is filtered and therefore doesn't have finings added.
Despite what brewers might try to tell you, isinglass is not a by-product of caviar (it's now more often made from other fish), just like leather isn't a by-product of beef (by weight, it's the most valuable bit of a cow).

Fake And Ale Pie

Here's my recipe for a vegan pie that I made for dinner last night. I used Black Sheep Ale*, but probably any ale will do. I've mostly been making pies in a 6 inch sandwich dish. This recipe should provide enough pastry and a little too much filling for that. It feeds two with another portion left over, so might do 4 if you serve if with plenty of other veg (roast potatoes and broccoli spring immediately to mind).

*This is reported as animal free, although their website says they use isinglass finings. I'm checking this out.

It took me about 1 1/2 hours to make this and some roast potatoes, so it's not really a week night meal. You can prepare it, ready to bake, and then freeze it. It'll bake straight from frozen, although it'll take slightly longer than 25 minutes.

For the Pastry:

170g (6oz) Plain flour
85g (3oz) Vegan margarine
Some cold water
Pinch of salt

A small tumbler of soya milk to brush the top of the pie with.

Put the flour and salt in a bowl.
Rub marge into flour with finger tips until it's like breadcrumbs.
Add a little water and mix in. Repeat until it forms a slightly sticky ball.
(Only add a tiny amount of water at a time, as it's easy to fuck it up. If you do put too much water in, add a little more flour. Again, only do a small amount)
Put the whole bowl in a plastic bag and put in the fridge whilst you make the filling.

Put the oven at around 220C (slightly hotter is fine, but if yours goes stupid hot then don't make it too hot).

For the filling:

100g (4+a bit oz)  dehydrated TVP chunks
1 Medium/large carrot
1 medium onion
Some garlic (optional)
1/2 bottle Black Sheep Ale.
2 teaspoon cornflour
100g frozen peas
Seasonings (I used some stock power, yeast flakes, dried parsley and a bit of salt and pepper).

Peel the carrot, and slice into quarters lengthways. Then cut across in to 1/2cm thick quarter circles.
Put the TVP chunks and the chopped up carrot in a pan and just cover with water. Boil until the chunks are rehydrated (this only usually takes a few minutes).
Drain the water off (you probably want to chunk it away).
Chop the onion, and fry it up with the garlic for a bit. Then add the TVP chunks, the carrot and the Blacksheep Ale. Sitr, then add some seasonings (dried stuff, you can leave salt + pepper 'til the end).
Bring it to the boil and then left it simmer, with the lid off, stirring occasionally.
Whilst it's doing this, mix the cornflower with some water, to form a smooth, cream like, liquid, and then add this to the rest of the stuff in the pan.
Then add the frozen peas.
You want there to be the ale to reduce to about half it's size.

Making the pie:

You can be rolling out the pastry while the filling is cooking. If you've got the time, then it's best to let the filling cool completely. In that case, you can leave rolling out the pasty until it's all ready to roll. If you're hungry though, don't worry about the cooling.

Grease the pan.
Divide the pastry into two, slightly unequally sized pieces. Roll the large piece out and line the bottom of the pan with it, trimming it to size.
Roll the top out too, but don't put it on yet.

Put the (now cooked) filling in the pan, and brush some of the ale mixture over the edges of the pastry.

Put the top on and trim to size.

Cooking:

Brush the top with soya milk (this helps it brown), and put in the oven for about 25 minutes, until the top is slightly golden (it won't brown that much because it doesn't have any milk or butter in it).

Drink the rest of the bottle of ale.

Serving:

When it's cooked let it stand for a few minutes before serving. Always serve yourself first as the first slice is the one that falls apart.



Monday, April 16, 2007

Information overload?

Compared to stories I hear of people monitoring 100s of feeds, I don't subscribe to that many blogs...however, I generally read them either on the train to work (thanks to t-mobile for flat-rate mobile internet!) or at work when I'm waiting for the compiler to finish.
Having just come back from a week of almost 0% computer use, there were a few posts waiting for me. Most of these I've scanned through, read, or simply marked as read. This done, it's left me with a dozen posts that I'd love to look at at some point, but either lack the enthusiasm or the time for at the moment.
So, inspired by GTD, I've now got a "someday/maybe" tag for posts. This way, I can easily see new stuff, but I've also got a reference to those which I might, either at home or on a delay train, get round to reading.
Thank goodness for tags.

Sunday, April 08, 2007

What's Happening To Green & Blacks?

Amy's Mum bought us some lovely easter goodies, including two Green & Blacks Easter Eggs - Maya Gold and Dark Chocolate.
There was, however, one thing missing off of the Dark Chocolate one: the Fair Trade mark.
It was just matter of time before this happened, but I'm disappointed that it's happening in such a subtle way: first Green & Blacks starts producing a non-Fair Trade (unfair Trade?) easter egg, next it'll be their normal chocolate, and then what? No longer organic? Cadbury said they'd leave G&B alone, but it seems it's slowly extending it dominion over it.
Fortunately, there are still plenty of other brands who can see the point in producing delicious fair trade, organic chocolate, and I'm taking my trade to them. Unfortunately, they're not as ubiquitous as G&B.

Thursday, April 05, 2007

Nice day? Nasty Day?

I don't often comment on the weather, as it's dull as shit.
However, today, when I left for work, it was beautifully sunny. So much so, that I didn't bring a jumper, just my thin jacket.
As the train hit the M60 (the big one round Manchester), it suddenly got very foggy and cold. When I got off the train, I could see my breath in the air.
What the hell is going on? It's about 20 miles from my house to Manchester, but the difference in weather is so stark I'm dress inappropriately.

Friday, March 30, 2007

Murphy's Law

I'm to London today. This means sitting on a train for over two hours. So, what do I do? That's right, I forget the phone with the big memory card so I can listen to music and block out the sounds of moaning as those who didn't have the foresight to book a seat raise as we're told of yet another delay.

Chaturanga Dandasana

Chaturanga Dandasana makes the front of your shoulders/armpits hurt in the most unusual way.

Friday, March 23, 2007

Entirely redundant C# 2.0 code

private static IEnumerable< int> Range ( int start, int end )
{
for ( int i = start; i != end; i = (start > end ) ? i - 1 : i + 1 )
{
yield return i;
}
yield return end;
}

private void PopulateDaysDropDown ( )
{
foreach ( int day in Range ( 1 , 31 ) )
{
DateOfBirthDay.Items.Add ( day.ToString ( ) );
}
}
The only benefit of this is Range accepts start > end, so I could equally well do
foreach ( int day in Range ( 31, 1 ) ) {  //... }
I'm determined to find a valid use for yield return somewhere!

Tuesday, March 20, 2007

"The Air Car - Zero Pollution and Very Low Running Costs"

http://gizmag.com/go/7000/
Just one question: How does the air get compressed in the first place?

Deployment

Just finished the most nerve racking deployment of my life.
Here are some things I need to remember:

  • Don't think you can finish stuff up whilst doing the deployment
    Rushing stuff when you're under pressure is a sure fire way to mess up royally.
  • Deploy when no-one's looking
    It's no fun finding and fixing bugs when you've got the whole company's watching.
  • Don't trust sourcesafe
    It's shit. It can't branch or merge properly. It corrupts all the time. It's a steaming pile of cow shit. Don't trust it.
  • Remember to set your alarm
    Waking up an hour later than you meant to and then rushing into work doesn't help your feeling of calm
  • Don't trust anyone else's code
    Unless you're happy with the rest of the team you work with, make sure you've got tools and monitors to see what's going on.
I'm sure there's other stuff that I need to remember, but I'm drained know. I'm going to spend the rest of the day trying to look like I'm doing work.

Friday, March 16, 2007

Ruby to screen scrape whether my train home is on time

require 'hpricot'
require ' open-uri'

while(1) do
html = open( 'http://www.livedepartureboards.co.uk/ldb/sumdep.aspx?T=MAN' )
doc = Hpricot(html)
results = doc.search("//td:eq(0)[text()='Middlesbrough']/../td:eq(1)[text()='17:55']/../td:eq(2)/text() ")
results.each { |r| puts "#{Time.new.strftime('%H:%M')} :\t#{r}" }
sleep(60)
end


# ruby is such fun!

Wednesday, March 14, 2007

Is Air Travel being made a scapegoat?

Yesterday, Gary made the important point about why Air Travel is currently being targeted for carbon reductions.
Make no mistake, mile for mile, air travel is the most polluting way of travelling, and it is predicted to expand in the future. But, this aside, Gary's point was that air travel accounts for such a tiny proportion of everyday travel (~3%) that, if it suddenly becomes twice as expensive, there's not going to be too much of a fuss.
I also think people expect air travel to be expensive - I was surprised that a return flight from Manchester - London was ~£70, which is tempting when an off-peak return by train is ~£60.
We've recently seen the uproar created by suggesting that the road users pay per mile. No politician is going be be popular by suggesting the cost of using your car should reflect it's impact on the environment. British society is too focused around the car for that.

Monday, March 12, 2007

FUCKING TRAIN TICKETS

WHY WHY WHY WHY WHY do train companies use session state to store my itinerary?
I used a tabbed browser, which means changing the itinerary in one tab fucks up the itinerary in the other tabs. fuckers.
It's just taken me an hour to book a return journey because of this evil fucking ploy.

Thursday, March 01, 2007

?? - C#'s Secret Operator

If you look at the MSDN documentation for ??, you might think that ?? is only useful for Nullable Types. However, it can be used with any non-value object.
So, in place of

return x == null ? default : x;

You can now write:

result x ?? default;

Cryptic? yes.
Wrist friendly? marginally.

I'm currently using an API that returns null instead of empty arrays. The basic construct now becomes:

ContentData[] dataToDelete = content.GetChildContent (folderId, false, "Title");
foreach (ContentData itemToDelete in dataToDelete ?? new ContentData[0] )
{
    content.DeleteContentItem( itemToDelete .Id);
}

This way I avoid NullReferenceExceptions, and get away without putting extra 'if' statements in.

Tuesday, February 20, 2007

Cars

There was someone on the radio yesterday morning talking about the expansion of the London Congestion Charging Zone, and arguing that it was pointless, and that it's wrong to charge people to use their own cars.
This is very much in line with the 1.5+ million people who've signed the petition against charging road users per road use.
The fundamental issue in this seems, to me, to be about whether it's your right to use your car as much as you god well like.
This is the mindset that the years of Thatcher rule has instilled in us, providing society that, without a car, you are nothing. This mindset pervades pretty much everything.
However, if we take the view that simply owning a car does not mean you have the right to drive it, then things like Congestion and Pay Per Use make a lot more sense. You have to buy your right to use your car. If the cost of ownership remained about the same, but the cost of using your car suddenly skyrocketed, you'd have to whether it was worth it everytime you got in your car. Similarly, if you consider using your car a priviledge, not a right, you spend more time considering every journey.
Obviously, all of this is completely pointless without a reliable public transport system, which is the one thing we don't have in this country.
I honestly thought I had a coherent thought about this before I wrote this.

Monday, February 19, 2007

openssh-server

If apt-get offers to remove openssh-server, don't let it - especially if that's only method of accessing that server*.
* I felt really stupid when I did that this morning.

Wednesday, February 14, 2007

Intelligence

Hmm, something I read pointed to this intelligence test. I got 14 before I had to cheat (and yes, all the answers are on the internet, and quite easy to find). The test's creators say that a score of 14 = intelligent. I'm happy with that.

Monday, February 12, 2007

Whisky Tasting Night

Well, it finally happened. I finally managed to spend a weekend with some of my friends from SDL (I worked there 2000-2001). Seeming as one of them is the two readers of my blog I feel like I'm talking to people who already know about it, but this is as much a document of my life as for anyone else.
I managed to take a 12 year old Aberlour, bought from the web, and a 14 year old Scapa, bought from Czerwik's in Brighouse.
We started off with Chris' Highland Park, which is one of the ones I remember most. We then had a Japanese one, and had a period on some Speyside ones. This included the Aberlour, which tasted quite mellow by comparison to some of the others, but was plenty drinkable.
Along with some of Bill's wonderful homebrew, the exact order of what followed eludes me, but I can say with certainty that I did enjoy it, and chanting "Tim Howson", playing digeridoo, and feeling utter dispair at the fact that Chris owns a telecaster that he just keeps hung on the wall, all made for a great evening.
Sunday was understandably mellow. We ended up walking around a fair bit of Sheffield trying to find somewhere to get some lunch. This was hampered by the fact that most places were full. We ended up going to a place called 543 (five four three, not five hundred and forty three). No vegan options, so I made do with chips and boiled brocolli, as I couldn't be assed fighting for a vegan dish. The other food looked real good.
It was nice to meet Chris' girlfriend, Liv (I'm shit with names, oh yes). She seemed nice, and didn't seem too disturbed by the fact Bill and I were acting very strangely.
Then I drove home, listening to a think about Guido Fawkes' blog.

Sunday, February 04, 2007

Scare

Well, good news, in a wish it wasn't kind of way.
Henry went out yesterday morning and didn't come back last night, nor this morning. In fact, he hadn't come back this evening at 5:30pm either.
However, he's back now. Little git.

Saturday, February 03, 2007

Bridges and Tests

Last Friday, a lorry hit a railway bridge and I thought I wasn't going to get home (the bridge was between work and home). This is because they had to get a structural engineer to go and check the integrity of the bridge before they could let anymore trains go over it.
Bridges have been around for a long time, and the tools and techniques to test their integrity are well established.
Fortunately, the bridge was fine, and I got home around the normal time.
However, I thought this might may a good analogy for why it is important to create automated tests for your code (I'd prefer unit tests and integration tests, but other forms of testing are equally valid).
Consider your code as being the bridge.
The trains are analogous to the data that your code processes.
The tools and techniques used by the structural engineer are the tests (hopefully automated) that your code has to passed before being released.
And the lorry? Well, that's a change in the code, such as an additional feature, or a refactoring, or maybe even a bug fix.
So, the question is, after the lorry hits the bridge, would you be prepared to let the trains continue to run before you'd thoroughly tested it for integrity?
Or, in coding terms, after you've changed your code, should you be prepared to let your it process data before it's been thoroughly tested?
If you have automated, up-to-date tests in place, you can easily test your code (bridge?), and get the trains running (data processing) going as soon as possible.
Without them? Well, it's a long hard night in front of the monitor for you and your testing team*.

*In most places I've work, the coders are the testers, so it looks like another, long, lonely night at work for you.

Monday, January 29, 2007

funny dogs...wet and cold...early morning...

ugh. Was in work at 7am this morning for a product launch. Went smoothly, which is a good thing, as early starts don't usually equate to a productive day.
 
Went to see The Hound Of The Baskervilles in Leeds at the weekend. It was bloody hilarious. The actors seemed to be enjoying themselves so much, and even had to stop themselves from laughing at each other at some points. It's had average reviews, and the gent who I was sat next to said that, during the opening week, it had been a little stayed. He also said that now that they'd got into it, they were ad-libbing a lot, and it was a lot funnier than before. I particularly liked that, at the start of the second half, they did the whole of the first half again, but in about three minutes. It was made more funny, as all three members of the cast had to do all the costume changes two, and half the time they were running on half dressed as the character. A few times, a member of the cast would come on stage out of character, and the others would continue acting, which added to the hilarity. The comedy was very silly, in a Monty python, plain-ridiculous type of way.
If you want to go and see it, it's at the west Yorkshire playhouse, at the moment, and then it's on tour (details here). I heartily recommend it.
 
Sunday I went out for a walk with Amy and her friend Lauren. We went along the other side of the Colne Valley, and got very wet. In fact, it was so nasty that we decided to take the shortcut down into Marsden, to the tea shop, and then walked along the canal home. It might be better to do that walk when you can see more than half a mile...
 
Also had vegetarian haggis for tea, which was quite nice. It was a bit peppery, but not too much, and really flavoursome. The only annoying thing was cooking it. We had roast veg with it, which meant we had to have the oven on too hot for it, so we poached in on the hob, for 45 minutes. Unfortunately, none of the rings on our hob goes low enough to keep a pan of water just below boiling, so we kept on having to move it about. There's some left over which I'm going to fry as patties.

Friday, January 19, 2007

Foundation Schools

This is a little late, but it struck me this morning...
In one of its possible translations, the name Al-Qaeda means roughly base, or foundation.
At the moment, Tony Blair is backing Foundation Schools.
Foundation = Al-Qaeda.
Therefore, if my reasoning is not wrong, Foundation Schools are Al-Qaeda Schools, and therefore, Tony Blair is backing Al-Qaeda Schools - a bit like the Yanks did before the World Trade Centre was destroyed.
As you were.

Sunday, January 14, 2007

Woohoo! Working tap!


Woohoo! Working tap!, originally uploaded by b3ardman.

Woohoo! Working tap!

Wednesday, January 10, 2007

Taps...fans...work

Well, back at work after a New Year's break, and it's been hard work so far. Everyone else is up to speed, rested after Christmas, so I'm feeling a bit like they're all just zooming around me...I'll soon catch up. Just you wait and see.
Looks like I might be able to get a replacement bit for the extractor fan in the bathroom. Got an email from the manufacturer which seems to say they'll send it out for free, which is nice.
The kitchen tap is turning into a saga. In fact, it's a three journeys to B&Q (as much as I hate them, they're the only place I can get to after work) saga, with more trips in sight. This just to fix a dripping tap.
I've tried replacing the washer, but the whole valve on one of the taps is fucked. I thought I had fixed it b padding it with a load of 'o'-rings, but no. It just stops turning off after a while, which is when I have to get turn the water off and take it all apart again.
So, I got a new valve for it (I thought I'd get a ceremic disc valve rather than a compression valve, as they apparently have a longer life and are less troublesome), but the spindle is too small for the existing taps head. You could be turning that baby forever without anything happening.
At the moment, the tap head is padded with some chopped up bits of elastic band, which at least lets us use the tap, but isn't really a long term solution. So, I'll have to get some more new valves, this time with the right size spindle. Which means another trip to B&Q. Oh joy.

Monday, January 08, 2007

Back at work...glad to be alive...wondering what other electrical surprises the house has for me.

Yesterday I learned the importance of turning off the electricity before playing with wires.
The extractor fan in our bathroom has not been working for a long time, I thought I'd take it apart to see if it could be fixed easily.
It's attached to the lighting circuit, but has its own fuse, so I thought removing the fuse would mean I could safely crack the fan open and work with impunity.
BANG!
The lights went out, and once again I'm glad that the trip switches are working as they should.
Turns out, the fuse bit for the fan had the neutral connected through the earth terminal, and the earth connected through the neutral terminal. So, removing the fuse meant I completed the circuit.
At least it explained why the thing had stopped working - the big resistor in it was complete black - presumably because the fuse hadn't blown.
So, in future, any work involving the electrics in the house, or even going near any wires, will be pre-empted by me turning off the electric at the mains.