Category Archives: Uncategorized

On configuring Apple TV

Partly on impulse and partly because I’d been discussing media streaming with my electrician, I bought an Apple TV (3rd generation). For a start, it seems a real steal at £83 and can stream from iTunes, YouTube and Netflix. The fact it doesn’t yet support LoveFilm Instant or Sky Now is a bit of a downer, but this isn’t a review of the Apple TV. Rather, it’s a collection of useful tidbits for getting the thing working better, in particular with AirPlay.

What’s AirPlay?

The Apple TV is a streaming media player. I’ve already mentioned a few sources for that streaming (iTunes, Netflix), but what if you could stream directly from an iPad or iPhone? This is what AirPlay does. When you have an iOS device or even a Mac laptop with Mountain Lion, you can mirror the display to your big-screen TV via the Apple TV box as long as they are on the same network.

This is pretty cool stuff, but there was one big flaw: when I first tried it, the performance was shocking. Completely unusable. Second time I tried it (on a different network), same thing. Being the highly rational person I am, I immediately blamed Apple and their AirPlay implementation. How could they seriously foist this garbage on us?

I didn’t give up though and I had this nagging feeling that the network could be the problem, even though WiFi is supposed to give us up to 54Mb/s. On a whim, I bought a TP-Link Powerline kit (which I see has gone up in price since I bought it) to provide a more reliable network connection between the router and my Apple TV. In one stroke, a significant improvement in the AirPlay performance. It still wasn’t really usable though, but it did highlight WiFi as the likely culprit.

Tuning the WiFi

After tweeting this, someone responded and pointed out that WiFi contention might be an issue. So I started investigating. In the UK, WiFi breaks down into 13 overlapping channels. Your WiFi access point is configured for one of these channels. So are probably a bunch of others in your vicinity. At this point, all I knew was that 15+ WiFi access points were broadcasting in range of my equipment and that many of these were probably interfering with my own network.

The first suggestion I came across was to set the access point to 802.11g only. I’d be surprised if many people have equipment that doesn’t support ‘g’. I certainly don’t, so I duly made the change.

The second suggestion was to pick an uncontested or at least weakly contested channel. To be honest, I didn’t even know what channel my WiFi was configured for. Fortunately, I found a magic incantation for my Mac laptop to discover what channels all the WiFi networks were using:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s

That’s one ugly command line, but that’s only because the airport utility isn’t on the path by default. Anyway, running that gave me a list of all the WiFi networks and their channels. If you happen to be on Windows or Linux, it shouldn’t be too hard to find an appropriate tool to give you this information.

What I found out was that channels 1, 6, and 11 were the most prominent, with a few networks on 7 and 9. At first glance, it looks like I have plenty of choice for the channel since there are 13 available to me. But it’s not at simple as that. These channels overlap:

(This image linked from http://www.airportal.de)

Any channel that overlaps with another interferes with it. As you can see, a predominance of channels 1, 6 and 11 pretty much mess up all channels! What could I do? I basically deduced that channel 13 was the best bet since the only channel in use it overlapped with was 11, and 13 has a larger stagger over 11 than 12, thus reducing the risk or strength of contention.

I don’t really know whether the above is accurate, but once I picked channel 13 for my WiFi access point and limited it to 802.11g only, AirPlay suddenly started working. And working well. This is great, because I can access things like LoveFilm Instant and Sky Now via my laptop or iPad and stream to my TV, even though Apple TV doesn’t directly support either of them. I also noticed that the Netflix streaming became much more reliable after switching to Powerline.

So if you’ve been having buffering and lagging issues with Apple TV (or any media streamer for that matter), then I hope the information I’ve presented helps you sort them out!

The journey continues

Last Friday (23 Nov 2012) was my last day at VMware. I’ve had a great time there and really enjoyed working with the team. So why leave? The two main ones are:

  • to focus on Grails in Action 2nd edition; and
  • to do some training and consulting to help teams navigate the big changes happening in the development space.

This doesn’t mean I will be disappearing from the Grails scene – far from it. I’m hoping that I will have a bit more time to work on some of my plugins and maybe some other projects (such as gvm, which I’m contributing to atm). I’ll see how it pans out.

Any switch to consulting won’t happen until later in the new year though as I focus on the book. I’m keen to get it to our patient readers as soon as possible! And preferably before Grails 3 comes out 🙂

I’d like to end by thanking VMware for the support they have given the Groovy & Grails projects and for giving me the opportunity to learn some news skills and to continue contributing to the OS community.

A rant about QWERTY

OK, so it seems that it’s no longer fashionable to knock the QWERTY keyboard layout (or QWERTZ in Germany, I gather). A couple of times I’ve moaned about the layout, people have said its got a worse reputation than it deserves. Well, maybe.

I did have a quick look at Wikipedia to find out some information, and that directed me to a one page QWERTY history. If that page is accurate, then it may not have been designed to slow down typists, but the aim of reducing the number of jams in a typewriter at the end of the 19th century is hardly geared towards efficient typing on computer keyboards. It’s not like we have to worry about jams these days, although crumbs, coffee, and other such evils are a different matter.

Anyway, it’s not really QWERTY per se that bugs me. Yes, I think the Dvorak layout puts less strain on my fingers’ tendons. But I can nonetheless type fairly fast on a QWERTY keyboard (it’s only taken 15 years of software development to get there!). No, my main gripe is with using QWERTY on touch screens.

One of my most memorable experiences with this was when I was trying to buy a train ticket from a new electronic ticket machine. There were many design issues with this machine, but I want to focus on the touchscreen keyboard. This is presented to the customer when he or she needs to go anywhere not on the quick links screen. Unfortunately my parents live in a not-particularly-large village, hence I had to type in the name of the station. That’s when I suddenly realised I had no idea where the keys were on the QWERTY keyboard!

This may seem strange at first glance, because I use a keyboard almost every day of my life (how sad is that?), but once you take into account the fact that I touch-type, things start to make sense. I don’t visually map the letters to the keyboard – my fingers in effect just take on a mind of their own. As soon as I was faced with the QWERTY layout and had to visually locate the letters, I struggled because it has no logic. I got to the stage where I was putting my hands on the screen as if I were typing!

What about all those people that don’t have experience with QWERTY? I know that techies may find this hard to believe, but not everyone has a lot of experience with computers and their keyboards, whereas almost everyone knows the alphabet. So why not display the keys in alphabetical order? I really think that no one actually bothered to field test the on-screen keyboard layout and simply went with QWERTY because “everyone knows it”.

Every on-screen keyboard layout I have seen goes with QWERTY, but I’m convinced this is completely wrong-headed for any situation that doesn’t involve touch-typing. In particular, any application that can’t handle fast typing (I’m looking at you, ticket machine) has no call to use QWERTY. Nor does any application that is used by people of all ages and backgrounds. Unfortunately, I can’t help but feel that this travesty will continue until even our grannies eventually learn where the QWERTY keys are.

Idiot’s guide to signing up for Yahoo! Groups

It seems fairly clear that Yahoo! doesn’t have the most intuitive user interface, so here are some instructions that I hope will help people get signed up for Yahoo! Groups with the minimum of fuss. It’s intended for members of my rowing club, Furnivall, but if it works for others, great!

  1. Go to the Yahoo! Groups web page, and click on the Sign Up link
  2. Sign Up link on Yahoo! Groups home page

    Sign Up link on Yahoo! Groups home page

  3. Fill in the form that’s displayed. Don’t forget to tick the checkbox at the end of the form to say you’ve read the terms and conditions! Then click on the “Create My Account” button.
  4. Sign up form

    Sign up form

  5. You will return to the Yahoo! Groups home page. In the top left corner, you will see your username. Hover the mouse over it and select “Account Info” from the drop-down menu.
  6. Yahoo! Groups home page when signed in

    Yahoo! Groups home page when signed in

  7. Yahoo! will ask you for your username and password again (it’s just an extra security step). Enter them and you will be transported to the Account Info page. From here, you will see one or more e-mail addresses. Click on the “Change” link as highlighted in the next image.
  8. Account Info page

    Account Info page

  9. On the next page, you can add or remove e-mail addresses. If you want e-mail from a group to go to a particular e-mail address, and that address is not shown on this page, click on the “Add Another” link.
  10. Adding and removing e-mail addresses

  11. You can now join a group, for example by going back to the home page and searching for the name of the group you want to join. One last thing: changing the e-mail address that the group sends e-mails to. Go to the home page of the specific group you want to configure and click on the “Edit membership” link.
  12. A group home page

  13. From the group membership page, you’ll see that you can select any one of the e-mail addresses you configured earlier. You can also hide your e-mail address if you want.
  14. Edit group membership page

    Edit group membership page

    Now go sign up to those Yahoo! groups!

Cropping an image in HTML

Take a look at the image of the Grails in Action book cover in the sidebar. That image has a white border to the right and bottom, but that border is not visible. Don’t believe me? Tough. For those of you who do believe me and want to know how to crop an image, read on.

The original image is 150×188, but to eliminate the white border we need to display 141×176, i.e. cut of the right 9 pixels and the bottom 12. We could use the width and height attributes of the img tag, but that doesn’t achieve what we want: the browser will just scale the image to fit in those dimensions, so the white border will still be visible.

The trick is to wrap the image in a div with the appropriate dimensions:

<div style="width: 141px; height: 176px; overflow: hidden">
  <img src="..." width="150" height="176">
</div>

Voila! The image is cropped! If I learn how to crop the left and top as well, I’ll update the post.