Tuesday, July 18, 2006

Back buttons on webpages.

Don't do it. You know it's wrong.

My browser has a back button, so I don't need one on your webpage. Give me bread crumbs, help me see where in your site I am, but back buttons don't work.

Either they go to the page's referrer, or to the last page in the browser history (should be the same, but not always). How pointless is that? If I come to one of your pages from outside your site and the best you can do is send me back to where I came from, then frankly you're not trying hard enough.

So, pull your socks up and decide how you want me to navigate your site. Either that, or I'm going somewhere else.

Wednesday, June 28, 2006

Coastal - Halfway to you

I thought I'd mention this record, as it's absolutely brilliant.
This is wonderful slow-core, and any comparisions with Low are superficial at best. Yes there is both a male and female vocalist, and, yes, they do interact in the same way, but the song structure is completely different, being based around short, melodic loops, rather than the more traditional structure that Low follow. In essence, I'd say they're more like Empress than Low.
This album has a spaciousness to its sound. The whole things swathed in reverb, but rather sounding like it was recorded in an aircraft hanger, it creates a wonderful warmth.The whole sound makes me think of sitting in the cool shade on a hot summer day, with nothing to do but listen to the animal noises.
Go out and buy this now. Or better yet, get it from my favourite online record store (that is genuinely independant) www.normanrecords.com.

Erlang

I had a little look at Erlang over the weekend. I was inspired by some articles on defmacro.org which I found through del.icio.us.
I've not done functional programming since Uni (apart from some XSLT, and that required some deep thought), and I don't think I really appreciated it at the time.
I'm not converted (yet), but there are a few concepts that I really like.
For example, I was debugging a (non-functional) program yesterday. Essentially, it was calling various functions (in some cases recursively) to build up a string. All these functions changed class level variables, rather than each function returning the bits to add onto the string.
The debugging was complicated because I had to step through each function because any function could append something to the class level variable.
It wasn't pretty. (I count this abuse of class variables - basically using them as global variables.)
What would have been better is if the functions returned the string to append to the class level variable, and one controlling function dealt with this.
So, instead of this:

var importantString = '';
function a(i) {
if ( i < 10 ) {
importantString += '' + i;
b(i);
}
}

function b(i) {
importantString += ',';
a ( i + i );
}
it should be this:
function a ( i ) {
if ( i < 10 )
return '' + i + b(i);
}
}


function b (i) {
return ',' + a(i);
}
I realise this is a trival example, but by eliminating the global variable, it makes it a lot easier to find problems, and to test. For example, we can expect a(1) to always return '1' + whatever b(1) returns - if we replace b with a mock version, then we can test it really easily. Similarly, testing b become equally as easy.
In Erlang, variables are immutable so we cannot recreate the first version The second version (easier to test, easier to debug) , therefore, becomes the way to do things.
I'm not saying you can't write some terrible code in Erlang, or with functional programming, but I wanted to demonstrate how features in one language can be usefull constructs in other languages.

Friday, June 23, 2006

Windows PowerShell

Apart from having a crap name, this is quite some tool [link].
Eg: I can add a registry value like this:
new-itemproperty registry::\HKEY_LOCAL_MACHINE\Software\CDS -name test -type string -value "monkey"
Brilliant!
Or I can stop the service that I'm developing without having to remember it's stupid name:
gsv ePIMS* | Stop-Service
Astounding.
There's a steep learning curve, and the WMI stuff is huge, but I think it's coding to be worth the effort.
(oooh, and just to clean up: rp registry::\HKEY_LOCAL_MACHINE\Software\CDS -name test)

Monday, June 19, 2006

AbeBooks.co.uk Greasemonkey Script

Abe Books is a great site, and I far prefer it to using other large, american based, online booksellers' sites.

However, their site is a little basic. For one thing, it doesn't show you a total price (price + shipping).
This GreaseMonkey script fixes that.

Sunday, June 18, 2006

Scafell Pike

View from the top
View from the top,
originally uploaded by b3ardman.
Had a nice short break (Friday night, Saturday and came back early this morning) away with Mike + Cate, who I've not seen for a while. Met some of their friends too, who seem really nice.
Saturday we walked up Scafell Pike. None of us were really prepared, and, in fact, Paul left his boots at the cottage, and had to go back and get them. Andy also insisted on carrying his 2.5kg tripod up there too.
It was a steep walk, and Amy, Tamsin and myself soon struck out in front.
We got to the top in about 4.5hours, and then spent about 3hours getting back again. The others took a bit longer.
Both Amy and I are absolutely knackered today.

Friday, June 16, 2006

Mikey

Do a Google Image Search for Mikey.
What's that first result about?

Running again

Did 60/60 again last night. Amy wore the gizmo and we noticed that her heart rate pattern is completely different to mine. Her heartrate went up to about 230 bpm tops, whereas mine only got up to just over 200.
This was the first time we'd been running after doing yoga the previous day, and I struggled. My legs were very sore.
Amy's got some proper running shoes now, and she was loving them, even thought they are a bit girly pink. She was suprised how much difference they made, and I was reminded that I really struggle when running for the train in my work shoes.
Overall, we ran at a steadier pace, but we actually went slightly further (only 0.02 miles/32 meters), and considering the extra effort it was for me to get going, I think we did quite well. I was noticable easier that saturday, when we started doing 60/60.
We're in Keswick on saturday, so if we do go out, it might be for 60/60 again. I think our hosts are planning a long (ie all day) walk, so we might not go running at all.
Side note: type 0.02 miles into Google. Brilliant.

Wednesday, June 14, 2006

Running Diary: Entry 8

60/60 again, for 20 minutes. Was a bit cooler than saturday, although did start off a bit quick. Have new toy (GPS + Heart Rate Monitor), which is suprisingly informative, and has meant that I can do away with carrying my phone.
Told me we'd covered about 3K, along with average speeds for each running session, as well as showing how my heartbeat peaked whilst running, and dropped back down again before we set off again. Of course, the Training Center software is the most usefull way to see all this.
More exciting is the prospect that it can be used to pace ourselves in the future, so we don't start off too fast, or so that the heart rate stays in a certain zone. Also, being GPS, it can guide us home if we get lost.
It also shows how many calories you've burnt, but I hadn't set it up properly.
I'm quite impressed, even if it does seem to need to find the GPS signal every time you turn it on (which takes a minute if you stand still, or much longer if you don't).

Monday, June 12, 2006

Apostrophes

Not meaning to be a captious pendant, or to blog about grammar, but...
There's a sign outside the pub, up the road from where I work, which says: "C'MON ENGLAND".
I say this, and did a double take. What does this mean? Surely it couldn't mean "Come on England!" (for the Football World Cup that's apparently going on), as that would be abbreviated "C'M' ON ENGLAND", or perhaps "COM' ON ENGLAND!".
The only thing that I could think it could mean is "Common England", which doesn't make any sense...although, the pub is The Three Legs, which has a bad reputation, so I wouldn't put it past them.

Saturday, June 10, 2006

Running 6 + 7

Thursday - 20 minutes of 50/70secs. Very hot. Very sweaty, as the heat was mostly hummidity.
Today - 20 minutes of 60/60. Managed to get out early, before breakfast. Was hard work, but we both made it through. And we got noticably further down the canal.

Wednesday, June 07, 2006

I'm not always right...

...no, I should probably say, I'm sometimes right, but often wrong.
A number of friends, who I worked with, but they're more than 'colleagues', anyway, I digress. We've been trying to arrange what has become an annual camping trip in Edale. In an email that was sent to all of the interested parties, I nonchalantly asked one of them (Chris) what 87 is in base 9.
He, correctly, replied 106, but another person on the list (Pete) replied 96. Chris called Pete a retard (for which he almost immediately apologised), but that's just Chris' nature.
Anyway, I, mistakenly, told Chris that Pete was right. I honestly thought he was. It took Chris to point out that you can't actually have 9 in base 9 before I conceded that I was, in fact, wrong.
Chris has won some lettuce for being right.
Anyway, I suppose I just wanted to point out that I'm not always right, and I should check my calculations before running head-long into something.
Oh, and I need to remember about number systems too...You don't have 2 in base 2 (Binary) do you? Am I some kind of retard?

Tuesday, June 06, 2006

Running Diary - Entry 4 + 5

Been better at running than keeping the diary.
Saturday and yesterday - 50 seconds running, 70 walking, 10 times. Also, did a 4.5 mile walk on Sunday that took in a 250m ascent. The running is more challenging, as expected, but I'm managing it. Amy's starting to struggle a bit. Hard to know what to do, as I want to move forward, but don't want to push Amy too hard. Going to do 50/70 again on Thursday and see how it goes for next saturday.

Thursday, June 01, 2006

Running Diary - Entry 3

20 minutes of 40 seconds run, 80 seconds walk. Was fine, and so was Amy. In fact, I found it a bit easy, so I did an extra sprint at the end.
What I mostly wanted to write about though was iterative design.
Before the first session, I wrote a little program for my phone. Basically, it allowed you to enter two numbers, one for run duration and one for walk duration, and then it would play a sound alternately after the run duration and the walk duration. Exactly what I needed.
However, after the second time out, I discovered that I don't always hear the sound (what with moving my arms about when I run). When this happened, there was no easy way to get back in synch, as there was no easy way to tell when the sound meant run and when the sound mean walk.
So, for the second iteration, I've changed it, so there are two distinct noises. The run sound is an octave higher than the walk sound. Also, just to be extra sure, my phone now vibrates at the end of each period.
The second version is a great improvement, I didn't miss a single alert, and I still just have a simple program that alerts me after the run and walk times.
I don't think I would have guessed about making the phone vibrate if I hadn't have been out a few times. This is the power of iterative design. I made something, I tried it out, and then I improved it. I'll keep doing this too. One idea I have is to make it so I only have to enter the run duration, and then it will work out the walk time ( given that it's a two minute cycle ), but this isn't a big deal at the moment, the alert thing was.
Perhaps, when I can run for the full 20 minutes, I'll need to make a new program that alerts me halfway through a run, so I can turn round and head homewards, and then at the end, so I know when to stop. I'll probably get a wrist watch with a timer on it for this though...

Tuesday, May 30, 2006

Is this insulting?

I just noticed the 'icon' that blogger uses for the accessibility feature for the word verification:

I'm sorry, but why would someone in a wheelchair need to use this feature? Surely this is more for partially sighted people?
On top of this, when I click it, Firefox claims it needs the Quicktime plugin, which I think breaks the idea anyway.
A case of the blind leading the blind? [Sorry, couldn't resist it]

Monday, May 29, 2006

Running Diary - Entry 2

Second run. 40 seconds running, 80 walking for 20 minutes. Felt ok afterwards, a bit snotty, but Amy was really suffering from hayfever and stopped after about the 8th repetition. She felt a bit low afterwards, but I think there may be other factors contributing to this too (something cyclic).
Realise I need to change my application for this so that I get a distinct tones for walk and run. Perhaps it needs to make my phone vibrate too, as it's easy to miss the noise and get out of synch with the walking/running part (as I found out after I ran for too long).
Also realise that I'm going to have to get on top of my hayfever this year, as it could hamper my training.

Saturday, May 27, 2006

Running Diary - First Entry

Running what? Eh? I shouldn't be writing a running diary. However, Bill's convinced me to run the Aviemore Highland Half-Marathon in October. I've been to the running shop in Huddersfield, and bought myself some fancy shoes (funny, they were cheaper in the shop than online!).
Went for a short run today, 20 minutes of 30 seconds running, 90 seconds walking. Wasn't too bad, but both Amy + I were feeling it as we walked up the hill home.

Thursday, May 25, 2006

Why do we write computer programs?

Ok, so beyond the core "because it's my job, and I get paid for it", I was thinking about why we write computer programs. (Yeah, ok, so "we" is used in a very loose sense).
The reason I could see was that they did something more efficiently that doing it by hand. Before you shout out "But I can write a letter with a pen and paper faster than I can load up Word and type it in", think about what the end result is. If you wanted the same output as Word produces, you'd have to either spend a long type with some old school type setting equipment, or learn to do caligraphy well. Neither would be faster than loading up Word and typing it in.
So, if programs are time saving devices, this puts them in the "tool" category. Sure, they're more complex than a hammer, but then they do more than a hammer does. (You could always go and look at the guys at 37signals, who think that computer programs should be a lot more focused). I digress...
Surely, then, we should be writing more computer programs, either to help us write computer programs, or to help us do something else that takes a long time.
An example of one of these programs is a SPAM filter - such as SPAMBayes. This has saved me loads of time in the past. Rather than having to spend hours (and I do mean hours - never publish your email address on the internet) trawling through emails, picking out the good ones, I set it up, show it some stuff that I already think is SPAM, and off it goes. Brilliant. Yes, it needs a little bit of help now and then, when my brother sends me a "forward this to 10,000,000 of your friends" email, but I think that's fair enough.
Back to the point - why is it so hard to write programs that automate existing programs? If you try programming any of the Office products using the macros, it gets really hard once you're past the "make this text bold" stage - mind you, getting the text to make bold in the first place is hard enough. Add to that the fact it forces you down the path of writing in a language which you might not be used to (VB sometimes makes me want to rip my own eyes out!), it leaves a bitter taste. Similarly, if you want to program Visual Studio.Net using macros, it's an uphill struggle, and some things that you think should be easy - such as finding out the function you're in, become very hard.
I suppose the problem here is that it's exposing the complexity of the underlying program. Sure, making a simpler wrapping on top of this would only increase the complexity, but when people like JetBrains (who write the amazing ReSharper) have to write their own C# parser, there's something very wrong.
Perhaps it'll get easier. Programming Google Maps is a doodle, once you get past the initial WTF. Similarly, programming Flickr is quite easy (especially if you use one of the already developed language specific libraries). As more and more programs/services expose APIs, perhaps we'll get better at writing them. Perhaps we'll need a common standard for APIs.
Anyway, this was going to be a rant about how, perhaps, we should be developing programs as though we were developing an API, and then write our front end on top of that. Certainly, that's not an original thought. But, perhaps, at the same time, we should be striving to write APIs that other people can use. Sure, there'll be a bit of learning to do for any API, but this should also be an understand of the problem domain, and the code behind the API should handle all the unnecessary detail.
I know I'm not there yet, but I'll keep on trying.

Argh! Hayfever!

These last couple of dayes, I've been feeling like I'm coming down with a horrible cold. Since it's been raining almost constantly for the past two weeks, I really didn't associate this with pollen. This morning I took a hayfever tablet, and suddenly I feel a lot better. Bloody pollen.

Sidenote: Outlook HTML email kills my blog layout.

Tuesday, May 23, 2006

Time Off Request

Time Off Request
Time Off Request,
originally uploaded by b3ardman.

I get round to booking time off today, which is done through the timesheet system.
What a terrible screen this is.

The required fields all have default values in them. This is one of my pet peeves. If something is required, it should either be blank or have a 'special' value in it, such as 'Select From Date'. How else can the computer tell if it's been filled in?

Time Off Code? What? These are all human readable values ('Bereavement', 'Holiday', 'Flexi leave'). I think this should be labelled 'Reason for Request', or something like that.
The default value for the Time Off Code (if there has to be one) is 'Bereavement'. So far, in 6 years of working live, I've taken precisely zero days off for 'Bereavement'. I've taken far more days off for Holiday than anything else, so why not default it to that?

From and To dates - now these really pissed me off. For one thing, they default to today's date. I'm in work, sitting at my desk, and the computer thinks I want to book today off. Also, I'm contractually obliged to give 2 weeks' notice of holiday requests.
Then, I select the From date (I have to click the little calendar to do this). Fine. I click to select the To date, and it show's today's date, rather than the from date I just selected (which it is also showing in the To date field). Argh!

I haven't used the Comments field. I can see, in certain situations, it may be necessary, but for the greater part, it's entirely superfluous. This said, it's still the largest field on the screen, and it's entirely optional. My preference would be to show a full calendar for the From and To date fields, and have a much smaller 'Comments' field.

Finally, the note about 'Partial days' is entirely superfluous as the system only allows you to book partial days on the first and last days of the request.

Sorry, did I say I read Krugg's Don't Make Me Think recently?