Archive for the ‘Geeky’ Category

USB is confusing

Monday, September 20th, 2010

So, everything in USB is named from the perspective of the host. You have endpoints, which define logical pipes down which data can flow. There are IN endpoints, which means that data flowing down them goes “IN” the host, and “OUT” endpoints, which means that data flowing down them is going “OUT” of the host.

So, if you’re building a USB device, you basically need to remember that “IN” actually means out (from the perspective of the device) and vice versa.

Also, if you’re writing a USB device simulation, and you’ve got a function called “OnReadTransfer”, this means that the host is making a request to read data from you. Which means that you, as a device have to write data. Down your IN endpoint. Obviously.

Google Nexus One

Tuesday, January 5th, 2010

So, Google have a phone out now. By all accounts, it’s very much Just Another Android phone – it’s running a more recent version of the OS than most, and it’s got a few tweaks like animated wallpapers, but it’s really nothing much more than any other recent Android devices. Certainly nothing that would make you immediately rush out and buy it over any of the others. What’s the point in this, then?

I’m pretty sure Google don’t actually intend this to be an iPhone-beater in and of itself, nor do I expect that they’re thinking they’ll make any appreciable money off it (heck, they claim to be selling it at cost – and it’s certainly a fair bit cheaper than the iPhone, although it’s still far from free). What it is, though, is a brand-positioning exercise: up until now, Android phones haven’t really had much unity of brand, being made by different manufacturers, with various customisations and widgety bits. In announcing their own phone, Google are making their presence in the phone market much more prominent to the average consumer – so now people can walk into a phone shop and can ask for a “Google phone”. And the really significant thing is – it doesn’t matter whether people buy the Nexus One, an HTC Hero, a Motorola Droid or any other future Android device – all Google care about is that you buy a phone running its software, delivering its adverts to you. And that is what I think the Nexus One is about.

A quick rant about consistency

Friday, November 13th, 2009

So, I’m doing lots of exciting gathering of statistics and drawing of graphs at work at the moment, and have been making use of the excellent Matplotlib and NumPy Python libraries to help me. They’re both really handy bits of code, but there’s some awful examples of inconsistent design in there. For example:

import numpy
data = numpy.array([1,2,3])
mean = data.mean()
median = numpy.median(data)

– that is, mean() is a method on array(), which makes sense, but median() is a global function that takes an array as a parameter. I’m sure someone, somewhere, has a really good reason for that. But I’m also sure they’re pretty much wrong.