Maybe Haskell …

After reading Learn You a Haskell on and off over the past fortnight and watching a couple of Erik Meijer’s Functional Programming Fundamentals, I finally got around to installing the Haskell platform and firing up GHCi.

After a couple of hours of implementing the simple functions scattered throughout LYAH, I was up to implementing quick sort. Given the number of times I’ve seen this example, I’m not going to reproduce it here, but it’s pretty amazing 1.

One of the main things I noticed was that after two hours of writing code in a language I’d never used, I’d produced zero run time errors. There were plenty of compile errors, but that’s to be expected – especially given I was using an editor that was inserting tabs in a language with significant white space (which, by the way, makes for fun times when unfamiliar with Haskell compiler errors). I know what kind of error I would prefer to deal with.

So far I’m liking Haskell, and I think it’s a huge shame that there is only one functional programming course at my university (COMP1024), which isn’t available to most dual degree students.

Edit: COMP1024 hasn’t been offered since 2010.


1. I know this isn’t ‘true’, in-place, high performance quick sort, but in how many other languages can you write a readable, generic sorting algorithm in 6 lines of code?

VirtualBox + Dell laptop VT-x issues

I recently had to use a VM for a uni project, and needed to have access on my laptop & desktop. I haven’t used a VM on my laptop in a while, but didn’t expect to see the following error message from VirtualBox (4.2.16):

VT-x features locked or unavailable in MSR.

I’ve used x64 hosts before with no problems, but I guess my BIOS settings were reverted for some reason (using a Dell laptop with Intel PM45 chipset).

So thinking to myself that this should be an easy fix, I rebooted, enabled VT-x and restarted, but I received the same error message. No amount of changing BIOS/VirtualBox settings, rebooting or otherwise reconfiguring would make this message go away.

I eventually read that it’s sometimes necessary to power down and physically disconnect the machine from power to properly enable VT-x. This solved my problem – I decided to make a note of it here to hopefully help someone else in the same situation.

Ubuntu 12.10 – Transmission fails to connect to HTTPS trackers

Transmission, the BitTorrent client installed by default in Ubuntu seems to have an issue with connecting to trackers using HTTPS at the moment.

After Transmission failed to connect to a tracker using HTTPS, I went searching and found this bug report.

The steps there are pretty simple and worked well for me:

  1. Close Transmission
  2. Download the .deb for updated libgnutls26 from here (bottom of page – choose your architecture then mirror)
  3. Install using

     dpkg -i (package name).deb
    
  4. Restart Transmission

UPDATE: It looks like this is now fixed, so running

sudo apt-get update
sudo apt-get upgrade

should get it working again for you.