subtleties

What's not in a name?

jp.stacey 5 August 2006

If you’re working with XML, as I currently am, XSLT can sometimes be a godsend. Something that would take ages to do in a structured, procedural way can be reduced to two or three lines of functional XSL code.

So it was with a growing sense of consternation that I noticed that adding XML namespaces to the original document seemed to break XSL’s ability to recognise elements! Consider:

<elem/>

Software was created free and is everywhere in ipchains

jp.stacey 15 August 2006

Don’t get me wrong: I think that Stallman has contributed massively to the open-source movement. But Tim O’Reilly is right: he simply doesn’t get the problem that closed web services present. I think talking about open access to the data is missing the point too. Often I’ve no wish to access the raw data, and couldn’t understand if I did access it.

Can't find a hint

jp.stacey 20 September 2006

I couldn’t find this on the Goggle, so: if your Coldfusion template occasionally furnishes you with the unhelpful, lineless error:

can’t load a null

then this might be caused by the following. You may be trying to compile a function using something like this code:

cfcUnit on Linux

jp.stacey 21 January 2007

Adding a helper framework that lets you unit-test your code can speed up development and refactoring no end. With this in mind, I decided to tame a recalcitrant new Coldfusion application by installing cfcUnit on my local Linux box. It was a sufficiently awkward experience that it’s worth sharing the problems I encountered here. I should stress that the safety cfcUnit brings to your coding is definitely worth these minor difficulties, so don’t let them put you off.

1. Requirements

Distributed Drupal development, determined by dedicated Drupaler

jp.stacey 20 August 2007

A recent thread on the Drupal development list (started by me, I confess) led to Larry Garfield publishing his development environment online.

Some Drupal gotchas

jp.stacey 29 August 2007

These have arisen in my recent workshops, and during programming....

  1. The Page content type isn't the same as the page template; nor is it the same as a page on the site, which is actually called a node.
  2. The file in your templates directory, called template.php: that's the only .php file that isn't actually a template (templates are suffixed .tpl.php).
  3. The region of the page called content is found in the variable $content, and any other regions you define with key foo, bar are found in variables $foo, $bar; but the left region is in $sidebar_left, the right re

If random is secure, pseudorandom is pseudosecure

jp.stacey 15 September 2007

Do you bank online? How are you asked for your secret code? Three randomly placed digits of it, hmm? The reason for the randomness is that any malicious keylogging software can’t see your screen, just your keyboard: so even if it logged every time you banked online, the fraudster it reported back to could never guess the order of the numbers in your secret code and hence the code would be useless.

Deserving of a serious LAMPing

jp.stacey 31 March 2008
Reinventing primary keys, one horrifying integrity error at a time.

The LAMP-stack community frequently shows their disdain for foreign and primary keys in databases, and sometimes with reason borne of experience. MySQL historically has been little more than a nice language for comparing a set of unrelated spreadsheets, so referential integrity has had to happen at the application layer or not at all. As such, careful MySQL users put a lot of work into ensuring referential integrity, without the help of the database.

Inconsistent syntax in SQL Server's sp_rename

jp.stacey 3 April 2008
Microsoft's developer-level APIs don't always work in precisely the way you'd expect them to, you know.

To rename columns in a SQL Server database, you can use sp_rename. The syntax of the command, in Transact-SQL-ese, is:

sp_rename
  [ @objname = ] 'object_name' ,
  [ @newname = ] 'new_name'
  [ , [ @objtype = ] 'object_type' ]

So say you have a table called t_est, with a column in it called est_client. You want to rename these to t_job and job_client respectively.

Drupal, licensing and the GPL

jp.stacey 30 June 2008
If you're about to start programming under the GPL, and you want to read just one article about it, then: don't read this; read the Drupal licensing FAQ instead.

Lurking in a dry, legalistic and apparently quite specific page on the Drupal website, is the commendable result of a lot of hard work, both from the the Software Freedom Law Center and from the Drupal community.

Drupal.org have produced a Licensing FAQ to explain some of the subtler aspects of licensing under the GPL.