September 2007 in the Life of Ben (Blog)

  1. January
  2. February
  3. March
  4. April
  5. May
  6. June
  7. July
  8. August
  9. September
  10. October
  11. November
  12. December

Hot Air Balloon Flight (29th September 2007)

My dad’s birthday was in July and we booked a flight with Adventure Balloons. It got rescheduled as the weather wasn’t good for them and today we went for it.

We were told the flight was going ahead at 2pm. Dad drove myself, mum, Zoe and Sarah to the field where they were launching from. We signed in and dipped our shoes in a disinfectant to avoid potentially spreading foot and mouth disease around the countryside.

I was one of the two “gloved men”. This basically means you hold a rope which stabilises the balloon as it is inflated, help pull it over when you land and various other odd jobs.

The other people on the flight were friendly and in good spirits, largely thanks to the Adventure Balloons staff setting such a fun tone for the event.

Whilst in the air we flew through some clouds and flew over one. Pretty awesome to be inside a cloud with no fuselage or anything around you!

It was a great trip and something I’d definitely do again.

Gave Blood for the 4th Time (28th September 2007)

The room was fairly cold and it was raining outside. While the blood was being taken, it got really uncomfortable and quite painful. So I called a nurse over and she adjusted the needle. That made it better. Well, bearable. But it was still pretty unpleasant.

I was relieved when I’d filled the pouch! Once they stopped drawing blood it was fine and dandy.

The staff are all still friendly and relaxing, which is cool. And you still get free crisps, biscuits and cups of tea afterwards to replenish the fluid you lose. Plus, giving blood saves lives.

Calthorpe Wins “Most Accessible Website” (19th September 2007)

What a day! Winnng the category with Calthorpe is a landmark for me. Professionally, landmarks include:

Being successful at something I care about has been a dream of mine since the day I could stack building blocks. To have overcome the uncertainties, learnt from my mistakes and been supported by my family and so many other like-minded developers is tremendous. It’s a fairy tale and a reality all at once.

Sure, it “only” covers Hampshire and the Isle of Wight. But there were nearly 100 entrants in this category. Winning it puts Calthorpe’s site approximately in the 1st percentile, as my Dad noticed on the way back. He and my mum both got a bit misty-eyed when I received the award with Cathy Anwar, Calthorpe’s headteacher. My heart was pounding so hard it nearly broke right out of my chest!

Whilst at the event I chatted to the developer of Court Moor’s website. He is a couple of years younger than me and is eerily similar to how I was at that age: keen but uncertain.

MSN Messenger 7 Dropped by Microsoft (13th September 2007)

Windows Messenger 4.7 had the perfect interface for a messaging program, imho. But it never played well with my home network. It would lose connection without telling me. File transfers often failed, too.

The deathly unresponsive and pixel-wasting MSN Messenger 7 was the oldest version which worked. But support for that has been dropped. I can’t sign in any more.

Now I’ll have to use Windows Live Messenger. There had better be an option to turn off all the annoyances that comes with it. If there isn’t, I’ll look for an open-source one.

Can’t minimise the download progress window for it. That’s a bad sign.

Syntax Highlighting in HTML (12th September 2007)

The syntax highlighting suggestions on public-html are quite varied. There’s lots of variety in what authors do, from the coding websites I sometimes visit. Microformats are gathering code examples.

Until that goes somewhere, here’s a blog post with some VB6 code I played with recently.

It is highlighted (highlit?) same as the IDE, which is conservative but makes a surprising difference to readability. Uses <i> for comments and <b> for keywords with a class on the <pre>. Consecutive words of the same type share the same element.

This approach gives lightweight markup, can be overridden by user CSS and degrades gracefully (such as when printed). This blog entry is probably the only place it is used, though.

What the Code Does

TextStudio is my homebrew text editor. It has an Edit > Delete Line feature (Ctrl+Y) just like the VB6 IDE.

But different newline characters are produced by some tools. Supporting LF and CRLF line feeds, including files which mix them both is the priority. I don’t come across files which use CR as a newline.

Previous Newline

Old

'Start of line:
lngCr = InStrRev(strText, vbCr, SelStart)
lngLf = InStrRev(strText, vbLf, SelStart)
If (Not lngCr = 0) And (lngCr < lngLf) Then
    lngStart = lngLf 'LINE FEED is nearest
ElseIf (Not lngLf = 0) And (lngLf < lngCr) Then
    lngStart = lngCr 'CARRIAGE RETURN is nearest
Else
    lngStart = 0 'use start of file
End If
'Ensure blank lines get selected:
If SelStart <> Len(strText) Then SelStart = SelStart + 1

New

'Start of line:
lngLf = InStrRev(strText, vbLf, SelStart)
If lngLf Then
    lngStart = lngLf
Else
    lngCr = InStrRev(strText, vbCr, SelStart)
    If lngCr Then
        lngStart = lngCr
    End If
End If

With CR Support

'Start of line:
lngLf = InStrRev(strText, vbLf, SelStart)
If lngLf Then
    lngCr = InStrRev(strText, vbCr, SelStart)
    If lngCr = lngLf - 1 Then
        lngStart = lngLf 'starts with CRLF
    Else
        If lngCr < lngLf Then
            lngStart = lngLf 'starts with LF
        Else
            lngStart = lngCr 'starts with CR
        End If
    End If
Else
    'No LF before current line:
    lngCr = InStrRev(strText, vbCr, SelStart)
    If lngCr Then
        lngStart = lngCr 'starts with CR
    End If
End If

Next Newline

Old

'End of line:
lngCr = InStr(SelStart, strText, vbCr)
lngLf = InStr(SelStart, strText, vbLf)
If (Not lngCr = 0) And (lngCr < lngLf) Then
    lngEnd = lngCr 'CARRIAGE RETURN is nearest
ElseIf (Not lngLf = 0) And (lngLf < lngCr) Then
    lngEnd = lngLf 'LINE FEED is nearest
Else
    lngEnd = Len(strText) 'use end of file
    
    'Blank line at end of file?
    If (lngEnd = lngStart) And (lngStart > 2) Then
        'Get previous line start:
        lngCr = InStrRev(strText, vbCr, lngStart - 2)
        lngLf = InStrRev(strText, vbLf, lngStart - 2)
        If (Not lngCr = 0) And (lngCr < lngLf) Then
            lngStart = lngCr 'CARRIAGE RETURN is nearest
        ElseIf (Not lngLf = 0) And (lngLf < lngCr) Then
            lngStart = lngLf 'LINE FEED is nearest
        Else
            lngStart = 0 'use start of file
        End If
    End If
End If

New

'End of line:
lngLf = InStr(SelStart + 1, strText, vbLf)
If lngLf Then
    lngEnd = lngLf
Else
    lngCr = InStr(SelStart + 1, strText, vbCr)
    If lngCr Then
        lngEnd = lngCr
    Else
        lngEnd = Len(strText) + 1
        If lngStart > 0 Then
            lngStart = lngStart - 1 'remove whole of last line
        End If
    End If
End If

With CR Support

'End of line:
SelStart = SelStart + 1
lngLf = InStr(SelStart, strText, vbLf)
If lngLf Then
    lngCr = InStr(SelStart, strText, vbCr)
    If lngCr = lngLf - 1 Then
        lngEnd = lngLf 'ends with CRLF
    Else
        If lngCr < lngLf Then
            lngEnd = lngCr 'ends with CR
        Else
            lngEnd = lngLf ' ends with LF
        End If
    End If
Else
    'No LF after current line:
    lngCr = InStr(SelStart, strText, vbCr)
    If lngCr Then
        lngEnd = lngCr 'ends with CR
    Else
        lngEnd = Len(strText) + 1
        If lngStart > 0 Then
            lngStart = lngStart - 1 'remove whole of last line
        End If
    End If
End If

This is much more reliable, uses simpler conditions and is almost self-documenting. If you know VB6, you know those functions return 0 on failure and 0 will evaluate to False for the conditionals. You also know which of these are 0-based and which are 1-based.

Update: Added CR Support

Some markup which used CR-only newlines came my way.

Cycling to the Max (5th September 2007)

The route I figured out a few weeks ago mixes extremely slow and technical sections with narrow root-covered tracks. Also has a very bumpy, undulating, grit your teeth and hope, high-speed sequence. It’s as much a test of nerve as of fitness and skill. It’s like the Nürburgring for mountain bikes.

By adding two more ditch crossings and a hairpin turn where the previous two ditch crossings were, the technicality is even more challenging now.

But today I managed an almost perfect run and did it in 2 minutes 39 seconds. That’s even faster than my best time without the extra parts!

Riding on the roads is something I hadn’t done for a while. The friction and bumpyness of dirt and gravel means high speeds aren’t sustainable or particularly attainable. But on tarmac roads, you can really test your limits.

Turning out of Basingborne Road onto the main road between the wharf and Crookham Crossroads, I decided to see just how fast I could go. So I honked as hard as I could out of the junction in high 2 until my legs were going as fast as they could. Then I changed to high 3, did the same. By this time the drag from standing tall on the pedals is greater than the extra force you get. I sat down and tucked in, with my hands in the middle of the handlebars and my chin down close to them. It makes a big difference to my top speed.

High 4, high 5...and my legs were flying round like pistons in an engine. I’ve never ridden that fast on the flat before. Small bumps in the road made the bike shudder and shift around, like a sports prototype racing car hurtling down the Mulsanne straight. I kept up this pace until the petrol station, by which time every muscle in my body was numb.

I turned right at the roundabout and cruised gently down to the Verne. I coasted on to Basingborne Park and turned right, trundling through the woods.

After parking my bike I walked around gently, letting my body recover. I started feeling a bit queasy so I drank some water. It took a good 15 minutes before I was feeling well enough to gingerly set off again.

So yeah, I think I found my cycling limits today. Maybe I even went a bit beyond them. Was pretty intense and I feel a sense of accomplishment.

Super-fine Markup Semantics (2nd September 2007)

There is a fairly steady stream of illconceived markup ideas being sent to HTMLWG’s mailing list. This is a little rant about it to get it out of my system without spamming the contributors to HTML5.

Armchair Engineering

From adding embedrel for <img> as a required attribute (complete with flaming the Editor) to a set of new phrase elements like <book-title>, <ships-name> and <Linnaean-binomial>, there’s plenty to chuckle about.

I tried to caution the speculation and got told I was purging semantics and motivated by theoretical purity. Ouch, dude! Well, not sure how I managed to “purge” semantics for elements which don’t exist. But anyway, ouch!

So maybe I’ll repeat one of my previous blog messages using these super-fine markup suggestions. I could make up a bunch more, just for fun. This wouldn’t just be to take the piss, mind. Well, mostly it would. But maybe it will also help demonstrate how entirely pointless super-fine semantics like those would be in a web page.

Or maybe it would show how totally essential they are for anything to be accessible? Yeah, I have doubts.

Experts are n00bs!

Even expert authors who really care about markup rarely use special-purpose elements. Even those we’ve had for more than a decade. Or, they use them wrongly:

You’ll have a hard time finding them on the mainstream web.

How would adding more specialised elements increase the chance of them being used more widely and more correctly? More confusion and less proper use are the likely results going by these studies and the markup I come across daily.

User Needs

Another aspect is the deafening silence from users pleading for super-fine markup semantics. People I talk to complain about:

That’s usability stuff, not format limitations.

Disabled User Needs

The disability support organisations cry out for:

That’s authoring stuff, not format limitations.

UAs and Information Overload

User aren’t experiencing problems which need <book-title>. Or for class to be exposed. Indeed, why would anyone want to know their mouse is over class='post hentry uncustomized-post-template' or that their virtual cursor has started reading through that part of the page?

These proposals suggest extraordinary verbosity be fly-tipped upon users. That is not what benefits text-to-speech users, for example.

My 2p

Relaxing the semantics of special-purpose elements seems more useful:

HTMLWG Participants and W3C WAI are already pooling their resources. Together, the standard can be balanced with what users actually need, what authors actually do and what ATs can actually deliver. Let’s keep it real.

Cycled with Dad (1st September 2007)

To try and find a way to ease the pain he gets from a trapped nerve, dad decided to go cycling with me today. After a couple of short test rides we identified a sticky link in his chain, loosened it out and went for a ride.

We rode along the towpath, past the swingbridge and down to the wharf. Went up onto the lane and headed away from Crookham Village.

We took the first lane on the left and swooped down the hill and over the little bridge. Rode gently up the hill, which steepens sharply towards the top. It turns 90° left and immediately steepens even more as it goes over a humpback bridge which crosses the canal. We both made it up easily by using the our lowest gear.

We actually made conversation a few times, which was cool.