Television statistics

Forget ratings. MythTV keeps pretty detailed records of EPG data (TV guide), what you record, when you watch it, all that jazz. Ew. I just remembered I watched some of Chicago this week and I didn’t like it. Now I can’t say all that jazz. Hmmm.

Stats! Mythweb has a neato stats page that shows some interesting TV viewing habits in this house! We’ve been with digital TV for quite some time now. We used DNTV Live! on Windows XP for a bit, before I bit the bullet and switched to MythTV on Ubuntu linux.

And just how long have we had MythTV? 2 years 6 days 12 hrs 27 mins. 13% of that time was spent recording TV. Top of the list was Toasted TV with 598 recordings! Good Game just made the top 10 with 62. Neighbours also contributes a lot, which places channel TEN first with 1199 recordings. ABC2 comes in second — for those great kids shows!

In total we have recorded 3 months 5 days 21 hrs 58 mins of television viewing. Which explains the 1.5 TB that we need. I’m certain there is absolutely no way we have watched all that, but we do watch more telly now we can watch what we want when we want.

If you haven’t switched to digital TV yet, you really should. But it isn’t worth making the switch unless you get a DVR (digital video recorder). There are lots of options. Myth is free and pretty darn good. Of course, you need to build yourself a linux box to get it up and running first … If that sounds daunting, there are TiVo and Foxtel IQ and I dunno what else. Just go get it!


Easy rounded corners — playing nice with borders in IE6

When a graphic designer gives you a mockup full of rounded corners, you just know you’re in for some pain. Why can’t they be satisifed with Comic Sans fonts instead of delving into techniques that haven’t quite penetrated the user-agent landscape yet. Ah… just jokes of course!

Andrew has published a technique dubbed “cornerise” over at irama, that neatly wraps up what we discovered when implementing rounded corners. As noted, border-radius does all the magic in newer builds of gecko and webkit, but that leaves us with a good chunk of Internet Explorer users needing some love—cornerise is such a technique.

It works by using javascript to insert some tactically placed tags into a document. These spans are positioned in the corners, and background images provide the corners. The overall footprint can be kept lean by utilising css sprites (like this one).

If you happen to be using borders with corners, you have a bit more to do. Firstly, the background images must include a border strip the same size as the border — pixel widths only here. Secondly, the corners need to be positioned on top of the border which means moving them slightly beyond the bounds of the containing box. Thirdly, you will enounter a quirk in IE6 that results in a 1 pixel border on the right or bottom of the box. Try as you might you won’t get rid of it — without compromising the corners in IE7 and IE8 that is! Actually, this quirk presents even without borders.

To solve this quirk, we need to understand it. It is caused by a rounding issue (measurements are rounded to the nearest pixel when a layout is drawn on the screen). It only occurs when the width or height of the box is an odd number of pixels. And it only affects the right or bottom edge, the top and left are always ok. Because this only occurs on an odd number of pixels, you might not even be aware of the issue straightaway. Ah, these are the challenges that web designers live for!

You could specify the dimensions of boxes so that they are always an even number of pixels, but that’s a poor compromise. Here’s a simple solution we discovered that allows you to have any size box, and support resizing on the fly (due to viewport or text size changes). It requires a css expression. Yes, expressions only work when javascript is enabled. Since the cornerise technique itself utilises javascript, this is completely suitable. (And it’s not like corners need to be accessible, this is just sugar.)

For corners on the right edge:
_margin-right: expression(this.parentNode.offsetWidth%2==0 ? '0' : '-1px');
For corners on the bottom edge:
_margin-bottom: expression(this.parentNode.offsetHeight%2==0 ? '0' : '-1px');

What does it mean? Well, this will set the right/bottom margin to either 0 or -1px depending on whether the width/height is an odd number of pixels. That’s what the %2 is for. Yes, another use for modulus arithmatic!

Now, as stated, this problem only occurs in IE6. We don’t want this expression interfering with the nice positioning in IE7 and IE8, so we need to hide it from those browsers. You can do this with conditional comments if you like, but if you don’t want to maintain separate stylesheets for individual versions of IE, you have another option: prefix the property name with an underscore. Yep, it is that simple to hide a rule from IE7 and IE8.

True, it’s a bit hacky, but you can’t argue with the results!