Friday, April 30, 2010

Oops! An Oil Spill!

I'm confused. The oil rig in the Gulf Of Mexico exploded over a week ago. Why wait so long before deploying booms and attempting chemical dispersion? Why wait a week before using the U.S. military equipment and personal? Why wait until the oil reaches the shore before doing anything? Why? These and other questions are going come very soon after this is over, perhaps even before it is over.

Thursday, April 29, 2010

I Love Specifications

Since the application now runs on the production PC as well as on my development system, this was good milestone to show to the customer. Given how late this project is, they were surprisingly calm about everything. When they showed me the mechanical side of the project, it was obvious that thing's were, um, how shall I say, a wee bit different. It's not surprising really, as the original specification was all of two sentences, one of which stated that it worked like an app I did for them several years ago. <^_^;

Well, at least I know why they were so calm. Looks like we are doing another iteration! Have I mentioned lately how much I love specifications. -_^

Wednesday, April 28, 2010

Udev Rules! Not!

If someone tells you how great Linux is, they've probably never had deal with odd ball situations. Take udev, for example. Please! Take udev! I'm begging you! ^_^

I'm using the 8-in/8-out version of this USB I/O unit on a project. This hardware doesn't require any Linux kernel drivers which make me very happy. The manufacturer provides the source to a library which uses libusb to communicate with the device. The device does not store the firmware permanently so it must be downloaded every time you plug in the hardware. One quirk is that after the download, the device disconnects and reconnects with a different product ID, but the manufacturer includes udev rules to handle it.

My big mistake was that I setup the hardware on my desktop system, which is running Debian sid/unstable, before trying it on the production PC, which is running Debian lenny/stable. The configuration requires two udev rules (which are slightly different that the manufacture's version)
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="1605", ATTRS{idProduct}=="001c", RUN+="/sbin/fxload -t fx2 -D $env{DEVNAME} -I /usr/local/lib/USB-IDIO-16.hex"
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="1605", ATTRS{idProduct}=="801c", GROUP="aiousb", MODE="664"
Of course, thinking that I could just copy this configuration over to the production PC, was just too optimistic. The first line works (the firmware is downloaded) but the second line doesn't set the device file group which is stuck as root.

After some (understatement! ^^) investigation, I found that the following udev rule on Debian lenny was causing the problem.
SUBSYSTEM=="usb_device", ACTION=="add|change", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add|change", NAME="$result"
At first I changed my custom rule to match the SUBSYSTEM and ACTION attributes, which worked for hotplugging and cold boot, but not for a warm boot. On a hunch I added the original rule back again, which worked!

The final rule set looks like this:
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="1605", ATTRS{idProduct}=="001c", RUN="/sbin/fxload -t fx2 -D $env{DEVNAME} -I /usr/local/lib/USB-IDIO-16.hex"
SUBSYSTEM=="usb_device", ACTION=="add|change", ATTRS{idVendor}=="1605", ATTRS{idProduct}=="801c", OWNER="root", GROUP="aiousb", MODE="0664"
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="1605", ATTRS{idProduct}=="801c", OWNER="root", GROUP="aiousb", MODE="0664"
It looks a kind of clunky, so there is probably a better way to do it, but I'm way past the limit of my udev-fu, so I not going to poke at it any more. I'll worry about it when it stops working. Which will be at some inconvenient moment, I'm sure. udev works great, until it doesn't. ^_^

Tuesday, April 27, 2010

Bad Idea

Oh dear! How is this for a bad idea? Thankfully, it's only research for now but it's insane that they are even talking about the system as if it could ever be used safely under normal driving conditions. I don't care how good they think the software is, it'll never be able handle all the complex situations that a driver deals with everyday. I read somewhere that the most challenging part of the work day for most people, is the commute to and from work.

Monday, April 26, 2010

Ferrari 599XX

Although I'm not a big fan of Ferrari, I enjoyed this video of the 599XX breaking the lap record for production-derived sports cars at the Nurburgring Nordschleife. As this article notes, "production-derived" is seriously stretching the term for the 599XX, which, apart from name and looks, has very little in common in with the 599. Still, watching the 599XX blast around the 20km track is worth the 7 minutes it takes to complete the lap.

These long tracks are awesome and I wish Formula 1 had one on the calender. Unfortunately, long circuits do not make for good television coverage, which is the primary business of F1 these days. It's a shame really.

Sunday, April 25, 2010

Death And Taxes

This about the second one. Yes, it's that time of year again. This was the last weekend before the April 30 tax deadline and naturally I procrastinated until now. Anyway, it's all done so no worries. Despite being self-employed, my tax return is actually quite simple because I keep my business records in order. My return only takes a couple of hours to complete using tax preparation software. Still, it's the most annoying two hours ever. It's taxes damn it!

Saturday, April 24, 2010

Quote For Our Times

There has grown in the minds of certain groups in this country the idea that just because a man or corporation has made a profit out of the public for a number of years, the government and the courts are charged with guaranteeing such a profit in the future, even in the face of changing circumstances and contrary to public interest. This strange doctrine is supported by neither statute or common law. Neither corporations or individuals have the right to come into court and ask that the clock of history be stopped, or turned back.
- Robert A. Heinlein Life-Line
Not only is it the perfect quote for our times but the source makes it especially interesting. Who says science fiction is irrelevant?

Friday, April 23, 2010

To Aru Kagaku no Railgun

The anime To Aru Kagaku no Railgun (A Certain Scientific Railgun) is great fun to watch and has some amazing displays of super powered action. The story takes place in the same setting as To Aru Majutsu no Index (A Certain Magical Index) which I wrote about last year. However, Railgun is not a sequel but a side story featuring Misaka Mikoto, a secondary character in the Index anime. Mikoto is the Railgun and she is freaking awesome!

Mikoto is one of only seven Espers who have attained level five ability, the highest level known. Mikoto can manipulate electricity and its associated magnetic fields. Her techniques range from the subtle, like controlling a running computer, to the devastating, like using a coin as a projectile. The latter is of course why she is called "Railgun." Mikoto holds back, using just enough power as is necessary (unless she is pissed off!), so its hard to be sure that we've seen her full power yet.

Although level five is the highest known level, there is ongoing research to produce a level six Esper. The Index anime featured one such experiment. The Railgun story details additional experiments being conducted on the children of Academy City. So far all of the research has been highly unethical and, as the Index anime revealed, apparently conducted with the approval of the powers behind Academy City. Why are they so desperate to achieve a level six Esper? So far this question remains unanswered.

Thursday, April 22, 2010

Tkinter? Really?

Of all the GUI widget tool kits available Python (PyGTK, PyQT, and wxPython, to name the most popular), the one I use most often is Tkinter, the Python interface for Tcl/Tk. The fact that your Python code is actually calling Tcl/Tk in the background is kind of icky, but Tkinter is also much simpler than any of the other options.

Years ago, the first automation project that I wrote in Python, required a simple GUI which meant that I had to learn a toolkit real fast, and Tkinter's simplicity was a definite advantage. I have written small Python desktop apps using wxPython, but for automation GUIs I always end up using Tkinter again. Yes, I know I'm weird. ^_^

Wednesday, April 21, 2010

WRC 2010 Turkey

The Rally of Turkey was run on completely different roads since the WRC visited in 2008, and featured some nice fast, flowing sections and mixed surfaces on several stages. Day one and two had some of the closest rallying of the season so far, with the top six drivers within striking distance of a win. By the end of day two, it had settled into a three way fight, as Loeb led Petter Solberg and Hirvonen by 16 and 17 seconds respectively.

Everything seemed to go Loeb's way on day three. First, overnight rain cancelled the stages 18 and 19 and the reduction in distance also reduced the chances of Solberg or Hirvonen catching Loeb. Then, Hirvonen had a wild moment on stage 20 which caused a puncture and ended his hopes for a win. On stage 21 which was the second loop of cancelled stage 18, Petter Solberg slid wide in a tight left hander and lost enough time to finish his charge. Sometimes, Loeb is just plain lucky!

Petter Solberg is now second in the drivers' championship! For a privateer, that's very impressive and shows how consistent he has been this season. I suppose it's too much to hope that he could win the championship against Loeb in a factory Citreon, but I can dream. However, Loeb is taking Solberg seriously and acknowledged that he is looking very fast lately.

Raikkonen continues to improve with another points paying finish in sixth place, two positions higher than the previous rally. If this keeps up, he'll be challenging for podium positions soon. I think Raikkonen is really enjoying himself, but you'd never know it with his "iceman" demeanour, which a stark contrast to Petter Solberg, who never holds back how he is feeling.


The Extensible Message and Presence Protocol (XMPP) is the protocol behind instant messaging services such as Jabber and GTalk. Myles Braithwaite gave a talk at this month's PyGTA meeting, in which he described how he uses XMPP for something other than chatting. XMPP is a store and forward protocol which is ideal for pushing important automated notifications from a server application to a user who may not always be online. It is using the protocol exactly as was intended but for an unexpected purpose. It's great to see this kind of outside-the-box thinking in software solutions.

Monday, April 19, 2010

A Copyright Holder's Wishlist

If copyright holders could wish for a perfect world, what would it look like? Well, unsurprisingly, they do have a wishlist which the EFF have analyzed. In a nut shell, the rights' holders want Orwell's 1984, complete with pervasive surveillance on every computer and network, scanning for copyright infringement. And of course, they always want others to do the enforcement on their behalf.

And while it is a pie-in-the-sky wishlist, the rights' holders are already getting their way in France, Britain, and now Ireland, so it is possible that some their wishes will come true.

Sunday, April 18, 2010

F1 China 2010

Redbull locked out the front row of the grid for the second time in four races after some stunning qualifying laps, nets Vettel and Webber first and second respectively. Unfortunately, Redbull were unable to capitalize on their grid positions in the race where wet conditions made strategy more important than raw performance.

The race start was dry enough that everyone (except Virgin Racing, I think) started on slicks, but a first lap incident brought out the safety car. While behind the SC, the rain became worse and Button switched to the intermediate wet tires a full lap before everyone else. This crafty choice is what eventually won him the race. Button is really showing that he deserves to be world champion.

As usual, the rain brought plenty of close racing and some impressive driving under difficult circumstances. The latest generation of intermediate tires are apparently not as durable as they were in previous years, and by the end of the race, everyone was struggling with extremely worn tires. Unfortunately, there was was some very scruffy driving as well.

In one example, while making a pit stop, Hamilton passed and almost collided with Vettel in the pit entry lane. Then the teams released them from the pit boxes at almost the same time, and they almost collided again! They drove side by side down the pit lane with Vettel slightly in front, before Hamilton finally backed off. What was that all about?!

The FIA has banned automatic ride height adjustment a systems, which almost everyone suspected Redbull of using. Their qualifying pace seemed to support their claim that they were not. On the other hand it will require a similar performance in a dry race to fully refute the suspicion. This wet race doesn't do that yet. Apparently Ferrari are developing a manual ride height adjustment system, which can be changed during a pit stop.

Redbull's situation is very interesting. They clearly have the best car and yet they are only third in the constructors standings. Vettel is a potential world champion but is only fifth in the drivers standings, while Webber, who is no slouch either, is only eighth. I know it's early in the season but their race day performance will have to improve noticeably, if they hope to win some championship titles. Perhaps they've been holding back some upgrades for the return to Europe. Time will tell.

Saturday, April 17, 2010

ACTA Draft To Be Public

So next week the the ACTA draft document will be made public at long last. We should be happy, right? Well, not really. First, there's been enough leaks that the document won't contain many new surprises. Second, it's a little late now! Releasing a draft document must mean that the U.S. considers most of the negotiations closed, so there's little chance that public input can affect the agreement now.

The only chance we have is convincing our governments not to enact laws to support the treaty. However, the negotiating positions of the various parties will not be disclosed, which means we won't know what our government's actually agreed with behind close doors. Which is why this IP agreement was disguised as a trade agreement in the first place.

Friday, April 16, 2010

Douglas Bader

It seems I needed a refresher on Douglas Bader. He was in three different squadrons at Duxford. According to his Wikipedia page, No. 19 Squadron was his first posting after re-enlisting but two months later he was transfered to No. 222 Squadron, which later moved from Duxford to RAF Kirton. When Bader was promoted to Squadron Leader, he was given No. 242 Squadron, which was initially based at Coltishall but was moved to Duxford as part of 12 Group. All of this occurred in space of a few months from February to June 1940, an indication of how quickly things change in war.

I became curious after a tweet that Bader had been posted to No. 222. ^_^

Thursday, April 15, 2010

Battle For Wesnoth

Battle for Wesnoth is one of the best free games available. I had not play it in a while and so decided to install it again, when I was feeling a little stressed out with work a few days ago. Like most good games, Wesnoth is also quite addictive, so perhaps playing it was not such a good idea, given how busy I am, but I needed a break. ^_^

The creators of Wesnoth describe it as a "tactical strategy" game which is quite accurate, if a little confusing. I would describe it as an operational level war game, but that assumes some knowledge of pre-computer wargaming. The tactical part is obvious as the combat style is very wargame-like. The strategy part is very light weight and mainly involves supply and recruitment, but each game is a campaign that consists of a series of scenarios, so you need to plan ahead as well.

Wednesday, April 14, 2010

Battle Of Britain On Twitter

The Imperial War Museum has started an interesting project in which they will post the 1940 Operation Record Books of RAF Duxford and No. 19 Squadron to Twitter. Yes, Twitter! The posts will be in real time (plus 70 years of course!) throughout the Battle of Britain period. I expect most of the posts will be quite dry (war being nine tenths boredom and one tenth terror) but I'm quite excited to have stumbled onto the project.

The Operation Record Books are not accessible to the general public so this is only way most of us are ever going to see their contents. One of No. 19 Squadron's pilots was the famous Douglas Bader and I'm curious about how often he is mentioned and the contexts, given his, er, colourful personality. No. 19 was definitely at the sharp end of the Battle of Britain so the project offers a unique insight into the period.


Plone is one of, if not the, oldest open source content management systems around. Plone is build on top of Zope, an application server written in Python. Plone was the subject of this month's talk at the GTALUG meeting. The presenter was Jordan Baker, who specializes in Plone deployments.

Plone is really intended for large scale, enterprise sites, so while you could use Plone for a personal blog, it would be serious overkill. Plone is very easy to get running, which is major selling point in a enterprise setting, when you can safely promise the site will be working the next day.

Now, I've heard an anecdote that it might take another six months to customize the site if the customer has any special requirements, but all of Plone's core functionality is completely usable during the customization. According to the anecdote, this is the main reason Plone consultants are very well paid. ^_^

Jordan tempted the demo gods and demonstrated a beta of Plone 4, which looks very slick. However, this type of admin interface is available in Drupal, Joomla, and others, which naturally led to the question of why choose Plone. Jordan gave a number of reasons but the the most telling was that he likes Python, which indicated that the choice was more personal than technical. And there's nothing wrong with that at all.

Monday, April 12, 2010

That's Neat! Um, No...

"That's neat!" was my first thought as I watched this promotional video from Marathon Robotics, in which robotic Segways are used as for military training exercises. "Um, no," was what I ended up thinking. The system has an obvious advantage in that it allows for live fire training. But that's all you get!

The entire exercise could be done with normal humans, who are definitely more "realistic" and a darned sight less expensive than robotic Segways. It's amazing how easily the military types can be fooled into thinking the technological solution must be the best one. I guess they have to justify those big budgets with flashy toys.

Sunday, April 11, 2010

New Doctor Who

First impression of the new Doctor Who played by Matt Smith is... This is going to be good! Everything is new: companion, TARDIS (inside and outside), title sequence, theme arrangement, and on and on. And yet somehow The Doctor remains unmistakeably The Doctor, which I suppose is why the character has endured for so long.

But can someone decide what season number this is? It seems to be a bit confusing. ^_^

Saturday, April 10, 2010

Links? We Don't Need No Stinking Links!

In the latest example of people who just don't get how the World Wide Web works (WWW-w? ^_^), Japan's Nikkei newspaper now requires that you obtain their approval for any inbound links to their articles. So why do they even bother to publish anything on the WWW?

I wonder how long before they notice the traffic to their site has plummeted. I googled for "japan nikkei newspaper" and didn't get a single result going directly to the newspaper's web site. Makes sense, otherwise Google would have to get permission for any links before it could show them to me.

I'd provide a link to Nikkei newspaper, but... ^_^

Friday, April 9, 2010

CNC Porn

Here is a cool video of a 5 axis industrial milling machine making a replica of a motor cycle helmet out of single piece of aluminium (aluminum for the North Americans). Presumably the hobbyists haven't reached this level yet. Come on, you can just stick the machine in the garage. I know you want one, don't you? ^_^

The above links leads to a lot more videos which are equally interesting. I can't help but feel that, as impressive the machinery is, it's the software that behind the scenes that's making it look easy.

Thursday, April 8, 2010

Digital Economy Bill Passed

So Britain's Digital Economy Bill passed. Such an innocuous name for a bill that gives unprecedented power to copyright holders, like cutting off Internet access of file sharers and an easy way to get their names from the ISP. All this legal overkill just because the rights holders want to stop non-commercial file sharing. It seems that some people hold copyright, which is merely a granted privilege, above the basic human right to share information freely. First it was France, now the UK, who will be next? Welcome to the future.

Wednesday, April 7, 2010

Same As The Old Boss

The CEO of Verizon claims that good ol' U.S. of A. is number one in broadband. This comment reminded me of how, in the 1970s, the CEO's of the U.S. car manufacturers dismissed the Japanese cars that were just appearing in the U.S market. Look where the U.S. manufacturers ended up 30 years later. Meet the new boss, same as the old boss.

Tuesday, April 6, 2010

WRC Jordan 2010

Another disappointing rally for Mikko Hirvonen. A big mistake on day two cost him any chance of scoring points. He needs victories in the next few rallies if he wants to remain in contention for the driver's championship, otherwise Loeb could easily run away with it. The new points system punishes mistakes much more than the old system did.

Latvala salvaged a second place for Ford. He tried his best but just doesn't have the experience to keep up with the likes of Loeb. Petter Solberg achieved another podium finish in third place. He seems to hang on to the leaders well enough that I'm wondering if a win might be possible this year. Kimi Raikkonen scored his first points in WRC so he is definitely improving.

This rally was all about the tactics for a better road position. The slowing down tactic is easy to understand, but the shenanigans on day three was very confusing because it happened in the road sections. Almost everyone conceded that perhaps this went too far, even though it was within the rules.

Monday, April 5, 2010

F1 Malaysia 2010

Qualifying was an example of old school strategy versus technical strategy. In old school, the wet conditions dictated getting a qualifying lap on the books. The technical strategists looked at the weather prediction data and believed it. The weather patterns around Sepang is generally unpredictable and Ferrari and Maclaren both paid dearly for putting their faith in the data.

After the third qualifying session resumed, Webber's bold choice to use intermediate wet tires when every one else was on full wets, was another example of old school, seat of the pants racing. Webber put in an awesome qualifying lap in absolutely atrocious conditions to grab only his second career pole. Webber effort really made up for his mistakes in Australia.

The race start saw some amazing driving as Vettel made a bold move on Webber in the first corner to jump from third to first position in the first corner. But Hamilton's magnificent charge from twentieth to twelfth had me on the edge of my seat. Even more impressive was that everyone got through the first corner with no serious contact as those faster cars carved their way through the field.

The rest of the race was very enjoyable as there were plenty of fights all the way through the field. There was even some passing! Alonso was outstanding as he wrestled with a car with a down shift problem which finally overstressed the engine, causing it to expire. It always amazes me that drivers can wring so much out of a sick car. Sutil and Hamilton's fight was also worth a mention. The Force India was very quick and forced Hamilton to eventually concede there was no way past. Sutil drove perfectly even with Hamilton breathing down his neck. Redbull finally shook off the reliability monkey to finished with a well deserved one-two.

Malaysia demonstrated a couple of things. First, a dry race can be exciting. Yes, passing is definitely a problem, there's no doubt about that, but this circuit offers classic passing opportunities which a few bold drivers used to good effect. Second, there's more to racing than passing. Sometimes it's little things like the air wrench getting stuck on Webber's right front wheel which cost him two seconds in his pit stop. Other times its getting the strategy all wrong. So yes, the passing needs to be improved, but there are other reasons folks like me enjoy this sport.

Sunday, April 4, 2010

Easter Dinner

We had a family get together for Easter dinner which was load and chaotic as usual. The weather was unusually warm so we sat outside which was a little strange for Easter, but we enjoyed it. My grand nephew Ethan has started walking since I last saw him at Christmas. His personality is a stark contrast to his sister's. The next gathering will be the annual family BBQ in July, which will be extra special this year because we'll have visitors from the UK and Australia. I'm looking forward to it.

Saturday, April 3, 2010

Disabling Radeon KMS

Kernel Mode Setting (KMS) for the ATI Radeon RV280 chip is not ready for primetime yet so i decided to disable KMS and revert to User Mode Setting (UMS) for now. KMS is the future but it is too immature on the Radeon hardware. Now, how do I disable KMS?

First I changed /etc/modprobe.d/radeon-kms.conf to
option radeon modeset=0
Then I ran update-initramfs -u to copy the change into the boot RAM filesystem, and rebooted. For some reason that doesn't disable KMS. Hmm. Figure out why or find another way? Door number two please.

Next, I added the kernel parameter nomodeset in /boot/grub/menu.lst. Run update-grub and reboot. Nope. KMS is still enabled. Hmm. Figure out why or find another way? Door number two please.

Next I replaced the nomodeset kernel parameter with radeon.modeset=0, again in /boot/grub/menu.lst. Run update-grub and reboot. Ding ding ding, we have a winner! Phew! Pant, pant!

It should be abundantly clear that KMS in the Radeon driver is a work-in-progress when disabling it takes that much effort. ^_^

Friday, April 2, 2010

They Are In The Car

So a study finds that a small percentage of the population can talk on the phone and drive at the same time. I'll bet that everyone in the pro-talk-and-drive camp thinks that they fall in that category. Despite the discovery of these unusual "supertaskers," the study found nothing to disprove that driving while conversing on the phone is bloody dangerous for the majority of us.

The talk-and-drive camp usually ask but what about talking to passengers? This article mentions another study which included that very question in the research. They found that while talking to passengers is definitely distracting, it isn't anywhere near as bad as talking on the phone. Why?

It's simple. They are in the car with the driver where they can tell that he is busy, and will shut up while he deals with the situation. A person on the other end of the phone conversation won't know why the driver has gone silent, and will probably talk at a crucial moment.

Ontario's hands-free-phone-only law is really toothless. There's a fine but no demerit points, even though it is moving violation and is as dangerous as drunk driving.

Thursday, April 1, 2010

Lame April Fools

Every April Fools, it seems like more and more people are making humorous prank postings of some sort or another. The problem is that the volume have become so much that most of it isn't very funny any more. Usually I'll see at least one good prank post that is worth mentioning, but this year it was all very lame. Has this Internet fad become dull and boring already?