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

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
   
Sharing Buttons by Linksku