Sunday, May 31, 2009

Race Conditions

I solved the strange error that I had in a unit test but I'm not completely satisfied with the solution because it limits what I can do in a unit test.

The error looks like a race condition due the tests running on NFS. The tests in question are actually functional tests that run a command line utility to validate the behaviour. The utility manipulates a SQLite database and two of the tests use direct access of the same database to either initialize or verify the contents. The external process terminates so it will always release all access to the database, but the tests run in the same process which does not end until all tests have completed. The tests do close the database which should release the resource, but this takes longer to propagate on NFS, so the process is still marked as accessing the file when the test fixture setup runs to reinitialize for the next test. Obviously you can't remove a file when it is still open, so the setup crashes.

For the time being I'm avoiding direct access to the database in the functional tests, until I can figure out how to get around this problem. The functional tests should simulate user actions only so direct access to the database isn't really necessary here, but it does make the tests more complete. Oh, well you can't have everything.

Saturday, May 30, 2009

Weird Error

I have /home on my desktop mounted as a NFS share. It has worked very well until now. I was doing some coding on Toms TV Utility today and after adding some new unit tests, I started getting a strange error:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.5/nose/case.py", line 364, in setUp
try_run(self.inst, ('setup', 'setUp'))
File "/usr/lib/pymodules/python2.5/nose/util.py", line 487, in try_run
return func()
File "/home/tlow/projects/tomstvutil/0.0.1dev/tests/test_tomstv.py", line 22, in setUp
ignore_hidden=False)
File "build/bdist.linux-i686/egg/scripttest/__init__.py", line 73, in __init__
File "build/bdist.linux-i686/egg/scripttest/__init__.py", line 203, in clear
File "/usr/lib/python2.5/shutil.py", line 175, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "/usr/lib/python2.5/shutil.py", line 180, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "/usr/lib/python2.5/shutil.py", line 178, in rmtree
os.remove(fullname)
OSError: [Errno 16] Device or resource busy: '/home/tlow/projects/tomstvutil/0.0.1dev/tests/test-output/.tv/.nfs00000000000005ea00000004'
The new unit tests needed a test fixture and it looks like the setup method is causing this.

Hopefully some Googling with turn up something and the problem won't hold up the coding too long which was going rather well the last few days.

Friday, May 29, 2009

Tytania

I watched the final episode of Tytania today. This anime is a classic space opera with great space battles between huge fleets of space ships. You just don't see much of that in science fiction anymore, so that alone made it worth watching. Fortunately, there is also a great story so there is more to it that just the space battles.

The Tytania family are the most powerful group in the Empire but they do not govern directly. Instead they control most of the trade in the Empire and use their powerful battle fleets to maintain order in the name of the Emperor, who depends on them completely. Needless to say, the Tytania family are not very popular.

One man, Fan Hulic, emerges as the hero of all Tytania's enemies after he defeats them in a battle which should have had an easy victory. Hulic is a reluctant hero and spends a great deal of time trying to hide from Tytania's forces. If Tytania had left Hulic alone, he would just have faded away, but their relentless pursuit eventually forces him to start fighting back.

The story isn't about the end of Tytania, but is really about the beginning of the end (with apologies to a famous British Prime Minister). Big changes do not happen over night and tyrants do not collapse after one battle, but Tytania is no longer perceived as being invincible, means that their power is already greatly diminished.

Thursday, May 28, 2009

Making New Contacts

I got a new prospect for some Linux server work today. Yay! I don't how much work will be required yet but making the new contact is probably worth more than anything.

The contacts that generated most of my work in the past, have become moribund in recent months. To try and expand my circle of contacts, I signed up at Linked In, social network site that is caters specifically to professional connections. I don't know if will help at all, but there's nothing to loose. I decided to keep my profile public since the point of the exercise is to attract attention. Only two connections so far so I'll have to spend some time on that.

Wednesday, May 27, 2009

Valkaria Chronicles #4

I'm enjoying Valkyria Chronicles, an anime set in a fictional 1930s era Europe. The backdrop for the story is the invasion of Gallia by the Empire. Even though the places are fictitious, the weaponry seems accurate for the period. There is a prototype tank that looks remarkably like a Panzer III. The Empire use tanks that resembles a French design and the Gallian regular army has a tank similar to the British Matilda.

The two main characters Welkin Gunther and Alicia Melchiott first meet during the early days of the invasion when they have to escape from their home town using the prototype tank. Alicia has had military training in the town militia and is not very impressed with Welkin, who is more interested in studying the local fauna. Alicia joins the Gallian militia and, much to her dismay, discovers Welkin is now a lieutenant and has become her commanding officer. However, Welkin turns out to be a surprisingly good officer and leader, and gradually wins the trust of Alicia and his squad.

The tank battles are exciting to watch but they do stretch my credulity. In the two engagements so far, the single prototype tank defeated a more numerous force without sustaining any serious damage. Superior numbers will always have the advantage, even if the force has inferior equipment or lacks leadership. Being outnumbered in a tank battle, or any battle, is rarely going to end well.

While it also seems unrealistic that the Gallian regular army would let the militia use the prototype tank, I get the impression that the regular army leadership is not very professional, based on the one General I've seen so far. In that context, it seems very reasonable that the army leaders would easily dimiss the new tank as something not very important.

Tuesday, May 26, 2009

WRC Italy

WRC lessons from Sardinia:
  • Tactics don't always pay off.
  • Loeb also has bad rallies.
  • Sometimes being first on the road is good thing.
I was impressed that the team let Latvala take the win but I suppose the 29 second lead was a little difficult to erase. Latvala deserved it, though. He drove faultlessly the entire rally.

So how do you change a tire in under a minute? You undo your safety harness before the car stops, that's how. Unfortunately, that's against the regulations and Loeb received a whopping 2 minute penalty. I assume that the penalty is so severe due to safety concerns. Both Loeb and Elena should know better.

Loeb's penalty gifted Petter Solberg with third place. Solberg actually did quite well despite having trouble with overheating. An upgraded intercooler didn't work so well for him. The car also had mechanical differentials which didn't sound like an upgrade to me but it didn't raise any complaints from Petter.

When Henning Solberg's bonnet flew off, I was surprised that it didn't hit the windscreen. I wonder if the hood is designed to detach like that, or was that just really good luck?

Monday, May 25, 2009

F1 Monaco

Qualifying was so very close once again. Kimi Räikkönen almost had pole position but once again Button managed another heroic last lap to grab the pole. Ferrrari has improved significantly and their drivers are also starting to deliver. I predict that a Ferrari will be on poll very soon. Barrichello needs to up his game if he wants ensure the equal treatment continues. This was the second time that Button apparently struggled in the early practice sessions but still out qualified Barrichello.

The race was a little boring. Most of the field was spread out after the first round of pit stops. Brawn completely dominated the race. Bernie Ecclestone made a somewhat cheeky remark that the racing has become predictable again. As much as I respect what Brawn has accomplished, I sincerely hope someone will be able to challenge them soon. Ferrari's race pace was good but their strategy wasn't flexible enough to capitalize on having the better tire early in race. However, third and fourth is very respectable considering how badly their season started.

It is easy to see why Ferrari are so opposed to a budget cap. I'm sure that they spent ridiculous amounts this year already in order to move up almost 15 places on the starting grid. Under a budget cap, if you've blown it on a poor design, you would never be able to recover during the season as Ferrari are doing now.

Anyhow, it looks like the budget kerfuffle will be over before the May 29 deadline for the 2010 registration. A breakaway series would have harked back to the pre-WWII days when there was only a constructors’ championship but what chance would it have under current economic conditions?

Sunday, May 24, 2009

Desktop Environments

There's an on going thread on the Debian user mailing list which underscores why I avoid desktop environments altogether. This thread discusses KDE 4.2.2 which has just entered Debian testing. The problem is the latest KDE depends on MySQL server. Of course, many KDE users are questioning the necessity for for installing a full RDBMS on a desktop system at all. But for me the broader question is why are Linux desktop environments becoming so complex at all?

My theory is that the Linux desktop developers are trying very hard to make the Linux desktop more comfortable for Windows’ users. There nothing wrong with that goal but I feel that it will inevitably lead to the same bloat that infests the Windows’ desktop. From what I can tell, the MySQL dependency is the result of adding MS Exchange-like functionality to KDE's PIM and email applications. Again, that's OK but SQLite might have been a better default for such a simple database, especially on a desktop system.

And please don't think that GNOME is any less immune to this type of thinking. Desktop environments are becoming ever more complex and I see no reversal in that trend.

Saturday, May 23, 2009

Guin Saga #4

Guin Saga is a fantasy anime in the true swords-and-sorcery tradition of Robert E. Howard's Conan stories, which pretty much invented the genre. Guin, the title character, has the same physical stature as Conan, except for a leopard head mask that appears to be permanently attached. Also like Conan, Guin is an extremely powerful and skilled fighter which carries an obligation that you have to throw some rather nasty stuff at him. So far the producers haven't disappointed and the fight sequences are just been wonderful to watch. Makes me pine for D&D again...

Friday, May 22, 2009

Too Strange

OK, now this is just strange enough to be true. A woman's three year old daughter buys a full size digger from an online auction site while the mother takes a nap. Of course, my first thought was: who the heck leaves a three old unsupervised? The full story is here.

Thursday, May 21, 2009

Silly Ideas From Down Under

I'm sure my esteemed reader from Australia has seen this recent nonsense. Curiously, the system will have a override switch. I assume this supposed to be used when passing another vehicle, but isn't that like admitting there are times when driving fast is completely necessary? And if given the choice, why would anyone turn on the system at all? I certainly wouldn't.

Wednesday, May 20, 2009

Strange Recession

I'm getting a strange feeling about this recession. Here we are in the worse economy in decades, and yet the price of oil is going up, which of course, immediately caused the price of fuel to jump to almost $1 per litre overnight. How does this make any sense? It seems that the greedy people will survive the recession just fine. Kind of how rats and cockroaches will survive anywhere and anything.

Tuesday, May 19, 2009

Software Liability

The EU recently proposed extending consumer protection laws to include software so that the developer would be liable for failures as for any other consumer product. At this month's PyGTA meeting, we had a round table discussion of the subject of software liability. Since most members of PyGTA earn a living developing software, the topic is quite relevant to the group. Despite the dry nature of the topic, the discussion was quite lively and even entertaining at times, but I don't think we reached any useful conclusions.

Monday, May 18, 2009

Eden Of The East #3

Eden of the East is the most intriguing anime of the Spring 2009 season. After three episodes there is still only the tiniest hint of what is really going on, but it was enough to get me hooked.

At this point in the story, all I know that the lead character, Takizawa Akira, is one of ten players in a game. But this is no ordinary game because the players are able to call someone named “Juiz” who somehow has the power to erase memories, kill people on the players’ behalf, and perhaps even launch a missile strike on Japan. Do you see why I'm hooked?

Sunday, May 17, 2009

Doctor Who: Planet Of The Dead

I finally got around to watching the Doctor Who Easter special, only a month late, but better late than never. ;-) The story was very well done and I thoroughly enjoyed every minute of it.

It was great to see UNIT back in action. We have only seen once them once before in the new series. UNIT was always a curious counterpoint to the Doctor since he never used guns of any sort, so they really only existed to shoot at things. Well, that hasn't changed but UNIT is different than they were in original series, because they never had any “boffins” on staff that I can recall.

This was the first of four specials to be aired this year. The next three will air in November and December so there is a long wait before we see any more of the Doctor. The final two specials will feature the regeneration into the eleventh incarnation.

Saturday, May 16, 2009

Urge To Code

Last night I had a sudden urge to code. I've been doing a lot of system administration stuff lately and I probably needed a change of pace. I decided to tackle Tom's TV Utility again, as I haven't touched it for a while. Of course, my specifications changed since then, so I had to bring the code up to date first. Even when I'm coding for myself, I can't avoid the realities of software development. I'd really like to get the project to a point where I can use it every day, so I'll see how far I can get while the urge lasts.

Friday, May 15, 2009

Victoria Day

This weekend is the Victoria Day long weekend and it is going to be a quiet one for me. Oh well, maybe something will come up. I have plenty of stuff to do so I won't be bored, but a change of scenery would be nice.

Thursday, May 14, 2009

Time Management

I had one of those days where I had all the best intentions but didn't actually accomplish very much. I really need to focus on more important things and not let the trivial stuff suck up so much time. Yeah, right...

Wednesday, May 13, 2009

Backups

Last night's topic at the TLUG meeting was backups. I'm not a system administrator so I'm always interested in picking up some tricks from the professionals. The presenter was Robert Brockway who is an experienced system administrator so there was good chance of learning a few things.

Robert covered tape backups of course, but it was interesting that he actually prefers disks for most situations. Ultimately, it depends on how much data you need to back up and more importantly, how valuable it is, but it helps to know a pro would recommend disks as a good solution. However, he emphasised that no matter what you use, if you don't have an off site backup, a disaster will make all your efforts meaningless.

Tuesday, May 12, 2009

F1 Spain

All the teams brought upgrades to Spain. Ferrari improved the most but threw away any technical benefits with bad strategy and poor race craft. McLaren, on the other hand, appear to be going backwards. I can't recall Hamilton ever being so blunt about how bad the car was.

I feel bad for Barrichello. He looked like he had a good chance of winning this race but something just wasn't working for him after the second pit stop. But that's motor racing. The media made too much of his statements afterwards as it is way too early for the team to be favouring one driver. Barrichello will be pushing himself much harder over the next few races to prove that he deserves the equal treatment. That should be fun to watch!

Webber made the bravest move of the race when he passed Alonso after the safety car restart. Webber is another driver with something to prove since Vettel has out shone him so far this season. That's probably indicative of this season, as there are so many drivers who are hungry for success and who finally have cars that will let them achieve something. It makes for some great racing.

Monday, May 11, 2009

Linux-VServer Or OpenVZ?

I spent most of today reading about Linux-VServer and OpenVZ. Both provide nearly identical functionality and neither is clearly better than the other. In the end I decided to try OpenVZ first based on instinct and a coin toss. ;-)

The plan is to build a DNS server inside an OpenVZ container. The host system is 450MHz PIII which is destined to become my new firewall. Since it is not a production system yet, it makes a good candidate for some experimenting. I wouldn't normally run a DNS server on a firewall, but the virtual containers provides an opportunity to get more out of an under utilized system while still isolating the DNS server from the host.

Sunday, May 10, 2009

RTorrent 0.8.4

The Debian rtorrent package was upgraded to version 0.8.4 which has a few incompatibilities with the previous package. Since I depend on rtorrent for all my entertainment downloads, I spent some time today making sure there were no problems.

The session file format changed but there is a script, fixSession080-d.py, which will update all the session files to the new version. I only have one session for an extremely large Babylon 5 torrent which I still haven't seeded 1:1 yet so I don't want to lose the current ratio. The script updated the session file without any complaints. You just pass the the session directory (.rtorrent in my case) as an argument:
python fixSession080-d.py .rtorrent

The new version of rtorrent changed the configuration for ratio handling so I also had to update my .rtorrent.rc. My old ratio configuration was:
schedule = ratio,60,60,"stop_on_ratio=100,100M,500"
The stop_on_ratio command no longer exists. The rtorrent wiki page on ratio handling isn't very clear but eventually I came up with this replacement:
ratio.enable=
ratio.min.set=100
ratio.max.set=500
ratio.upload.set=100M

The new rtorrent gives a warning about deprecated configuration commands:
Deprecated on_* commands, use 'system.method.set_key = event.download.{inserted, erased, ...}, , ' instead.
These lines are the culprits:
on_start = lock_torrents,"execute=touch,~/torrents/lock"
on_stop = unlock_torrents,"execute=rm,~/torrents/lock"
on_hash_queued = lock_torrents,"execute=touch,~/torrents/lock"
I haven't figured out the fix for this problem yet, so it is fortunate that it is only a warning for now. Rtorrent's documentation is not the reason I use it. ;-)

Saturday, May 9, 2009

No More Ikariam

I deleted my Ikariam account today. Nothing against the game. It is a good game and I actually enjoyed playing it for a while, but it couldn't overcome my lack of interest in strategy empire building games.

Friday, May 8, 2009

MPlayer And Mkv Linked Chapters VI

[2009/09/26: More recent info here]

Well, after upgrading to faster hardware, I tried styled subtitles with 720p video for the first time. Running through my test videos, I found a case which the patch does not handle. When the linked chapter is the first chapter, MPlayer does not display the subtitles from the main file. If the linked chapter occurs later in the chapter list, all subtitles work normally. Unfortunately, the opening title chapter is usually the first one in most anime videos, so this is big problem.

Faced with doing more serious digging into the source file, I was feeling the limitations of Subversion. While investigating MPlayer git repositories, I noticed the development branch logged some changes for “ordered chapters.” Was this yet another effort to add support for Matroska ordered chapters? Only one way to find out: try it!

The following will downloaded MPlayer source from the development branch. You will also need the FFmpeg source.
git clone git://repo.or.cz/mplayer.git
cd mplayer.git
git clone git://git.ffmpeg.org/ffmpeg/
Then configure, build and install as usual.
./configure
make
make install

This attempt at the linked chapter problem works very well. It plays all my test videos, even the ones where the encoding of the external files do not match the main file exactly. There is occasionally a slight hesitation in the video when switching between the linked chapters, but it is not consistent so it may be hard to track down. So far that is the only problem I've noticed but I'm sure I'll find something. This is the development branch after all, and I certainly wouldn't expect it to be completely problem free. However, it is a good sign that linked chapter support is finally in a repository rather than some random patches which may never be updated.

Thursday, May 7, 2009

“New” Computer

I finally got around to setting up the AMD Athlon 64 3200+ system I acquired about a month ago. I was going to install 64-bit Debian sid on the system but just wasn't finding the time to do it. Today, I changed my mind and just moved the hard drives and graphics card from my current desktop system into the new box. I actually prefer not to move drives in Linux systems any more because I found it can cause some minor annoyances.

I should have swapped the NIC too which would have avoided one inconvenience, but I knew what to expect when I used the K8T's on board NIC instead. The problem arises because the new NIC becomes eth1 but the network configuration is for eth0, so you have no network access. This is easily fixed, however, by editing the udev rule in /etc/udev/rules.d/70-persistent-net.rules and changing the eth1 to eth0.

Actually, physically installing the hard drives in the new case wasted more time than anything else. The system came in one of those funky transparent Plexiglas cases, which I had to take in order to get the system. These cases may look interesting but this one is not well designed. For example the Plexiglas hard drive mounts are too far apart so the drive does not fit snugly. In fact the gap is so big, you can only put screws on one side of the drive because the provided screws won't reach on the other side. I already decided the case has got to go.

Transferring the graphics card saved a lot of effort. The AMD system had a Nvidia card which would have required the proprietary drivers to get accelerated video. Not something I want to tackle right now. I'm very happy with my older ATI 9250 card which uses free drivers for accelerated graphics. The only other problem was getting sound to work again, since both systems had on board audio so moving the card was not an option. As usual, it was the microphone input which which took the longest to figure out. Nothing serious but annoying none the less.

The MSI K8T motherboard is about 4 years old now. The previous Intel system was about 8 years old. The only reason for this “upgrade” was for 720p video which the new system plays without any effort at all. Frankly, I see no need for anything faster at this time. I haven't bought a complete computer system since 1998, and with all these retired older systems up for grabs, there's a good chance I may never buy another system again.

Wednesday, May 6, 2009

Canada And Open Source

A recent report ranks Canada's open source activity at number 28 out of the 75 countries that were included in the research. It is quite sad that several third world countries rank higher, but I'm hardly surprised by our mediocre position. The Federal government has only now started to study open source as an option for government projects. While this a good sign, we all know how long these studies can take so it could be at least another 5 years before conditions for open source improve in Canada. And I'm sure the lobbyist from the propriety vendors will be working overtime to ensure it doesn't happen.

Tuesday, May 5, 2009

Akikan! End

I don't know what to say about the anime series Akikan! which I recently finished watching. I liked the series otherwise I wouldn't have watched till the end, but I still haven't figured out why I like it. The leader character, Daichi Kakeru, is alternately annoying and likable. The reason why the cans' exist at all, is lame and funny at the same time. The ending is both a bang and a whimper.

Maybe I enjoyed the series because there is very little that is serious about it. “Puerile fun&rdquo, is the phrase that comes to mind. ;)

Monday, May 4, 2009

MPlayer And Mkv Linked Chapters V

An updated patch for MPlayer Matroska linked chapter support is available here. The patch should apply cleanly to a recent Subversion checkout of the MPlayer source. You will also need the development header files for the libraries that you expect to use with MPlayer. You can figure what is missing by examining the output at the end of the ./configure command. I did not pass any flags to ./configure.

Download the source:
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
Compile:
cd mplayer
./configure
make
make install
Test MPlayer thoroughly with some files that you know should work. If they do not play properly, you should figure out why before applying the patch. At this point you can still expect to get some help from the MPlayer-users mailing list.

Apply the patch and recompile:
patch -p0 <mplayer_matroska_linked_chapters.diff
./configure
make
make install
MPlayer will now play a .mkv file with linked chapters. The external files must be in the same directory as the main file, otherwise MPlayer will not find them.

The original patches that I used, can be found here for those who are curious, but you don't need them, as the updated patch includes everything from the originals. My only addition forces MPlayer to always play the external chapters even if they appear to be incompatible. I did this because there no command line option to control the flag. If the external files are really incompatible, it will be obvious anyway, and you must delete them or move them out of the directory so that MPlayer cannot find the files. Renaming will not work.

Please do not expect support for this patch on the MPlayer mailing lists since the devs did not accept the original patches. We are on own with this one. The work to add linked chapter support has moved to ffmpeg (here and here), but I couldn't find any sign that those patches were ever accepted. We may be stuck using a feature without developer support.

Sunday, May 3, 2009

Chrome Shelled Regios

I wasn't to sure about the anime series Chrome Shelled Regios, but after watching six episodes, it has really grown on me, due to the main character, Layfon Alseif. He is the classic reluctant hero who is extremely powerful, with abilities that are off the scale compared to the other characters in the story. At first he tries to hide his abilities, but it is a dangerous world and eventually he is forced use his full power to protect everyone else. The story is revealing Layfon's background very slowly, so it is still not clear why he wanted to leave his old life behind.

The story also hasn't offered any hints about how the world became so messed up. The blurb on ANN does explain a little, but I hope the story expands on that soon. There are also some strange action sequences with the worst engrish (sic) ever. These sequences don't seem to fit the rest of the story so it is not clear what their purpose is yet, apart from giving people ear cancer! :-)

Saturday, May 2, 2009

Misery

I hate having a cold. I need rest but some chores must be done, but I guess everyone has that problem. :(

Friday, May 1, 2009

RideBack End

I enjoyed the end of RideBack anime series. However, I feel that the story really needed two seasons to be told properly. Even one more episode might have helped as the final episode feels really cramped as the various subplots are wrapped up.

The GGP are never explained in sufficient detail so it is difficult to understand exactly how they operate as a world government. They came to power after a crucial attack on a base Arizona using RideBack prototypes, but not much detail is revealed about those events, except as it relates to some characters in the present. However, it is clear that the GGP are a typical post revolutionary government in that they are still highly militarized and quite corrupt. Events in the story eventually lead to changes in how the GGP operates, but it is all in the background and a little vague.

The main story focuses on Ogata Rin who has never come to terms with quiting the stage after her injury, and especially with how it affected her fans. The tragic events of episode 9 forces her face these issues, and she does some serious soul searching before she finally understands that she needs to perform as a way to find closure. She chooses her stage carefully and gives an absolutely brilliant performance on Fuego. Blending dancer and machine, she takes out a half dozen of the GGP's autonomous RideBacks. To most it looks like she is fighting, but the few who understand that she is dancing, are left completely speechless by her performance.

As is typical for anime sci-fi, the RideBack itself is really not very important to the story, and there are no techno babble explanations of how it all works. Obviously, a RideBack would require a complex control system to make it drivable. However, what makes Fuego special is that some of the control systems are turned off, so that an exceptionally skilled rider can get more out of the machine. There's a not so subtle hint here about how humans and machines need to complement each other to be effective.