ThoughtFactory.CreateThought() A random collection of thoughts from an easily bored developer

29Jun/080

Full to the Brim

It seems that the recent capacity and load management problems being experienced by several social networking sites are self perpetuating.

Regardless of the application, users always have preconceived expectations with regards to performance, usability and availability. If those expectations aren't met, they like to let people know about it. Depending on the environment and target audience, you can always expect a disgruntled user to call, email or talk to someone with the express purpose of getting that person to:

  1. handle their support problem or;
  2. listen to them whine

More often than not, users will choose option 2, and proceed to use their communication medium of choice to tell as many people as possible that they are unhappy.

FAIL Whale

So what happens when it's a social networking application such as Twitter or Facebook that's having the problem? Well, as long as the system is partially up and running, users will continue to use the system to complain about it being too slow or partially unavailable, after all, it is the communication medium of choice for many of the users. Even in times of a total outage, users will often wait for the service to come back online and then start using it to tell all their friends about the outage, as if they didn't already know.

The recent Twitter replies tab outage is a great example of an outage that simply generated more user content, potentially exacerbating the problem. Minutes after the problem occurred, my twitter feed filled with people telling me all about it, and even more people chimed in with replies to those comments. I can't imagine that this helped whatever problem they were having, and any application that has a fan club for their "out of service" mascot certainly doesn't need to have it's performance problems inflamed in any way, shape or form.

18Jun/081

Get Back

I've been using the Firefox 3.0 beta since I upgraded to Ubuntu 8.04, as it came as a standard package, but until now I had no idea that version 3.0 had a significantly different UI from 2.0. In fact, I only found out when I saw recent Flickr posts showing a Firefox comparison chart with a list of "advantageous" features. One in particular stuck out:

Large "back" button, the result of decades of market research

Large back button? I couldn't see a large back button on my Ubuntu install, even though I was running the latest 3.0 release. What were they talking about?

After installing Firefox 3.0 on my Windows 2003 machine at work I soon found out: They've enlarged the back button, presumably because it's the most commonly hit icon in the tool bar, and it looks pretty cool. I must say that I don't use the back button much, I'm more of a "delete key == back" kinda guy, but it's a nice touch.

Apparently there's a bit of backlash against this new feature, but at least they're trying. It's certainly less jarring than IE7's "hide the menu" approach to UI innovation, and it makes quite a lot of sense from a practical point of view.

I've now upgraded my Mac and XP machines to Firefox 3.0, and I'm enjoying the new UI. As an aside, and regardless of John Gruber's list of gripes, I still think that Firefox 3.0 on the Mac is a huge step forward in comparison to what they had. Versions 2.0 and 3.0 are like chalk and cheese. But I digress..

So why didn't my Linux install have this spiffy new button? Well, it turns out that Firefox 3.0 on Linux is one of the latest applications to get the Tango treatment.  Tango is an attempt to bring some order to the world of open source applications by giving them a sense of consistency. This is actually a great idea, and it's done wonders for applications such as OpenOffice.Org and The GIMP, which now look somewhat respectable. There's a showroom full of projects that have had a Tango related makeover, and most of the featured applications are much better off with the new icon set.

This is all well and good, but what about Firefox? It's probably the biggest open source project in next to Linux itself, and yet it's not yet mentioned in the Tango Showroom. Surely there's a reason for this?

Well, a potential reason becomes fairly obvious once you actually open up the browser. The very first page that pops up has a picture of what the new theme looks like on Windows Vista, which is a stark contrast to what you are seeing in your native browser window.

Mozilla on Ubuntu

See what I mean? The "standard icon" idea that has worked so well for OpenOffice.Org, The GIMP and VMWare Workstation has given us a fairly plain browser that has lost all traces of the innovation that the Firefox team were trying to implement. It looks pedestrian and boring, in fact if it wasn't for the deli.cio.us plugin icons I think I'd never get any work done, as a mere glance at my Firefox toolbar would send me straight to sleep.

It's sad that the most interesting, and therefore the one most likely to draw your attention at a casual glance, icon in the standard set now being the home icon. Although it is much more visually appealing than the plain forward and back arrows, it's a button that I can't remember ever clicking. Not even once. There are no paint brushes or printers to mix things up and keep your eye from settling on a useless feature that you've never wanted and will never need.

The great thing about Firefox is that you can apply a theme to get it to look however you want, so you would think that I would have no need to complain. I could just pick a theme from the Firefox website and would be happy, right? Well, yes and no. There's no "official" theme from Firefox that delivers similar functionality for Linux. There might very well be a 3rd party theme that will make my browser act like this (I did look for one without success, but that's another story altogether), but that still doesn't change the fact that the Firefox team have taken a vastly different approach to their Linux UI when compared to OSX and Windows, one which flies in the face of their obvious urge to innovate.

Alex Faaborg spoke about how they wanted to integrate with the host OS as much as possible on the proprietary platforms, and that didn't stop them from making the forward and back buttons look absolutely nothing like any native control on XP, Vista or OSX, so their integration manifesto couldn't have been that rigid. With Linux they have gone for total homogonisation, where as OSX and Windows have an "integrated, but with individual flair" feel. They haven't had all the life sucked out of them by a desire to conform to the nth degree. Standards are great, and are certainly needed on Linux given the diverse nature of the different window managers, but they shouldn't be used to stifle ideas and discourage creativity.

Tagged as: , , 1 Comment
16Jun/080

The Drudgery Report

I was recently interviewed by Sheila from Sheila's Wanderings. Typically for me, I ended up with a longer answer to the "Any last words?" section than any of the others. The tone of the questions really got me thinking about my first year of University, when I was amongst 200 other students looking forward to a prosperous career in a DotCom bubble.

To quote myself:

I can remember starting my degree with around 200 people in my course. By the end of the first year, over half of them had figured out that IT wasn't all about playing computer games. I'd say that around 30 students out of that initial 200 actually made it through the degree still wanting to get a job related to the field. Make sure it's something that excites you, and if you HAVE spent three years on a computer science degree and don't want to use it just remember that you can always take a post-grad degree in something totally different. You have to live and breathe IT or the grind of continuous learning will suck the life out of you. Well, either that or you'll stop learning and will soon find yourself relegated to the sidelines.

It was 1998, and the media were all over IT. The buzz surrounding anything even remotely related to computers was so prevalent that every man and his dog wanted in on the action.

Over the course of that first year I saw a large number of my classmates gradually come to realise that Computer Science was nothing like the media spin. Many of those disaffected with the degree dropped out at the end of the first year, but quite a few stuck around till the end of the degree, with some even ending up in industry jobs. The disaffected students became disaffected employees.

I'm incredibly lucky to get paid to spend 8 hours a day indulging in one of my favourite hobbies, so I guess I've always felt sorry for those who were inclined to settle for something less than that. I can't relate to other fields, but I can say for certain that a career in IT isn't for everybody, and that's nothing to be ashamed of. It's a discipline where happiness is usually accompanied by a constant desire for self improvement, and any hint of stagnation breeds disenchantment. If you have no personal desire to better yourself then you are probably in the wrong field.

The most important thing to remember is that even if you have spent several years training for a job that you have no interest in, it's not the end of the world. It's never too late to discover how to get paid for something you love to do, and there are plenty of options for re-skilling.

If you already have a Bachelor's Degree then Post Graduate Diplomas and Degrees are always a good bet, as is simple on the job training. Many degree-based jobs simply require that you have "a degree", as well as some enthusiasm for the role. You might not be starting out as the CEO, but at least you'd be on your way to enjoying your work.

If you do have a degree that you're unhappy with and want to move into a role that does not require a University education then you may end up viewing your time at Uni as wasted effort, however all is not lost. The primary goal of University is to teach you how to learn, which is always a useful skill no matter what you end up doing. If you find that a 12 month TAFE course will lead you to career fulfillment then don't let your previous efforts influence that decision. There's no point in being compelled to continue down a path of drudgery simply because you've spend 3 years walking down it. The principle of not throwing good money after bad applies to your career too.

If you're not happy with your job, regardless of the industry you are currently in, just ask yourself "what would I rather be doing?". If the answer is "not this" then you may want to give some thought to what would make you happy, and what it would take to get you there. Many of us would have been in the workforce for a long, long time before we can officially retire, so spending a few years here or there to figure out how you can be happy for the majority of your waking hours isn't really a big ask.

8Jun/082

Twittering Heights

Until recently I honestly didn't "get" the Twitter phenomenon. I figured that it would be chock full of people posting about what they had for lunch, or other such inane comments.

There are quite a few excellent articles that go some way to refute this by pointing out the power of choosing who to follow, but that still wasn't enough for me. Finding people to follow seemed like a lot of hard work, and constantly maintaining this list was not of any particular appeal to me. I'd given up on trying to maintain a LiveJournal friends list, which also had the tendency to suffer from the same sort of noise problems, so why would Twitter be any different?

Thinking back, the reason I lost interest in LiveJournal had nothing to do with the work involved in tending the garden that was my friends list. I simply never felt compelled to post anything on the site, so I had no buy in. I was merely an observer, and I was never going to become interested in a service that I had no urge to contribute to.

Twitter is a little different. The short, 140 character messages and public API seemed like the perfect way of complimenting my blog, especially if I could put a Twitter feed on my site.  I could augment the larger posts with short, train of thought ideas, and generally ignore the horrors of trying to accumulate another Facebook-like friends list and just concentrate on producing content. At last, a social networking site with a chance of holding my interest!

There are a few ways of getting at a particular Twitter feed. Aside from the obvious "code your own" approach, Twitter themselves publish a series of "badges" that provide a variety of Flash of Javascript driven ways of getting your Twitter info onto your site. This blog runs on WordPress, so I could also the variety of Twitter based tools for WordPress that let you create and display tweets on your blog. I ended up using the main Javascript driven "badge" provided by Twitter. All it took was some minimal styling and I had a working feed of all my tweets.

It only took a few hours for me to figure out that the side bar's performance was greatly affected depending on Twitter's now legendary availability problems, and the Twitter results wouldn't even show if you were behind a proxy server that didn't allow social networking sites. The feed implementation I chose worked by including two Javascript blocks sourced directly from Twitter, one being a file that defines two functions used to display tweets and the other being a JSON file representing a call to one of these functions with data from my feed. Obviously if a user was trying to view my site from a location that does not allow Twitter, e.g. most work places, then they would not see the feed on my site. Even if they could view Twitter, there was a good chance that the service itself would be down, causing an HTTP timeout to occur on the client.

One option would have been to move the Twitter call to my server, making a PHP call from the WordPress site to populate the list of tweets, or even pointing the existing Javascript at a script on my site. Contacting Twitter on the server would allow me to bypass the "social network" proxy tax, and it would also give me a point of contact to introduce a cache for the Twitter feed.

By caching the data on my server, and only fetching it from Twitter if the cache was older than a certain period of time, I could at least make sure that the feed would always display. If Twitter was down then I'd just have to wait for the request to time out and return the cache results regardless of age. Unfortunately any potential HTTP timeout could still affect the timeliness of the response from my blog, meaning that a user still had the potential to feel the wrath of Twitter's downtime on my site.

It seemed that, no matter what I did, contacting Twitter to retrieve my tweets was going to be an expensive and unreliable operation, and not one that I wanted to impose on the user when they request pages from my site. After all, I'm trying to augment my blog, not cripple it.

In situations such as this I'd normally install a service of some sort to do the request outside of the request/response life cycle experienced by users of the site. However, this site runs on shared hosting Linux environment with no SSH/shell access, and my only way to configure it is through FTP or a web interface, so I assumed that my options here would be limited.

Fortunately, after a bit of poking around in the web configuration tool, I discovered that my hosting provider lets me schedule cron jobs. This was the missing link that would allow me to use a cached approach and keep the same Javascript display code, while still enabling the cache to be updated outside of the normal request/response lifecycle. Effectively I could create a poor man's Twitter update service just by executing a Python script every 15 minutes.

In the interests of spending as little time as possible on the problem, I decided that I was going to keep all the existing Javascript for displaying the tweets. All I needed to do was point both the function definition and the JSON file links at copies on my site, and update the JSON file on a regular basis using a script executed via a cron job. A few lines of Python and some site configuration later and I had a Twitter feed that updates every 15 minutes.

One of the most interesting aspects of the exercise was deciding how to handle failures in the script. Twitter is down so often that I really don't care if the web request fails. So much so that I didn't even bother logging it. I've effectively assumed that the service will fail a good proportion of the time, and if it fails because Twitter couldn't be contacted then so be it. I get told about everything else, such as being unable to write to the cache, but I could really do without 50 email a day reminding me about the precarious nature of a service I have no control over.

Tagged as: , , 2 Comments
30May/080

Maximize Your Potential

Up until tonight I was pretty happy with my switch to Thunderbird. I'd migrated over my RSS feeds, for which I was previously using the (admittedly rather cool, as the RSS feeds are almost done at an account level, rather than application level) Outlook 2007 RSS feature, and was busy searching for a replacement calendar application.

My state of mail related bliss was interrupted when I performed a system update involving a new version of GTK. Upon restarting my machine, I discovered that Thunderbird was stuck in full screen mode. Full screen mode involves an application filling the entire screen with no window adornments, so it can't be resized or even moved to another screen. This wouldn't have been so bad if it wasn't for the fact that all the secondary windows (preferences, new messages etc) seem to behave strangely when in full screen mode, often appearing under the main window and requiring a click on the relevant task bar item to get them to show.

After a bit of searching on the web I managed to find a bug entry on the Ubuntu's Launchpad Bugtracker confirming that I wasn't alone. Various Linux installs I've used in the past have allowed me to push "Alt-F11" to toggle  full screen mode, but that didn't seem to be enabled on my Ubuntu 8.04 install.

Figuring that it was an issue that could probably be solved by playing with some window manager settings, I went poking about in the CompizConfig Settings Manager. I found some interesting shortcut configurations under "Window Management > Extra WM Actions", one of them being a shortcut to "Toggle Fullscreen", which was disabled.

Compiz Window Settings

In about two seconds I had set this up to use the familiar "Alt-F11". I then tried it out on Thunderbird and my problem was solved. No more forced full screen mode. Now I could drag that little window around to my heart's content! Even better, I could now jump in and out of full screen mode for any application I wanted. I'm going to have to do a bit more digging in the Compiz settings to see what other useful features I can find.

28May/080

Evolution at Work

I very rarely see the Gmail front page, as I've usually got an active session kicking around on whatever machine I'm using. This means that I never get to see the Gmail blog updates that they feature on the front page. I'm far too lazy to actually subscribe to the Gmail Blog RSS feed (and I still haven't found a Linux RSS reader I like, so I won't be doing that for a little while), so I usually miss out on all the latest Google Mail related gossip.

Tonight I went to check my mail using Safari on an old Mac laptop we have floating about. It was the first time I'd used this particular account/browser combination to access Gmail, so I was confronted with the login screen.

Seeing as it was already in front of me, I gave the page a quick cursory scan to see if there was anything of interest. I'm glad I did, because I noticed the latest Gmail blog entry, which was centred around Gmail's IMAP support I must have seriously missed the boat on that one, because I didn't even notice that Gmail supported IMAP.

I set about trying to configure a mail client on Linux to work with this new-found IMAP goodness. I already had two clients installed; Evolution, the default Gnome email client, and Thunderbird, from the same guys who make the little browser that could, so I was determined to pick one of those, at least in the short term.

I'd used Evolution way back in 2002 when it was the only linux mail client that could connect to Exchange, so I thought I'd give it a go first up. Gmail uses a few funny ports for SMTP and IMAP, so I grabbed those settings from the IMAP client configuration page. They haven't made a specific page for Evolution, so I just picked "Other" and away I went.

Initially everything went great. All of my mail came down, and the test messages I sent to some of my other email accounts worked fine. Great! I was all but ready to mark this one off as a job well done. There was one little problem, though: whenever I tried to reply to a message, i got a nasty error message telling me:


Error while performing operation. Host lookup failed: myemailaddress: Name or service not known

Hmm. Just to make sure that there were no whacky Evolution settings to consider, I went and grabbed an Evolution specific tutorial. No luck. I even tried switching to my ISP's SMTP server. Still no luck.

Thunderbird's icon was calling me from the launch panel, so I thought I'd give that a go to see if it suffered from the same problem as Evolution. Google have made a specific guide on configuring Gmail IMAP for Thunderbird, so to avoid complications I followed it word for word. I wasn't going to risk some silly configuration mistake getting in the way of my inexplicable need for a thick client email solution.

It took around 20 seconds to have the entire account configured. I got all my mail, sent some test messages (both new compositions and replies to other messages), and it all just worked. Amazing.

So in the end, it looks like Thunderbird won by default. I could go back and try to fix Evolution, but I honestly can't be bothered. I'll give Thunderbird a go for a few weeks and see how I like it. I may even mode back to using the Gmail browser-based client. Or maybe I'll just start answering all my email via the Gmail Mobile client. Then I'd be able to fulfill my lifelong dream of developing  horrible thumb-based RSI from excessive predictive texting.

Edit: Looks like I spoke too soon. I'm currently having fun with this bug. After doing a GTK update last night, Thunderbird has been stuck in full screen mode. Oh well, I didn't move to Linux because it was easy!

24May/082

Chasing the Heron – Part 1

My Ubuntu box has actually been up and running since late last year, but I haven't starting using it as my primary desktop until recently. In its previous life it was a file server, subversion repository and web server. It started off as a 7.10 Gutsy Gibbon install, but I recently upgraded to 8.04 Hardy Heron just in time for my big migration.

I had never had much luck with networking on the machine. The wireless network dropped out when I put any decent sort of traffic through it. I would still have a signal, but would be unable to send or receive any packets. This wasn't a major issue when the box was sitting under a desk only being used to serve up files via ethernet, but as soon as I started taxing the wireless card, which I use for all internet traffic, it would start to flake out. I would only get around 45 minutes of usable internet access and then I'd either have to reboot or start playing with ifup/ifdown for 30 minutes, hoping that something would breathe life back into the connection.

Unhappy with the situation, I decided to do some digging and came up with a list of problems people were having with dodgy wireless cards. Some of the symptoms were remarkably similar to those I was experiencing, which at the very least told me that I wasn't alone.

Some posts suggested that there was a problem with the networking components of the OS itself, and made suggestions such as running DHCP manually. I tried every potential solution I could get my hands on, including replacing the default wireless network management software with the same handy KDE utility that my EEE PC uses, but to no avail.

Having had no luck with the OS side of things, I started to look for issues specific to my wireless chipset. Using lspci, a utility that lists information about PCI devices, I was able to find the chipset used by the onboard wireless card on my ASUS P5K-E motherboard. After adding this number to my google query I quickly discovered that there was a flaw with the wireless driver needed by my wireless card. This meant that I was not going to get it working properly, short of rewriting the driver.

Figuring that I wasn't going to get anywhere, I thought that I could just cannibalise the wireless card from my Vista box and pop that in. It turns out that there are no native drivers for the card I was trying to use, but NDISwrapper came to the rescue. NDISWrapper lets you use any Windows driver written to take advantage of the Network Device Interface Specification. NDISWrapper was amazingly easy to install and configure with the Windows driver for the wireless card I was trying to use. Then I simply reset my machine, disabled the onboard wireless in the BIOS and let the machine boot normally. My wireless network was picked up straight away by the new card and everything worked like a dream.

One lesson I did learn after all this was to never assume that a piece of hardware will work on Linux. Thankfully, the Ubuntu Community's excellent documentation surrounding wireless networking contains a list of supported wireless cards that should be helpful should I ever choose to put together another box.

19May/080

Linux or Bust

Growing up, I managed to take advantage of my older brother's love of computing to get access to a few different computing platforms at a relatively early age. He's two years older, so I managed to play around with an ORIC and a Commodore 64 before I was 7. Our''80s computing experience was less "green screen" and more "16 colour TV screen".

For the majority of the '90s we had an Amiga 1200 that looked like it had been on Pimp My Ride. It had, amongst other things, a 50Mhz 68030 expansion card with 16 meg of Fast RAM, a 2.5 gig hard drive and a SCSI CD-ROM. Kickin'! This machine was powerful enough, and Amiga OS was cool enough, that we managed to avoid having a Windows box at home until 1998. We only picked one up after 3D video cards became standard, as they enabled Wintel boxes to finally start making games that could beat Super Stardust in the looks department. The fact that all of our University software ran on Windows helped inform the decision just a little, too.

This early avoidance of the Wintel market instilled a love of "underdog" computing platforms in me. Unfortunately this love has not previously resulted in me shifting away from Windows as my main home computing platform. I seemed to always have at least one machine running an alternative operation system, be it Linux, Mac OS, or even Amiga OS via WinUAE, but my primary machine has always been a Windows box.

My day job used to give me an avenue for exploring the "other side" of computing, as I worked in a fairly heterogenous environment with no preconceptions about what platform an application should run on. Choosing "the best tool for the job" was encouraged, so I got to play with some cool stuff. I would create applications in everything from PHP to C# to C++ to Java, all on a variety of different platforms. I can even remember running Redhat 8.0 for 6 months on my work laptop way back in 2002. Sure, I ended up doing a lot of stuff with remote desktop to some Windows development boxes running Visual Studio, but I got by.

Eventually my work drifted firmly into the Microsoft camp, and I swapped platform independence for the world of .Net/MS SQL Server based enterprise application.

After using Windows all day at work, I'd come home and use Windows on my personal machines. Home started to remind me a bit too much of work, and quite frankly I missed the whole "underdog" vibe I got from using a non-mainstream computing platform. So I did what any sensible person would do; I purchased enough components to build a quad core box with 4 gigs of ram and put Ubuntu on it.

Traditionally I would have installed Linux on an old machine and bought a new one for my windows desktop, but seeing as I planned on making Ubuntu the centrepiece of my home use I thought I'd better act like I meant it.

The switch was no where near as bad as I thought it would be. I managed to find replacements for most of the common software that I was used to on Vista, although I'm still very much in the evaluation phase for a lot of them. The important thing is that I was able to continue working in much the same manner as I did before, minus the chance of insane due to repeated exposure to the Windows login sound.

The operating system wasn't the only thing that was getting me down. I really wanted to do something that wasn't C# when I got home; I wanted to get back into dynamic languages and C/C++.

I had looked at doing Win32 C/C++, but there's just too much other junk getting in the way. I'm sure creating typedefs for everything under the sun does a great job of decoupling the code from the underlying type system, but it sure doesn't make for readable code. Plus there's the proliferation of double underscores. I HATE double underscores. There seems to be a lower barrier of entry to cutting useful C/C++ on Linux environments, especially if you're just looking at command line applications. gcc and glibc tend to "just work" in the most uncomplicated fashion possible.

Speaking of gcc, the fact that it supports so many languages is quite simply amazing. If the urge took me I could start cranking out ADA code again. Any ECU computer science students who did any part of their course in the previous century will know what I'm talking about. If it's good enough for the US Military then it's good enough for me.

If you want to do any dynamic language development then Linux seems to be where it's at, too. I'm primarily interested in Python and Ruby at the moment, although I wouldn't mind checking out PHP 5. I last looked at PHP in 2005 when the majority of hosts still had PHP 4.x installed, but the improvements in the OO features look really interesting. I remember writing an Active Record implementation in PHP 4.x, which seemed push it's OO capabilities to the limit.

Finding an equivalent web browser was a no brainer. I'm a Firefox user on all platforms. Ubuntu 8.04, the version I'm currently running after running through the painless update process from 7.10, even comes with Firefox 3 beta 4 installed by default. Whether or not this is a good idea remains to be seen. The default browser and the controversy surrounding the PulseAudio sound server have certainly made 8.04 an interesting release. I'm not a big user of Firefox extensions, so I seem to be avoiding most of the issues surrounding version 3.

IRC plays a rather large part in my computing life. It seems to have turned into the event organisation hub for most of my closest friends, so without it I'd probably have a much larger phone bill. I've always been a big fan of mIRC on Windows, but I've also been an XChat user since we bought our first Mac back in 2005. I've continued using XChat on Linux, and have been pretty happy so far. There are a few niggling issues, (such as having the specifiy the # when joining a channel, e.g. /join #mychannel as opposied to /join mychannel), but it's been a good experience overall. I haven't tried to create any scripts for it yet, but I'm sure it's Python interface must be better than the horrid "language" used my mIRC.

I used Picasa on Vista for photo management. I'm not a big retoucher, I just like to browse my photo libraries using a decent UI. There's a version of Picasa for Linux, but that's basically the Windows client running under WINE, which I'm not so keen on. I also took a look at DigiKam and F-Spot, finally settling on the DigiKam because my 5 year old was able to navigate our photo collection using it. This was a BIG plus for me. It's pretty cute seeing her flicking through old photos with her little brother on her lap.

I use GarageBand on an old G4 iBook and a souped up G4 PowerMac that I have lying around. The closest thing I can find to that on the Linux side is Audacity. I've used this on Windows before, so I was not expecting the world. I do have a POD 2.0 now, so real time amp modelling is less important to me than it used to be, so hopefully I can get something decent sounding out of it.

I never got into the whole "music management" software on Vista. I had iTunes installed, but I only seemed to use it for podcasts. I had taken to using Winamp or Media Player and just using my well organised file system to sort through my music. I decided to give Amarok a go on the Linux side, just to see if I had a use for a searchable music tool. The only problem I've run into here is that Amarok has trouble scanning a few files in my music repository. I've got a feeling that the problem is being caused by some MP3s I made using iTunes that came from GarageBand songs I'd created. Apparently iTunes doesn't "play nice" with it's MP3s. Regardless, the Amarok scan process isn't 100% working for me yet, so I have yet to experience the wonders of a fully searchable music library. Maybe when I get time to sort out the dodgy files I'll have the epiphany about my music collection that has been promised, but I'll reserve my judgement until then.

I'm a big fan of Outlook 2007. I use it at work, and I had it installed on my Vista machine. I use Gmail for all my mail, and I traditionally POPped it onto my Vista box (leaving a copy on the server so I could still read my mail on my N95 using the Gmail Mobile Client) and read my mail via Outlook. The logical thing for me to do would be to migrate all my mail to Evolution on the Linux machine, but I haven't done that yet. I've actually been giving the GMail web client a go. Conversation based email is certainly an interesting way of approaching correspondance, and the GMail Notifier certainly makes life easier. My PST may yet be migrated over to Evolution, but I'll give the web client some time to grow on me before attempting that.

I thought that the move to Linux would bring an inevitable move to OpenOffice , then I realised that I just don't use word processing and spreadsheet applications all that much at home. Probably the only time I'd fire up Word or Excel would be to make changes to documents from work, as I don't tend to create personal documentation using an office suite.

I've promised myself that I'll learn TeX, at the very least start using LyX to create TeX documents. I've always hated the style system of Microsoft Word (one of my pet peeves is the use of straight formatting in a Word document without the use of styles. Another is the odd situation where you can't make a particular style apply to a specific area of text in Word because it's confused as to where previous styles finish), especially compared to HTML/CSS, and TeX seems to offer a similar level of style/content seperatation. It remains to be seen whether or not I start producing documentation in this way, but it does feel wrong to make the shift to Linux and not at least try to use Don Knuth's labour of love.

Visual Studio has been replaced by KDevelop for C/C++ and Komodo Edit for Python, Ruby and PHP. Interestingly, ActiveState, the company that makes Komodo Edit and Komodo IDE, have created an open source effort around Komodo Edit called OpenKomodo. I haven't had a chance to check it out yet, but it's definately on my radar. I've also got Eclipse on there for checking out Java code. I gave the C++ features of Eclipse a go, but in the end I found KDevelop to be vastly superior.

I was already using Subversion for source control, primarily with TortoiseSVN and AnkhSVN under Vista, so I've continued that practice on Linux. Considering I'm not doing any distributed development I've yet to jump on the Git bandwagon, no matter what Linus says. KDevelop integrates nicely with Subversion, and I'm using RapidSVN for general operations.

To be honest, I had delusions of granduer when approaching this project. I was all set to go back to non-IDE text editors, and was even planning on making the switch from my traditional text editor of choice, VIM, to Emacs. I even read most of the Emacs LISP manual in preparation, but the stories of RSI scared me off. Perhaps I was temporarily insane, but the concept did seem pretty attractive at the time. I'm still using VIM wherever I can, but I haven't gone so far as to start building an IDE out of it. Most of my actual coding gets done in one of the afformentioned IDEs.

Traditionally I've used Rational Rose, Sparx's excellent Enterprise Architect or even Visio for UML modelling. The closest thing I could find for Linux was a product called Umbrello. Despite the name, it has nothing to do with the Umbrella Corporation from Resident Evil. I've only just started playing with this, but it looks promising. I'm currently modeling a small project using it, so I should know how good it is soon enough. I don't expect to have the traceability features of Enterprise Architect, but then what does? The Sparx product is one of those "great if everyone on the project is using it" tools that, if you stick to a certain methodology, give you some really cool results. I don't think I'll be needing anything of that scale for home projects, so hopefully Umbrello will suffice.

For image editing on Vista I had been using the excellent, and free, Paint.Net. The most obvious Linux equivalent is The GIMP. I've tried to use it before, but that was on Windows, where the GTK implementation doesn't exactly blend in with the native OS. The application menus are especially horrible to use, which is one of the reasons why I've never switched to Open Office on Vista. I've found that the application is much nicer to use on Linux where the widgets are native. Still, it's no Paint.Net. I'm still hoping that it will grow on me

I know that others have spoken highly of Paint.Net, but I cannot stress this enough: If you are running Windows and do anything with images then you need Paint.Net. Get it. Now!

After all this I still have VirtualBox running a Windows Server 2008 instance in seamless mode on one of my desktops. The good folks at Microsoft were kind enough to give me two enterprise licenses at the recent Heroes Happen event, so I thought that I'd put one of them to good use. I've got Visual Studio 2008 on there just in case the need hits me.

I honestly cannot heap enough praise on VirtualBox. For starters, the default packages just work with 64 bit Ubuntu, unlike VMWare. The UI is intuitive, and the seamless mode is great. The fact that it's cross platform means that I can now use the same virtual machines on my Linux, Vista and OSX boxes, which is also an amazing feature.

One thing I've noticed is that a lot of the applications I've started using have been KDE native applications. I'm running KDE on my EEE PC, but my main desktop Ubunutu machine uses GNOME by default. I've never gotten into the whole GNOME vs KDE argument, and always tend to use whatever is installed on the system I'm using. Perhaps if choosing a windowing environment dictated the software I could install (e.g. if you couldn't run KDE applications on GNOME) then I'd put a lot more thought into it, but as it stands I really don't care enough to look into it. GNOME seems to just work, as does KDE. I'm not going to let something like the default menu or control panel stop me from enjoying my PC.

My experience in "switching" certainly hasn't been smooth sailing. In fact, several issues, such as multi monitor support, had me tearing my hair out. I've had so many issues that I could fill several posts alone just with those tales. But at the end of the day the experience of making the switch and using something which is totally outside the realm of what I do at work makes all the lengthy forum post reading sessions worth it.

13May/080

The Saga Continues

After the success of her first programming lesson, my 5 year old daughter was eager to start the next one.

Previously we had covered boolean logic and control flow, both of which she had no trouble with, so she was ready for something slightly more complex. I had a few ideas about what to talk about next, but I didn't want to decide until we were both sitting at the desk, ready to start the lesson.

The first lesson really drove home the similarities between teaching adults and children. It's all about being able to capture someone's interest for long enough to get your point across. The good thing about kids is that they make it fairly obvious when their attention span is waning and they are no longer taking on information. Adults have a nasty habit of trying to be polite, which only ends up wasting your time and theirs.

I left the decision to the last minute so that I could take my daughter's current demeanor, energy levels and alertness into account. If she was easily distracted then I'd want to avoid some of the more complex topics, and only explain short, easy to swallow chunks of information.

This turned out to be a good call. She had previously discovered TuxPaint on my Ubuntu box, and was already asking if we'd have time to play "the penguin game" (i.e. TuxPaint). I immediately knew my chances of having her undivided attention were shot.

As an aside, I highly recommend TuxPaint. I've installed it on her laptop, an old G4 iBook we had lying around, and she plays with it most nights. TuxPaint also has the honor of being the first open source project I've ever donated to. The guys who make it even offer really cool kid's shirts so your pre-schooler can show their support for open source software. It almost makes up for the fact that they don't sell FireFox shirts in kid's sizes. Almost.

I ended up ditching any ideas of discussing encapsulation for something much simpler. I figured that I could sell the concepts of variables and functions before she got bored and started asking about that silly penguin again. These two concepts would be enough to round out her understanding of some basic procedural programs, and probably allow us to actually create something cool.

Variables were easy to explain. I was considering starting with a brief overview of lambda calculus, but that might get us a call from child services, so i toned it down a little. At the heart of it, a variable can be explained away as an alias for something. It's just another way of referring to a particular "thing".

I appealed to her natural sense of vanity, something every 5 year old has more than enough of, and explained variables in terms of her age. She loves writing her name, so this was a good attention-getter.

EMMA'S AGE = 5
# I used this to explain what happens on her birthday
EMMA'S AGE = EMMA'S AGE + 1
EMMA'S AGE IS NOW 6

I explained that, after stating that her age was 5, we didn't need to say "5" over and over again. It was enough to say "Emma's age", because we knew that she was 5. I used her birthday as an example of changing the value of the variable. Every year she has to add 1 to her age, so on her next birthday she will be EMMA'S AGE + 1.

We tackled functions next. She loves baking, so I thought I'd use a concept of reusability that she would already be familiar with: a recipe. We wrote out a definition for baking a cake. Of course, I have no idea how to bake a cake, so I wouldn't recommend following the recipe...

BAKE CAKE()
{
	Add Flour
	Add Milk
	Add Eggs
	Add Sugar
	Add Butter
	Mix
	Put in Oven
}

Now that we knew how to bake a cake, we could bake as many of them as we liked.

BAKE CAKE
BAKE CAKE
BAKE CAKE
BAKE CAKE

After learning about functions and solving the world hunger crisis with cake we decided to call it a night.

Hopefully she's now learned enough to have a basic understanding of procedural programming, or at least enough to let her understand a simple programs, which is what we plan to do next. I don't expect her to be writing the next Crysis, but she should be able to sit over my shoulder and understand a Hello World or two.

Tagged as: No Comments
28Apr/081

Reading, Writing and Random Access Memory

There are certain important life skills that parents are obligated to instill upon their children. It's our responsibility to make sure that our kids have a have well developed I/O skills, a strong moral backbone, a social conscience and, most importantly, that they know how to program.

My 5 year old girl recently started inquiring about what I do for a living. More specifically, she wanted me to show her what I did all day and explain how I did it. Now, this would have been really easy if I was a bricklayer, as we have plenty of Bob the Builder DVDs lying around the house that I could have shown her. However, I'm not. I develop line of business applications for a living. So what exactly can you teach a 5 year old about programming, and how would you go about it?

Obviously I needed to start running through Charles Petzold's seminal book, Programming Windows, with her. The Windows Message Pump is an essential concept that all 5 year olds have to know. Or maybe not.

I decided to simply explain a few fundamental concepts that would enable her to "think like a programmer". I didn't want to push anything onto her, and I certainly want to give the impression that it was the only way to think, but at least she would be aware that the option exists.

We started out with boolean logic, introducing her to the idea of AND, OR and XOR. I used an example involving two entities that she would be familiar with, a cat and a dog, and ran through the various combinations (cat AND dog, cat OR dog, cat XOR dog etc). I was a little hesitant about doing this, considering that teaching the concept of the English Language definition of "or" to children is extremely difficult once you get into the specifics of the matter. She's not quite big enough to have a debate about disjunction, but we're working on that one. She was able to grok it straight away, and immediately started talking about how great it would be to have a cat.

Fortunately I was able to distract her by moving on to control flow, more specifically using the boolean logic skills she had just learned to discuss conditionals in an IF/THEN/ELSE form. I ended up scribbling a lot of pre-primary level pseudo-code down on a piece of paper for her to understand this. Drawing flow charts helped, too.

# I termed this as "If we had a cat and dog, we are happy,
# otherwise we're sad".
# Not exactly the most complex business rule in the world,
#but it gets the point across to a 5 year old.
IF (CAT AND DOG) { HAPPY }
ELSE { SAD }

I drew a quick flowchart of that code, showing the decision and then the two different results, and she immediately got it. The simple, one word results using terms that she was familiar with really seemed to click in her head. There's certainly something to be said for the universal appeal of a flow chart, too. Next time someone tells you that they don't understand your chart, tell them that a 5 year old can pick up the concept in a few minutes.

From there I was able to expand on control flow to include the concept of iteration and looping. By this point she was really into the whole cat analogy, and I was drawing pictures of cats under her strict direction. Pretty soon we had quite a few cats drawn on the page, so I said to her "what if you wanted to pet each one of those cats?". I got an enthusiastic response; apparently petting cats is a pretty popular activity amongst 5 year olds.

I initially made the mistake of trying to explain the concept of collections at the same time. We spoke about the cats living in a house, and how she might like to pet all the cats in the house. We ended up with the following scribble:

FOR EACH (CAT IN THE HOUSE)
{
	PET CAT
}

This was great, but it lead to an off topic conversation about why there were no dogs in the house, and how if you had small babies then you might only want to have one cat or maybe even no cats at all, and if you had cats you might want some dolphins too because dolphins could live in a pool outside and dolphins are really cool. She was concentrating too much on the house and the endless possibilities of what could be put inside the house and less on the idea of the house being a container for cats. So I dropped the house concept, drew some more cats on the page, put a circle around the cats and pointed at them while running through the following example.

FOR EACH (CAT)
{
	PET CAT
}

Removing a direct mention to the house cleared up the concept enough for her to focus on what I was saying. She could see the cats on the page, she knew that she wanted to pet each one, and she got the idea that she was going to pick up a cat, pet it, put it down, rinse and repeat until all the cats had been petted.

Then it was time to bring it all together. My daughter suggested that perhaps some cats might not be big enough to be petted. They might be babies that you need to be gentle with. Huzzah, we had our first business rule! Time to throw that in the mix.

FOR EACH (CAT)
{
	IF (CAT IS A BABY) { BE GENTLE }
	ELSE {PET CAT}
}

So now we had an example combining boolean logic, decision making and iteration/looping. It was almost like a mini JAD session, only with a 5 year old inventing random business requirements relating to cats. None of it went over her head, and I found that as long as I kept talking about something she was interested in then she'd quite freely discuss the topic and want to talk about more things that we could do to the cats. The interest was there, so she wanted to naturally evolve the conversation and learn more.

The two main ideas that I hope to tackle next are variables and the concept of ownership. Ownership will be a big one, as it will (hopefully) be a starting point for some basic OO concepts. This should lead on to separation of concern and a few other ideas. Now I just have to pick a language to demonstrate some of this stuff in. Oh look, KTurtle is installed on my machine!

Sharing Buttons by Linksku