Wednesday, December 08, 2010

Cancelling pending messages in Skype

How often are you chatting with someone in text on Skype when they log off, leaving messages in a send queue "waiting to be delivered"? How often does this happen, and the other party doesn't log on at the same time as you for days or weeks?

Well, it happens to me now and again. Sometimes you'll check the chat window with someone and see that it's waiting to send "Hey, I'll be a bit late this evening, maybe 9pm?", a month after the event? In many cases, you'd rather cancel the message rather than possibly confuse them when they receive it weeks later out of the blue.

Unfortunately, for some inexplicably stupid reason (or, more likely, no reason), Skype does not provide any method to cancel messages that are waiting to be sent, even though they're merely held offline on your local machine until Skype sees the other party online again. There is no technical reason whatsoever why these messages can't be deleted.

Since Skype doesn't do the job, you'll have to do it yourself. And luckily, it's not too difficult - it just requires one SQL statement to be executed on your local Skype database:

download a sqllite editor (
exit skype
browse to: %AppData%\Skype
browse into your username directory
backup main.db <--- IMPORTANT!!!
run the sqllite editor
open main.db in sqllite editor
in the Execute SQL tab type the following commands:

--> (optional) this command will show you all of your unsent messages:
select author,identities,dialog_partner,body_xml from messages where sending_status = 1

--> this command will delete all unsent messages to a specific username:
delete from messages where dialog_partner = "username" and sending_status = 1

--> this command will delete all unsent messages:
delete from messages where sending_status = 1

Thursday, November 11, 2010

Miktex + LyX. Pixellated font?

My Miktex (2.7) install came without the "Computer Modern" vector font, and PDFs generated by LyX came with an awful bitmap version. There were two reasonably easy fixes:
  1. Go to Document->Settings...->Fonts and choose the Latin Modern variant for the three font families.

  2. Open the Miktex package manager, find the cm-super package and install it.

Both worked for me, but I stuck with the second option rather than make global changes to LyX default document settings.

Sunday, October 10, 2010

Alipay? Alibollox!

Taobao/Alipay are the Chinese equivalent of eBay and Paypal. To buy things, you have to set up an account with both services and register some kind of payment method - mostly Chinese banks, but Visa and Mastercard are apparently supported (although they didn't work for me).

There are a number of hideous, needless errors and usability mistakes on the Alipay site in particular:

  1. When entering your name, you must type it all in capitals. Why? You can automatically convert the string to uppercase if necessary in Javascript. No need to burden the user with this.

  2. You can't enter a phone number with more than 11 digits, it can't have a '+' symbol at the start, and it's validated as a Chinese mobile phone number (must have 13 or 18 at the start). The hell?

  3. The actual payment forms assume that the customer is using Internet Explorer and they're completely broken in Firefox. I'm using a Mac and even on my Vista box at work I use Firefox and Opera.

  4. After finally submitting the form (by using Firebug's console to fix some of the broken Javascript/DOM code: "form1 = document.forms[0]"), we get a page telling us there was a "payment failure" with error code -1, with the helpful message "没有定义的错误代码" meaning "the error code is undefined". Thanks for that.

What's most annoying are the problems that are so easy to fix: allow any phone number to be entered. Don't ask your users to type things in all caps. Don't assume your users are using Internet Explorer (or Windows) - that kind of nonsense should have been left in the 1990s!

Chinese websites and software often suffer from these problems. Everything appears to be written for Windows, even the web sites. Software doesn't declare what language it's written in and assumes the user has a Chinese version of Windows, forcing them to call the program through AppLocale (if they know how). If there's version of the software built for OS X or Linux, it will be binary only and either doesn't work at all or crashes constantly (QQ for Linux). Of course, you can't use an open-source program that tries to use that protocol because the servers detect and ban unofficial clients. Weak!

Another thing: about 99% of Chinese websites appear to be spammy search portals with hundreds of links and no useful content. Is there a way to search for useful content on Chinese sites and filter out all the useless portals?

Thursday, September 23, 2010

Eclipse: escape strings when pasting - off by default?

After a couple of years of occasionally having to paste a large multi-line string into Java source code and escape the hell out of it, I eventually searched for some kind of online tool to automatically do the job and quickly discovered that Eclipse automatically does this for you if a certain menu option is enabled (prefs->Java->Editor->Typing->"Escape text when pasting into a string literal").

So why on earth is this feature not enabled in Eclipse by default?

Tuesday, September 21, 2010

Integrity in snooker: empty pandering or meaningful measures?

When the John Higgins scandal erupted some months ago, I tried to keep an open mind and honestly hoped it was all a misunderstanding until I watched the video and heard some of the details of the case. It was very disturbing evidence, but even then I hoped for everything to turn out alright in the end, even if there was a good chance that he truly intended to carry out the promised match-fixing.

Flash forward a few months and Higgins' manager is banned from the sport for life (even though he had already resigned from his position on the WPBSA board) and Higgins gets a backdated six month ban and a £75,000 fine.
Then Barry Hearn, the recently-appointed chairman of World Snooker, appears on BBC2 today talking about the new anti-corruption unit being set up as a preventative - rather than curative - measure against betting fraud and match-fixing.

He was asked what role Higgins will have in this new light, and responded by basically saying that he would serve as an example to other players of how dangerous it is to give in to that temptation and appear to agree to dodgy deals without reporting them, especially now that there'll be some official, private channels for doing so. He also stated that Higgins made a silly mistake, by trusting people he shouldn't have, and was heavily punished and that £75,000 isn't pocket change.

That was a mistake, I think. For someone like Higgins, a backdated six-month ban and a £75,000 fine is chump change, especially when Hearn followed up those comments to assure of the seriousness of the new regime by saying "we're talking about lifetime bans here".
If we're talking about lifetime bans, Higgins got away very lightly and you should really acknowledge that. Why not just say something like "the case with Higgins could easily have ended up differently and he might have received a very lengthy or indefinite ban. But now we're drawing a line and making it very clear what you can and can't do, and specifying the penalties for breaking those rules"?

Another player, Quinten Hann, was handed an 8 year ban a while back, for agreeing to lose a match in the China Open. However, he resigned before the ban was decided, and never had a squeaky clean image to begin with. Also, his highest ranking was #14, where John Higgins has been #1 for a while and is one of the most consistent players in the game.
What if Higgins was a much lower-ranked player of less fame? Would he have been banned for longer (or even forever) and fined less?

What worries me is that much of the assurances about "hard measures" might be concerned more with convincing the public with tough-talking "draconian" plans than with actually stamping out corruption - that Higgins' real mistake was to get caught. But I'm still glad to see Higgins back in the game - it'd be such a shame for a master craftsman to be officially banned from his craft forever. I just hope that Hearn and the rest truly care about sport and its integrity rather than simply protecting the bottom line by telling the optimal story to the punters.

Oh and on a side note, I'm glad to read Hearn's comments on Ronnie O'Sullivan's odd attitude towards completing a 147 today: “I really don’t like to hear multi-millionaires talking about a few extra pounds for a 147 when that’s the game that’s given them their livelihood”.
Spot on, and a big "WTF Ronnie". Walking away from the table on a 140 break with the black on, or missing on purpose (which he very nearly did - the black nearly bounced off the table) would actually hurt the audience - remember Ken Doherty's missed black on a maximum attempt and the groans from the crowd, and try to imagine what it would be like if O'Sullivan missed one on purpose. I'd hate to be the guy giving post-match interviews with him - it seems like 15% of the time he enjoyed playing, 70% of the time he felt nothing, 80% of the time he says something really sad that makes you wonder if he hates the whole thing, himself, fans, other players etc.

But on the other hand, a 147 is still an amazing feat, even if it's slightly more common. The commentators seemed to only consider the case where there's no maximum break prize versus a £147,000 prize. Why not have a token but still half decent prize for a maximum - let's say £14,700 - which a) would not be sniffed at and b) would be separate from the high break prize, so that getting a 147 gets you a tangible reward. The amount isn't really important, as long as a maximum is distinguished from a high break of 145 or whatever.

Sunday, September 12, 2010

Screen magnifier and Orca screenreader stuck on at login screen (Ubuntu)

Although Linux has improved immensely in many respects over the years, there's still a chance of running into bizarre problems, either during install or in normal use.

A while ago I wiped the old Mandriva 2008 partition on my Acer Aspire 1705SMi, a 7 year old juggernaut of a laptop which was sitting in a drawer for a year or so.
The first problem was that the Ubuntu Live CD could not even boot properly, since as soon as it loaded the splash screen the video adapter (a NVidia GeForce FX Go5600) went slightly insane and produced a screen which looked like a garbled moire interference pattern. Rough shapes (maybe that's a dialog box...?) were visible but it was basically unusable.

Getting past that required editing the boot command line for the kernel at the GRUB prompt (hitting 'e', IIRC) and adding the "nomodeset" parameter. I also removed the "splash" parameter but this probably wasn't necessary. If something like this can happen, why not offer a nomodeset boot option on the boot menu, rather than forcing the user to edit the boot command line?
This got as far as a failed start of X and dropped back to the shell, where I was able to edit /etc/xorg.conf and start the installer.

So that was okay. The install worked nicely, although both suspend to RAM (sleep) and suspend to disk (hibernate) completely fail to resume, requiring a hard reboot. No change from ~2004 when I had to download a fixed version of the buggy Acer DSDT and install it at boot, as well as tinker with the kernel source (maybe, not sure if it was necessary). Surely those problems could have been fixed in the mainline kernel though - if it was fixable by a layman like myself before, why does it still not work out of the box?

Then a 2 year old demon managed to somehow enable Orca (a screenreader), a screen magnifier and dreadfully annoying "slow keys" by randomly clicking around (from her own user account), and things got really weird on the next reboot: the left half of the screen is normal, while the right half shows a magnified cursor and a load of garbage (maybe due to the old NVidia card being a pile of arse). Trying to type in a password to login seemed impossible at first, until I realised that I had to hold each key for about half a second before it would register. Ugh.

Anyway, after logging in I made sure that all of the accessibility tools were switched off in every preference menu on the GNOME desktop. Unfortunately this didn't really switch them off, even though the gconftool-2 program declared that they were successfully disabled.

After much googling (for once, not very helpful except to confirm that other people in similar situations have solved the problem by reformatting and re-installing Ubuntu, WHAT!) and grepping, I found another set of gconf XML configuration files in /var/lib/gdm/.gconf, even though you need to be root to access them.

Anyway, these global settings could be unset as follows:
$ sudo su
# cd /var/lib/gdm/.gconf
# gconftool-2 --direct --config-source xml:readwrite:. -s --type boolean /desktop/gnome/accessibility/keyboard/stickykeys_enable false
# gconftool-2 --direct --config-source xml:readwrite:. -s --type boolean /desktop/gnome/accessibility/keyboard/bouncekeys_enable false
# gconftool-2 --direct --config-source xml:readwrite:. -s --type boolean /desktop/gnome/accessibility/keyboard/slowkeys_enable false
# gconftool-2 --direct --config-source xml:readwrite:. -s --type boolean /desktop/gnome/applications/at/screen_magnifier_enabled false

Some of these problems may be due to the laptop having a poorly-designed BIOS/DSDT, so this post may sound like sour grapes. But a natural response from anyone who uses such a machine would be "but it works in Windows?" - and if it does, why shouldn't it work in Linux?

Tuesday, August 31, 2010

Parisian driving

(saving a comment I wrote on a thread)

I thought we had some crappy driving here (in Ireland), but visiting Paris for a week really put things in perspective.

Firstly, if you're a pedestrian walking at a crossing, even if it's a signalled one with a green light in your favour, drivers will happily continue to fly around corners and barrel through the crossing. Get in their way and either get knocked down or beeped into deafness.

Secondly, remember that two-second clearance rule here? The TV safety ads suggest that when the car in front passes a point, you should be able to say "only a fool breaks the two second rule" before you pass the same point. In Paris it's "only a foo- ARGHHH!", with cars overtaking you (from any side) and diving into your lane after having barely cleared your car. This happens all the time. The cars behind don't even brake when it happens, so the tacit understanding seems to be a) one or two metres of clearance is an acceptable distance at 100kph and b) overtaking drivers will never have to suddenly brake while directly in front of my car. Weird.

The two and a half hour trip from Amboise back to Paris really made this clear: drivers will gladly overtake a bus and pull in front with about two metres' clearance. Not only that, but the bus driver starts to pull into the lane they just left, while they're still moving into our lane with two metres' clearance.
All of this is completely normal there.

And as probably everyone knows, parking there means gently (or not) backing into the car behind you, then forward into the next one, then back and forth repeatedly bashing the surrounding cars until your car is wedged into a space with two inches to spare on one side, with bumpers touching on one side. Almost every car's registration plate and bumper is dented, scratched or missing.

So I arrived back in Dublin airport thinking "I guess the standard over here isn't so bad really", just as a shitestain of a taxi driver in a silver Merc floored it as soon as the green man started to flash, as I was already running across the pedestrian crossing pushing a trolley full of bags which missed his car by about two inches as it screamed past me.
If that thing didn't have its own brakes, you were getting a heavy iron trolley in the rear left wing. I was sorely tempted to just let it happen too, but settled for a rapidly-shouted "my light's still green, you stupid fucking bastard!"

Sunday, August 22, 2010

Does the free software movement represent "true freedom"?

Someone commented on a Youtube video that:
Actually, free software represents freedom. The Open Source Movement just supports the benefits of source code being available. The Free Software Foundation supports true freedom."

To which my response was:

It doesn't support the freedom to sell software though, does it?

Almost all of the software I use is open-source, and I've made (miniscule) contributions to open-source software in the past, but I don't think it's fair to demonise those who wish to make money from writing software by selling it.

Stallman seems to characterise closed-source as unethical, but is it really wrong for someone to release a program without the source code so that they can profit a bit from their work?

I'd be interested to hear any insight from others on this issue. Free software provides some freedom, but obviously removes the freedom to sell that software, even by the author. As a big fan and user of free software, but also a programmer and tradesman, I recognise that other people may want to do programming as a living by selling their work (rather than doing unenjoyable coding tasks for a large financial company they dislike, say).
I don't see anything wrong with that, unless there are superior models that allow them to still get paid reasonably well for their work as well as allowing them to release as open source. For example, many open source project pages have a donation link which allows happy users to send any amount of money to the developer if they wish, but I'd expect that this isn't a hugely profitable source of income compared to selling the software (which would kind of require it being closed source or at least with a horrible restricted semi-free license).


Friday, August 20, 2010

Why does Applescript suck so badly?

It's not like Apple is lacking developers or time or money or experience. Not only is the syntax for Applescript simultaneously verbose and vague, the API documentation sucks and the implementation appears to be buggy.
Not the language implementation per se, but the underlying hooks that allow it to do its job. For some reason, certain programs fail to respond to Applescript correctly, so scripts like the following don't work properly (and worse, the problem is sporadic):

tell application "Mnemosyne"
end tell

Fine, maybe the Python wrapper for Mnemosyne is a bit dodge. But why should it matter?

In Windows there are free third party scripting/automation languages like AutoHotKey and AutoItScript. I've never had a problem bringing an application window into focus with them - why would you? Perhaps Applescript's hooks are at a higher level, while those of AutoIt etc operate on a low level Windows message scheme: instead of applications responding (or ignoring, or bolloxing up) Applescript requests, they simply receive normal window/GUI events, just like when a user is manually clicking and typing.

These Windows automation/scripting languages "just work" - you can assume that a window is just a window and if you can activate one by clicking or alt-tabbing to it, you can activate it via a script - and the syntax is simple and intuitive for most programmers (although AHK's is a bit ugly IIRC).

If they can do that, surely Apple can do much better than Applescript.

Addendum: It seems that you can't even move the mouse from Applescript, without installing extra 3rd party software. Boo-urns!

Addendum 2: Well, it's not giving me error -9874 anymore when trying to activate the window. Also it's become apparent that when activating the Mnemosyne window with a modal dialog open (the "Add cards" window), focus will be on the application's main window, unless the mouse cursor is hovering over the main window. This happens when you manually cmd-tab to the application. Very odd - perhaps the GUI event loop isn't processed properly until the mouse cursor is moved over the main window? Ah well. The rest of my diatribe stands (or crouches) though - I still dislike Applescript in more ways than one.

Tuesday, August 17, 2010

Why is speeding so commonplace?

The root problem seems more that people are expected to drive at least at the speed limit, if not over. When a driver travels at 3-5kph under the speed limit, following cars tend to overtake as soon as possible or get angry and start behaving dangerously. There are very large number of people out there who will consider you to be a lunatic for doing 48km/h with a 50km/h limit. In Dublin at least, a 50km/h limit is tacitly interpreted as a 60km/h limit, a 60 as an 80, etc.

And it's not purely a social problem; it starts in the Rules of the Road, which says things like:

You must progress at a speed and in a way that avoids interference with other motorway traffic.

Avoid driving too slowly

In normal road and traffic conditions, keep up with the pace of the traffic flow while obeying the speed limit. While you must keep a safe distance away from the vehicle in front, you should not drive so slowly that your vehicle unnecessarily blocks other road users. If you drive too slowly, you risk frustrating other drivers, which could lead to dangerous overtaking.

While it does remind you to obey the speed limit, this comes into conflict with the greater message here: "keep up with the pace". Since it seems like the majority of other road users are almost constantly speeding, this reinforces the notion that you should never travel below the speed limit, and if anything, increase speed to match traffic in front.

It's frustrating - if you're driving within a city, given the time spent in traffic or stopped at lights and the relatively short distance, it doesn't really matter if you travel at 45 or 55. But it's considered a greater crime to err on the low side. Why?

Thursday, August 05, 2010

Java verbosity again

(Repost of a comment I made somewhere on the topic of the verbosity of Java, and particularly its APIs)

The Reflection API is a fairly shocking example of the needless verbosity of Java. And I would consider the official API to be part of Java.

Here's a simplistic example in Java and Ruby, replacing characters in a string ("putty" => "puppy") first directly and then via reflective invocation:

// Java
String s = "putty";
System.out.println(s.replace('t', 'p'));
try {
Class c = s.getClass();
Method m = c.getMethod("replace", char.class, char.class);
System.out.println(m.invoke(s, 't', 'p'));
} catch (Exception e) {

# Ruby
s = "putty"
puts s.gsub("t", "p")
puts s.send("gsub", "t", "p")

This kind of verbosity is prevalent in Java's standard libraries, particularly when (anonymous) inner classes are involved. At the moment I'm struggling with "doPrivileged" blocks in some Java code which deals with sandboxing, and it is syntactically very unpleasant.

Ok, we could chain the Java calls together and knock some lines off, but it's still not nice:
try {
System.out.println(s.getClass().getMethod("replace", char.class, char.class).invoke(s, 't', 'p'));
} catch (Exception e) {

Tuesday, August 03, 2010

Ankimini audio on the iPod: can I hear it now?

Yes! But a small amount of manual muckery is required.

Here are the rough steps that I followed to get an Anki deck working with audio on my iPod Touch (2nd gen, on IOS4):
  1. Jailbreak the iPod. This was actually so easy that it will be hard to suppress an ear-to-ear grin. Just going to that link and opening a cleverly broken PDF file exploits a bug (presumably a stack smash) to execute arbitrary code and install Cydia. You don't even need to reboot the device! Very different from the iPhone OS 3 jailbreak that I used last time, but this will probably become impossible soon (until someone finds the next suitable vulnerability).

  2. Install Ankimini from the Cydia or Rock package managers. Easy peasy.

  3. Create or download the deck in Anki (desktop). Get your deck working on a desktop machine as normal, then sync it with an online account.

  4. Sync your deck in Ankimini. This should be straightforward.

  5. Copy across the media files. From my Mac, the command to do so was scp -r ~/Documents/Anki/ mobile@ipod_ip_address:~/.anki

I then stopped and started Anki via an SBSettings button, but I don't think this step is necessary. Now I can learn and listen to spoken Chinese in "dead time" (i.e. when I'm on a bus or taking a shite). Brilliant!

On a related note, I would like to try the new AnkiMobile, but it's just a bit too expensive for me at the moment. I think the developer may be pricing himself out of the market - you don't see (proportionally) many iPhone applications that cost €20. At an uneducated, not-thought-through guess, I'd wager that more than twice as many people would buy the program if the price was halved. Hopefully it works out anyway, after the tremendous work he's put into Anki.

Thursday, July 29, 2010

Abuse of software patents (what else are they good for?)

Check out the Wikipedia entry for Vistaprint (emphasis added):

The company recognizes that developing and protecting its intellectual property creates additional value in the company, and acts as a business moat to deter competitors. So far, Vistaprint has secured 15 issued patents and has applied for almost 40 more.

The company has described its objective as a "minefield of patents" and has been active in pursuing companies that it considers to be infringing on those patents."

If you think that's an unfairly exaggerated statement, check out the interview* with Wendy Cebula, then Executive Vice President and Chief Operating Officer (now President of the North American unit) of VistaPrint (emphasis added in italics):
VistaPrint has always placed a strong focus on getting patents. Which one or two would you classify to be the most important?
We really look at patents as a portfolio approach. As different competitors may choose to enter the market in different ways, our strategy is to create a minefield of patents that would be difficult for anyone to navigate. That being said, our patents around our studio design technology, which is one of the ones we are defending right now in the public, and in our back-end aggregation and our bridge are two that have been issued and that are public that we believe that are very important to us. There are others pending that, clearly, we are excited about as well.

If that's not clear evidence that patent systems, and especially software patent systems, are purposely abused to stifle competition, then what is?

* Note that the interview was taken down - I had to find it in the Internet Archive snapshot from 2008. Interesting...

Tuesday, July 20, 2010

Irish casual racism: an exchange of vitriol on Youtube

After watching a very disturbing Youtube video trying to make the point that our good Irish culture (and presumably, skin colour) are being diluted, I felt the need to respond to some of the worst comments, particularly those that seemed to assume that all immigrants are gaming the system and/or getting "free housing", benefits and other such nonsense.

There were many comments like this:
nomorefreebees 3 days ago
great video ,,, so we now have foriegn irishmen do we? i dont think so,
the foriegners are here for only one reason and thats to make ireland their land,,,,,while our stupit government gives them all the benifits available and deprives its own people ,, hospitals closing down to keep immigrants ,,, benifits cut to keep immigrants...... and all the while we say nothing ....... so are we going to act now or do we want to let immigrants take us over like they almost have now in sweeden ...

I was saddened to see that a greater number of commenters seemed to agree with these misinformed racists. But then entertained by a quite ludicrous private message sent to me by one of them:

From: nomorefreebees Subject: fool Date: Jul 19, 2010
You have some cheek to dictate to Irish people haven't you? You didn't even know where this country was a few years ago.
You hand out allot of meaningless advice about a dole office. I have a business and I don't know what the inside a dole office looks like but obviously you do. Furthermore many so called immigrants are illegal and work as well as collect benefits. The evidence is on my channel if you care look at my videos. But you won't will you? Because you don't want to know do you? Or should I say you already do.
If all immigrants are working as you claim then why is it costing the Irish people 90 million a year to keep immigrants in Mosney Co. Meath? Plus another 190 million to keep the rest of them in free housing, benefits all over the rest of our country,
I have my facts right so get your facts right before you comment on my channel.
Letting on your little Mr. Innocent and trying to let people think you're the oppressed while all the while you're bleeding our country dry,

And my response:
"You didn't even know where this country was a few years ago"

It hasn't moved much in the last few million years. Also, could you start out by not spouting such clearly useless drivel as this? A few years ago, I was right here in Dublin, so I know exactly where we were.

"If all immigrants are working as you claim then why is it costing the Irish people 90 million a year to keep immigrants in Mosney Co. Meath? Plus another 190 million to keep the rest of them in free housing, benefits all over the rest of our country,"

Excuse me? Where did I claim that "all immigrants are working"? I certainly said no such thing and by trying to build such a flimsy strawman argument you have instantly reduced your credibility to ZERO.

Furthermore, the "immigrants" in Meath and "the rest of them" with free housing are a tiny minority of the immigrants in Ireland.

Your argument is like saying that humans shouldn't be allowed to live here because we spend millions to operate prisons and hand out dole to scangers who never work a day in the life.

The people who unfairly game the system are the VAST MINORITY.

Unfortunately, racist idiots like you appear to be growing in number.

Is it just that Youtube brings out the worst assholes (like him and well... me) or is this really how a majority of Irish people feel now? Because it's pretty damn sad.

More from him:
This is a small country and you claimed 90% of immigrants were working thats not true how could it be when its costing our goverment or should i say the tax payer 90 million a year to keep immigrants in mosney not counting their benifit money. And how about all the others? there costing us another 200 million a year , they have free housing, benifits, free bus passes , and the rest.
your only kidding yourself not me, like i said i have the facts i dont speculate. wheres your facts? tell me it doesnt cost us that money will you?

"your only kidding yourself not me, like i said i have the facts i dont speculate. wheres your facts? tell me it doesnt cost us that money will you?"

You do not have all the facts. If you had the facts you would not say something like "that's not true, how could it be if the tax payer is paying 90 million a year to keep immigrants in Mosney"? That is you taking a fact (90 million a year "to keep immigrants in Mosney") and jumping to an unsupported conclusion (at least 10% of immigrants are spongers).
You can't just take a fact and suggest that it supports any claim. THAT is speculation, and it's what you are doing.

I note that you're trying to build another strawman argument: "tell me it doesnt cost us that money will you?". Do you not see how silly this is? I never said that it doesn't cost us money. Of course it does. My point is that it's a small number of immigrants/refugees that cost us the money. Not only that, but the vast majority of immigrants (there are more immigrants than just refugees) HAVE to work to be here, and they pay tax like every other worker. So the legitimate immigrants are also funding the spongers.

Yes, there are some sponger immigrants. Yes, there are some sponger refugees. Yes, some of those refugees somehow got free housing. A very small number of them (and most of that happened at least 10 years ago).

You talk as if the majority of immigrants have free housing, free bus passes etc. That is not true and you do yourself a disservice to suggest so.

Saturday, July 17, 2010

Audio sync in DVD Flick

We were trying to create DVDs with the workflow Avid Xpress Pro -> (export Quicktime ref) -> Sorensen -> (convert to MPEG-2 DVD Pal) -> DVD Flick.

The output from Sorensen seemed okay when played locally, but the DVDs produced by DVD Flick had audio slightly earlier than video. After a long time searching, we stumbled upon a forum post where a guy (thank you, "dng"!) in a similar situation had resolved the problem in DVD Flick by going to Edit title... -> Audio track -> Edit -> Ignore audio delay. This worked perfectly for us, and showed that the audio delay in the MPEG from Sorensen was -160ms or so, which explains why the audio was slightly ahead of the video. Perhaps the media players we used (Quicktime and Windows Media Player) ignored this metadata which was why it seemed fine until burned as a DVD-video?

HTML5 video: WebM/VP8 vs H.264 on OS X 10.5

Trying to get away from the somewhat processor-intensive Flash for watching videos on the web, I just tried out the new codecs for HTML5 on Youtube in three browsers, getting the following rough reading for CPU usage (in the "top" utility):
  • Opera 10.60: ~110% (i.e. hogging more than one core)

  • Nightly Firefox build "Minefield": ~110%

  • Safari v4: ~20%

For comparison, the "old" Flash player was taking ~50% CPU.

It seems that both Opera and Firefox are using the VP8 codec for video, which is currently not hardware accelerated (at least on OS X, due to Apple not standardising some API for GPU use). Safari is using the H.264 codec which clearly performs much better on this machine, but which is patent and licence encumbered.

So at this point, VP8/WebM is completely unusable for watching video on slowish machines like mine (a 3 year old Intel Macbook). Here's hoping that VP8 can take advantage of better hardware rendering soon...

* Minor addendum: Looking at this analysis of VP8, perhaps the encoder/decoder implementations are just immature at the moment and need to be optimised in a few areas. However, there are also some mentions of disturbing (in terms of possible future patent issues) similarities between the VP8 and H.264 designs.

Thursday, July 15, 2010

Blinkenwords - Windows build

Following up on a previous post, a Windows build of Blinkenwords is now available here. I used a very impressive program called OCRA to automatically bundle the Ruby interpreter and required libraries into a single 4 megabyte (not enormous) packed executable.

Tuesday, July 13, 2010

On a minor roll...

Been fighting off a slight backlog of flashcards in Anki, pretty much due to downloading two French card decks as a refresher before heading to a conference in France next month.

After about 25 minutes going through some of the French cards, I had to leave them and pay some attention to the Chinese deck I've been building for a couple of years now. The cards are about 25% single characters (production), 40% multiple-character words (recognition) and 35% sentences (recognition), after switching sometime in December/January from production-only words/characters to make things more practical.

For some reason, it went really well today and I was on a roll, correctly answering some 83 cards in a row. No new cards, but a few recently-added ones which weren't completely familiar. Usually I'm happy to get 80-90% right, depending on tiredness.

It seems most efficient (at least if you occasionally create backlogs by not reviewing all of the cards on the day they're due) to review cards in order of their interval (i.e. if I don't finish all my cards today, at least I'll have dealt with the ones that were most in need of revising - seeing a 1 month card two weeks late is better than seeing an 8 day card four days late), so quit while I was ahead when asked to write the character for ginger (with an interval of around 2 months)*.

Minor arbitrary happy moment!

* I've been told that I should use less parenthesised clauses when writing. Makes sense... Actually thinking about it now, if I extracted the bits in parentheses from that sentence into footnotes, and then saw how silly the result looked, it might make refactoring the text more obvious. On the other hand, it's 2am and I'm supposed to have a meeting at 9:30am :/

Wednesday, June 23, 2010

Ultima 9

Ultima IX was one of the ultimate letdowns in the history of game sequels. Pretty much all of the previous games improved as the franchise continued, with the arguable exception of 8 (but Ultima 7 "The Black Gate" and 7 part 2 "Serpent Isle" were superb and very hard to follow). Ultima 9 took the leap into a properly 3D, third-person adventure, with a very clever physics engine and pretty graphics.
Sadly, it was released as a buggy, unconvincing game, with unsatisfying combat, awful AI, a fairly linear plot and an unimmersive environment - especially compared to the Black Gate where you could bake bread, sew thread into cloth and cut cloth into bandages, deliver pumpkins and meat and really interact with an enormous number of objects, as well as watch NPCs carry out believable tasks on a real schedule.

Perhaps the most enjoyable thing about Ultima 9 was the ability to build ridiculous, gigantic bridges out of sticks balanced atop scrolls lying on bottles balanced on loaves of bread, and jumping along the bridge in stages to cross the unswimmable sea between islands (!!).

Tuesday, June 22, 2010

Worst Google machine translation ever

Chinese: "齐桓晋文之事"

Rough meaning: The story of Huan Jin Wen of the Qi dynasty

Google translation: "Renal calculi matter of cerebral infarction in rats"


Saturday, June 12, 2010

Windows: still with the silly needless reboots?

Back when I used to use Windows 98 and then XP primarily, the phenomenon of having to reboot when carrying out a minor system change or installing an inconsequential update caused much exasperation, something which was far less of a problem on Ubuntu.

Then I moved to the Mac and was again disturbed by the occasional mysterious requirement to restart the machine merely because the web browser or worse, iTunes (which I do not even use) had updated itself.

And then I got a Windows Vista box and was reminded of the good old days:

Nice. I've never used Windows Mail, but now it wants to reboot the computer just because it's updating its own files? Piss awf!

Friday, May 28, 2010

Why you shouldn't multitask

Two great articles on why multitasking is not only bad for getting work done, but also damaging to our bodies and brains: here and here (yes, I know one of them is from the Daily Mail, pretend it isn't!). Well worth reading - I'm going to try to stop multitasking as much as possible (no more half-watching TV in the background, reading email/articles, talking, listening to MP3s all at once and so forth).

A couple of choice quotes:

"He found that just being in a situation where you are able to text and email - perhaps sitting at your desk - can knock a whole ten points from your IQ. This is similar to the head-fog caused by losing a night’s sleep."

"An American study reported in the Journal Of Experimental Psychology found that it took students far longer to solve complicated maths problems when they had to switch to other tasks - in fact, they were up to 40 per cent slower.
The same study also found multitasking has a negative physical effect, prompting the release of stress hormones and adrenaline.
This can trigger a vicious cycle, where we work hard at multi-tasking, take longer to get things done, then feel stressed, harried and compelled to multi-task more."

"Using brain-scans he’s found that if we multi-task while studying, the information goes into the striatum, a region of the brain involved in learning new skills, from where it is difficult to retrieve facts and ideas. If we are not distracted, it heads to the hippocampus, a region involved in storing and recalling information."

Thursday, May 20, 2010

Monday, May 17, 2010

Legislators and corporate donations

Was reading the Wikipedia article about a senator with some disturbing views on homosexuality (his office said he "does not hire openly gay staffers due to the possibility of a conflict of agenda"), Israel (that America should base its Israel policy on the text of the Bible, WTF!) and the rights of prisoners (saying he was "outraged by the outrage" over relevations of abuse in Abu Ghraib, and one of nine senators to vote against an act prohibiting "cruel, inhuman or degrading" treatment of individuals in U.S. Government custody).

Then I saw this part. Inhofe is highly sceptical of the climate change, an issue which I'm somewhat undecided about. Fair enough, but surely receiving a $429,950 "donation" from the petroleum industry is a serious conflict of interest?

U.S. senators make huge decisions on bills and treaties, as well as appoint high level government officials and judges. Surely if they can receive donations from any source, then effectively it means the richest corporations and industries can unfairly influence government policy?

Would it not be better (democratically speaking) if there were no such donations and politicians received some fixed amount for their campaigns from government coffers?

Tuesday, May 11, 2010

Automated refactorings... check that they work!

Many modern IDEs provide automatic, context-sensitive refactorings, especially for statically-typed, popular languages like Java. While you should use these wherever it saves time, you should check that they preserve semantics on the code they transform.

For example, in the following test code, Eclipse will offer to "exchange left and right operands for infix expression" when you try a quick fix (cmd-1 on a Mac, ctrl-1 elsewhere) at the '&&' on line 2. The refactoring transforms "(a || b) && c" into "c && a || b".

 boolean a = true, b = true, c = false;
boolean original = (a || b) && c;
boolean swapped = c && a || b;
assertTrue(!original); // ok
assertEquals(original, swapped); // fail

Note that the parentheses have disappeared - at first I assumed that they must therefore be unnecessary and "c && a || b" is therefore equivalent to "c && (a || b)", but figured that the parser should evaluate from left to right (which would produce different results). Being unconvinced one way or the other, I made a simple testcase to verify that both expressions were logically equivalent, which failed.

I'm not sure why Eclipse removed the parentheses, and it doesn't really matter - the point is, keep an eye on what your code transformation utility is doing - don't assume that it must produce correct output. This was one of those cases where the logic bug might not show up for a while, and the existing unit tests wouldn't have caught it, unless I bothered to run a (probably outdated and slow) integration test.

Abandoned locks

When people arrive back to where they locked their bicycle and find it vandalised, they often just abandon them forever, so you find bike racks with a certain percentage of rusting, ruined bikes.
Fair enough but... why do they leave them locked there, if they're never coming back? The locks are sometimes more expensive than the bike (or at least a new wheel). Why not take the lock home? Then a) people can recycle the bike if they want, b) people can use that parking slot and c) the victim at least doesn't have to buy a new lock for €€€ in future!

Saturday, May 08, 2010

Thoughtless showers

(from Wikipedia article on brainstorming)
Some governmental organisations (The Welsh Development Agency and the Department of Enterprise, Trade and Investment in Belfast) have reached the conclusion that the term 'brainstorming' is offensive to people with epilepsy (see political correctness) and have suggested the alternative "thought-showers".

Oh you stupid, stupid people. You hideously moronic, making-reasons-to-get-offended-about-clearly-inoffensive-things obsessive wankers. You waste public tax funds to research what existing terms could be deemed offensive to somebody by reading it in some contrived and obviously unintended context - something which is completely out of your mandate.

Happily, the article continues:
However, research by the National Society for Epilepsy found of those affected by epilepsy questioned, 93% considered the term inoffensive. A specific comment states that changes need not be made since that could promote an undesirable image of epileptics being easily offended.

Here's a tip for (predominantly) UK government-funded organisations: do your job. Don't waste your time and money determining which terms might offend somebody somewhere if viewed in some funny way. That's not your job.

Thursday, May 06, 2010

Vote for against change, or something

Accidentally caught a political ad on BBC between/after snooker the other day, by the DUP/UUP or some-other-wankersUP. The guy went on about how if you let xxx in, they'd let all the Scottish and Welsh nationalists break up "the union", so you should vote him in instead.
Then, immediately after he says his piece, the words "VOTE FOR CHANGE" appear on the screen.

WAT??? Wasn't he just campaigning AGAINST change?

Opera 10.53 on the Mac: Crash central

The latest release builds of Opera for the Mac are atrocious, crashing all the time. All. The. Fucking. Time. And with seemingly random user interactions leading up to the crash, which kind of suggests a race condition, memory allocator or some other effectively random bug, although I have so many damn tabs open, many of which have JS stuff going on in the background, that it's hard to tell.

Another thing which makes it even harder to tell, is the rubbish stack trace provided when it crashes. A major downside to having closed-source software like Opera is that you can neither properly investigate these crashes nor solve them properly. Why not provide at least some kind of assertions or at least filename/line numbering in the stack traces? AFAIK, adding that sort of debug info, even for a shitty language like C++, isn't that big of a performance hit.

And if they're purposely obscuring debug info because Opera is closed source, then WHAT THE FUCK. Nothing "damaging" would be leaked by such information. Blargh!

Sunday, May 02, 2010

Using tor/Vidalia to access BBC iPlayer (etc) outside the UK

There's a decent article explaining how to set up tor/Vidalia to access sites like BBC's iPlayer which only allow connections from certain countries (like England). Not mentioned in the article (although someone added a comment about it) is that now you do not need to manually select exit nodes in the UK - you can specify exitnode countries in your torrc files by putting a two character country code in braces. This makes the process much easier!

I'm running on a Mac with Vidalia, so the setting file (you can find the location of it in the Vidalia settings dialog's advanced tab - but it's probably ~/Library/Vidalia/torrc) ends with:
ExitNodes {GB}
StrictExitNodes 1

Note that the country code is GB and not UK, which a couple of posts/articles online misleadingly state.

There's another problem with the recent Mac builds - the geoip file is in the wrong place, leading to log messages like the following:
[Warning] Failed to open GEOIP file /Applications/ We've been configured to use (or avoid) nodes in certain countries, and we need GEOIP information to figure out which ones they are.

That was solved like this (from the terminal):
cd /Applications/
mkdir -p share/tor/
cp Contents/Resources/geoip share/tor/

Then stop and restart tor.

Update: StrictNodes should now be StrictExitNodes.

Wednesday, April 28, 2010

Opera and the CPU

Opera 10.51 is running on my work PC under Windows Vista, with 2gb RAM and 2.66ghz Core2Duo. There are about 50 open tabs, and one of them is playing a Youtube video. CPU usage is listed in the Task Manager as around 2-3%, with 300mb of physical RAM used.

The most recent Opera (10.10 I think... actually 10.52 was apparently released today, but 10.10 still reports that there are no new updates) on my 2.33ghz C2D Macbook with 2gb RAM in the same configuration except without any Youtube videos playing, uses 10% CPU according to top, and 20-30% with a video playing. And that's with the Flashblock userjs - before it was much higher.
Why? Is it because my PC has a half-decent graphics card and the Macbook doesn't?

Tuesday, April 20, 2010

US government finally admits most piracy estimates are bogus


A nice, measured treatment of the flaws (especially the common citations of bogus or non-existent work) in pro-IP surveys and studies, usually commissioned by "content industries" (organisations like the MPAA, RIAA, BSA etc) which often contain "specific and alarmist rhetoric".

It's US-centric but has some very sane and generally applicable points, like: "For instance, these studies ignore the obvious points that pirating goods leaves consumers with more disposable income, which is likely spent elsewhere in the economy. Effects on the economy as a whole, then, are terribly speculative and seem more likely to be simply redistributive".

Thursday, April 15, 2010

Distinguishing between "choking" and "panicking"

If you've ever "choked" in any kind of performance (e.g. when you're far ahead in a snooker game and just need this one, simple shot to win, you can do this, just keep your shoulder down and your elbow straight, follow through with the cue and WHAT THE-), then this utterly superb article will have you nodding your head in acknowledgement, understanding and compassion.

Not only does it explain and separate the notions of panicking (reversion to instinct) and choking (loss of instinct) under pressure with dramatic examples, it introduces the interesting form of choke that is "stereotype threat" (which seems to correspond with something I wrote a while ago):
"Steele and others have found stereotype threat at work in any situation where groups are depicted in negative ways. Give a group of qualified women a math test and tell them it will measure their quantitative ability and they'll do much worse than equally skilled men will; present the same test simply as a research tool and they'll do just as well as the men."

Ultimately, we're faced with a Schrodinger-type paradox, whereby external, theoretically irrelevant variables (audience, expectations, prize, etc) influence performance on a task:
"We have to learn that sometimes a poor performance reflects not the innate ability of the performer but the complexion of the audience; and that sometimes a poor test score is the sign not of a poor student but of a good one."

Tuesday, April 13, 2010

Redundant T&C's

These fair use conditions are such that a Customer's usage of this tariff plan shall not exceed 45,000 minutes of calls and/or 5,000 texts per month.

1 month = (max) 31 days = 31*24 hours = 31*24*60 = 44,640 minutes.

Since it's physically impossible to exceed 45,000 minutes of calls in any 44,640 minute period... why have that condition in the contract at all?
It's like having a "friends and family" discount with a condition that you can only apply the discount to a maximum of 7 billion people.

Saturday, April 10, 2010


Was walking to the train station with the childe on the way home from town, going by Leinster House. To prompt the dawdling girl into hurrying up I told her the Garda stationed at the gate would catch her if she was bold, which naturally caused her to sprint away at full pelt. As we passed, the young cop called out: "Ah don't make me run, I'm full of chocolate!"

Good to see a Garda with a sense of humour (and a decent knowledge of Simpsons episodes) :D

Friday, April 09, 2010

Subclipse: "An existing connection was forcibly closed by the remote host"

Subclipse "suddenly" stopped working, so I couldn't commit or synchronise to a svn repository anymore:
RA layer request failed
svn: Commit failed (details follow):
svn: OPTIONS of 'http://big-long-svn-path': Could not read status line: An existing connection was forcibly closed by the remote host.

Maybe a recent update of TortoiseSVN bolloxed it up, who knows... anyway, I worked around it by going to Team->SVN in Eclipse's preferences dialogue and changing the client in the "SVN Interface" section from JavaHL (JNI) to SVNKit (Pure Java). Works so far, although I had to re-enter the username/password which had been stored before.

Wednesday, April 07, 2010


Saw a nicely vandalised sign in the DCU car park today which reminded me (pleasantly) that this is Ireland. Someone had crossed out three letters so it read:


Chinese character frequencies

After a long time of somewhat naïvely trying to learn Chinese by adding production flashcards for new words (where the front side is a English term with hints to avoid guessing an answer that was correct but not the one on the back side, and the back side is Chinese characters and phonetic pinyin), I realised the task was far too difficult and time-consuming. For each of those cards, I'd write the characters on a graphics tablet and speak them, then flip the card and fail it if I made any mistakes in either the writing or speech. This was needlessly laborious since there was so much redundancy and opportunity to make small mistakes even if most of the answer was correct (writing out 印制电路板 (printed circuit board) many times was extremely tedious and unproductive).

So some reading on Glowing Face Man's blog led me to switch things around a bit, changing my deck so that the only characters I would write (production) were single characters, of which there are still very very many (over 20,000!) but the most common 3,000 account for over 99% of what you'll see in actual modern Chinese. All the other cards changed to recognition, where the front side is the Chinese characters and the back side (what I speak out loud before flipping the card) is phonetic pinyin and a (sometimes rough) English translation. Rather than mess about with Anki's deck format or exporting/modifying/importing, I wrote a dodgy AppleScript program to automate moving through the deck interface and sending keystrokes to cut, paste and rearrange the text... even crappy automation can be better than changing 2,500 cards manually. In fact, it would still be better even if it took the same amount of time, because of the sense of reward that it spurs.

This has helped immensely, reducing the pain and greatly increasing throughput and efficiency. However, learning the characters still takes time - my current plan is to go through the 3,000 most common ones and learn them as production cards before carrying on with sentence recognition cards.

But why 3,000 characters? Why not half or twice that? And which ones?

That's answered here - a computer program can quickly go through a huge corpus of text and produce a sorted listing of characters by frequency. Predictably, the first couple of hundred characters account for a huge fraction of written Chinese: 200 characters will get you 55% understanding (that's "most" Chinese already, heh), 400 will get you 70%, and so on. (Of course, when I say "understanding", I'm ignoring the fact that you need to learn the grammar, idioms and so on, and which of many possible meanings a character will take on in different contexts.)

A quick plot of the numbers provided produces a roughly logarithmic shape, showing diminishing returns (given the roughly constant time required to learn characters):

So it looks like the payoff is small by the time you're hitting around 2,500 characters (98.5%), but it would be nice to say that you only don't know <1% of written Chinese when you hit 3,000 characters (99.2%), and only add more unfamiliar characters to the deck as you encounter them during reading, less and less often.

Saturday, April 03, 2010

Tip of the Tongue learning is bad!

This article came as a surprise - my default assumption was that "working through" this tip of the tongue state until I came upon the answer. The research demonstrates that the time you spend agonising and searching for the answer causes the same thing to happen next time - you're "practicing" the stuck condition.

So the best thing to do is to have a short timeout (10 seconds was better for future remembering than 30 seconds, in the study) whereupon you give up and look up the answer, or make a note to check later or something. Anything but keep struggling until you remember the answer the hard way, since it only facilitates the same wrong mental paths in future.

Two more suggestions...
1. When you struggle with a tip of the tongue thought, whichever way you manage to resolve it, make an entry for it in an SRS program like Mnemosyne or Anki.
For example, the researcher who carried out the study said that she often struggled to remember the word "obsidian". So when you notice that you tend to struggle with this word, you add a flashcard to your SRS with "glassy lava rock" on the front, and "obsidian" on the back. Then when reviewing the cards, if you can't remember the answer after 5-10 seconds, you give it a fail mark. If you remembered it quickly, give it a passing mark. The SRS program will take care of the rest, managing the transition of the properly-learned knowledge into your long-term memory.

2. When you see a friend (or a child!) struggle for a word and you can guess what word it is, put them out of their misery ASAP, and if they say "ahh, I would have got it, why did you tell me?" then explain why!

Tuesday, March 30, 2010


Uploaded a small utility called Blinkenwords on RubyForge. It's a simplistic RSVP (rapid serial visual presentation) program which takes input from the clipboard (shortcut: up arrow key) and displays it (shortcut: down arrow key) in vertical chunks. You can change the number of words in each block (from 1-10 at a time) and change the speed in words per minute (shortcuts: -5 wpm => [, +5 wpm => ]).

There's lots of similar programs out there, some implemented as Javascript programs - I only wrote this because none of the ones I tried rendered text as I wanted to see it (i.e. reading in vertical columns, 3 words per column, but not scrolling a 3-line textbox one line at a time). It has a couple of very basic heuristics which insert a slight pause when a group of long words or end of sentence/clause is detected. Also, I took the opportunity to add easy keyboard shortcuts to streamline things (i.e. copy some text, switch to Blinkenwords, press up key (paste), press down key (play text), left/right keys (skip backwards or forwards)).

Whether reading this way helps or hinders speed and comprehension is questionable (see this blog post I wrote a while back on the topic of speed reading), so this is pretty experimental and YMMV (if you can even get it working - had some troubles with source file encodings and a couple of other things). Personally, I find it useful when there's lots of drudgery-reading to be done (e.g. catching up on forums/lengthy emails/news articles), but have problems with difficult, dense texts.

Update: You can download a Windows build of Blinkenwords is here. I used a very impressive program called OCRA to automatically bundle the Ruby interpreter and required libraries into a single 4mb(not enormous) packed executable.

Plink beta 0.60 broken

Spent about 20 minutes wondering why Plink (part of the free PuTTY SSH suite) was acting extremely oddly on my machine - not displaying help when run with no arguments, and completely ignoring PuTTY saved session configurations, and generally not working at all.

On the off-chance, I downloaded the snapshot release of Plink (from the same page) and it worked straight away. Argh! A completely useless buggy version has been the official release since 2007?!

Sunday, March 28, 2010

Polaroid TLU-02241W blank screen oddness

Picked up a Polaroid TLU-02241W LCD flatscreen TV cheapish on eBay a year or so ago, intending to set it up for use with my Atari STe, which didn't happen until today (and is still pretty crappy with the horrendously low quality RF cable - will need to pick up a special 13-or-something pin DIN to SCART cable).
When I received the TV I did a quick test and it seemed fine, but turning it on this time only displayed the Polaroid logo on boot and then the display seemed to power itself off, even though the blue LED showed that it was still "on". Also, it seemed to pick up some analogue broadcast via the RF cable and produced a good sound output.

A quick Google indicated that this model (and many other Polaroid TVs) has serious problems, particularly relating to bad quality electrolytic capacitors in the power/control boards. While watching a series of videos on Youtube showing how to identify and replace the dodgy caps, I went back in and booted the TV again, this time repeatedly hitting the menu button on the remote. Surprisingly, it went from the logo to a blue screen with a working OSD. Problem solved, even after turning the TV off and on without the same button mashing.

Sounds like it will eventually fail, with all the bad reviews, but for now it seems ok. If you're seeing the same symptoms, see if this works.

Update: Problem not solved - came back again the next day and no amount of button mashing will help it. Also, tilting the screen backwards or forwards causes the power LED to flicker and go dim, which is disturbing. Looks like it's a painful capacitor replacement job which is somewhat likely to fail anyway if it turns out to be another problem.

Poor show, Polaroid!

Saturday, March 27, 2010

Phone IQ test failure

*phone rings*
GF: "Hello?"
Caller: "Hi is that Danny?"
GF: "No, I think you've got the wrong number... Ok bye!"

...... *6 or 7 seconds pass... phone rings*
GF: [It's the same number, you talk to her this time]
Me: "Hello?"
Same caller: "Hi, Danny?"
Me: "Eh... no, I'm pretty sure you have the wrong number."
Caller: "Oh right! Sorry."
Me: "Ok, good luck."

...... *5 seconds pass... phone rings*
Me: [Just leave it, answer again if she does it in an hour or so]

*voicemail icon flashes, we check the mailbox*
Same caller: "Hi Danny, this is Anne-Marie here at Classic Cuts, just checking if 1pm on Wednesday is ok with you. Bye!"

Why would someone dial the same number twice and, after being told twice that they've got the wrong number, dial AGAIN and leave a voicemail for "Danny", even though the voicemail greeting clearly identifies as someone other than Danny?
What could possibly explain simultaneously having the ability to dial phone numbers and speak English, while being unable to comprehend the most obvious facts? If you call a number TWICE and are told that it's a wrong number, it's STILL going to be the wrong number the third time.

Top Tip: No amount of redialling the same wrong number will cause Danny to answer the phone.

Sunday, March 21, 2010

Freeline skates... feasible for transport?

After my bike was robbed [smiley face indicating that I'm loudly shouting "cunt!"] in November or so, I figured I'd experiment with alternative forms of transport, hoping to find something more casual and less stealable (i.e. something I don't leave outside my house only locked to itself might be appropriate).

Doing a bit of looking around online, I was intrigued by so-called "Freeline" skates (Wikipedia article appears a bit anaemic), which are very much like the old snakeboard, albeit without the connecting bar between the two plates. To propel yourself forward, rather than kicking off the floor like with skateboards and inline skates, you use your hips, legs, shoulders, arms and whatever you can to swing your body weight around and turn your feet so the skates follow a kind of S-curve.
It's called "non-holonomic motion" and I found it very difficult to understand via textual descriptions which were far superior to this one, so basically you just have to try it until you get the knack, which took me quite a while on the Freelines.
So I picked up a pair on eBay around Christmas (very expensive too, ended up around €110 delivered from the UK).

The initial hurdles

1. Standing on the skates without doing the splits. As you stand on the skates, the axis of movement is just off horizontal so the skates want to slide out to your left and right and you accidentally do Jean-Claude Van Damme sidesplits. Most people, including myself, can't really do that without our legs falling off and exploding, so you quickly learn to control the relative position of the skates with your inner thigh muscles.

2. Rolling across the room with losing your balance. This is presumably the same with any kind of skates/skateboard, but exacerbated by the fact that these behave in a slightly more unexpected way due to the wheels being angled slightly differently: there is a distinct left skate and right skate, so when they're side by side the wheels make a shallow V-shape. Getting used to this means rolling back and forth on flat ground by a railing or low wall so you can pull/push yourself and keep steady with your arms, until eventually you can coast a few metres unaided. Or get a friend to hold one hand and walk back and forth, but that's limited by their patience since it can take a long time.

3. Launching from stop without pushing against a wall. It's difficult to even stand still on the skates - a little bit like on a bicycle. Sometimes you see bicycle couriers with gearless bikes and no freewheeling clutch, stopped at a traffic light (yes, many bicycle couriers actually stop at lights :D) and very slowly inching forwards and backwards on the spot rather than putting their foot down. You can do a similar trick with these by angling your feet into a T-shape, but it takes practice, and actually pushing off from that position to get moving is even more difficult (I tried it about ten times and succeeded once, and awkwardly at that).

Normally, to push off moving from right to left, you put both skates in front of you, then knock the right skate over away from you and step onto it so your toes are also touching the floor. Then you put your weight on those toes and place your left foot on its skate, and push in that direction (without extending too far or your right foot will fall off the skate), pulling the right skate upright with your foot as some of your weight moves onto the left skate.

4. Propelling yourself! After all the other challenges, this one is pretty easy, to begin with anyway. Your feet will probably start to do this automatically in step 2, when you're just trying to roll without falling. Essentially, as one foot is moving in an upwards curve, pushing it forward will increase your speed, and similarly when it's on downwards curve.

Then what?

Well, I only got them to replace my bike, so all the tricks people do with them (mostly pirouettes, riding on one foot and dropping/stomping the second skate, switching etc) are not really relevant. If I ever get supremely good at riding the things, maybe I'll experiment a bit.

Mostly, I want to find out if I can travel any kind of significant distance on them, somewhere between walking and cycling speed. A measly 8km/h for 4km (the distance between my house and DCU) would suit me just fine, but so far I have to stop riding after about 1km (about 10 minutes) because I get pains in the following places: the middle of the soles of my feet, my calf muscles, my instep. By then my thighs basically just run out of energy and I start moving more and more slowly and my form gets sloppy.

I don't know if this is poor general fitness (I'm a lazy, lazy man who likes sitting on his arse with a laptop or playing PS2 for hours on end), or specific muscle conditioning that needs to happen for everyone, or if I'm literally physically incapable of adapting to the skates for longer periods, or even if the skates are just not suited for that kind of travel, especially over the crap, laughable pavement conditions we have here in Dublin (stupid 1 inch deep, 3 inch wide drainage channels between every few houses, cracks and bumps everywhere, corrugated concrete driveways which make skates trundle and vibrate like a broken shopping cart).

That said, if you're going at a reasonable speed you can get over small cracks and drains by leaning slightly onto your back foot - that way the front skate can bounce past the obstacle and even if it gets caught and stops dead, you just hop off since they're not tied to your feet. If your front skate gets caught and most of your weight is on that foot, your balance can be thrown off badly.
And I've seen a couple of videos on Youtube which suggest that people can and do cover more significant distances on them - about 34km in this one.

One recent change that's working much better for me is focusing more on my back foot to push myself forward, rather than trying to drag myself with the front foot which causes it to slip out of position and seems to tire me out. Maybe it's just more efficient for the way I happen to distribute my weight on the skates. Who knows. Even if it turns out to be a complete failure, it'll be a fun failure!

Saturday, March 20, 2010


(trying to reassure scared 2-year old daughter at 3am)

Me: Ok, if there's a monster there, just give it a kick.
Aela: How 'bout YOU kick monster.

Tuesday, March 16, 2010

Irish wit

Saw this today and had to save it... classic lowbrow humour, Dublin-style!

Saturday, February 27, 2010

Stage Irish in "Murder, She Wrote: The Celtic Riddle"

Just watched "Murder, She Wrote: The Celtic Riddle", set in Ireland. I've seen worse imitations of Ireland by American films and TV (notably an episode of the old Mission Impossible where people were terrified of a fake banshee and the carriage of death or something, jeeeeez that was pathetic), but still, it seems at least 75% of the 'Irish' cast were not only American, they seemed to have spent less than 10 minutes practicing their Irish accents... the better ones manage to mix some kind of Irish accent in with English, Scottish and a bit of a Russian twinge. The worse ones (e.g. the spiky-haired mechanic modelling his look after Johnny Rotten who sounds more Scandinavian than anything, and the blonde male cop) make a complete bollox of it, or just give up completely. I guess almost all the dialogue scenes were filmed in the States? Otherwise there's really no excuse for hiring Americans with bad stage Irish accents to play Irish characters - if it was filmed in Ireland, why would you ship American actors over to do a crappy job?

Can you imagine an Irish film crew flying to the USA and bringing Irish actors over to play Americans, with horrible cheesy accents that don't convince anyone?

Apart from the actors, there are cars you don't see here (e.g. Chevrolet police cars or the big Ford van which tries to drive someone off the road) and obviously fake number plates (with non-existent county codes)... which is to be expected I guess. Plenty of modern films and TV series simply do without number plates altogether (Fringe, IIRC), which kind of spoils the realism IMO.

Some stupid did not do the research mistakes:
  • Who... WHO refers to the Irish language as "the Gaelic language"? Christ on a bike, do some research!

  • The same supposedly Irish character also failed to recognise Ogham script (which is fairly distinctive) but then later seemed to know about its history... which is it - does she know about it or not? Be consistent, damnit!

  • A letterhead addressed to "Dublin BT238479, Ireland" or similar - Ireland is not in the UK and we don't use UK postcodes!! WTF

Other than that, it was basically an extra-long episode of Murder She Wrote. It kind of petered out a bit, perhaps because I was getting distracted by the silly errors, or perhaps the 45-minute format worked better for the series?

Replacing the electromagnetic clutch brushes on a Micra CVT

Soon after buying my first automatic transmission car, a ten year old Nissan Micra (K11) with the CVT gearbox, I found that the carbon brushes which supply power to the electromagnetic clutch tend to wear down.

The clutch operates (as far as my limited understanding goes) by passing a current through some kind of magnetic powder (maybe just iron filings? Anyone know what this is?) which fills the gap between the driving (engine-side) and driven (gearbox/wheels side) plates. When the engine is at idle, no (or very little) current is passed through the powder so the engine spins without transferring force to the driven side.

As you hit the throttle and engine speed increases, the current passed through the powder is raised and the powder becomes magnetised, sticking together more strongly and transferring more of the rotational force from the engine to the wheels.

The electrical current is supplied by a pair of carbon brushes which rest against turning discs (I think they're called slip rings, which just slot onto a splined axle), since you can't just stick a wire into something that's constantly spinning. After a while, both the brushes and the slip rings start to wear down - hopefully the brushes more and the rings less, since the brushes are easy to replace while the slip rings are probably almost impossible (i.e. cheaper to buy a new car than to get the clutch out, open it up, replace a part, put it back together and re-install it in the car, argh). When the brushes wear down, springs in the brush holder push them further out until a certain limit, they either lose contact completely or periodically slip out of contact briefly, triggering the "N-CVT" warning light on the dashboard. As they wear out of reach of the clutch wheel/slip disc arcing can occur which is apparently a bad thing, too.

So anyway, my Micra had started to get sluggish, needing more revs than before, and I figured it might be the clutch brushes. I checked the web for similar problems and solutions and found a LOT of problems and NO solution other than buy a new brush holder/new gearbox/new car.

Nissan refused to talk to me on the phone, telling me to call local dealers instead. Two separate dealers quoted me a laughable €218 for the whole brush holder assembly, which is apparently all they will give you short of an entire new clutch (again, more than the cost of the car).

This seemed a lot of money when it was just the carbon brushes which had worn down. So I took the brush holder assembly out anyway.

Where is it? Here, on the front of the transmission bell housing:
(edit, new pic to help locate it)

You can disconnect the power plug by pressing a tab on the left side of the upper half and pulling it upwards. Blurry closeup of power socket:

The hole down into the clutch after removing the brush holder. Looks... not so great:

And the brush holder after removal:

Knackered. Right down to a stub on the engine-side brush and while not so bad on the driven side, the spring was jammed up with cruddy carbon deposits and failing to push the brush out to maintain contact with the slip ring.

So I disassembled and cleaned it (on the left is another brush from a mk3 Ford Fiesta's broken alternator... similar!):

The brushes looked so similar to what you'd find in an alternator, serving the same purpose anyway, that I went to a shop ("Electro Maintenance" in Baldoyle) to find something suitable. A guy came out of the back room and took the disassembled holder away before coming back with some Delco alternator brushes, for which he charged a pretty reasonable €7. He also suggested that I snip off the old brushes, leaving just the bit of wire that was somehow attached to the metal mount, and then solder the copper wire of the new brush on top of that. Before doing this, we threaded the old black plastic insulation piece onto the wire, fed the spring through and cut off the excess wire (to stop the brush from falling out the end of the holder!).

Soldering the new wire onto the bit of old wire (no idea how the old wire is attached to the metal so nicely but still conducting current):

And reassembled after soldering:

Note the slight slant in the brush faces where they contact the clutch wheel/slip rings - the longer edge is on the bottom and the shorter edge on the top (where the power socket is pointing). This is what the wear pattern in the old brushes looked like, so I oriented the new ones in the same way (if I'd bought brushes without a slanted edge, I might have used sandpaper or emery cloth to file one in, since it probably helps them fit into the clutch properly).

Also, if you have a multimeter, check the continuity from pin to brush for both pairs. Each pin should form a circuit to the brush on the same side.

After installing the brush holder (much easier than removing it, bizarrely - it took about 5 minutes of gently sliding it around and twisting to get it out, after removing the battery and its tray* and moving a relay box out of the way), I sat in the car and gingerly started the engine. It fired up, and I listened for any horrible scraping noises and watched the N-CVT lamp on the dashboard, which didn't light up. Knocked off the engine and did a self-test of the gearbox (put it in D, ignition on but don't start engine, brake on, accelerator on, cycle Ds-D-N-R-P, accelerator off, brake off, start engine) which reported okayness (N-CVT indicator flashes one long, then seven short and repeats).

* Note: I recently checked the brushes again and was able to get the holder out without removing the battery or its tray. If you have the right screwdriver or a ratchet with screwdriver bit, you can get it out in less than 10 mins! I did have to lie under the car and ask my SO to hold the ratchet end in place though.

I carefully reversed and turned from the cramped shed into the cramped laneway and drove home. Feels a bit more responsive so far but I was literally a 2 minute drive from my house so no chance to get it up to speed.

Hopefully the fix is ok and won't trash the clutch or wear down within 2 weeks - time will tell. (It'd be pretty funny if it completely failed within a couple of days :/)

Replacement from Nissan: €218
DIY hack job with alternator brushes: €7 + time (one hour if you're smart, 4 hours messing about if you're me).

Hope this helps anyone in the same boat!

Update 26/10/2011: it worked fine for over a year and a half, until...

...Until I stupidly drove through at least a foot of water in a flood on Monday (yeah, who'd have thought it might rain in Ireland). This seemed to short out the coil and some kind of safety interlock started switching it off despite my repeated attempts to stop and restart it. Eventually after an hour or so hanging around near where I'd parked the dying car, it managed to get going again, albeit warning me that the clutch's coil circuit was shorting (IIRC, the fourth flash during the self-test mentioned above).

If I'm lucky, either the brushes have simply worn down, or a bit of trapped water is occasionally making a short in the connector. If not, water may have leaked into the clutch and contaminated the powder or something, I don't know. That hole is near the bottom of the engine, so for all I know the bell housing has a pool of water in it, bathing the clutch and promising rust or some other disaster.
I wonder if it's the same type of clutch used in the older Subaru Justy - it looks like they can lose their powder, which would not be good.

Finally got round to removing it, which just took a couple of minutes this time - amazing how much easier some jobs are in direct sunlight rather than in a dark garage. Last time I removed the battery and its tray and pulled a bunch of stuff out of the way, needlessly.

Turned out the brushes were hardly worn at all, but they were very wet. When I replaced them last year, the generic alternator brushes may have been slightly too long for the available space, and I was afraid to break something so didn't tighten the brush holder's bolts nearly enough, leaving a gap large enough for water to pour in as I foolishly rammed the car through floodwater.
Might be a good idea to file down the brushes a tad before installing them, enough to push the brush holder absolutely flush in its socket and screw it in tight enough to prevent water entering the clutch housing.

Friday, February 12, 2010

What is the proposer's occupation?

Looking up insurance quotes on a few different sites, I found a funny form on Britton Insurance's website, which asks among other things, "What is the proposer's occupation?".

The choice available is quite amazing - here are some examples:

Bacon Curer, Baggage Handler, Bailiff, Baker, Bakery Assistant, Bakery Manager, Bakery Operative, Balloonist, ... Skipper, Slater, Smallholder, ... Stock Controller, Stock Manager, Stockman, Stocktaker, Stockbroker, Stone Cutter, Stone Sawyer, Stonemason, ... Sub-postmistress, ... Tachograph Analyst, Tacker, Tailor, Tank Farm Operative (WTF?), Tanker Driver, Tanner, Tarmaccer, Tarot Reader/Palmistry Expert

I'd like to put down balloonist, but it would be a wishful lie.

Saturday, February 06, 2010

Sign language on kids' TV

There's an episode on CBBC of "Lazytown", a kids' show from Iceland of the "eating fruit and getting enough sleep gives me the energy to be a muscular annoying man!" variety. BBC have a woman (uncredited) overlayed like a subtitles track, only she's conveying the speech and sounds with sign language.

The interesting thing is it appears to have been done entirely in one take - I haven't been watching all the time, but had my eye on it for about half the programme and didn't notice any fadeouts/cuts. Signing a whole episode of a somewhat hyperactive children's show in one go, conveying the tone of voice with body language and doing a couple of songs on the way - that is damn impressive!

Tuesday, February 02, 2010

Toyota/Lexus stuck accelerator crash

Saw this article about an extremely dangerous suddenly-stuck-on-accelerator problem in the Lexus ES 350. The awful headlined crash in the USA involved a driver realising his accelerator was stuck on and the car speeding out of control toward a busy intersection, so he called 911 and prayed that they would be ok, which they weren't.

This is tragic, but surely in this situation, you would try the following things:

1. Knock it into neutral/reverse
2. Handbrake
3. Stamp on the footbrake anyway, maybe it actually does work
4. TURN THE ENGINE OFF so it doesn't keep accelerating at least

Rather than these things:

1. Call the police and expect them to somehow help
2. Pray
3. Nothing else

Certainly, Toyota/Lexus is at fault for allowing a car out to market with a severe and dangerous problem which was reported and dismissed many times, but that doesn't help this guy and the other three people who died in the crash - surely there was a better option to avert or mitigate a high-speed collision than dialling 911 and praying that everything would be ok. The fact that the driver was an off-duty highway patrol officer just makes the outcome even more incomprehensible.

Why didn't they knock it out of gear and/or turn off the engine? How is calling 911 going to help avert a crash that is seconds away?

Sunday, January 17, 2010

installing rsdl on OS X i386 via rubygems

I was getting this problem trying to install rsdl, a wrapper program for ruby which initialises SDL/Cocoa:

Jehannum:SDL-1.2.14 oisin$ sudo gem install rsdl
Building native extensions. This could take a while...
ERROR: Error installing rsdl:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for ruby_sysinit()... no
checking for ruby_run_node()... no
creating Makefile
creating rsdl.c

gcc -arch ppc -arch i386 -Os -pipe -fno-common -I"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0" -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -c rsdl.c
gcc rsdl.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch ppc -arch i386 -lruby -lpthread -ldl -lm -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -o rsdl
ld: warning in /usr/local/lib/libSDLmain.a, file is not of required architecture
ld: warning in /usr/local/lib/libSDL.dylib, file is not of required architecture
Undefined symbols for architecture ppc:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccEkUyfQ.out (No such file or directory)
make: *** [rsdl] Error 1

The solution was to add an ARCHFLAGS environment variable which stops it trying to build a ppc version:
Jehannum:SDL-1.2.14 oisin$ sudo env ARCHFLAGS='-arch i386' gem install rsdl
Building native extensions. This could take a while...
Successfully installed rsdl-0.1.2
1 gem installed
Installing ri documentation for rsdl-0.1.2...
File not found: lib

The "File not found" message at the end doesn't seem to matter.

It's handy that SDL, SDL_image and SDL_gfx seem to build and install the UNIX way (./configure && make && sudo make install) with no problems - at first I was worried by the lack of a .pkg installer for SDL but it seems to work fine so far. Cool!

Tuesday, January 12, 2010

Schneier: "Stop the Panic on Air Security"

A good article by Bruce Schneier on the tendency for overreaction to dramatic and rare events, such as hijackings and attempted underwear bombings, while ignoring far more common dangers which don't make the news headlines.

We're doing these things even though this particular plot was chosen precisely because we weren't screening for it; future al Qaeda attacks rarely look like past attacks; and the terrorist threat is far broader than attacks against airplanes.

We're doing these things even though airplane terrorism is incredibly rare, the risk is no greater today than it was in previous decades, the taxi to the airport is still more dangerous than the flight, and ten times as many Americans are killed by lightning as by terrorists.
We can see the effects of this all the time. We fear being murdered, kidnapped, raped and assaulted by strangers, when it's far more likely that the perpetrator of such offenses is a relative or a friend. We fear school shootings, even though a school is almost always the safest place a child can be. We worry about shark attacks instead of fatal dog or pig attacks -- both far more common. In the U.S., over 38,000 people die each year in car crashes; that's as many deaths as 9/11 each and every month, year after year.

Nothing he hasn't really said before, but well stated and all the more significant these days, given the hilarious ban on liquids and the ridiculous fiasco of Newark Airport being temporarily shut down and causing hours of delays because an innocent Chinese student crossed a laughable rope barrier to give his girlfriend a goodbye kiss.
Of course, instead of admitting that security was basically a joke (on the one hand, you're made to take off your shoes, be frisked, have your luggage X-rayed and possibly have someone examine your bits in a full-body scanner, then you enter the 'secure' area which is separated from the 'insecure' area by a cinema-waiting-line rope) and that they overreacted badly, New Jersey Sen. Frank Lautenberg stated that "what he did was a terrible injustice" to the thousands of people who were inconvenienced. Even though it was what airport security did that caused the inconvenience...

Let's stop the panic!