Archive for the 'ruby' Category

A Freelance Programmer’s Manifesto

Wednesday, February 21st, 2007

Update: If you think I’m being arrogant, I assure you, I’m just trying to be assertive

(For the background that inspired this post, see here, here and here.)

Why are you reading this post? Perhaps you’re thinking of becoming one of my clients. Perhaps you’re a freelancer yourself, or thinking of becoming one. Perhaps you feel that I’m just an insufferably opinionated t**t with whom you disagree and are keen to let me have it in the comments (Feel free by the way, provided you have a reasonable argument, and aren’t just going to call me an insufferably opinionated t**t).

Why a manifesto? I know, I know, it’s an overused term, but I wanted to describe something of my approach to freelance software development, one which has been successful for me so far. I’m not deliberately setting out to be controversial, but no doubt I will be, and as long as it starts reasonable debate, that’s a good thing.

So without further ado…
(more…)

Getting off my lazy butt and doing something…

Wednesday, November 15th, 2006

Err, yeah. I remember, once upon a time, I used to have time to blog. That was before we built this:
New House

Oh, and before he was born:

Warren and Liam

So despite the fact that I’m lying on the couch there, I’ve been far from idle.

My yard still looks like this:

New House - yard

so it’s not as though i don’t have enough to do! However, I *am* committing to finishing up, in the very near future, the Ruby Web Spider I began to write about some 5-6 months ago.

Consider this, a dusting off of the cobwebs kinda post…

How to calculate standard deviation

Monday, March 13th, 2006

When I started this blog last month, I thought “Standard Deviation” was a snappy title. Of course, I also knew about standard deviation as a statistical tool, however I didn’t expect that this overlap would cause Google search to drive 50+ visitors a month here looking for implementations of the standard deviation formula.

So as a “public service”, here is some code to figure standard deviation in Ruby and Java.

(disclaimer: no warranties as to correctness, particularly to the nth decimal place, don’t use this to run your home made nuclear reactor or air traffic control system, blah blah, etc, etc :-))

(more…)

Ruby web spider Part 1: The scheduler

Wednesday, March 8th, 2006

This is the second part of a series of posts covering the development of my web spider in Ruby. You can read about the initial idea here, and the architecture in Part 0: Concept.

You may also recognise some of the code in Scheduler#run from a short post I made to check that the syntax highlighting was working :-)

First I want to recap the goal of the scheduler before getting into the code itself. Simply put, the scheduler exists to mangage the list of URIs (web pages, RSS feeds) that need to be spidered, and to manage the spiders themselves. In particular, we want to be able to limit the number of spiders working at any one time, out of politeness if nothing else.

I’m not going to make this a tutorial in Ruby syntax by explaining things line by line, if you haven’t used Ruby before and find something you don’t understand, the PragProg book, Programming in Ruby is the place to go look.

So let’s take a peek at some code!

(more…)

Ruby web spider Part 0: concept

Friday, March 3rd, 2006

(I should probably mention that I have never written a spider or worked on a search engine before, so this is a learning process… I don’t pretend to be an expert on this - I picked this partly because it is far enough from my “day” job that I’m not going to inadvertently end up in a conflict of interest. The closest I’ve come in the past was working on a natural language interface to search engine queries, way back in 2001 while I was in my final year at UTas.)

So how did I start?

(more…)

The expressiveness of ruby…

Tuesday, February 28th, 2006

The web spider writeup continues. I am no longer best friends with red wine after the weekend however.

Speaking of things that are red, I *love* the expressiveness of Ruby. The following is the run method of my Scheduler class, Ruby makes it a piece of cake to understand what is going on here, even without the full context, I think the following is fairly intuitive…

(more…)

Ruby web spider - watch this space

Friday, February 24th, 2006

I mentioned before that I’ve been busy this last week, one of the things I’ve been working on in my own time is a web spider (written in Ruby) that can trawl both HTML pages and RSS feeds. I won’t say much about what I’m using it for, other than to say I’m testing some ideas out right now :-)

Anyway, I’m almost at a point where I’m happy to share this code (probably under GPL) as it’s not exactly rocket science (and I’ve only invested a week or so of evenings into it), but it has a couple of neat tricks that made it a good exercise in Ruby. A short laundry list of features:

(more…)

“So I can extract all your knowledge…”

Friday, February 10th, 2006

I was just jokingly informed by my ten year old stepson that he intends to build “some kind of mind reading device, so I can extract all your knowledge about computers and rule the world!”

Hmmm, evil genius in training. After discussing whether we should inform his mother of his plans for world domination, he informed me that the reason *I* did not rule the world was because I don’t have a “master plan for world domination.” apparently, HE does. :-o

(more…)