Ian McShane Rotating Header Image

Development

Project Euler

I came across Project Euler this evening via this post.

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.

I thought this would be a good way to get my hands dirty with Xcode and ObjC.

I’ve just completed the first problem (Add all the natural numbers below 1000 that are multiples of 3 or 5), which has elevated my Genius level to the dizzy heights of 1! 🙂

Whilst some of them are pretty simple mathematic manipulation type problems, some of them are proper head scratchers!

I’m quite tempted to post my solutions to them here somewhere so I can get some code feedback – i’m probably making a right mess when it could be done in a much simpler fashion!

Free Trac and SVN hosting

I’ve been getting really pissed off trying to install Trac to my Dreamhost shared server, to the extent that i’m contemplating moving hosts.

In the interim, DevJaVu have just started to offer free Personal accounts that include integrate Trac and SVN.
All you need to do is sign up using the referal code johnny5. I don’t know how long that code is valid for so get on it.

RadRails – Unable to detect ruby install on OS X Leopard

I installed the RadRails plugin for Eclipse and Aptana today.
On first start, it complains that it is “Unable to detect ruby install” on my Leopard macbook.

Now, I know ruby is installed and working so had to try and figure out the path to the ruby installation.

Took me a while to work it out, I thought it would be under /usr/.. but it’s actually here:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr

After adding a new RubyVM with this path everything was good again.

Incidentally, although Aptana is available on it’s own as an IDE (built with the Eclipse framework), I decided to use it as a plugin for a native Eclipse IDE. That way I just have one IDE for Java, C++ as well as RoR. Made sense to me.

I’ve only had a quick play with it but it already beats the bejesus out of my Notepad and command line setup on XP. 🙂

[tags]OS X, Mac, Eclipse, RadRails, Aptana, Ruby on Rails[/tags]

Ruby on Rails, mySQL, Mongrel and OS X Leopard

For the majority of my RoR development, i’ve used a Windows machine running Instant Rails. Apparently, the Mac is the so-called “favoured platform” for Ruby on Rails development so i’ve been looking forward to getting rolling with this on my shiny Macbook. However, i’ve spent a couple of days scouring Google and Groups trying to find the optimum way to get everything set up and running. There isn’t much information where Leopard is concerned, most of the posts and articles are geared toward Tiger and involve building and compiling Ruby from source with XCode.

Well, i’ve got mine environment up and running so hopefully this will save someone else a bit of time. Of course, that does assume that i’ve done this all in the correct manner! Any corrections or updates welcome! 🙂 (more…)

iPhone (continued)

Whilst the iPhone is sync’ing up (gonna take a while to sync mp3s and photos), i’ve been perusing the myriad leaflets stuffed in the bag by O2.
This one is hidden away in the t’s & c’s under the information about credit checks, which is a bit of a strange place to put it:

Making unauthorised modifications to the software on you iPhone violates the iPhone software license agreement, and the inability to use your iPhone due to unauthorised software modifications is not covered under your iPhone’s warranty.

At the moment i’m not sure if i’ll bother with any forthcoming Jailbreaks, when they manage to exploit 1.1.2. I’m looking forward to the SDK next year though.

Versioning a web development project

This week, i’ve been trying to get my head around workflow using SVN.
As i’ve mentioned before, i have a Ruby/Rails project on the go at the moment and at the start I decided to use SVN for version control – Mostly because DreamHost provide SVN as a one-click-setup job.
Here is a list of what I wanted to achieve, in order:

1. Backup in case I lose my local working copy.
2. Automatic publishing to webserver.
3. A nice way to track changes throughout the project.
4. Be able to publish the changes dynamically to a webpage.

I use TortoiseSVN on my XP installation to manage my working copy.
The first requirement was easy to achieve, so long as I check in regularly I have a nice shiny copy on the SVN server (obviously).
The second was fairly simple. I just checked out the latest version to the root directory for the webserver and run “SVN update” when I want to refresh it.

When I started, I didn’t really have much comprehension of source control from a developer perspective so I just had the root of the SVN repository as my working copy.
I have since read up a bit, taking in the concept of trunk, branches and tags.
Today I spent a couple of hours working out how my folder structure should be and moving everything around using TortoiseSVN to the following structure:

http://U.R.L/ProjectName/trunk
http://U.R.L/ProjectName/branches
http://U.R.L/ProjectName/tags

I also changed the web version to use the latest release version using SVN switch %URL_TO_RELEASE_VERSION_IN_TAGS_FOLDER%.

My idea of the workflow is that I make changes to the working copy (a subfolder of branches, i.e /branches/0.1.x) and check in as required.
Once I am happy with the changes, I transfer the changes to the /trunk/ version which can then be accessed via the web for any remote testing I may rope people into.
Once the trunk version has been tested against I can go ahead and make a copy of that into the tags version as the next release, do a SVN switch in the web directory and all is done (along with any config changes to the app’s db of course).

I’m not sure if that is a ‘best practice’ way of running an SVN linked project but it makes sense to me and would seem to work out in an environment where there was more than one developer working on it.

Like I said, it makes sense to me but maybe I have missed the point and made some fundemental error somewhere?
For example, I still don’t get the ‘Patch’ part of SVN, would it be possible to just update the web directory using a patch from the latest release rather than running SVN update?

I’ve also been looking been looking into a product called Trac which appears to be a good project management/defect tracking application, anyone had any dealings with it? From research it looks like a pain in the ass to install (to Dreamhost at least)

Wii-ked

This was my final week off before heading back to the office. Having been off for 3 weeks and in the US for 3 weeks prior to that, i’m not keen! On the brightside, I get my driving licence back at midnight on Thursday January 11. However I have yet to get my car serviced and MOT’d – it’s been sat motionless for almost six months now 🙁

Wii

After 3 weeks of searching Teh Internets and visiting game stores every couple of days or so, I finally managed to get hold of a Nintendo Wii. I didn’t want one bad enough to start queing outside of stores early every morning so it was pretty lucky that a friend of mine managed to reserve one for me.
(more…)