Skip to main content

Posts

Showing posts from August, 2005

Trying to understand Ruby :symbols

After reading Kevin Clark's recent post on Ruby symbols made me want to learn more about this mysterious part of the Ruby language. After writing some unit tests to ensure that a symbol really is the same object as any other with the same name, I have come to the following conclusion: symbols are immutable string objects, same named symbols share the same object and therefore the same object_id.

Kevin's example points out that they make great keys for hashs, and other indicators of what action to take (:get, :post, etc.)

Coming from a Java background, symbols have made me hit my head a number of times, this rather helpful post from Rob Sanheimhelped clear things up a lot for me.

Why the lucky stiff also has a good explaination, he suggests:
Symbols

Symbols are words that look just like variables. Again, they may contain letters, digits, or underscores. But they start with a colon.

:a, :b, or :ponce_de_leon are examples.

Symbols are lightweight strings. Usually, symbols are used…

Configuring Subversion (svn) on Linux (Debian Stable)

My last post documented how to install Subversion. This post will cover the resulting configuration of Apache, plus the creation of the initial repository.

When you install Subversion, it adds two LoadModule lines to /etc/apache2/httpd.conf. This is not wanted as the Debian version of Apache2 installs things slightly differently from the default Apache (httpd.conf is not used, all this configuration now lives in apache2.conf, plus the loading of modules is done differently). edit /etc/apache2/httpd.conf and remove the 2 uncommented LoadModule lines.

Debian loads modules a little differently that the default Apache2. It lists the available modules as individual configuration files within a mods-available directory, then enables these by linking to them from a mods-enabled directory.

We need to create the two required module configuration files that are required by Subversion (we just removed them from /etc/apache2/httpd.conf!):

cd /etc/apache2/mods-available
echo "LoadModule dav_sv…

Installing Subversion (svn) on Linux (Debian Stable)

This post details my recent install of Subversion 1.2.1 on DebianStable. The Debian packaged version of Subversion is currently only 1.1.4, but I wanted to install the latest version as it supports full WebDAV autoversioning & has the FSFS repository back end as the default.

I wanted to access Subversion via the WebDAV protocol, this requires Apache2. As Debian Stable only recently included the apache2 package, I had to update to that version first.

Note: all these commands were run as the root user.

Install Apache2:

apt-get install apache2

That installs the web server and all the required packages, it does not start Apache by default, you need to edit /etc/default/apache2 and change NO_START to 0, then run /etc/init.d/apache2 start to get the basic web server running.

When you build Subversion from source, it requires the apxs2 tool to be able to build and install the Subversion extension modules. This is hidden away in the apache2-threaded-dev package, it's not available in an…

Mr. IT Conversations (Doug Kaye) discovers my podcast post

Just took a quick look through my StatCounter logs, and found a strange link from Google Groups pointing at my recent post about the podcasts that I listen to. I followed it through to find Mr. IT Conversations himself, Doug Kaye, thanking me for my review:

"There are new blog postings like this one *literally* every day, but I particularly liked what Andrew had to say"

Cheers for the kind words Doug!

Technorati Tags: , , , , ,

A list of the podcasts that I subscribe and listen to

Peter Cooper asked a few days ago about what podcasts people are subscribing to. Here's my list:

IT Conversations
IT Conversations got me into podcasting, it's the original and the best for anything to do with technology. They have loads in interesting recordings, the best ones for me are recordings of presentations given at conferences like eTech and Web2.0. If I could only subscribe to one podcast it would have to be this one.
http://www.itconversations.com/index.html

For Immediate Release: The Hobson and Holtz Report
Neville Hobson and Shel Holtz are two communication professionals who discuss public relations, corporate communications and how that intersects with technology in a twice-weekly show, each show is about 1 hour in length. They normally discuss what's happening in the blog and podcasting worlds including any new tools or sites that are of use in tracking what is going on. Shel and Neville get some great banter going and so this podcast is one of my favourites…

Pretty printing Java classpaths using Ant's pathconvert task

Lance Hankinsposted on Saturday about more readable classpaths using the <propertyregex> task. It jogged my memory back about 4 years when I was trying to solve the same problem. This was back in the days of Ant 1.4.1 and just before the existence of the optional Ant-Contrib package. Back then I was considered a bit of an AntMeister by my colleagues as I managed to spend hours tweaking the smallest of things in my lovingly created Ant build environment searching for perfection...

So how did I solve this particular issue? A clue is in the title of this post, I used the <pathconvert> task, which is normally used to convert lists of files, directories, etc. and convert them to a different platform's style. So path separators using Windows ';' get converted to Unix ':', etc. But you can also use it to convert the path separators to something else, in my case a nicely formatted string for displaying in a printable form.

Here's the code:

<!-- get th…

Add fresh RSS content to your website with Feed Digest

Peter Cooper in the UK has just launchedFeed Digest, the successor to the very popular RSS Digest.
It's a tool that allows you to put a section of HTML on your website which is powered by one or more RSS feeds so it means that your website is updated by these RSS feeds.

Here are a number of things you could do with it:

* Show the latest BBC news.
* Display your latest 10 del.icio.us bookmarks.
* Display your latest blog post in your home page.

I haven't thought of my use for this yet, If I add too much other data, the blog posts will disappear into a sea of links, but it's an interesting service none the less.

The other thing that is interesting about this service is that it's powered by Ruby on Rails. This is a Ruby-based web framework that I've been reading about lots but haven't got into yet. There are quite a fewUS-basedsites that use it, but Peter's is the first UK one that I've heard about.

Technorati Tags: , , ,