Skip to content


TextMate 2.0 (Alpha) and Python 3…

I’m currently learning Python, and as a new Python programmer I’ve opted to go with Python 3, that said I want to keep the standard Python 2.6 install available, just in case. As you may be aware I’m also a Mac user and therefore a TextMate user. On 13 Dec 11, the first public alpha of TextMate 2.0 was made available to those of us who have both a TextMate license and an Intel Mac, which I’d guess must encompass a LOT of Mac developers?

Anyway, one of the things they’ve got rid of in TextMate 2.0 are the old project files, I was using these to direct TextMate to my Python 3 install (and yes, I am aware that there are other ways to do this). However, it seems we can now use a Git Style Configuration (erm, okay I’ve heard of Git and should probably be using it, but I’m still using Subversion!). Anyway, it seems that this means we stick a .tm_properties file in the root directory of our project. So to achieve the same effect as my old TextMate Project File I created a .tm_properties file containing the following line of code:

1
TM_PYTHON = "/usr/local/bin/python3.2"

and hey, presto I can run Python 3 code from within TextMate 2.0.

Posted in Programming, Python.


How to access USB drives from the Command Line…

This is another blog entry primarily aimed at reminding me of how to do something, that I’ll no doubt have forgotten by the time I need to do it again!

I currently store all of my ebooks on my server, a nice central location which is easy for me to access from anywhere at home. However, I was due to go away for a four month period trip and decided to take a copy of my ebook directory away with me on an external hard drive. My initial thought was to simply copy the directory and it’s contents from my server to my external hard drive, but all those small files sure do take a long time to copy…

Why not simply plug my external hard drive into my server? Well I should probably point out that my server is configured as a headless system and as such runs Fedora without a GUI and is administered via the Terminal in OS X. Naturally as I haven’t needed to use an external USB drive before I hadn’t configured my Fedora install to use them, and so we finally come to the point of this blog posting!

To find out the device name for your USB drive you can navigate to

/dev/disk/by-label

and then use

ls -la

Terminal window screenshot

As you can see my USB drive is called

ELEMENTS

and it’s device name is

sdb1

To create a mount point for the drive use

mkdir /mnt/usbdrive

and then to mount it use

mount /dev/sdb1 /mnt/usbdrive

You can then use the drive like any other drive, for example

cd /mnt/usbdrive

Finally to unmount the drive, use

umount /mnt/usbdrive

Posted in General.


OS X how to view your installed Video Codecs…

As part of my Everyware Computing module, my tutor has included a series of videos to help us get to grips with Android development using Eclipse. Curiously I could watch some of them on my MacBook Pro but not on my iMac.

This was no doubt due to video codecs (or a lack of the required ones on my iMac) and I must have installed the necessary codecs on my MacBook Pro when I did some video editing on it a couple of years ago, but which ones?

After a little research I discovered that you can view your installed Quicktime video codecs, if you go to:

[Hard Drive] -> Library -> Quicktime

Rather obvious once you know where to look… That said, there is still one video that I can’t play on either of my Macs, and while it has been made available as a download (rather than imbedded in a flash website) which I can play, I’m determined to work out why it doesn’t want to play!

Useful codec packages for OS X include:
Perian for Divx.
Flip4Mac for Window Media.

While for video conversion, editing and playback:
Squared 5 – MPEG Streamclip seems to work!

Posted in General, My Studies.


My continuing quest for a BSc in Computing…

Earlier this year the Open University informed me that some of the modules I was using towards my BSc (Honours) Computing have a time limit which would soon expire! This means that I’d have to complete and pay for even more modules. After giving this some serious thought during the summer, I have decided to stop studying with the OU and instead enrol with the University of the Highlands and Islands, via Moray College.

I will be completing my BSc Computing, over the next two years by attending Moray College on a day release basis. That said the lectures are delivered via video conferencing, which is a new experience for me. My modules this semester are Everywhere Computing, which involves a fair amount of Android development and Web Science, a multidisciplinary research module studying the Web and the issues and challenges it presents.

All in all two rather different modules, which I suspect will challenge me in completely different ways during the next three months…

Posted in My Studies.


M363, TMA01 finally submitted…

Following a few unexpected events, which included a house move! I have finally submitted my first assignment for M363, Software engineering with objects, three and a half weeks late! Although I did have extensions from both my tutor and the Open University Student Support Team.

My tutor has emailed me to let me know that he has downloaded my submission and he hopes to have it marked and back to me by the end of the week, so all I need to do now is catch up with the work I’m behind on for the next assignment which is due on the 15th of June…

Posted in My Studies.


An unplanned theme change…

Last week I received an email with a malware warning from Google, this took me by surprise especially after checking that I was indeed running the latest version of WordPress and that a quick search or two revealed no mention of any WordPress security issues.

After digging around a little, I discovered that the troublesome code was imbedded within the WordPress theme that I was using (Carrington Blog), hence my blogs reversion to the default theme. At the moment I’m unsure whether I’ll attempt to fix my old theme or implement a new one, but it’ll have to wait until after my TMA has been submitted.

Posted in General.


Some new vintage computers…

Category: Vintage Computers

A couple of weeks ago Kev, a long time friend, visited me and mentioned that he’d been looking at my blog and had something for me, if I wanted it…

My interest was suitably awakened and I followed him out to his car. Much to my surprise and delight it was full of old computers! Naturally I said I was interested and we moved them into the front room, fortunately my wife was at work, so this was easily accomplished!

“So what did Kev, give you?” I hear you ask.

Well, I’m now the proud owner of a Commodore Vic-20, Dragon 64 and Atari 2600 Video Computer System, okay strictly speaking it’s two computers and a games console, but I appreciate them all. I’ll post more about them all individually, along with some photos in the next few days.

Posted in Vintage Computers.


Getting started with textmate-clojure

The aim of this blog entry is to take you through a couple of Clojure Hello World examples using TextMate and a Clojure Bundle. As is often the case with my blog entries, this post is primarily for my own use at some point in the future, but who knows it may be of some use to others. I am using an iMac running OS X 10.6.6 (Snow Leopard), Clojure 1.2, TextMate 1.5.10 and David Nolan’s clojure-bundle.

First of all create a directory in your code directory called myCode:

mkdir mycode

Open a new file in TextMate called myfile.clj with the following contents:

?Download mycode.clj
1
2
3
4
(ns mycode.myfile)
 
(defn hello []
	(println "Hello World!"))

and save it in your mycode directory.

Load the file with Apple+Shift+L.

Now open a Terminal session and type:

cake repl

to enter the project’s REPL. Then switch into the file’s namespace with:

(in-ns 'mycode.myfile)

and run the hello function with:

(hello)

For an example with an argument passed to a function, add the following code to your file:

?Download mycode.clj
1
2
(defn hello2 [name]
	(str "Hello " name))

Save the file and evaluate the expression by placing the cursor after the final parenthesis and using ctrl+x to evaluate the expression. You can then return to your terminal session and run the function with:

(hello "Hamish")

Posted in Clojure.


TextMate and Clojure

After my euphoria at getting Clojure and Ant to work, I received an email tonight from Rik, where he started his reply to my query about using Ant to compile Clojure with “This is really not the preferred way of developing in Clojure”. Whoops!

However, as part of his reply he directed me towards a useful video which shows some of the features of a TextMate Clojure bundle, interestingly this is a fork of the bundle I use(d) for syntax highlighting.

I have now installed this clojure-bundle and Cake, by following the instructions on the webpage. This means that I can now evaluate Clojure code from within TextMate!

Posted in Clojure.


iPod and iTouch repairs…

While I was away, I managed to drop my iPod Classic on a concrete gym floor, breaking the LCD screen. Fortunately, the Hard Drive survived the fall and I was able to continue using it for the remainder of my trip via the Shuffle Songs option, which was easy to navigate to and select without a screen.

When I got home I discovered that an iTouch, belonging to one of my sons, had developed a problem with it’s headphone jack. So the search was on for somewhere that could repair them…

First stop Apple, iPod with video 60 GB = £116.44 and iTouch 8 GB = £116.44 ouch! Next up were the adverts in MacUser, followed soon after by Google. This revealed that the typical repair cost was around £40, so after looking at a few companies I decided to use ukipodrepairs.co.uk primarily on the basis of their testimonials, but also as they have a physical shop near Brighton and they give a three month warranty on their repairs. Their repair fee was £40 for each of these faults, but this included return postage via Royal Mail Special Delivery.

I posted the iPod and iTouch separately, via Royal Mail Special Delivery (for the insurance cover), a few days apart as my son couldn’t decide if he wasted his iTouch repairing, despite the fact I was paying! In both cases I received three emails from ukipodrepairs, the first to let me know it had arrived, the second to let me know it was fixed and the third to let me know it had been posted. With the items arriving the following day. In both cases the whole process took four days, well strictly speaking I signed for them at lunchtime so three and a half days! Both the iPod and iTouch have worked faultlessly since their return.

So I have no hesitation in recommending ukipodrepairs if you are unfortunate enough to break an iPod, iTouch or iPhone.

Posted in General.