Monday, September 08th, 2008

I need to pick up an XML file from a server every 30 minutes and process it. I’ve done similar things before, and using Hpricot it is a pleasure:
#! /usr/bin/env ruby
require ‘rubygems’
require ‘hpricot’
require ‘open-uri’

doc = Hpricot(open(”http://example.com/the_file.xml”))
(doc / :person).each { |person| … }

Couldn’t be simpler. This time, there is a snag: the file is [...]

Wednesday, August 20th, 2008

[This is a re-write of a project note I wrote in project over a year ago. Published here to make the world a better place.]
There has been some commotion recently regarding XHTML and HTML, where standardistas have reiterated their arguments about XHTML: it’s a nice standard, but since is isn’t actually treated as XHTML [...]

Category: Web development  | Tags: ,  | One Comment
Wednesday, August 06th, 2008

So I was writing this tool to create a bunch of SQL statements from a data dump. Simple enough, right. And as always when you generate SQL statements, you have to make sure that the data doesn’t interfere with the SQL syntax by escaping the single quotes (and generally any binary data, but [...]

Category: Ruby  | Tags: , , ,  | 5 Comments
Wednesday, August 06th, 2008

It’s time for the yearly survey for web professionals:

But that’s hardly a note to self.  Looks like I’m turning this into a blog.

Sunday, July 27th, 2008

Installing the mysql gem for Ruby is almost always a mess, as witnessed by the large number of hits one get when googling for “mysql gem leopard”.  To make the gem work with your platform, you need to ensure that the ‘make’ command run internally by ‘gem’ has the right ARCHFLAGS, which most of the [...]

Friday, July 25th, 2008

I acquired this server in December 2006 to host a few Rails projects and one of the first things I did was to disable Apache and install Nginx.  Once I decided to use Wordpress for this blog, I needed PHP, and while I could have tried to set up PHP for Nginx, I decided to [...]

Friday, July 25th, 2008

While this is a public blog, its primary audience is not the meandering surfers of the inter-tubes, but myself.  I need someplace to store various findings and HOWTOs that I write for myself.  I assume that they will prove useful for others too, from time to time, but that is mostly a side-effect.
That being said, [...]

Category: Meta  | Leave a Comment