April 2011
1 post
My Viva
Last week I sat a viva (defence) for my PhD thesis. Here are my experiences of the examination, in case they might be useful to future PhD students.
Submission
After I submitted my thesis, my PhD supervisors and the university began to make arrangements for the viva. My viva took place roughly 2 months after I submitted. My supervisors and examiners made all of the arrangements for the day of...
March 2011
1 post
2 tags
JRebel for enhanced hot-swapping in Eclipse
I run a lot of Eclipse plugins from source in a developer workspace, and often use a runtime workspace for my day-to-day work. This allows me to develop and test plugins in a single Eclipse installation. However, whenever I want to make a change to a plugin that I’m using, I have to shutdown my runtime workspace, make the change in the developer workspace, and relaunch the runtime workspace....
January 2011
1 post
2 tags
Enhancing existing types in Objective-C
The types built into Objective-C and the Foundation Classes provide many useful methods, but I’ve found some functionality to be missing. NSString, for example, doesn’t provide methods that search for substrings, which is a task I often want to perform in iOS apps. Fortunately, it’s very easy to add extra methods to existing types in Objective-C.
For determining whether one...
November 2010
2 posts
1 tag
Time Travelling with Git
Today, I was in the midst of changing some code when I discovered a bug. I wondered whether the current set of changes had introduced the bug or if it had been around longer than that. Fortunately, I’m using Git for this project, which has some really handy commands for time travelling…
First of all, I used stash to store away my current changes and revert to the last committed...
1 tag
September 2010
1 post
2 tags
Cucumber and Web Services in Rails 3
Today I wanted to write a cucumber feature to check that a RESTful resource could be created by posting XML to my app:
Scenario: Post an event
When An event titled "First event" is posted via the API
And I go to the events page
Then I should see "First event"
Defining the first step took quite a lot of work. I discovered, thanks to Patrick Ritchie’s answer on StackOverflow, that...
July 2010
1 post
1 tag
Freezing time in Cucumber
Today I found that I needed to write some date-sensitive tests for a little Rails app I’m building. I’m using Cucumber to capture my features, and I wanted to say something like this:
Scenario: See yesterday's date on yesterday's tracker
When I am on the tracker page for yesterday
Then I should see "27 July 2010"
Where “the tracker page for yesterday” maps to a...
April 2010
2 posts
1 tag
Installing RMagick on Ubuntu 9.04
I’m using Ubuntu 9.04 as my production environment, and I had some trouble installing the rmagick gem (via bundler). I received the following error message:
configure: error: Can't install RMagick.
Can't find Magick-config in ...
I tried Googling the error and followed various instructions for installing imagemagick on Ubuntu, but none of them worked. In the end, I realised I...
1 tag
RVM for multiple rubies
Last week, Apple released a Snow Leopard update containing a version of Ruby that had a fairly major bug in BigDecimal. I wanted to patch my OS, but not break ruby.
RVM to the rescue! RVM allows several versions of Ruby to be installed on the same machine. I followed the installation instructions here, and installed ruby 1.8.7:
rvm install 1.8.7
I set this to be my default ruby:
rvm...
February 2010
3 posts
1 tag
Upgrading to Rails 3 beta (part 2)
This is the second part of a series of posts detailing my experiences while upgrading to Rails 3. The first part covered migrated configuration and framework files to play nicely with the new Rails 3 APIs. Now, we’ll look at booting the server, fixing dependency issues and walking through our app.
Fixing authlogic
Once we’re confident that we’ve migrated files to conform to...
1 tag
Upgrading to Rails 3 beta (part 1)
This post covers my experiences of upgrading a small Rails 2 application to boot with Rails 3.
Getting Started
First, we’ll need to install the Rails 3 beta.
As per the official instructions, we perform:
> [sudo] gem install tzinfo builder memcache-client
rack rack-test rack-mount erubis mail text-format
thor bundler i18n
> [sudo] gem install rails --pre
Before touching an...
1 tag
Selenium and Firefox 3.7
This week, I’ve been trying to run some Cucumber features with Selenium to test a web application using AJAX. I ran into a couple of problems; here’s a quick description of how I solved them.
The Cucumber wiki includes a Setting up Selenium guide, but it’s a little out-of-date. Webrat includes Selenium Remote Control (Selenium RC), so there’s no need to install the...
October 2009
1 post
1 tag
Team Project Sets in Eclipse
I’ve just discovered Team Project Sets, a very handy feature in Eclipse. A Team Project Set can be used to share the contents of a workspace with others. I can export a specification of my workspace contents (which defines the projects and working sets I have in my workspace, and the source code repositories in which my projects are stored):
File > Export > Team Project Set
Somebody else...
June 2009
1 post
1 tag
Packaging a JAR as an Eclipse plugin
Occasionally, I need to package a set of JARs into an Eclipse plugin. Often this is so that I can depend on third-party code that does not ship with Eclipse and that can’t (or won’t) build from source.
In Ganymede, the incredibly simple way to do this is:
Import the JARs into the workspace.
Select and right-click the JARs.
Click PDE Tools | Convert JARs to plugin project.
Follow the...
March 2009
1 post
2 tags
Safari – Forcing new windows to open as tabs
I dislike that, in Safari, links with the target “_blank” open as new windows, rather than tabs. Here’s a simple fix. Enter this on the terminal, and restart Safari:
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
From the Unofficial Apple Weblog.
February 2009
1 post
3 tags
Java 6.0 and Mac OS 10.5 (Leopard)
When I made the switch to Mac, I assumed that Leopard (OS X 10.5) didn’t have Java 6:
> java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
However, it seems that Java 6 is available, but to activate it, you have to dig around in Applications list. Open...
January 2009
2 posts
1 tag
Exporting an RCP app to multiple platforms
Eclipse RCP apps are standalone: they don’t require an Eclipse platform to be installed. I’ve been using an RCP app to share a GMF editor with some colleagues who don’t use Eclipse. However, my colleagues use various platforms, and using Eclipse to build binaries for each of those platforms was confusing. Here’s my process:
Install the Eclipse RCP delta pack, as described...
1 tag
Installing the RCP Delta Pack for Eclipse
Note: This post refers to Eclipse 3.4 (Ganymede). Eclipse 3.5 (Galileo) was released earlier this month. The process for installing the delta pack is slightly different in Eclipse 3.5, and is described by Andrew Niefer (via Lubos’s excellent list of Eclipse plugin and RCP development resources).
I recently wanted to deploy an Eclipse product to platforms other than my development platform....