text

Using Drupal SimpleTest To Test Nodes With CCK Values

SimpleTest is a great way to test your modules, but it can take a bit of setting up. For every test that is run SimpleTest effectively has a fresh install of Drupal, so if you need to test a particular function you need to have everything in place before you run the test. I was recently testing a migration module that I had written and needed to create nodes with a variety of CCK fields, which is quite common in Drupal site setups.

philipnorton42 Mon, 12/13/2010 - 21:03
Zend Lucene And PDF Documents Part 2: PDF Data Extraction

Last time we looked at viewing and saving meta data to PDF documents using Zend Framework. The next step before we try to index them with Zend Lucene is to extract the data out of the documents themselves. I should note here that we can't extract the data perfectly from every PDF document, we certainly can't extract any images or tables from the PDF into any recognisable text. There is a little issue with extracting the text because we are essentially looking at compressed data. The text isn't saved into the document, it is rendered into the document using a font. So what we need to do is extract this data into some format the Lucene can tokenize. Because we are just getting the text out of the document for our search index we can take a few short-cuts in order to get as much textual data out of the document as possible. All of this data might not be fully readable and we will definitely loose any formatting and images, but for the purposes we are using it for we don't really need it. The idea is that we can retrieve as much relevant and indexable content for Zend Lucene to tokenize. Also, it is not possible to extract the data out of encrypted PDF documents.

philipnorton42 Mon, 10/26/2009 - 22:33

Find Appropriate Colour In PHP

25th February 2009

Use the following function if you want to print the text in a particular colour, depending on what the background colour is.

PSPad - The Free Text Editor

30th April 2008

Since starting programming I have used a lot of text editors, some have been good, and some have been very, very bad.

One text editor that stands out is PSPad. It is a free text editor for Windows that has lots of features and is very stable. I have been using this for a while now and have seen very little problems. I say "very little" as I once tried to open a 800 megabyte log file and it fell over, which is understandable.

PSPad

Flashing JavaScript Text

27th January 2008

Here is a simple function that makes text in a tag fade into one colour slowly before quickly fading back into the original colour. If the background is the same colour as the text then the text will appear to fade in and out.