Wednesday, June 24, 2009

PHP regular expression failing silently due to output buffering

I just had a problem where this regexp worked for finding the option with value 'foreign-relations' but not for finding 'economy':

'#(name="Section".*<option value="(.*)" selected="selected">.*</select></p>)#s'

The result was the dreaded PHP blank page. With no errors logged.

This fixed it:

'#(name="Section".*<option value="([\w\s-]*)" selected="selected">.*</select></p>)#s'

The second version is more specific about what string will match in the value attribute and I think that when specified with .* the match filled up the entire PHP memory buffer. If so, it wasn’t logged as an error and that could be because the code here is executed in ‘output buffering’ mode, following an ob_start() call. A guess, but if I am right that might help to avoid a lot of aggravation in future. [nb PHP: not providing error output is Bad.]

Corrections to this assumption welcome!

Labels:

Wednesday, June 10, 2009

Meanwhile in South America…

Protests descend into murder following the grant of massive mineral extraction concessions in the Amazon region by the government of Peru.

Labels:

Wednesday, June 03, 2009

BCS helps UK understand personal data guardianship principles

The British Computer Society has published a code of practice for people who work with personal data. There are quite a lot of people working with our personal data, and we know that some have been negligent in the past. Government agencies in particular sometimes seem to encourage their employees to burn CD- and DVDROMs loaded with information that they are not allowed to distribute and leave them in public places such as railway carriages; but there are lots of other insidious ways in which such information might pass from legitimate into illegitimate use.

This code digests UK law and provides guidance that to my eye is simple enough for even the most harried civil servant to understand. I hope sections like Responsibilities of the data handler will be pinned up in the offices where those CDs and DVDs are burned. The code may also be of interest to anybody who is concerned about the way that personal data is being collected and used in the UK. Its weakness may be the use of terms such as ‘responsibility’ which seem not to be understood and applied by all of us in the same way.

Labels: , , ,

Sunday, May 31, 2009

Broadsheet Ballads and a Broadside exhibition at St Bride Library

St Bride Foundation is participating in the Story of London Festival this June. Both the Foundation’s education department and St Bride Library are involved; the chief outcome is Broadsheet Ballads, ‘a promenade theatre experience’, in other words a play which is performed as cast and audience move through the streets around the Foundation building in Bride Lane.

The play was written during a four-day project by the Foundation’s Youth Theatre in which a group of young people used their analytical and creative skills to respond to the character and content of broadsides in the collections of St Bride Library. During the Festival itself they will get to see their work presented to public audiences.

The press release, which I quote below with permission, is rather modest about the exhibition which accompanies the show. In fact it will be a very rare opportunity to see some of the Library’s authoritative collection of broadsides, many of which were produced (and sold) in the area where the Library is now. For enthusiasts of ephemeral printing, the exhibition is a must. For others, I would recommend it as a valuable insight into popular culture. The songs and poems, the accounts of murders, hangings, freaks and innovations are worthy of study just as much for their style and content as for their printing and illustration. You will learn a great deal about British popular culture, 19th century style.

Entwine yourself in stories from the past…

St Bride Foundation and Occam’s Razor present Broadsheet Ballads, an innovative promenade theatre experience inspired by St Bride Library’s unique collection of 19th century broadsheets. Join us on a musical adventure as we journey from St Bride Churchyard through the lanes behind Fleet Street, encountering tales from times gone by.

The performance finishes in the Grade II listed, St Bride Foundation, featuring a small exhibition of 19th Century Broadsheets and the history of this fascinating area.

St Bride Foundation is perfectly placed in the City of London, just off of Fleet Street, making it an ideal stop as you work your way towards St Paul’s Cathedral, the Southbank or Covent Garden.

The promenade theatre experience was inspired by 30 young people who researched the broadsheet collection, devised scenes and produced a 30 minute theatrical exploration alongside a director, writer and composer.

Labels: , , , , ,

Friday, May 15, 2009

UK spooks lectured

GHCQ had the benefit of these twelve succinct slides on privacy, trust and biometrics delivered by Ian Brown of Oxford Internet Institute. A useful experience, I hope.

Via @monkchips.

Labels: , ,

Tuesday, May 12, 2009

W3C to cut the web fonts gordian knot

The W3C is constituting a new Working Group to get ‘Web fonts’ sorted out. They propose to do this via a wrapper around an existing font format, probably OpenType. The aim will be to allow the inclusion of fonts that are restrictively licensed, without causing legal headaches for designers. Along the way we may see some benefits for permissively-licensed fonts too.

Labels: ,

Friday, May 08, 2009

Github visual diff of typeface glyphs

OFL listers will have seen this but it’s rather lovely so I thought I would share more widely. It’s a visual difference between two revisions of the outline of a character from a typeface under development.

Thanks to Eric Schrijver.

Labels: , , ,