Categories
Uncategorized

Humax HDR-FOX T2 usability bug #1 – is it recording?

I love the Humax HDR-FOX T2 personal video recorded. It has brought the loveliness of Freeview HD to my life. It is pretty reliable, but there are some annoyances and bugs in the software. These are mostly in the user interface design, but a couple of them are functional. So I’m starting a series of posts to highlight them, in the hope that Humax will try to correct them.

#1 – Is it recording?

The problem

The box is pretty reliable, so it usually is doing what it should be doing. My problem with it is that when it’s in standby mode, you can’t tell at-a-glance whether it is recording something or not. With a Sky+ box or even an old VCR, you can visually tell if something is being recorded. With this you have nothing.

The solution

Oddly, this problem only exists in standby. When powered up, the box does show whether something is being recorded by changing the ring colour from blue (on) to red (on and recording). Therefore, the solution is very simple. Have the box turn the ring red when it’s recording something in standby too. By leaving the text display dimmed, users will still realise the box is in standby rather than fully powered.

Categories
Uncategorized

SVG graphics library for PHP – does one exist?

I can’t find an SVG library for PHP. Really. Am I just being thick and lacking Google-fu, or is there seriously not one in existence?

Categories
Uncategorized

Regular expressions for IP addresses, CIDR ranges and hostnames

I have recently had cause to find regular expressions that allow me to determine if some user input is an IP address, IP address range (in CIDR notation) or a hostname. The IP address and IP address range validators were needed for both IPv4 and IPv6. I found various bits and bobs around the web, and if I’m honest, I can’t remember where I got them from (please let me know if I owe you some attribution!).

But I don’t want to go looking for them again, and I think they will be useful to the wider community, so here they are. Remember that these all have to be entered on one line. You can test them out in your browser using the excellent Regex Pal site.

IPv4 address

^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$

IPv4 CIDR range

[Updated: 13/Jan/2015 – thanks to Mike in the comments for pointing out the bug in the old version!]

[Updated: 6/Apr/2015 – fixed to resolve the problem pointed out by Pirabarlen in the comments]

[Updated: 9/Aug/2016 – fixed the precedence for the part after the forward slash. Thanks to Gavin in the comments]

^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-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[Updated: 6/Apr/2015 – fixed to resolve the problem pointed out by Pirabarlen in the comments]

[Updated 9/Aug/2016 – changed precedence of matches after slash to go longest to shortest. Thanks to Oleksiy and Rui Lapa in the comments for pointing this out.]

^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))$

Hostname

(Updated 9/Aug/2016: Escaped “.” to avoid accepting any random string as a hostname! Thanks to Thomas in the comments for pointing out this error.)

^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9-]*[A-Za-z0-9])$
Categories
Uncategorized

Seesmic is a battery hog

A couple of days ago I realised that despite dumping Twitter around the beginning of the month, I had left Seesmic on my HTC Desire with background updates still running.

I turned it off a couple of days ago, and now my battery is lasting quite-literally 3x as long. Amazing.

Categories
Uncategorized

Films: Take 2

So it’s nearly the end of January, and so far I’ve watched 7 films this year, easily beating the total for the whole of last year. Since my last film-related posts I’ve added Tron: Legacy and The A-Team. Very different movies, both good in their own ways.

But the real news is that I’ve been chatting with friends and colleagues about movies that I should have seen, but for some reason haven’t. I now have a list of 66 movies that I need to watch! That should keep me busy for a while.

Categories
Uncategorized

Twitter – you’re dead to me

I seem to have fallen out of love with Twitter.

A dead bird on the floor
This one certainly ain't tweeting any more

For the first few days of this year, I haven’t checked my Twitter timeline. At all. Not once. This was not a concious or deliberate decision – I just haven’t felt the need to look at it. I think the new-found focus from my New Year’s resolutions may be filling in a gap that used to be filled with Twitter. Basically, I had too much spare time on my hands!

I am now getting on with other stuff instead. Whether it is more useful stuff is debatable, but it is stuff that is more likely to have an impact on my life than passively reading a Twitter feed and then randomly diving in to the deep end of the web by following a link to something that I absolutely must read.

All of that said, I will probably continue to tweet myself. I find it to be a very useful venting mechanism sometimes and I would be in a worse place without it. I may also dip in to specific followee’s timelines ocassionally to see what’s going on. But the hour or more per day that I was spending keeping up with Twitter can be better used elsewhere, so it has to go.

Categories
Uncategorized

Attitude

Tools alone will not change you. They are necessary but not sufficient.

The changes I need to deliver in 2011 will also need a change of attitude. I have always described myself as a ‘realist’, but looking back, it’s been more ‘pessimist’.

From this day forwards let it be said that I will ask first not why I should do something, but why I shouldn’t. It’s time to live life a little. It’s time to shake things up and move out of my comfort zone.

It’s a strangely exciting idea.

Categories
Uncategorized

Tools

I have mixed feelings about New Year’s resolutions. On the one hand, I feel that it’s a good idea to take advantage of the natural optimism that usually accompanies the start of a new year. On the other hand, I think that if you want to do or change something, you should just get on and do it, regardless of the time of year.

However, one thing that I don’t want to do is publish a traditional, boring list of New Year’s resolutions that I will have broken by the end of next week. So I want to outline some of the tools that I will be using to try to keep me on the straight and narrow.

A selection of hammers
When all you have is a hammer.....

I had a brief moment of mental clarity around May last year when I got myself a Remember The Milk (“RTM”) Pro account and started to use it in earnest. When your mind doesn’t have to remember all the day-to-day stuff any more, it’s much easier to concentrate on what’s really important and make better decisions.

On holiday in 2009 I had read David Allen’s excellent Getting Things Done (GTD), which describes a personal organisation method that is almost entirely based around lists. RTM and GTD are an excellent fit. Once you add in the awesome Evernote to store those reference items, photos and articles that aren’t actions in a list, you really are set for a fully-digital, lower-stress way of life.

So between those three tools, I am hoping to be more organised, more decisive and less forgetful in 2011. I have planned this year to be one of major change for me, so keeping things organised will be very important.

Categories
Uncategorized

Films

I ended up in the pub during the time that I hoped to use to finish my ‘proper’ blog post. Woops!

After the pub, I went back to my mates’ flat and watched the 4th Shrek film (I have no idea what the actual title was). Best described as ‘meh’ I think. Good story but not as funny as the early versions.

This was quickly followed by ‘Taken’ starring Liam Neeson which was pretty darn good. Zero thinking required, lots of guns and explosions and some pretty girls all make for a great movie.

Yesterday I watched Bee Movie, Wall-E and Inception. So I have seen 5 films in the first two days of 2011. I think that is more than I saw in the whole of 2010. This increased movie watching is a trend I would like to continue, but only if it’s not to the detriment of books!

We shall see what happens!

Categories
Uncategorized

A new year, a new blog

I’ve been thinking for a while that I should start a blog. So, since it’s the start of 2011, I have decided to set it up and get it done. I’m not really sure what I will blog about yet, but I imagine that a theme will emerge that will set the overall tone.

I believe that the best way to improve your writing skill is to do it as regularly as possible. Therefore, I’m going to aim for a post to be published every single day this year. Since I haven’t been to sleep yet, I’m counting this as 1st January’s post, but since it’s 3am there is no way that I’m going to write anything insightful. I’m off to bed.

Belated happy New Year!