Welcome to gnomedia codeworks!

This is a blog, a collection of articles, some software projects, some miscellaneous scripts, a kitchen sink... I hope you'll find something useful or interesting.

Using SAX Parsers

December 2nd, 2003

This article will introduce the subject of parsing XML files, using as examples the Expat parser and the Xerces parser. In the process we will examine the two event interfaces for XML parsers, SAX1 and SAX2. I will assume that you’ve read the two previous articles in the series (Introducing XML by David Nash and History of Unicode by myself) and I assume that you have a good understanding of C++. The article won’t cover the design of XML documents, the samples we use will from necessity be simple and designed to demonstrate the basic facilities of the XML parsers. We will create a simple program to parse an XML file and count the characters and tags in it, showing how the program differs between Expat and Xerces.

Read the rest of this entry »

Introduction to XML and C++

November 22nd, 2003

Over the last few years a growing number of applications and services have been using a type of text mark-up known as XML. The structure of XML, and the timing of its introduction, made it a perfect match for the new (at that time) and fast growing language Java. However, its use in C++ has lagged behind somewhat, and this series of articles is aimed at redressing the balance a little.

Read the rest of this entry »

A Short History of Character Sets.

November 22nd, 2003

In this article I will provide some background to character sets and character encodings. The focus is on what is needed to work with XML parsers, as a preliminary to further articles in the series. For this reason there are some areas (glyphs and representation for example) that have not been covered.

Read the rest of this entry »

SnipSrv - a random quote generator.

November 8th, 2003

SnipSrv is a small PHP script to extract a piece of text from a file (which I assume is a quote, but could be anything) and return it. You’ll find it on its own page here.

Westhost Tips and Tricks

November 5th, 2003

I’ve added a slab of articles related to running a website on Westhost (where we are hosted). They’ve been through a hard patch recently with a rather, er, rough upgrade and the forums there have been buzzing with people trying to keep their systems going. A lot of good ideas put out, and I’ve collected some of them here.

Check out the Westhost Tips and Tricks pages.

Making the jump to PHP

August 26th, 2003

Introduction

Any modern day Web programmer has to master a whole range of languages and protocols, from client side scripting through to server side Apache modules. And now, here is PHP, one of the fastest growing server side scripting languages around and you need to add it to your current arsenal of Perl, Python, ASP, JSP, Javascript, Java…

In this article, I’ll point out some of the main areas where things are different from other languages (particularly Perl, Javascript and VB/ASP) to help you get started. After all, programming is programming whatever the language, and most of what you already know can be reused in PHP. Just watch out for those little details!

Read the rest of this entry »

Why PHP?

August 8th, 2003
Introduction

The World Wide Web is a global network of computers, most of them running some form of HTTP (Web) servers. A Web server is a very simple animal, when asked for a web page, it looks for the page and, if it can find it, returns it to the browser. What makes Web servers interesting is when we can ask the server to process the page before returning it. This is the job of server side scripting modules, of which there is wide choice, such as PHP, ASP, Cold Fusion, JSP and Perl CGI. They all have their strengths and their weaknesses and there are situations where one is to be preferred over another.

Read the rest of this entry »