fix for WordPress shortcode bug

I’m starting to use shortcodes heavily in WordPress1 as we are using it internally on the DEPtH project to coordinate our new TouchIT book.  There was minor bug which meant that HTML tags came out unbalanced (e.g. “<p></div></p”).

I’ve just been fixing it and posting a patch2, interestingly the bug was partly due to the fact that back-references in regular expressions count from the beginning of the regular expression, making it impossible to use them if the expression may be ‘glued’ into a larger one … lack of referential transparency!

For anyone having similar problems, full details and patch below (all WP and PHP techie stuff).

Continue reading

  1. see section “using dynamic binding” in What’s wrong with dynamic binding?[back]
  2. TRAC ticket #10490[back]

What’s wrong with dynamic binding?

Dynamic scoping/binding of variables has a bad name, rather like GOTO and other remnants of the Bad Old Days before Structured Programming saved us all1.  But there are times when dynamic binding is useful and looking around it is very common in web scripting languages, event propagation, meta-level programming, and document styles.

So is it really so bad?

Continue reading

  1. Strangely also the days when major advances in substance seemed to be more important than minor advances in nomenclature[back]

spam going up

I noticed the size of my spam folder seemed to be going up.  16.5 Mb in the first 14 days of July.  I checked back to see what it was previously (I am truly sad and archive my Trash folders, so can see what t was!).  The 9 months October-June was 154 Mb, so with July at 33Mb in one month that looks like near doubling in rate.  Actually looking back the previous 19 month period was 88Mb, so again doubling.

I checked Eudora’s record of the numbers of emails arriving (right).  This incoming mail is  dominated by Spam and shows it going up from about 3000 a week in January to over 5000 a week now, again consonant with a doubling about every 9 months.  I’m not sure if this is because the server-side spam exclusion is letting more through or because the total volume is increasing. If the latter, the trend is worrying, not just for those of us personally trying to cope with the volume, but also for mail servers.

Moore’s law for disk capacity is about doubling in 18 months, and personally I’ve noticed that my actual document sizes tend to double about every 3 years (more media etc.), so basically disk space keeps ahead of disk need.  However, if the Spam volume is doubling every 9 months it is faster than disk size increases, so mail servers may find themselves struggling with the throughput, even if they can filter and remove it.

Is it just me or are other people seeing a similar pattern?

grammer aint wot it used two be

Fiona @ lovefibre and I have often discussed the worrying decline of language used in many comments and postings on the web. Sometimes people are using compressed txtng language or even leetspeak, both of these are reasonable alternative codes to ‘proper’ English, and potentially part of the natural growth of the language.  However, it is often clear that the cause is ignorance not choice.  One of the reasons may be that many more people are getting a voice on the Internet; it is not just the journalists, academics and professional classes.  If so, this could be a positive social sign indicating that a public voice is no longer restricted to university graduates, who, of course, know their grammar perfectly …

Earlier today I was using Google to look up the author of a book I was reading and one of the top links was a listing on ratemyprofessors.com.  For interest I clicked through and saw:

“He sucks.. hes mean and way to demanding if u wanan work your ass off for a C+ take his class1

Hmm I wonder what this student’s course assignment looked like?

Continue reading

  1. In case you think I’m a complete pedant, personally, I am happy with both the slang ‘sucks’ and ‘ass’ (instead of ‘arse’!), and the compressed speech ‘u’. These could be well-considered choices in language. The mistyped ‘wanna’ is also just a slip. It is the slightly more proper “hes mean and way to demanding” that seems to show  general lack of understanding.  Happily, the other comments, were not as bad as this one, but I did find the student who wanted a “descent grade” amusing 🙂 [back]

a simple PHP record sorter class

Not for the first time I needed to sort arrays of arrays in PHP (structures like tiny DB tables).  I have previously written little wrapper functions round usort, but decided this time to make a small class. It is a simple, but generic utility, so popping it up in case useful to anyone.

The rest of this post has moved to a permanent page at:

http://www.alandix.com/blog/code/sorter/

a new version of … on downgrades and preferences

I’m wondering why people break things when they create new versions.

Firefox used to open a discreet little window when you downloaded papers.  Now-a-days it opens a full screen window completely hiding the browser.

A minor issue, but makes me wonder about both new versions and also defaults and personalisation in general.

Continue reading

going SIOC (Semantically-Interlinked Online Communities)

I’ve just SIOC enabled this blog using the SIOC Exporter for WordPress by Uldis Bojars.  Quoting from the SIOC project web site:

The SIOC initiative (Semantically-Interlinked Online Communities) aims to enable the integration of online community information. SIOC provides a Semantic Web ontology for representing rich data from the Social Web in RDF.

This means you can explore the blog as an RDF Graph including this post.

<sioc:Post rdf:about="http://www.alandix.com/blog/?p=176">
    <sioc:link rdf:resource="http://www.alandix.com/blog/?p=176"/>
    <sioc:has_container rdf:resource="http://www.alandix.com/blog/index.php?sioc_type=site#weblog"/>
    <dc:title>going SIOC (Semantically-Interlinked Online Communities)</dc:title>
    <sioc:has_creator>
        <sioc:User rdf:about="http://www.alandix.com/blog/author/admin/" rdfs:label="alan">
            <rdfs:seeAlso rdf:resource="http://www.alandix.com/blog/index.php?sioc_type=user&amp;sioc_id=1"/>
        </sioc:User>
    </sioc:has_creator>
...

Crash Report

You would think crash reporting would be made as seamless and helpful as possible, after all your product has just failed in some way and you wish (a) to mollify the user; and (b) to solicit their assistance in obtaining a full report.

You would think …

In the following I will reflect on what goes wrong in Adobe’s crash reporting and some  lessons we can learn from it.

Continue reading

Descartes: Principles of Philosophy

I have just read Descartes‘ “Principles of Philosophy” – famous for “Cogito ergo sum“.  I have read commentaries on Descartes before, but never the original (or at least a translation1, I don’t read Latin!).  Now-a-days “Cartesian thinking” is often used in a derogatory way, symbolising a narrow, reductionist and simplistic world-view.  However, reading “Principles” in full reveals a man with a rich and deep insight of which his rational and analytic philosophy forms a part.

Continue reading

  1. René Descartes, 1644, Principles of Philosophy, trans. George MacDonald Ross, 1998–1999[back]

Last days in Rome

Five weeks in Rome seemed like a long time, but with a week mainly in Milan and Trento and the coming week in India, in fact just three full weeks and they have flown by.

I had imagined long evenings reading philosophy of the physical world, and weekend afternoons under the shade of a tree on the Palatine Hill, but it didn’t quite work out like that.

Of the ‘work’ books I brought to Rome (and borrowed here), I have only read Gibson’s “The Ecological Approach to Visual Perception“, Goodman’s “Languages of Art” and Noe’s “Action in Perception“; and of the ‘fun’ books only Tamara Pierce’s  The Healing in the Vine. I have flights back and forth to India next week, so may manage a bit more then, but mainly overnight, so I fear most of my bookshelf will return to the UK unread 🙁

One of the reasons is evident on a table in my office. Normally at home when I finish something the paper from it ‘goes away’ somewhere, but here as I have read something or finished with printouts I have been laying them out on an empty table in case I wanted to refer to them again. So the table is now covered, smothered, in the results of three weeks normal academic work. I am amazed, if not aghast, at the volume. The entire table between 50 and 500 sheets thick in paper, I’d guess somewhere between one and two thousand sheets of paper printed, read and to be discarded. I mentioned climate change in last post and, boy, it looks like one academic can wipe out most of the Amazon and drown the South Pacific single-handed.

I have printed out a bit more than I normally would as I knew I couldn’t print things during the evenings at the apartment and so tended to do so ‘just in case’ before heading out of the office.  So normally some of this would have been dealt with purely electronically, but nevertheless, the volume is frightening. And I don’t think this was a particularly unusual three weeks in terms of volume.

So what is here?

On the one side there is input: there is a PhD thesis, twenty of or so papers reviewed or meta-reviewed during the period, several papers given to me by people to read while here, one EPSRC grant proposal I reviewed, and a few piles of papers I was referring to in things I was producing during the period. On the output side during the three weeks two grant proposals have been submitted, one other needed extra work and a STREP is in process of preparation for the autumn, two journal papers, a book chapter, an article for Interfaces, some work on other papers, and a few internal reports for discussions about future work. Other things never saw paper: a couple of long blog posts (5000 words between them), three job references, innumerable emails, and the preparation for 33 hours of masters and PhD teaching and two other talks.

Although I often feel busy seeing all that paper makes it tangible and does shock me somewhat. But I know this is relatively normal; Aaron Quigley‘s twitter feed is exhausting just to read!

So, did I see much of Rome …

Well on one Sunday, with Manuela, Francesco and his daughter I visited the annual open-air art exhibition of the 100 painters in Via Margutta (between Piazza di Spagna and Piazza del Popolo). One of the artists was, Paul Van den Nieuwenhof, a friend of Manuela and Francesco from whom they had recently bought a still life (apples). Paul’s real passion is more avant-garde installations, but the still lives are mainly focused on the Italian market where modern art is not so popular. Looking at his more traditional paintings I was impressed again by the way an expert oil painter creates light from pigment: shapes and solids seem more the medium and the pure light the message.

Another Sunday I took lunch in a pizzeria on the Trastevere (my favourite place for both pizza and bread), and took a meandering path there nearly as far as St Angelo and sauntering along the Tiber … but mainly because I took the wrong road out of Largo di Torre Argentina. In the middle of Argentina is a large exposed ruin, and I was told (but by whom I have forgotten!) that this was where Julius Caesar was assassinated.

Incidentally, while in Milan (which I will write about separately sometime) I learnt that in Julius Caesar’s time it would have been pronounced Kaiser as in German today, the softer ‘c’ came later.

Apart from that I am ashamed to say no art galleries or exhibitions, and my main view of Rome has been the area between Termini station, the Department, and my appartment, ‘Al Colosseo’, a lovely location within sight (just) of the Collosseum (see below).

However, most mornings I have taken a run down past the Colloseum as far as Circo Massimo and one or more laps of that. It is a popular spot for morning runners, although I prefer it best when I get there a little earlier. Not to avoid the others, but because from about 7am when the sun starts to rise it gets so hot. The most interesting end of Circo Massimo is currently boarded off as they do works there and in the last 2 weeks the far end has turned into a mini-stadium for Beach Soccer, I assume to coincide with the UEFA football next week.

Tonight it will be another pizza evening and I am promised it will be at a place that specialises in Roman-style pizzas and those lovely deep fried vegetables. Italy is about sun and ruins, about design and expensive cars and the Vatican and bureaucracy, … but above all it is about food and friends.