Blog Archive — Page 16
This is part of my blog, which I have long since stopped maintaining. The page has been preserved in case its content is of any interest. Please go back to the homepage to see the current contents of this site.
-
UX is in the Radio
This morning, on the daily hour-long moan-fest we call “commuting”, we engaged in our normal pattern of radio use – working our way across the entire spectrum several times, not finding anything particularly appealing, before at last settling on the least annoying option. Then, a minute and a half later once that one not-too-bad song had finished, repeating the whole cycle again.
I am given to understand that most people pick a preferred radio station and stick with it, tolerating the annoying bits while they wait for whatever they like listening to to come on. I, and the carpool, just don’t quite “get” that behaviour. For me, ten minutes of inane Scott Mills drivel, yet another yokel radio “guess the sound and win two tickets to the cinema!” competition, the hundredth fucking advert for Apple Fucking Conservatories – they’re intolerable obstacles in the way of possibly-decent music.
I approach this problem in the manner of what old people might term a “digital native” (a term which suggests to me that I should have a necklace of USB sticks and perhaps a battle cry that’s something to do with SuperPokes). The choice for me is not Radio 1 against Wessex FM, Radio Solent against Wave. It’s FM radio versus net radio.
And against that competition, the user experience of traditional radio stations is appalling.
Say, like I usually am, you are in the mood to listen to a particular kind of music that you don’t happen to have on you in any form. Here’s how some popular services compare:
- Spotify will, for free, play you exactly the songs you request, with the occasional advert – so let’s call that about 95% “what you want”. By paying, you can remove the adverts and essentially, so long as your taste isn’t too obscure, get that to hit 100%.
- Pandora will try to guess your exact taste over time, delving deeper than just high-level genres. With a few adverts and the occasional bad choice, you’re probably getting 90% enjoyment.
- Last.fm will play you your “Recommended Radio” songs that are “similar to” an artist of your choosing, or songs with a certain user-contributed tag. No adverts, but a higher rate of playing songs you don’t like – call that 85% enjoyment, though of course as with Pandora you can always skip the ones you’re not in the mood for.
- Local radio, by contrast, often dedicates around 10% of its time to adverts, 5% to news, and (conservatively) 20% to inane DJ drivel. This leaves 65% for music, and if you’re lucky, you might enjoy half of what they play. A miserable total of 32.5% enjoyment. And of course, if you’re particularly in the mood for say, metal or EBM, well… out of luck.
I’m sure it would be premature of me to declare the death of broadcast radio, just the same as I’m sure lots of people enjoy Scott Mills being a twat and the possibility to win virtually nothing by doing virtually nothing in some local radio competition.
But as a means to consume music? It’s a long way from being a service that gives its users what they want.
-
Madness and the TableModel
What follows is a lengthy rant about a particularly annoying situation in some of my code. Programmers, please let me know - is it the toolkit that is mad, or is it me? Everyone else, feel free to skip it!
:)
For one of my current Java projects, I am using a toolkit that comes with its own complete set of GUI widgets based on Swing. Swing… and horror.
I was under the impression that managing a table in any sane OO language goes a bit like this:
-
Create a class that roughly represents, or at least holds the data for, a row of the table.
-
Create a “Table Model” or some other kind of backing array to hold objects of that class.
-
Create a Table widget that uses the table model as its data source.
-
Happily filter and sort away, knowing that the model and the view are completely separate entities.
And if you should want to serialise the data behind the table to disk, and load it again, you can just save and reload the model, then call some update method on the table itself to let it know that the model has changed.
Bring on the horror!
What this toolkit does, allegedly in the name of MVC, is this:
-
Create a class that roughly represents, or at least holds the data for, a row of the table.
-
Create a “Table Model”, but completely ignore it.
-
Name the columns of the table after the internal member variables of the class you have created.
-
Add each object to the table in turn, watching in agony as it extracts the values of those member variables, and puts them into the table as Strings, discarding the original object in the process.
But wait, what if those member variables are (sensibly) private? Oh, no worries. It uses reflection, each and every time you add an object to the table, to figure out what the getter method for that variable is called.
And then we come to wanting to serialise the data to disk. Well, that could be a problem - the table doesn’t contain the objects we want, only Strings. Oh, no worries. You can give the table a new instance of your object, have it figure out (again, at runtime) which the appropriate setter methods are, and run those to make your object again!
Oh, hey, I hope that object didn’t contain any variables that weren’t in the table. ‘Cos if so, you’re not getting them back.
Luckily in my case, everything I care about is shown in the table, which only leaves the attempt to serialise it.
Now I want to have a single class that nicely encapsulates this serialising business for all tables, regardless of what the objects expressed in that table are. Normally, one could just serialise the
TableModel
and be done with it, but now we need to dynamically re-make the objects based on what’s in the table.For a fully encapsulated solution, I really want to be able to just pass in the table and have the serialiser take care of the difficult stuff. i.e. I want to call:
if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { SerialisedTableFile f = new SerialisedTableFile(fc.getSelectedFile()); f.save(table); }
But I can’t, because
f.save()
now has no idea what kind of object it is supposed to be building. So we need to passf.save()
a template object of the class that it is supposed to be building, the only requirement of which is that it can be cloned to produce the real object that we want to store data from the table in. So we implement theCloneable
interface – except thatCloneable
doesn’t actually includeclone()
for some no-doubt genius reason. (Not sarcasm, I really do suspect that language designers are an order of magnitude more intelligent than I.)The end result of all this is that I now have an interface that delights in the name
ReallyCloneable
, which all classes that I wrangle into tables have to implement. And poor oldf.save()
looks like this:public boolean save(Table table, ReallyCloneable itemTemplate) { boolean success = false; try { if (file.exists()) { file.delete(); } if (file.createNewFile()) { ArrayList<Object> items = new ArrayList<Object>(); for (int i = 0; i < table.getRowCount(); i++) { try { Object o = itemTemplate.clone(); table.getItemFromRow(o, i); items.add(o); } catch (NoSuchMethodException ex) { Logger.getLogger(SerialisedTableFile.class.getName()).log(Level.SEVERE, null, ex); } catch (InvocationTargetException ex) { Logger.getLogger(SerialisedTableFile.class.getName()).log(Level.SEVERE, null, ex); } } ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file)); out.writeObject(items); out.close(); success = true; } } catch (Exception ex) { Logger.getLogger(SerialisedTableFile.class.getName()).log(Level.SEVERE, null, ex); } finally { return success; } }
I think it’s about time I started buying Bad Code Offsets by Direct Debit.
-
-
The فراشة Effect
Two months ago, a young Tunisian vegetable-seller killed himself in protest when officials in his home town of Sidi Bouzid prevented him from selling his wares on the street.
That was December. Now it is February. What became known as the Jasmine Revolution swept through Tunisia, exiling its President of 23 years and ushering hope for freedom and democracy. Egypt followed, ousting President Mubarak from his 30-year rule after a protest in Tahrir Square that saw more protesters’ children in impromptu day-care groups than molotov cocktails.
Unrest has swept the states of the Arab League. Protests have rocked Morocco, Algeria, Jordan, Syria and Yemen. Tensions are flaring once again in Iran. Bahrain ordered its soldiers to open fire on their people. And tonight Libya lies on the brink of revolution or civil war, the east of the country reportedly under civilian rule as army units defect, police stations burn and hundreds lie dead.
I wonder if Mohamed Bouazizi had any idea, back in December, that his death would be the catalyst for the greatest unrest the region has seen in decades?
And I wonder how many other situations, political or otherwise, are susceptible to the same butterfly effect. How many other butterflies are there out there whose simple, local actions will end up tearing countries apart?
-
The End of an Experiment
A year and a half ago, off the back of a holiday that was largely caffeine-free, I decided to bite the bullet and ditch my high caffeine intake for a life of tea. Up until that point, I was getting through around four cups of instant coffee a day at work, and suffering for it on the weekends – I’d forget to keep my Saturday caffeine intake as high as my weekday intake, and by Saturday lunchtime the headaches would have set in. I frequently solved that problem with Red Bull, which in turn often left me feeling sick for the rest of the afternoon.
It was almost six months before I had my next cup of coffee, bought for me by someone who hadn’t remembered that I was trying to avoid it. And oh boy, how good does a cappuccino taste after half a year without!
At that point I decided to relax my self-imposed regime – I would allow myself “proper” coffee, but not instant. Instant coffee was the only kind I could sensibly drink at work, so the “no instant” requirement would still prevent my excess weekday consumption while still allowing me to drink cappuccinos on the rare occasions I made it to a café.
Though my promise still stands mostly intact – I have had only one cup of caffeinated instant coffee in the last 18 months – the idea behind it has fallen by the wayside. The culprit? Our office’s coffee machine.
It’s more expensive than making my own tea, but it’s much less hassle. The cappuccino it produces is dubious, but its idea of tea is much worse. But more than that, it’s more social. On a normal day as a tea-drinker, I only had to venture five metres outside the office for hot water, usually meeting nobody on the way. But as a coffee-machine-user, I get to chat to dozens more people every day. It’s a small change, but it makes taking a break from work an order of magnitude more enjoyable. And once back in the office, the caffeine rush from coffee hypes up my productivity far more than a cup of PG Tips ever did.
It was a nice 18-month experiment, but I think it’s time to close it down and see what happens next.
-
Johannes Kepler and the Fabric Mice
We have a book called “Twinkle Twinkle Little Star” which intersperses the lyrics of the famous nursery rhyme with pages in which fabric mice contemplate their place in the universe. One of the pages which particularly strikes a chord with me has a mouse looking up at the night sky and wondering “are there stars for us all up there, or do some folks have to share?”. I’m not sure our child is as enthused as I am about the answer to that question – that not only is there a star for every human being (and mouse) on Earth, but that in just the observable portion of the universe we have about 10 galaxies each – a total of around 100 trillion stars for every single one of us. [Wikipedia]
In similarly humbling news, the Kepler team yesterday announced the results of the first four months of the spacecraft’s planet-finding mission. Even if only 90% of their candidates are real planets [Morton & Johnson], that still means they found an an astonishing 1112 new planets in four months.
The plot of extrasolar planets discovered by year now looks something like this: [Wikipedia, Borucki et al]
Never has the trend of bars on a graph given me a more wonderful feeling about the future of our species than this. We may have budget cuts, wars and enough weapons stockpiled to wipe humanity from existence, but I can’t help looking at a graph like that and thinking that we’re going to get there. Though it might be thousands or tens of thousands of years from now, we’ll be out there; our descendants spread across the hundreds of human worlds, counting yet more stars to call our own.
-
The Pulse
Another afternoon of high-volume Pendulum and high-caffeine brain, blazing through work on one screen while flicking my attention over two others. Two news pages and four Twitter lists are open, poised. They all refresh automatically, but each time my eyes focus on them I reach for the manual refresh button purely on instinct.
It’s a constant stream of news that’s in real terms utterly useless to me. I’ve never been to Egypt and I don’t know anyone there. I don’t know a lot about Mubarak’s regime or any of the alternatives. In a world without the internet, maybe I’d buy a paper tomorrow and read about it with mild interest. But the internet itself, and the real-time access it brings, can elevate any topic to the point of obsession.
Something big is going down in a country thousands of miles away, in a country where everyone’s phones are offline, internet access has been cut, and news agencies’ cameras have been conviscated. But still the news comes. Phone calls translated into tweets, live blogs pushed byte by byte over satellite modems, handheld camcorders standing in for the lost news cameras.
The immediacy of it, the raw transport of information from reality to text and video, the process itself kicks off a little spark of adrenaline, inducing a stress response, refresh, refresh, refresh until the source stops broadcasting, then find a new one. Never stop. Disconnection is death.
The white-hot pulse of news flashes upwards from Tahrir Square out to low-earth orbit, back to the surface, across millions of spiderweb miles of cable and straight into my forebrain.
The real world feels so slow sometimes. It can be minutes between tweets.
It’s a continent away and it doesn’t affect my life at all. But I don’t want to be a day late reading the news – I don’t want to be 30 seconds late.
Each day I carry around a plethora of devices that let me avoid that horrible lateness; allow me to find the pulse from wherever in the world it starts and catch it before it’s had a minute to grow cold. One day, we will be able to catch that pulse and ride it with a mere thought – and for me, that day can’t come soon enough.
-
Inbox Many
There’s been a recent increase in productivity-related posts on Lifehacker, so inspired by that I thought I’d share how I “get things done”, and hopefully swap tips with others!
My approach is simple: I attempt “Inbox Zero”. And deliberately fail.
After several years of attempting to keep a clean inbox, having any messages at all sitting there really annoys me. I use that to my advantage and end up doing the polar opposite of “Inbox Zero” – that is, I use my inbox as my to-do list. Whenever I think of something I need to do, I write a short e-mail, usually just a subject line, and send it to whatever inbox is appropriate for the task (work or home).
It has the advantage of simplicity – while corporate firewalls could prevent me from using a
todo.txt
and a filofax could be left at home, there’s virtually no situation when I’m more than a few feet from a device that can do e-mail.And the worry that “Inbox Zero” was designed to address – huge inboxes that get piled up with junk that never gets acted on – is avoided because having those e-mails in my inbox, even though I put them there, is annoying enough that I clear them as soon as possible.
I’ve taken to calling the technique “Inbox Many”.
So, great untamed hordes of the internet – I’m intrigued. How do you lot get things done?
-
The Flow
So I spent my day caffeinated up to the eyeballs, loud music playing, churning out documentation until I started spamming Twitter with all-caps weirdness and I started wanting the phrase “COFFEE FOR THE COFFEE GOD! MUGS FOR THE MUG THRONE!” emblazoned on my coffee mug and, frankly, my soul. (Thanks @Bobolequiff.)
@HolyHaddock later tweeted about his much more restful afternoon, but while I can appreciate it being nice, it just seems so much less… epic.
There’s no sensation, for me, like finally achieving the hyperactive nirvana of flow.
It takes caffeine, of course – four cups of strong coffee over the course of the day, each one timed to mitigate the crash from the last. It takes music – the kind of music that doesn’t give a damn about genre or technique, but is brutally designed to hot-weld your eardrums to your adrenal gland with lightning at 150 beats per minute. It takes focus – a single task to be done, no distractions except for the continual background process of the internet’s pulse.
It just accelerates, never stopping. Athletes talk about “hitting the wall”, you reach a point where it hurts so much you just can’t find a way to carry on, until at last you crack it. But there’s none of that, because it’s all in your mind and your mind is hot-wired. It’s a single white-hot moment that lasts for hours but feels like microseconds, where ideas escape your brain at a billion degrees Kelvin and etch themselves into reality.
Sure, I’ll probably explode in a shower of caffeine and adrenaline when I’m about 30. But for now, screw restful afternoons. Eyes wide open, brain set to overdrive. It’s like feeling alive, only more so.
-
Autonomous Quadrocopter: What and Why?
It’s now been two years since I last did any work involving autonomous vehicles, and I’m kind of disappointed by the lack of that kind of work. Writing software for big data acquisition systems is all well and good, but it lacks a certain something – I just don’t get attached to them in the way that I do to vehicles such as this one.
One could probably argue that developing an odd fondness for robot boats is a bad thing, but unfortunately that appears to be the way my brain is wired. So, onwards!
Since no autonomous vehicle work seems likely to come my way professionally at the moment, the urge is rising to build one in my spare time. This presents a problem, in the form of a lack of time and money.
I’m unlikely to stumble upon a free RIB, jetski or minisub that I could hack about with, and have nowhere to store one anyway, so those are probably out. Cars would be the next obvious choice, but if we had a car to start with, the family may object to me covering it in sensors and filling the boot with computer equipment.
I think we need to think smaller, and my co-conspirator @aefaradien suggested a quadrocopter.
Our first challenge is to specify the parts we want to use, which is the first point at which my expertise starts to become less useful. The natural approach for me at this point is to spend about £20,000 on a cRIO and a bunch of PC104 boards and wire them all up in a big case – not only don’t we have anything like that amount of money, weight is now also an issue.
For the CPU of the device, we considered a cheap Android phone, as this would give us GPS, a gyroscope, WiFi and a camera without spending too much money. However, we would still need to use a separate motor driver board for the propellers, and getting a phone to talk to it could be tricky. @aefaradien raised the issue of reliability, too – a crashed phone means a crashed vehicle. Even with a watchdog timer to reset the phone (potentially yet another board), Android’s boot time is going to leave our precious ‘copter in a ditch somewhere.
An Arduino is looking like a much more appropriate solution, especially as they come with digital and analogue I/O baked in, and readily available “shields” that could drive the motors. However, that leaves us sourcing our own gyroscope, GPS and camera, as well as figuring out how to remotely control the vehicle.
Our notes are available at sparktank.net, and more bloggery will occur as the project progresses.
-
The Rise and Fall of LiveJournal
Once upon a time, accounts on blogging site LiveJournal were precious commodities indeed – the site gave out invites for its members to use, but there was no public sign-up page. I got my invite in the autumn of 2003 thanks to sasahara (Account active 2003-2009) from the IRC channel that I frequented at the time.
LiveJournal was the ‘in’ place to be for angst-ridden students like myself, in the dim and distant pre-MySpace past. We were all there; it was our network before Facebook came along and crushed all other ways of swapping awful memes with your friends.
If I recall correctly, on our first encounter, squirmelia (2001-2011) asked for my LJ handle before I was asked for my name. (Though seeing as that night was also my first encounter with eldritchreality_ (2004-2011)_ and charon47 (2001-2010), and my first trip to The Dungeon, that recollection may easily be in error.)
As the place where we bared our hearts for the world to see, there were good and bad times aplenty, all pasted up on the internet – though in the case of the most intense drama, it was locked down for only certain groups of people to see. I recall having “Everyone except X” groups for all three of my University crushes, plus the girl I ended up with.
The LiveJournals we created for characters in a roleplaying game, like my own Kotori (2004-2005) are still there. And aside from an in-character Remus Lupin blog (2003), eldritchreality and I are still the only LJ users to express an interest in combat magic. We spammed countless quizzes and memes together, organised dozens of parties over LJ; my friends and I.
Good times. And yet, in a few short years, it has become nearly irrelevant.
10% of those people I was friends with on LJ have properly closed their accounts; 90% of the rest stopped posting long ago. 20% of the groups I was a member of are closed, 100% of the rest are silent or beset by Russian spammers. 19 of my friends have their own blogs elsewhere. And I irritate everyone I’m sure by syndicating my own posts from my blog to LJ with the accompanying hook link to direct people back to my site.
Scrolling back as far as I go in my LiveJournal friends list turns up a grand total of 10 people still using it, of which 8 post only unprotected entries which I could easily pull using an RSS feed.
Which leads to the conclusion that LiveJournal is taking up its space on my toolbar and in my brain in order that I stay in touch with two people – both of whom I interact with more on Facebook than LiveJournal anyway.
Sad as it is to see LiveJournal wither and die when once it was our companion through our angstiest years, I think it may soon be time to declare it over. Like all technology in our century, it ends not with a bang but with a whimper, simply rendered archaic and irrelevant by its successors.
Like tears in rain, and all that.