One of the rather odder bugs. OOo’s file menu suddenly appears for no good reason (while playing embedded video in Firefox on another workspace). Story is that OOo has the focus while the video is playing in totem-mozplugin, totem-mozplugin seems to want to inhibit the screensaver from kicking in so sends regular Left Alt strokes to the display via XTest. If OOo has the focus, it receives the Alts, and one of its quirks is that the file menu appears on press and release of Left Alt.
(March 09, 2010 04:18 PM)
This article is based on work which will be expanded more fully in the book, when I get to that chapter.
Every time we do an online store here in webworks, the postage/packaging is different. In one case, for example, postage is free over €50 euro, in another, it depends on where it’s going, and in the latest, it depends on a load of factors including where it’s going, what the weight of the products is, and what delivery option was chosen.
Up until now, hand-coded the postage rules. Everything else was handled by user-friendly parts of our CMS, but postage was such a random thing that we couldn’t find anything common enough that we could make a generic P&P handler.
The finished product is more complex than this example, but I’ll describe a cut-down version of what we’ve done, with countries and parcel-types removed.
admin demo – demo of UI for generating P&P rules
The first demo shows how the postage-and-packaging rule-set is created, using an “if-else” flow generator to build up the logic of the thing, and after each major action, convert the current state into a JSON string which can be saved.
The PHP is not really important in this one. The JavaScript handles everything. It translates a “seed” JSON string into a graphical representation of the rules, which can then be manipulated and finally translated back (automatically) into a JSON string to be saved in a DB (or session in this case). source for the PHP, source for the JS.
The frontend does its work in the background:
frontend demo – using those rules to evaluate P&P (visit admin first).
In this case, we enter values – total, weight – and run through the rule-set to find out what the P&P ends up as.
The source is suprisingly small, using a small recursive function to dig through the rules, no matter how deep and complex they go.
Here’s the recursive function (see source for rest of file):
function os_getPostageAndPackagingSubtotal($cstrs,$total,$weight){
foreach($cstrs as $cstr){
if($cstr->type=='total_weight_less_than_or_equal_to' && $weight<=$cstr->value)return os_getPostageAndPackagingSubtotal($cstr->constraints,$total,$weight);
if($cstr->type=='total_weight_more_than_or_equal_to' && $weight>=$cstr->value)return os_getPostageAndPackagingSubtotal($cstr->constraints,$total,$weight);
if($cstr->type=='total_less_than_or_equal_to' && $total<=$cstr->value)return os_getPostageAndPackagingSubtotal($cstr->constraints,$total,$weight);
if($cstr->type=='total_more_than_or_equal_to' && $total>=$cstr->value)return os_getPostageAndPackagingSubtotal($cstr->constraints,$total,$weight);
}
$val=str_replace('weight',$weight,$cstr->value);
$val=str_replace('total',$total,$val);
$val=preg_replace('#[^0-9*/\-+.\(\)]#','',$val);
if(preg_match('/[^0-9.]/',$val))eval('$val=('.$val.');');
return (float)$val;
}
The switch block goes through the various “if” types that can exist in the flow model, handling each of them recursively and return their values to the caller.
If no “if”s are encountered, then the ruleset has found an answer, and we return that answer.
Before returning it, though, we parse the value of the answer. This is in case the answer is a math formula to do with the weight or total of the item.
For example, An Post have definite prices for packets to Europe up to 2kg (which is 10.75), and beyond that, it’s 3 euro extra for every extra kg.
That translates to a load of definite “if” statements, and an end value of “(weight-2)*3+10.75″ for the final “else”.
So, we convert recognisable words such as “weight” or “total” to numbers, make sure that we’re only left with parseable characters (and not something that can be used to hack), and eval it to produce the result.
Obviously, the full product is more complete than this, with safeguards against faulty formulas, extras to handle countries and envelope types (parcel/packet/envelope), but this example should give you a few ideas if you’re building your own P&P handler.
(March 09, 2010 04:07 PM)
So, day one of WordCamp Ireland draws to a close, there is a dinner tonight but the talks and sessions are over for the day.
I briefly helped John Handelaar during his talk on WordPress MU, but my main talk was on WP Super Cache. Thank you Hanni, Jane and Sheri for recording the talk. Hopefully it’ll be available online next week. In the meantime here’s the OpenOffice slides of my talk.
I must extend a big thank you to Sabrina Dent and Katherine Nolan for organising a great day and to the sponsors who made the weekend possible.
Looking forward to the dinner tonight, and the rest of the conference tomorrow.
Update! I’ve added a few photos from Day 2. I was shattered tired though as I was up until 1.30am chatting with Donnacha!
Update 2! Sabrina has written a thoughtful post about WordCamp Ireland. I for one had a great time there and so did everyone I spoke to. I totally agree with her about child minding facilities. My son Adam had a whale of a time, and is still talking about it. (and for an almost three year old, that’s a very good sign!)
Oh, more photos on Pix.ie!
Related Posts
(March 06, 2010 05:35 PM)
WordPress MU 2.9.2 has just been released and is mostly a security and bugfix release based on WordPress 2.9.2. Grab it from the download page.
As well as the security fix mentioned above, this version also fixes a few bugs, makes the blog signup process much faster and adds a new “Global Terms” Site Admin page.
The “Global Terms” page is one I should have added years ago. Currently it’s fairly bare, but hopefully in future versions of WordPress it will be expanded. It allows the Site Admin to “fix” the terms (tags and categories) used in MU blogs. These terms are normally synced with the “sitecategories” table but sometimes they go astray. This can happen if you “import” a blog using PHPMyAdmin without going through the WordPress importer, or if a plugin manipulates the terms table directly.
WordPress MU forces the “slug” used by terms to be a sanitized version of the “name”, which isn’t the case in WordPress. This page can optionally rename the terms so they match the slug. It doesn’t do the opposite because that would break public facing URLs on the site. (I must extend a big thank you to Deanna for helping debug that page)
Enjoy!
Related Posts
(March 03, 2010 05:01 PM)
I just ran the following code on the 2009 archive of my inbox.
grep "From: " 2009|cut -f 1 --complement -d " "|sort|uniq -c|sort -nr|less
I received the most email from bots and scripts, among them WordPress.com, Twitter and Facebook. Of the real people here are the top 5 names you may recognise:
This was of course inspired by Matt’s post in January. I should do the same for Twitter replies/messages and for blog comments. I somehow doubt there would be much overlap between Twitter DMs and emails.
Related Posts
(March 03, 2010 12:17 PM)
We’ve just released newirishplans.com, a site for finding commencement notices. This is extremely useful for people in the construction industry, as I’ll explain.
Companies that work in construction need to be constantly on the lookout for new projects that are starting up. If you find a project just before it starts, you can call up and advertise your business, instead of waiting for the project manager to get around to finding someone else when the time comes.
As an example, if you sell bricks, it is better to call the manager of a house-building project just before they start building the house, than to not call at all, and realised when the house is built that the manager found a different brick supplier and didn’t realise you even existed.
You need to time the call as well – if you call too late, it’s obviously too late, but if you call months before the project starts, then the manager may totally forget you exist by the time the build actually needs your wares.
One way to find these builds that are starting up is to go around to all the planning authorities in your area of interest, and inspect any “commencement notices” that have been submitted since the last time you visited. A “commencement notice” is notification that you are about to start work on your build. All planning applications have this as a requirement.
Obviously, this can take hours out of your working week (and therefore, money), and even after you have the notice, you need to match the notice to the application and see if you’re actually interested in it at all.
The new irish plans project does this all for you. At the moment, the project covers about 17 counties, but we are always adding to this. For example, I’m working on getting Fingal added to the mix at the moment.
An account on the site costs 35 euro a month, and with that, you get an email once a week telling you of any commencements that the system has uncovered during that week.
But anyway – €35 euro a month. Just over one euro a day, and it’s all emailed to you.
If you know anyone in construction (does windows, landscapes, roofs, electrics, etc.) that is looking for work, tell them to go to newirishplans.com – the information is handed to you on a plate.
On the programming side, we wanted to make the search engine stand out, so we used the inline multiselect jQuery plugin (with a few small modifications) to help make selection of features and dates easier.
When I first came across that plugin, I was surprised and kinda proud to find that it’s based on some of my own work from 5 years ago! Open source is brilliant – you write a small piece of code and give it away, then 5 years later you find that someone has taken it and improved it vastly.
Commencements go through a “vetting” process. When a commencement is found, details about it are placed in a system where someone reads through the planning application, and marks down any interesting features about it. Those that have been vetted are then imported once a day into the main site itself, where you can search for them online, filtered by whatever interests you.
The system has been very long in the building, and has changed quite a bit over time. We’re very happy to finally make it public!
There’s still a few things that need to be completed on it (for example, we’re still organising WorldPay integration, but in the meantime we have PayPal), but on the whole, it’s ready for public use.
(February 27, 2010 05:48 PM)
In DEV300_m72 filter and desktop are now unused method free. Though additional unused methods in scripting and sc appear. -16 overall
(February 26, 2010 09:55 AM)
(February 26, 2010 05:04 AM)
Well, this is a surprise. One of my .ie email addresses got a very targeted phishing email. It was so specific that it was actually written in Irish! It wasn’t directed at me, but at a list owner address at linux.ie.
I wonder if the spammers know how many Irish people could actually read their email easily? It’d certainly be easier for most people to read in English.
Aire
Tá mé an tUasal Patrick KW Chan an Stiúrthóir Feidhmiúcháin agus Príomh-Oifigeach airgeadais Hang Seng Bank Ltd, Hong Cong.
Tá mé togra gnó brabúsaí leasa choitinn a roinnt le leat;
Baineann sé leis an aistriú suim mhór airgid.
Fuair mé do tagairt i mo cuardach a dhéanamh ar dhuine a oireann mo chaidreamh gnó molta.
Má tá suim agat i obair liom teagmháil a dhéanamh liom mo trí r-phost príobháideach (mrpatkwchan52@yahoo.com.hk) le haghaidh tuilleadh sonraíDearbhófar do fhreagra túisce chun an litir seo a mhór.
An tUasal Patrick Chan
E-mail: mrpatkwchan52@yahoo.com.hk
I suppose it was bound to happen now that Google translates text into Irish. Well done to Gmail for marking it as spam!
Related Posts
(February 24, 2010 01:32 PM)
This is weird, a huge number of POST requests started to hit the Shite Drivers website a few days ago. The requests came from lots of IP addresses and all requests went to the non existent /bc/123kah.php
The payload was an array that looked like this:
Array
(
[showed] =>
[clicked] =>
[version] => 2.6.2.4
[id] => c3b342beb6ad7adf39499e7a38f93c09f681611d
[tm] => 1266855758
[aff_id] => gooochi
[net_id] => gooochi
[safe] => 1
[exceed] => 2505,2507,2582,2597,2602
)
So I presume it’s the Gooochi malware referenced in this search for that word. Strange that the infected PCs hit my server though.
The traffic was never overwhelming but I decided to put a stop to it with a simple
in a .htaccess file. Much better than having WordPress serve up a 404 page.deny from all

I mentioned the 123kah.php file on Twitter and I’m not the only one to see these odd requests. I guess even malware has bugs! (which is all the more reason to keep your anti-virus software up to date if you use Windows)
Related Posts
(February 23, 2010 10:06 AM)
Sometime last year I noticed that links to my blog on Feedburner had attracted a few extra parameters. A simple link to a post became this huge monstrosity:
http://ocaoimh.ie/exploit-scanner-095/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+HolyShmoly+(Holy+Shmoly!)&
utm_content=Google+Reader
It’s a marketing thing right? It’s all useful information but I don’t really care about it, have never used it and don’t like my URLs getting mangled. It annoys me for two reasons:
So I added a new option to Supercache to redirect the url and get rid of the utm_source bloat.

If you want to give it a go, grab the development version of the plugin and upgrade.
Oh, and if someone has decent docs on utm_source and it’s friends I’d love to read it. Google didn’t return much when I went looking.
Related Posts
(February 22, 2010 01:36 PM)
Search results for url:taint.org on Delicious
: wow, you can search a time period for everyone who bookmarked pages on a specific site (via Britta)
(tags: delicious search nifty tools egosurfing via:britta)
Mindblowing Python GIL
: ‘presentation about how the Python GIL actually works and why it’s even worse than most people even imagine.’ A good chunk btw could be rephrased as ‘pthreads is worse than most people even imagine’. pretty awful data, though
(tags: python gil locking synchronization ouch performance tuning coding interpreters threads pthreads)
(February 19, 2010 11:05 PM)
OOO 3.2.0 “vanilla” install sets for minority Linux ports are now available from download.openoffice.org. 3.2.0 rpms for
* PPC (32bit powerpc)
* s390x (64bit z/Series)
* IA64 (64bit Itanium)
and 3.2.0 .debs for
* parisc (32bit HPPA).
(February 19, 2010 08:49 PM)
I’ve just released version 0.95 of WordPress Exploit Scanner.
This release fixes a number of bugs and makes it easier to scan for exploits and read the results.
I’ve added an “Exploits” scan level which looks for obvious code that hackers use. It will return a few false positives but it’s a good first scan to try if you suspect your website has been hacked. You can then use the “Blocker” and “Severe” to scan for ever more suspect strings.
Scans are now done 50 files at a time, with the page reloading after each. The scan results are saved in the database (in your options table as not-autoloaded records to minimize load on your blog) and you can open another browser window or tab on the Exploit Scanner admin page to view the saved results even before the scan is completed.
MD5 hash records for WordPress 2.9.2 have been added, and the hash records for 2.9.1 were corrected.
In other news I’m looking for testers to try out the almost ready WordPress MU 2.9.2. More details are on the forum thread above.
Related Posts
(February 19, 2010 05:12 PM)

Related Posts
(February 09, 2010 06:08 PM)
(February 08, 2010 11:58 PM)
Well, the new WP Super Cache is available now.
This release adds experimental object cache support. Don’t go looking for it unless you have an external object cache already. It won’t show up. I recommend using the Memcached object cache.
Some of the other major changes include more translations: Chinese (Pseric), Ukranian (Vitaly) and Japanese (Tai). The Italian and Japanese translations have since been updated but not included in 0.9.9. You can grab them from the languages directory if you don’t want to wait until the next release.
If you have WordPress Mobile Edition installed the plugin will grab the list of mobile user agents from that and warn if your .htaccess is outdated.
And, a small but significant change is that the PHP cache loader will use the static “super” cache if necessary. This might happen if your rewrite rules aren’t working properly and not serving cache files. At least your anonymous visitors will see some sort of cached file. Use the debugging system built into the plugin to determine where the cache comes from.
See the changelog for the complete list of changes.
Related Posts
(February 08, 2010 06:14 PM)

I was in Dublin yesterday to see Matt and Craig become Honorary Patrons of The University Philosophical Society in Trinity College. It was a low key informal event with many students and a few staff in attendance.
Eamon Leonard, of Echo Libre, kindly used my Flip Mino to record the Q&A session that followed. I want to express my gratitude to him for doing a fine job, especially as I saw him switch the camera from arm to arm during the hour long event. It wasn’t easy holding the camera aloft for so long. I’m currently transcoding the video and trying to make it smaller before uploading it.
I’ll add it to this post later, you won’t want to miss it!
Update! Matt was interviewed by Silicon Republic earlier today. Catch up on what’s happening at the Web Summit in Dublin by following #dws2 on Twitter.
Related Posts
(February 04, 2010 01:18 PM)
(February 04, 2010 02:16 AM)
DEV300_m71, svx, soltools and accessibility all 0 unused methods now. ucb reportdesign and sal nearly unused free. sc and sw creep up again. Over all count -17
(February 03, 2010 08:45 PM)
(February 03, 2010 07:07 AM)
(February 02, 2010 05:49 AM)
I’m happy this week. Last week, I spent some time and organised myself a bit more. In work, things are going smoothly – managed to get over a tricky piece of work and the rest is simply a list of small tasks.
For the last few weeks, I’ve been emailing and messaging Darshana at Packt Publishing, about writing a second book (jQuery 1.3 with PHP is going very well – list of reviews).
I initially wanted to write about file management, to explain how KFM works, and to help force me to improve on it. But there’s just not enough of an interested market in that – it’s too specialised.
So instead, I’ll be writing about CMS design using PHP and jQuery.
We (webworks.ie) have a CMS engine which we’ve written and improved for the last 6 or so years. We’ve open-sourced it a number of times, but never managed to generate much interest in it. We never had the time to spend on publicising it.
The book will not be specifically about that engine, but rather about the concepts that went into creating it – how a CMS works, how to manage plugins, administration, user management, and all the other little bits and pieces that every PHP developer needs to eventually address.
By way of explanation, I will be demonstrating various parts of our CMS, and explaining how and why it was built that way. I will be closely examining the other major CMSes as well, and giving alternative methods where good ones exist.
The proposed chapter list is:
I’m really excited about this project!
(February 01, 2010 10:55 AM)
(February 01, 2010 09:03 AM)
Here’s a quick post to encourage brave testers. I’m adding object cache support to WP Super Cache so you’ll be able to store your cached files in a memcached backend instead of disk.
It’s not complete but it’s running on this blog and well, you’re reading this which means it’s doing something and not breaking! If you want to give it a go grab the development version from the download page.
There are few caveats, but three spring to mind:
If you don’t know what memcached is, or how to set it up then you probably don’t want to test this. If you do, use Google and find out about them. Unfortunately I don’t have time to explain how to install it.
Inspiration and some code taken from batcache, the excellent caching plugin we use on WordPress.com.
Update! I updated the Changelog in the readme.txt and I’m looking for testers. Here’s what’s new in the development version:
* Added experimental object cache support.
* Added Chinese(Traditional) translation by Pseric.
* Added FAQ on WP-Cache vs Supercache files.
* Use Supercache file if WP-Cache file not found. Useful if mod_rewrite rules are broken or not working.
* Get mobile browser list from WP Mobile Edition if found. Warn user if .htaccess out of date.
* Make sure writer lock is unlocked after writing cache files.
* Added link to developer docs in readme.
* Added Ukranian translation by Vitaly Mylo.
* Added Upgrade Notice section to readme.
* Warn if zlib compression in PHP is enabled.
* Added compression troubleshooting answer. Props Vladimir (http://blog.sjinks.pro/)
* Added Japanese translation by Tai (http://tekapo.com/)
* Updated Italian translation.
The biggest changes are the addition of the object cache and a small change to the php code that serves cached wp-cache files. If the mod_rewrite rules on your site don’t work for whatever reason the plugin will look for the Supercache file and serve that instead. An extra header is added to the served page when this happens. It’s all in the readme.txt!
Related Posts
(January 27, 2010 04:02 PM)
Short run-down of what I’m doing lately: nothing.
Less short: I’m trying to get work out the door, get a good run at some personal projects, pass grade 2 piano, get organised, and generally improve my lot.
None of this is working. I think the “get organised” bit is the most important, as it will help the rest of it fall into place.
I usually only post about web-development-related topics here, as that’s the only subject where I feel I can contribute something new and interesting, so I tend to not talk about other stuff. But sometimes, rattling off the current state of the head is good for clearing it.
In work, I can’t really complain – we have a number of largish projects which are slowly creeping towards completion. The hardest thing about them is getting information from the clients, and then a week or two later being told that half the information is not required. I guess my main complaint at work is the inexorably slow completion rate.
On the personal projects side:
There are still a number of small bugs in KFM 1.4, and either I don’t have the time to get to them, or there is no enough information to recreate the bug and the submitter doesn’t give me access to their copy so I can’t see it from their side.
KFM 2 has been halted for a while – the idea is huge, but I simply don’t have the time, and no-one is clambering for it. I’ll get to it when I have time, but I might have to approach it by evolving KFM 1.x into meeting what I wanted, instead of the original goal of building KFM 2 from scratch.
I started a new project, OddJobs4Locals two weeks back, and got a good two-day run at it, then time got ahead of me again. I think this will be a good one, when I can complete it. Useful for students, people with a little spare time, or simply people that just want to make a little extra cash. Not yet working, but it will be soon, I hope… This is doubly interesting to me, as it is done purely through AJAX, so it will be easy to do a smart-phone client or a desktop client when the time comes.
I’m in the back/forth stage of working with Packt publishing to see if they want me to do a second book (the first one has no bad reviews at all). We’ve mostly agreed on a table of contents, and I’m just trying to get the time to combine a few of the smaller chapters together.
On the piano, I’ve been ready for the grade 2 exam since November, and am still waiting to see if there will be an exam near me any time soon – I hate the effort that goes into travelling (I have a family, and no car). I was hoping to do a grade every 6 months. It looks like this might not be possible, despite me being ready for it… The tunes I’m doing for it are Beethoven’s Sonatina in G Major, a waltz by Bela Bartok, and Boys And Girls Come Out To Samba, by Terence Greaves – by the way, I don’t like those videos; there are no dynamics in any of them, and I can hear a number of mistakes as well. No video apparently of the Terence Greaves one.
As for organisation… well I guess I’d better start working with Mantis again.
My lot will have to wait – I’ve a load of work to get done before it can improve.
Meh. Depression taking hold again.
(January 27, 2010 09:35 AM)
(January 22, 2010 03:18 AM)
DEV300_m70 callcatcher results show four new unused methods arising out of the (cool) new printing changes.
(January 21, 2010 05:49 PM)
one dot one dot one dot one dot dot dot…. Yes, last week’s release of WordPress MU wasn’t to be the last one. This is. Really.
WordPress MU 2.9.1.1 fixes #1193 and #1195, two annoying but one liner bugs that crept into the last release.
This is also a security release fixing a bug in the installer that has existed for quite some time. If you can’t update yet, delete the file index-install.php immediately. That file is only used when you install WordPress MU for the first time so it’s not needed afterwards. Don’t ask, “I’m using version x.x.x, do I need to delete this file?” Just do it. Thanks Mad Sprat for reporting the problem.
The index-install.php in 2.9.1.1 is safe, but I’ve added a note at the end of the install recommending the file be removed. The file is not used after installation and it’s always a good idea to clean up unused scripts.
Get WordPress MU 2.9.1.1 on the download page or wait until your Dashboard upgrader finds the new release.
If you’re adventurous, download and replace the following files on your site to upgrade:
Sorry Jeffro!
Related Posts
(January 18, 2010 06:15 PM)
A short while ago, someone popped into the PEAR irc channel on efnet and asked about installing Statusnet – which is a “open source micro messaging platform that helps you share and connect in real-time within your own domain.” It’s what powers identi.ca and similar micro-blogging services.
Specifically, this person wanted advice on installing the six or so PEAR packages on which this software depends; eight if you include the optional ones.
Foreseeing a number of people wanting similar help, I thought it would be best to create a metapackage to bundle these PEAR packages together – at the least it would mean only one “pear install” command would be required and it would reduce the number of potential mistakes that could be made.
Following my own instructions in the “Dependency Tracking (Meta Packages) with PEAR” section in the PEAR documentation, I quickly came up with Statusnet_Statusnet-0.1.1.tgz.
Install it via “$pear install http://short.ie/statusnettgz” for the moment – as the location of where it’s being hosted may change during the week.
(January 17, 2010 11:55 PM)
WordPress MU version 2.9.1 has just been released.
This is probably the last release before it is merged into WordPress 3.0 as the merge has already started!
Anyway this release brings the new features and bug fixes of WordPress 2.9 and 2.9.1 into WordPress MU. My favourite new feature has to be the Trash can, but there’s also an image editor, plugins can be bulk updated and video embeds are easier to do.
If you have more than a few dozen blogs, be sure to add the commentmeta table first before upgrade.
Thank you to everyone who has helped make WordPress MU better over the years, either by helping on the forums, writing plugins, contributing code, working on Trac tickets or any of the other hundred and one other things that go into an open source project.
Related Posts
(January 14, 2010 01:20 PM)
I was going to announce WordPress MU 2.9.1 today but I knew that people would run into trouble with the missing commentmeta table if they didn’t upgrade their blogs immediately.
So, download add-commentmeta.txt, rename it to add-commentmeta.php and copy it into your mu-plugins folder. Login to your site as a Site Admin, visit Site Admin->Upgrade and upgrade all the blogs on your site. Make sure you’re using WordPress MU 2.8.6 as the upgrade script in older versions may not execute the plugin.
The script above will add the commentmeta table to each blog. Give it time because it will take quite a while on large sites. WordPress MU 2.9.1 tomorrow.
Related Posts
(January 13, 2010 05:43 PM)
callcatcher results for DEV300_m68 and DEV300_m69
Down to 864 unused methods, unused svx mostly moved into new cui lib. svtools split into svl happily removed all unused svtools methods, leaving svtools unused-free. (x86_64) bridges also unused methods free as well.
sd now accounts for 25% of all low-hanging fat
(January 08, 2010 08:18 PM)

The weather reading on my desktop computer says -3C, that’s the temperature at the local airport I presume. It’s very cold out, but the sun is out and at least there’s no wind.
I took Oscar for a walk, I’m all wrapped up against the cold with a thick warm hat and over that a hoodie (yes, they do have a use!) and finally a light jacket to keep all the heat in. I dodged the ice and enjoyed the lovely sunlight melting away the frost on exposed surfaces. The footpath wasn’t too bad, Oscar was enjoying himself.
Half way down the road I bump into a neighbour. He’s dressed for a totally different season! Apart from his usual black jeans, he had on a nice shirt, but the top two buttons were undone exposing flesh to the cruel winter cold, and his one concession to that cold was a light black jacket, not closed of course. He hurried past, commenting that, “the sun is very bright this morning isn’t it?”
Amazing.
Related Posts
(January 08, 2010 10:54 AM)
I’ve just noticed that a site is running a competition to give away a copy of my book.
All you need to do is leave a comment explaining how you intend to use jQuery in your next project.
If you want to see reviews of the book, I’m maintaining a list of reviews here.
(January 07, 2010 11:16 AM)
WordPress MU 2.9.1 is almost ready but we need people to test it before the final release. This will be the final release before we start merging into WordPress so I’d love to get as many bugs as possible ironed out. Take a quick look at the tickets in Trac and see if you can fix any!
Check out revision 2044 or to get the latest code get it from trunk instead. If you’re not comfortable with Subversion access, there’s a zip file at the end of each page.
Only try this on a test server of course! The new version creates a new “commentmeta” table on each blog after you upgrade. That could be intensive on large sites. Ron points towards John’s script that adds those tables. I haven’t tried it yet (it’s a job for tomorrow!) but it’s definitely a good idea to create this table on all your blogs before you upgrade. Let me know how it goes.
Related Posts
(January 05, 2010 09:44 PM)
As an undergrad I was quite active in the NUI Maynooth IT society. We called it MiNDS>. Though These days it’s written as Minds. I have a soft spot for Rowan Nairn’s original site design and logo featuring that angular bracket. To my surprise I was recently contacted by some guy wanting to talk to MiNDS>. I think he was flogging SEO, however I pointed him at the committee email address. I don’t run MiNDS> anymore. But I did write a small paragraph on why the committee may not reply to him on the subject of SEO. It makes for good reading as to the personal accomplishments of several alumni.
“Many of our past members are the technical plumbers for both the Google and Amazon Irish operations. At least one of our alumnus works in the PowerSet team that develops an engine that Microsoft are integrating with Bing. Furthermore, several other alumni members have completed PhDs in the area of heterogeneous distributed searching and sorting and several others own web development and SEO firms. We’re bursting at the seams with high-quality talent.”
And that’s just from the people I know about. I’m getting all teary eyed thinking about days in the Union, modding Athlons into MPs and general mayhem. Someone should write an official history. Maybe I can meet Mags for a coffee some day and get the story about the founding. I was at the meeting that she took over from the postgrads (or I believe I was) but I don’t remember the whole story.
(January 04, 2010 08:05 PM)
So, yesterday marked the day that the new Blasphemy law came into force in Ireland. It also marked the day when Atheist Ireland published 25 “blasphemous” quotes, in a supposed act of defiance.

Atheist Ireland have gone about it in a very strange way; the url in their blog post is not a hyperlink, and the quotes aren’t simply in their post or on their front page. That’s their prerogative, of course, but I do wonder if it’s a sign of overt caution. Either way, the circus seems to have worked, and CNN and the BBC have both picked it up, among many more.
As a press-stunt, it’s genius. Getting the attention of the international media like that is not easy, and through careful choice of celebrities to quote, and the right tone, Atheist Ireland have pulled off a well-executed PR coup.
But as an act of online advocacy, and of affecting political change, frankly it’s stupid. And I think that Atheist Ireland will have approximately zero success. Such is the magnitude of their “not getting it” that they are probably forever doomed to an existence of committeeism and tokenism in near-equal measure.
Firstly, the action itself is ineffective, it does not – in my opinion – constitute any kind of an offence. Let’s go to the source, the 2009 Defamation Act;
(2) For the purposes of this section, a person publishes or utters blasphemous matter if—
(a) he or she publishes or utters matter that is grossly abusive or insulting in relation to matters held sacred by any religion, thereby causing outrage among a substantial number of the adherents of that religion, and
(b) he or she intends, by the publication or utterance of the matter concerned, to cause such outrage.(3) It shall be a defence to proceedings for an offence under this section for the defendant to prove that a reasonable person would find genuine literary, artistic, political, scientific, or academic value in the matter to which the offence relates.
Clearly there is political, scientific and academic value in Atheist Ireland’s statements. If they really wanted to engage in civil disobedience, it would take something akin to cartoons of the prophet, getting it on in a threesome with Buddha and Jesus while being bitten by some vampire Jehova’s Witnesses. That’s what the law was designed to impede. To be clear, I don’t agree with that law, I think freedom of speech is more important than a bizarre right not to be offended, but the law simply isn’t of the nature that Atheist Ireland and others imply.
I’m not sure if it’s willful misrepresentation, but by conveying the impression that the new law is designed to outlaw such trivial, and relatively innocuous, statements of the sort that Atheist Ireland quotes it is only serving to undermine Atheist Ireland’s own credibility. In light of the actual facts, it’s hard to take them seriously on the issue. Sacrificing integrity and accuracy for punchy-PR is never a great idea, long term.
To be fair to Atheist Ireland, they don’t actually claim that their statements are prosecutable, and are making the broader (but again, tokenistic) point that the law is simply silly and unworkable. Great, that’s an important point – but what use is making so much noise about it? This actually entrenches politicians and makes them less and less likely to respond favourably. It’s ironic that this the kind of reactionary “we must be listened to” tokenism that led to the law in the first place.
PR-led advocacy groups, which are really pressure groups almost never work in Ireland. There simply isn’t any political incentive to respond to pressure on these kind of issues. Across all of Ireland there are maybe 200 swing votes on the Blasphemy issue, thinly spread across the constituencies. Elected politicians, rightly, place it very low on the agenda. Going to 2 funerals, fixing some lamps, and changing a speed limit or two will get you as many votes – and in one parish.
Real, successful, advocacy groups don’t look like this. Instead there are small, targeted and strategic efforts. It’s lots of small meetings, tactically-directed briefs and letters and relationship building. The effective groups work somewhat within the system, more quietly, and get a lot more done. Groups like Barnardos get more mileage from lobbying the Department of Finance behind the scenes than they do out of a hundred press releases.
When we were running our campaigns against E-voting, I’m convinced we made ten times as much progress by working quietly behind the scenes than we ever did through PR-based activity. In order to run a successful effort, I think it’s important to keep some basics in mind;
Think in terms of the people you are trying to influence, and how they perceive it. How do you make your cause be in their interest? What can you do for them?
If it’s a political change you need, how do you frame the issue in terms of jobs, money or core political ideology (ideally patriotism)? If you need to influence a small number of politicians, how do you make the issue about their legacy?
If you plan to take your case to the courts, how do you influence the context in which judges rule? How do you develop and frame legal theory, how do you make it such that “your side” seems like the obviously equitable one, to judges and their peer-group. An article in a legal journal espousing your side will go a long way.
When you do make a press-release or PR effort, consider very carefully the question “How will this actually progress our cause? what are we aiming to achieve here”. Inciting rage, generating “pressure” and elevating one’s personal profile should be non-goals, they aren’t effective. A lot of progress can me made by suppressing your ego and not taking credit; ghost-writing political speeches and news editorials is incredibly common, for example. Have those been considered first?
An effective goals would be “increasing awareness, and converting this into membership and resources”. A clueful organisation ends their campaign with a notice to donate money, rather than to sign a petition. It’s an important dictinction, the money can help make real change, most petitions are ignored.
Bottom line; always judge an advocacy group by the amount of actual progress they make on their issues, not column inches. And if you are an advocacy group, ask at every stage – for every action – “what is the sequence of events I hope to trigger that will actually cause the change I desire?”.
Now, to be more constructive. What would I do? Firstly, I think the priority should be to convert all of the PR into money, and to use that money to fund legal research. Small, but targeted academic briefs – aiming for 3 or more papers a year establishing the jurisprudence of the blasphemy law. The aim would be to establish a credible context in which it showed that the law is out of place, that it doesn’t fit with many of our international treaty commitments and is comparatively regressive.
Next priority would be to start to frame the issue as anti-republican. Ireland is at a very important cross-roads, in the wake of the Ryan and Murphy reports there are calls for more church-state separation. The way to capitalise on this is to make the case for a newly invigorated Republicanism, one of the great Irish political ideals. Republics are supposed to be by and for the people, relatively free of church interference. Our proclamation says;
The Republic guarantees religious and civil liberty, equal rights and equal opportunities to all its citizens, and declares its resolve to pursue the happiness and prosperity of the whole nation and all of its parts, cherishing all of the children of the nation equally and oblivious of the differences carefully fostered by an alien government, which have divided a minority from the majority in the past.
It’s not that hard to frame the blasphemy law as anti-republican.
With a few short years of that kind of hard work, it would be possible to create a context in which an Irish politician could see it as in their interest, and in the betterment of their legacy, that they bravely spear-head a new Republican ideal.
Backed by research and briefs which will help them not look stupid to their peer-group, or in the face of opposition questions, we can give them the confidence to propose it in the first place. This is what achieving real change looks like; careful groundwork. The system simply isn’t going to respond whining from a marginalised minority group.
The good news is that it’s doable. It took us a long time to get it finished, but a relatively small group of e-voting campaigners finally managed to get a key government policy 100% reversed. And this was in spite of far more political (and real economic) capital having been invested than in the new blasphemy law. There were many many small meetings, letters, briefing documents, ghost-written speeches and editorials, researched papers, legal strategies and only about 2 press releases per year on average – with a cluster around 2004 during the run up to the elections.
To me, based on experience with ICTE and other lobby groups, that’s a lot more like what this kind of successful advocacy looks like. I do hope Atheist Ireland, or another secular-interest group, can find the time and experience to develop these issues properly, but for now it doesn’t seem promising.
Update: Throwing caution to the wind, Atheist Ireland have now made the url I mentioned a hyperlink and published the quotes on their front page. Also, there’s some lively discussion in the comments to this post.
(January 03, 2010 03:14 PM)
“Jesus is the only son of God, and if you don’t follow him, you will not be getting through the gates into Heaven”.
Anything wrong with that? Yes – it’s blasphemous, to just about every religion on Earth which is not Christian.
And so, Dermot Ahern, in his infinite wisdom, has just made the central tenet of the religion of one third of the entire planet illegal.
Well done, sir. Fucking genius idea, that.
How about this one then – “Jesus is not the son of God”. Now I’m blaspheming against Christianity.
There’s absolutely no way to win against this except to be completely silent and never discuss what you believe with anyone at all. And that means it wasn’t just Christianity that the idiot has made illegal to speak about, but all religions.
By the way, I’m an atheist. I believe in thinking about what is “true”, and in discussing it with people that are interested, and in not pushing my own beliefs on others.
I hear the door knocking – the thought police are here to take me away. Pray for me…
(January 01, 2010 11:27 PM)
In years gone by I used to worry about the first game I’d play in the new year. When I say “years gone by”, I really mean it. This was around the time when Ikari Warriors and Armalyte were only a few years old, and I was a teenager pounding out ASM code on a C64 keyboard with an Action Replay.

Time passed and the PC rose to become the dominant gaming platform and with it my interest in games waned. Sporadic bouts of play included almost all the ID games and the original Half Life but as I had to reboot into Windows it was never going to last. In recent times I became the owner of my first two games consoles. First a Nintendo Wii (gathering dust in the living room) and an Xbox 360 this year that awoke in me the dormant games playing interest that had been killed off a dozen years ago.
So, this year I’m once again pondering what game will become that first one. Will it be the obvious choice of Modern Warfare 2? Or perhaps a bit of COD 4? Maybe even Batman: Arkham Asylum?
No, I think the first game of the teenies (or whatever we’ll call ‘em) will be Trials HD. A kick ass game I already wrote about and couldn’t stop playing even after hitting the restart button a few dozen times!
What about you?
Related Posts
(December 31, 2009 10:38 PM)
So, about 2 minutes after taking this photo;
I slipped on the paraffin-laden solid granite pavement, everything went flying, and I ended up getting a very different kind of photo entirely;

That’s my right arm, and somewhere in there a minimally-deforming radial fracture that I don’t remotely have the training to actually see. Though I definitely don’t like the look of that suspiciously lumpy bit of bone. Here’s another look;

As fractures go, I think I got the best kind. It’s now 3 weeks later and I’m almost back to a full range of movement and strength is starting to return. I can write, type, take photos and most importantly, play music once again. The people at St. James’s Hospital have been very good, and if you ever plan to break anything I can recommend doing it near them.
Science is really really cool. Randomised control trials have shown that a simple millennia-old sling (not a cast) is the best treatment, so that’s what I got. About a century of rigourous bio-chemical engineering has led to little pills I could buy in a pharmacy that magically suppress complex sources of pain with minimal side-effects.
Over that same century we’ve progressed from a naive understanding of “Röntgen radiation” as mysterious emanations from a vacuum tube, to a complex quantum-mechanical model of X-Ray interactions that allows us to record these highly-ionising photon jet-streams on a semi-conductor, convert the impression into a digital image and then have it pop up on my clinicians desktop. Right now, reading a random blog on the internet, you can see inside my body – as easily as you might look out the window.
And social science is used too. Because people frequently forget their appointments, there are text message reminders; a few days, and one day before anything that’s scheduled. Again, a trial has shown that this is both cost-effective and clinically beneficial. And when I go to the physio-therapy clinic, I get given a simple set of tried and tested exercises that have been shown to lead to improvements.
Cooler still is that despite all of the science, and care and attention involved in the whole process – really it’s the body doing the work. Through some magic – mostly unknown – system of DNA signaling, controlled protein unfolding, stem-cells and “stuff”, tiny microscopic organic “bits” somehow communicate and coordinate the building of whole new bone, mostly in the right place. So without having to do all that much, I can play Fussball and write dumb blog entries again.
It’s almost worth doing just for the experience.
(December 28, 2009 09:12 PM)
As a response to a reported bug where Chrome was taking ages to load up a flash multiple-file uploader, I’ve updated KFM to use HTML5’s multiple-file input box where possible.
To do this, first create the element:
var input=document.createElement('input');
input.type='file'; // use old-style JavaScript method to make sure all browsers respect it
input.name='kfm_file';
Notice that we’re not using setAttribute to set the type and name – that’s a DOM method which works in most browsers but not (of course…) in Internet Explorer 6, where it has bugs.
And now, we tell the input to use the multiple-upload method. We use .setAttribute in this case because we only expect newer browsers to succeed with it.
input.setAttribute('multiple','multiple');
if(input.multiple)input.name='kfm_file[]';
In the second line, we check to see if the element is now marked as a multiple-uploader (most current browsers will not succeed in this), and if it does, then rename the input element by adding a [] to the end. If this is not done, then the server will only see the first file which is uploaded.
That’s the client-side done. This will only be visible in newer browsers such as Chrome, Safari 4, Firefox 3.6. I expect Internet Explorer will eventually catch up by 2020 or so.
If you’re doing this in pure HTML, then I suppose this would be good enough for you:
<input type="file" multiple="multiple" name="file[]" />
In this case, you must put the [] in the name in all cases.
On the server-side, you need to write your upload receiver to expect either a single element, or an array.
For some really goddamned stupid reason, when multiple files are uploaded to PHP, the results are interlaced in a really crappy and awkward manner (I don’t like it).
Instead of something logical and easy to use, like this:
array(
[0] => array(
'name' => 'file1.txt',
'tmp_name' => '/tmp/abcdef'
....
),
[1] => array(
'name' => 'file2.txt',
'tmp_name' => '/tmp/ghijkl'
....
)
);
You get this…
array(
'name' => array(
[0] => 'file1.txt',
[1] => 'file2.txt'
),
'tmp_name' => array(
[0] => '/tmp/abcdef',
[1] => '/tmp/ghijkl'
),
...
);
While that looks at first glance to be easy to use, it’s not. You can’t do a simple “foreach($_FILES['kfm_file'] as $file)” and expect the above to be usable at all…
So, the first thing I do, is to check for the $_FILES['kfm_file'], and convert it into the first form above, which is very easy to work with:
$files=array();
$fdata=$_FILES['kfm_file'];
if(is_array($fdata['name'])){
for($i=0;$i<count($fdata['name']);++$i){
$files[]=array(
'name' =>$fdata['name'][$i],
'tmp_name'=>$fdata['tmp_name'][$i],
);
}
}
else $files[]=$fdata;
In my own case, I’m only interested in the name and tmp_name variables, so that’s all I set up.
Now you can do a foreach on $files and treat them all individually.
foreach($files as $file){
// uploaded location of file is $file['tmp_name']
// original filename of file is $file['file']
}
If you want to see this in KFM, have a look at the nightly-updated demo tomorrow, or download from SVN right now.
oh – and buy my book!
(December 28, 2009 04:37 PM)
Today was a Christmas Day my family won’t forget for a long time! We had a great time today, heard some amazing news, and then had a bit of an adventure on the way home. The weather has been pretty cold for the last while, the county was covered in a sheet of ice but this afternoon temperatures rose slightly which was great because we were due to visit family for Christmas dinner.
My brother Donal and his wife had ice problems this morning when their car slid out of his estate. Two hours later they got underway when the roads thawed out a bit. That had worried me because there’s a hill into our estate too.
After a great day with family, a delicious dinner made by my brother-in-law Chris and a visit to my own family we returned home, sharing the road with nervous drivers and reckless drivers. The journey home was uneventful but the hill into our estate proved to be troublesome. The road was covered in ice and slush and as we rounded the bend a car slid down backwards and eventually braked and turned back down. I tried to drive us up there too but the car only got so far before wheels started to spin, the car shuddered and we weren’t going forward any more. Kinda scary!
I had to turn back of course, we parked further up the road where I spotted a break in the ditch. In the freezing dark I managed to get up there, and to make what is turning into a long story shorter enlisted the help of our neighbours who were in the same boat. Between us we managed to get the essential bags out of the car, I carried Adam up the road, and we took a short cut through Rosy and Con’s house knocking a good 100m off our journey.
I used the light of my Nokia 5800 in video mode to light the way so I have a record of all that happened, even if it’s more audio than anything else! Must have a listen tomorrow.
Anyway, I’m glad to be home, safe and sound. We’ll get the car tomorrow. Thanks neighbours for your help. Nollaig Shona dhaoibh go leir!
Related Posts
(December 26, 2009 12:02 AM)

The FPS Freek by Kontrol Freek is a small attachment for the Xbox 360 or PS3 controller that helps players aim more precisely in first person shooters or FPS games. There’s a Speed attachment too for racing games.
The FPS Freek snaps on to the top of the controller sticks so your thumbs have to physically move further to make the same in-game movement. This is supposed to help when you want to make small accurate movements, especially useful when aiming at a small distant figures in a shooter such as Modern Warfare 2. From the blurb on the product page,
The added analog stick length provides 40% more linear distance from full stop to stop. This gives you more leverage and increased precision without disturbing your natural gaming playing feel.
I’ve been using it for a week and while my gaming has improved a whole lot, it was improving any way because I was getting better with practice. I don’t think you’re going to see a dramatic improvement in your gaming by using the FPS Freek.
I tried increasing the sensitivity of the controller, thinking that the extra leverage of the thumbstick would help but it really didn’t, and I think it’s back at 3 in MW2 now. At that sensitivity I can aim fairly well. With a silenced Scar-H I was able to make a few kills at the other side of Highrise, but on the other hand, a distant crouched enemy-in-waiting in Estate shot me while I attempted to aim at him.
The FPS Freek is comfortable to use however. It probably has helped my gaming but it’s not the major leap you might think. Learning how to use a mouse and keyboard properly was better for my gaming than using this, but of course you can’t use a mouse and keyboard on the Xbox 360. All you PC gamers will know what I mean!
In the US it costs $10 but here in Ireland or over in the UK you have to buy it from Lime. I think it cost me the equivalent of US$29 including (for some reason) registered postage of about 7 Pounds Sterling. I had to sign for it when it was delivered. At that price it’s not great value for money, but at $10 it’s an impulse buy I could live with.
In theory the science is sound. The extra length of the stick will give you more travel and room to aim precisely but if you’re not a good gamer this won’t work miracles. If you panic when you’re confronted by an enemy on a map, you’ll still do that. If you don’t use a game’s maps to your advantage now, then buying this won’t magically make you immune to enemy fire. It may help you aim if you’re sniping. I’m still using the FPS Freek on my right thumbstick however, it’s comfortable.
Buy it only if you have $10 burning a hole in your PayPal account. Don’t buy it if you’re outside the US, it’s not worth it.
Just don’t expect miracles.
Just so you know I haven’t a clue what I’m talking about, here’s a few glowing reviews:
Impressive accuracy at custom sensitivity 7 in COD 4, but then this guy is hardly a newbie at the game!
Related Posts
(December 22, 2009 10:48 PM)
Because it’s difficult to know exactly how well my book is doing, I went looking for online apps that might be able to help.
I came across NovelRank a few weeks ago, which keeps track of your Amazon SalesRank and uses the fluctuations in the value to try figure out when a sale happens.
At first I was a bit disappointed, as my own ratings should not many sales going on, but I realised that this was because there were no reviews out there so people a) didn’t know about the book, and b) didn’t know if it was worth buying.
Since the reviews have started coming in, sales have picked up, as can be seen in the NovelRank graph for my book.
I like this application – it’s a simple idea, and the author has made it freely available (I assume he makes money from affiliate links).
Want to see it in action? Buy JQuery 1.3 with PHP and then view NovelRank graph for my book the graph a few hours later to see your very own blip appear on it.
It’s interesting to see that the book is not selling at all in Canada. What’s wrong with you Canadians??
On a very related note, I’m in talks with Packt to produce another book. More on this later when details are more concrete.
(December 17, 2009 02:00 PM)
(December 17, 2009 05:22 AM)
I’m sitting on a train, the Enterprise, moving along at about 140 kilometers per hour between Drogheda and Dublin. Something is causing practically every particle in my body to spark into a new life at a different position in space one instant to the next.

For each one of those particles, there’s some chance it could just pop into life on the far side of the moon, or even the universe. But something, I guess “motion” is averaging everything out and look, there the sum of me pops, every tiny instant getting slightly closer to Dublin.
If the train was in the vaccuum of space – or somehow free from the effects of friction – it wouldn’t even take anything to keep this atomic leap-frogging going. Each small micro-part of me would just keep on dancing. And somehow at the same time, it’s exactly as if I were staying still all along – there’s no real difference. This has been tested.
But if for any reason a change of tempo was required, to move from a waltz to a samba, something intangible and ephemeral – mysteriously lumped into the word “energy” – is required. It’s weird and mystical and it doesn’t make a whole lot of sense, but it can be measured and described – and relied upon.
And as I sit here and write, using the word “I” like that, it feels like there’s a “me”. It seems as if there’s a real sense of ownership over my thinking, I can’t tell where my thoughts come from, but they are mine.
I feel like I’m free to choose things, when I get off of the train I could get straight into a taxi or walk to a tram. I don’t know which I’ll do yet, there are a lot of factors to consider, but neither choice seems pre-ordained, and once it happens it will feel like “I” owned that choice.
“Free will” seems as real to me as the forward motion of this train, it’s an inexplicable dance, but it’s my tune. And that makes less sense. Reality is describable by all of these symbols and equations, and we can make predictions with them. This has been tested.
There are even divisions between what is predictable in detail, and what is predictable only in the aggregate, random and unknowable at the finer grain.
Here in my head, it doesn’t seem like my thoughts are predictable, or could be. If they are just an inevitable cadence, then that “I” is merely an illusion. It also doesn’t seem like thoughts are random or unknowable, to me anyway. I have patterns of thinking, recurring themes, and a detectable personality. It can’t be the same dance.
How many miracles are there on this train? Motion is miraculous enough, that “I” can think, that the universe even exists seems miraculous too. But most astonishing, is that these simple realities are seemingly contradictory.
I’m still on that train, I haven’t gone anywhere, there haven’t been any angels visiting me, or deitious interventions. These thoughts haven’t led anyone to complicated dogmas, wars or ceremonies. Some say science is cold. Maybe the dance is a myth.
And if this mental dance should one day just end, where are the real love-songs? Songs that speak to the real meaning, the genuine warmth, of spending a fleeting, passing, bittersweet whirl around the floor with someone. Not an infinitesimal slice of eternity living in hope of a better dance; that’s cold. This has been tested.
(December 16, 2009 05:43 PM)
I have a huge archive of photos. I shoot tens of thousands of photos every year. Storage requirements for all those photos was bad enough when I shot in Jpeg but then I switched to RAW and space usage jumped! Here’s what the last 3 years looks like:

169GB of data is a lot of stuff to store. Originally I had them all duplicated on two external drives but then I bought a 500GB internal drive for my laptop for speedier access. Unfortunately that drive simply wasn’t big enough. I need to convert some of my RAW files to Jpeg to save space. To preserve the original RAW files I want to archive them somewhere permanently. I have a DVD writer so that was an obvious choice.
Burning data to lots of DVDs is tiresome. You can use tar, zip or another archiver to split the data but then you have to run through all the DVDs to pick out a file to restore. I like having the files directly accessible but that means endless selecting files, making sure they’re as close to the DVD size as possible, burning them, moving on to the next bunch. In the bad old DOS days I had a program to fill floppy disks if you pointed it at a directory but I’ve spent years searching for a similar Linux script. Last week I found one.
Enter Discspan. My 2007 archive was already burned to DVD, and I wish I had this script while doing it. I’ve burned my 2008 archive with Discspan and it was a doddle. Point it at the right directory, feed it some details about the DVD drive and let it go. 26 DVDs later and my 2008 archive is safe on DVD!

The script scans the directory, figures out how many DVDs are required and it fills each DVD with data, spanning my digital archive over multiple DVDs.
Be aware when using it that you should let Linux detect the next blank DVD before pressing return. The first time I ran it the script bombed out when growisofs didn’t see media to write to. You also need to patch it because it doesn’t detect the right size of DVD+R’s but it’s a simple one-liner.
Another Linux project, Brasero promises to span disks too but it didn’t for me. It’s the default CD/DVD burner in Ubuntu now and it’s a shame this functionality is broken in it.
Hopefully Brasero will be fixed for the next release. I’d offer to help but my C/C++ is very rusty.
Related Posts
(December 16, 2009 10:26 AM)
Just a few minutes ago I read Jamie Nay’s A Better Postal/Zip Code Validation Method for CakePHP 1.2 blog post.
Jamie says that “The Validation::postal() method that comes with CakePHP 1.2 is good in that it can handle a number of different country formats, but the problem is you can only validate your data against one country. What if you want to accept, say, either Canadian or US postal/zip code formats? I ran into this problem earlier today, and decided to write my own postal() function that can take either a string as the country, just like Validation::postal(), or an array of countries.”
I’m probably going to have to wait for Jamie to wake up before my comment on that blog-post is approved, but the crux of it is “Don’t”. Don’t write your own code to validate user input, unless of course the input data is specific to a problem domain that others haven’t catered for yet.
I drew attention to two things. The first is that there are Validation packages in PEAR, including the main Validate class and all the Validate_xx subclasses such as Validate_US, Validate_CA and some 22 others).
The second item I drew Jamie’s attention to is that his validation code counts a zip code of “00000″ as valid, when the USPS zip code look up tool correctly (and they should know!) identifies that code as invalid.
Why spend time writing and debugging regular expressions, compiling lists of valid data and so on when other people have already done this work? Especially when it comes down to such things as validating data input which is crucial when you need to guard against cross site scripting vulnerabilities.
Focus on what you need to do rather than reimplementing what others have already done.
Honestly, this probably should be subtitled – “Stop the NIH craziness, please” – though to be fair Jamie might not have known of the solutions already out there.
(December 15, 2009 01:59 PM)
This is the first book sent to me from Packt where I wasn’t left dizzy from trying to understand just what it is the author was trying to get across. It looks like their proof-reader was awake for this one – totally awesome.
jQuery, as the vast majority of us already know, is a JavaScript library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. In other words it does all the heavy lifting and takes care of cross-browser compatibility issues so you don’t have to and thus allows you to focus on the work that you need to do without all those distractions.
“jQuery 1.3 with PHP” is aimed “for PHP application developers who want to improve their user interfaces through jQuery’s capabilities and responsiveness”. Over the course of ten chapters Verens starts the off with an introduction, then a series of ‘Quick Tricks’ that almost immediately help you add some measure of “Web 2.0″ functionality to what I’d term a “web 0.2 application” rather sharply.
The book ends with a chapter on Optimization – some of which you are bound to already know and some which are complete gems.
In the middle are chapters with mini-projects on tabs and accordians, forms and form validation, file management, calendars (and how to make your own google-calendar-like application), image manipulation, drag and drop and data tables.
In each case, projects are analysed and the required steps for each are outlined in the simplest terms – no extraneous buzzwords are used or are the projects over-analysed for the sake of pedantry.
I was a little surprised in some places where, for example, the json encoded output was not created via json_encode; but then thought not everyone is going to have PHP 5.2 or greater installed. Thumb forward a few pages and this is mentioned. So all’s o k.
It was good to see Kae suggesting use of the PEAR Validate package (or similar) in the Forms and Forms Validation chapter (chapter 4). I had to wonder if there was a PEAR package for creating and shunting down jQuery validation rules to the client – and found that there isn’t. That’s something to consider for later on, I guess.
The rest of the book is similarly both easy to read and easy to understand – my first port of call for learning how to do something that I’d almost term exotic with jQuery and with PHP in the background is usually Google but that is going to change (actually it already has).
Honestly, I wouldn’t be surprised if this books working title was “JQuery and PHP: The HowTo” – it is that good.
Now, this book is not for learning jQuery – that is not within its remit, but I would heartily recomend “jQuery 1.3 with PHP” by Kae Verens to anyone wanting to utilise jQuery from a PHP background.
(December 13, 2009 11:46 PM)
Consciously, I’ve never been keen on the idea of role-models. Thinking it synonymous with hero-worship, it has always seemed a bit of an anti-pattern to me. Why try to emulate anyone? There are enough people in the world behaving the same as someone else, being different and original is definitely more useful, even if it makes you a bit crazy. When I did a dubious “leadership style” test I came up as “anti-follower”, so maybe it’s just another form of contrarianism on my part.

Over time, I’ve found that the best way to learn is by example, even if it’s a process of unconscious osmosis. And when I’ve spent time on what is sometimes called “personal development” I’ve found that there is real benefit in reading the biographies and the writings of truly awesome people. It certainly seems more productive than reading self-help books that are written in truisms and marketing crap.
I thought I’d share some of the people who I’ve really benefited from reading about, truly amazing people.
RPF is a legend; a nobel laureate physicist with an uncanny ability to explain complex ideas, an anti-authoritarian maverick who loved to screw with officialdom but most of all an incredibly generous, warm, loving guy (even if a womaniser at times). His writings on physics and his letters to his first, dying, wife are an inspiration.
Pirsig, someone genuinely crazy enough to have been institutionalised, still managed to write one of the best sellers of the 20th century and to invent a philosophical system that many consider to have merit. ZMM is amazingly well written, all the more so when you consider that every paragraph was planned out in advance on index cards. Worrying, his narrator in ZMM is the only literary character I’ve ever strongly identified with.
Grace Hopper signed up for the US navy during World War 2, and rose (primarily as a reservist) to the rank of commodore/rear-admiral back when this was incredibly unusual. But more than this, she was an excellent experimenter, and kept a rigourous lab-book, despite being mainly a computer scientist. She was a strong believer in getting things done, and coined the phrases “dare to do” and “It’s easier to ask forgiveness than it is to get permission”. Seriously awesome woman. Oh yeah, and she invented the compiler.
Doc Watson has been blind nearly his entire life, but that doesn’t stop him from being the truly most amazing guitar picker the world has ever seen, or doing crazy things like mending the tiles on his roof. His solo runs and accompaniment are incredibly good, and he’s somehow maintained humility in the face of multiple grammy awards and playing for the president on a regular basis. Another doer, he just kept going and became more productive after the tragic death of his duet partner and son Merle.
Dolly is a self-described mis-fit, but she is also a very very shrewd business woman as well as being a dedicated humanitarian and gifted songwriter. She is one of the really great singers, and is emotionally invested in every song she sings (even the ones that sound like bubblegum, listen to how sad she is in “Here you come again”).
CP Snow was basically a troll, but a very very good one. His arguments, lectures and writings weren’t always rigourous and balanced but they were always enlightening, thought-provoking and forward thinking. Most famously he identified the tension between literary and scientific cultures and made a great case for the unfair treatment of science. A scientist and a well-regarded author CP Snow is a great example that it is possible to straddle both worlds.
Peter Watson is a prolific researcher and writer, the volume of his output and the breadth of his knowledge is unfathomable. I’m constantly reading something of his. He has methodically and thoroughly condensed practically all of known intellectual history, writing about all of the inventions of the human mind. His writing is great, but it also brings home how relatively ordinary our time in history really is, yet serves as a great reminder that so many things we take for granted even had to be invented.
No doubt I’ll think of more now that I’ve put a list together. I’ve been fortunate enough to meet some of these people, but I’ve also been even more fortunate in that other people I’ve come across in my life have served as role models (starting naturally enough with my parents). I don’t intend this post as meme, but if you have role-models, I’d be interested in hearing about them. As I mentioned, it’s definitely a great benefit to read about such inspiring people.
(December 13, 2009 08:24 PM)
Christmas is coming, as most of us (especially parents and people that have wallets) know, so it’s time for ye all to dig deep and buy the perfect gift for that favourite web developer in your life.
Not knowing what that perfect gift could possibly be, I’ll recommend instead that you invest in a copy of my book, JQuery 1.3 with PHP.
Reviews are just starting to come in. I only know of two on-line ones so far, my favourite of which is this one:
The author does a great job of introducing complicated theories and breaking them down into manageable steps, whilst always taking very thorough considerations for applying jQuery knowledge into CMS ’s and web applications.
I noticed that the same reviewer posted this on Twitter: thoroughly impressed with reading jQuery 1.3 with PHP. writing a review on it, will be available soon!
The other one that I’m aware of is more of a list of notes than a review. The only thing he says in general about the book is “Overall a good book.”
There are a few minor criticisms in the second review that I don’t agree with – that I didn’t use inline functions in all cases, didn’t use Google’s functions to load jQuery from its CDN, and used document.getElementById in some cases instead of using jQuery’s $ function.
My reaction to those points are: inline functions are explained later in the book as I didn’t want to throw the reader head-first into understanding them, there’s no point in loading three libraries (google, jquery and jquery-ui) when you only need jquery and jquery-ui, and for the purposes of getting an element by its ID, document.getElementByID is much quicker than $.
I think the real problem with my decisions with the above points is that, after having had them pointed out as mistakes, I feel I should really have explained more clearly in the book why I chose to do things in those ways in the first place. Well, that’s something for edition 2
So far, though, the reactions are positive, and I hope this continues – there haven’t been any “this is crap” reviews so far, which is good.
I know of a few other people that are writing reviews, and can’t wait to see them. So reviewers, please do criticise it – it makes the end-product better.
And christmas shoppers, it’s a great book
(December 13, 2009 05:35 PM)
I was shocked and amazed when I saw the boxes of Call of Duty Modern Warfare in the Wii section of Gamestop the other day so I went searching for reviews. Metacritic gave it it a reasonable 77, while the following two Youtube reviews rate it very highly. Graphics look awful, and aren’t a patch on the Xbox 360 or PS3 version but the Wii remote makes aiming easier and more precise.
I loved Call of Duty WAW on the Wii, I’m tempted to dust down the machine for this too…
Just added it to my Amazon Wishlist.
Related Posts
(December 13, 2009 01:15 PM)
Everyone else goes wireless with radio waves buzzing through the air and I return to good old ethernet cables and a switch. Today a package came from Amazon containing the D-Link DHP-303/B Powerline 200Mbps and a 5 port switch (and an internal drive to replace the tiny one in my Dell laptop but that’s another story).
The D-Link Powerline product is actually two plugs that are inserted into your wall sockets and use the wires in your house to communicate. I was a little dubious about it working well but it’s been fine. One plug is downstairs by the DSL router, and the other is upstairs here in my office. They apparently talk at 200Mbps but I’d take that with a grain of salt. My computers talk at 100Mbps, as does the switch so I presume that’s the limiting speed. It’s plenty fast enough for my DSL but I’ll have to try a file transfer later.
For the last few years I used WiFi to bridge the gap between downstairs and upstairs but this works just as well, and file transfers between computers aren’t as dog slow as they were using wireless networking. Wifi was never as fast as it should have been, probably because the signal was weakened by:
No chance eh? I once tried to force the connection to be 54Mbps but it failed half the time, the Xbox wouldn’t connect. It just didn’t work well. Oh, and sometimes, the cordless phone ringing downstairs knocked me offline! Didn’t matter what channel I was on.
Sheesh, I’m getting very old school. I changed back to Apache from Nginx last weekend, changed from P2 to a more traditional WordPress theme this morning, and then dumped wireless networking this afternoon. I hear vinyl records are making a come back.
I will plug in the wifi router again, for those moments when I want to work from the kitchen. Unless I get another D-Link powerline adaptor..
Related Posts
(December 08, 2009 04:45 PM)
If you use the Sitewide Tags plugin for WordPress MU you may have missed Ron’s announcement post about the new release.
This version is all Ron’s doing. He merged in features he has worked on over the past year. Check out his blog post for the full list of changes.
Oh yeah, I’m doing mini-merges of WordPress and MU code all the time. Update from trunk (svn link) if you want to try it out, and please report any bugs on trac! I love the new trash feature!
Related Posts
(December 08, 2009 02:02 PM)
Nick introduced me to Soekris a few weeks ago and some neat little boxes they make. For a current project, the net4801 fit the bill perfectly, especially with the add in vpn1411 which off loads the intensive computational operations for encryption and compression.
I plan some future posts looking at the throughput performance of OpenVPN with and without the vpn1411 as well as general traffic throughput measurements. This post however will focus on installing FreeBSD on this device as easily as possible.
Firstly, I ordered the following:
Including P&P, this all came to €369.48.
While there is a lot of documentation online and a number of methods available to install FreeBSD on a Soekris box, I found that the easiest way to to do it was as if I were installing on the local machine and hence I could just install it as normal. For this, we turn to VirtualBox1.
da0 for me). Once it completes, there are some changes you should make before popping the CF card back into the Soekris box:
/etc/rc.conf, set up the network configuration. Note that in VirtualBox, the interfaces will be reported as le0 but when booted on the Soekris box, they’ll be sis0 through sis2. I set sis0 (marked Eth 0 on the case) to configure by DHCP. I also set a static IP on sis2 so I can access the box on a direct computer to computer connection if necessary. Lastly, I enable the SSH daemon (ensure you have created a user!):
ifconfig_sis0="DHCP" ifconfig_sis2="inet 192.168.130.2 netmask 255.255.255.0 up" sshd_enable="YES"
fstab to something like (as appropriate for you – I have a single root filesystem and a swap partition):
# Device Mountpoint FStype Options Dump Pass# /dev/ad0s1b none swap sw 0 0 /dev/ad0s1a / ufs rw 1 1
/etc/ttys by editing the ttyu0 line:
ttyu0 "/usr/libexec/getty std.9600" vt100 on secure
/boot/loader.conf:
comconsole_speed="9600" console="comconsole"
Now, pop the CF card back into the Soekris box and boot with the serial console attached (19200,8,n,1). I immediately changed the Soekris console speed to 9600 so that it works seemlessly from Soekris BIOS to FreeBSD bootloader, kernel and console.
1. VirtualBox is a fantastic piece of software. I run Kubuntu natively on my laptop and I have a virtual Windows 7 Professional machine running in VirtualBox most of the time. It runs smoothly and quickly and there is a wonderful feature to allow you to attach USB devices to the virtual machine (so my iPhone can access iTunes for example).
(December 08, 2009 11:53 AM)
It’s been a while since I wrote anything vaguely technical. I guess it’s because I like to write only when there’s something new to say, and usually only if I have some new code to give away.
No new code today, but I can describe the recent work on php.ie (I’m the secretary of the Irish PHP Users’ Group).
So firstly, it was basically a static/brochure site for about a year, until we installed WebME (written by me!) as the CMS and created a skin for it so there’s only a tiny design difference. If you want to try out WebME, then download the SVN version from the google code site, or create a test site here (uses a really old version of WebME – you’re better off using the SVN version).
Then, I started rewriting the right panel. Beforehand, it displayed recent twitter messages, but they’re not often put out so it was a bit of a wasted space.
The panel now uses a WebME widget which displays recent Twitter messages, emails from the mailing list, and posts from the forum.
Over the next few days, I’ll be adding a new News section to the site, and the message widget will be able to show new articles from planet php.ie and new jobs from the jobs page.
I’m currently reading through Ken’s linux.ie todo list to see what I can appropriate for php.ie for its ongoing development.
Big thanks go to Michele and the team at blacknight for hosting the site.
Oh! Just a reminder, buy my book! JQuery 1.3 with PHP – hasn’t been reviewed by anyone yet, as far as I know, but my own opinion is that it is worth having on your shelf if you are a PHP developer that wants to step into jQuery.
(December 07, 2009 09:49 PM)
A round up of a few videos and photos of the flooding in Cork last month.
Panciostela drove from Victoria Cross up the Carrigrohane Straight to Windsor Motors and posted 3 videos along the way, shooting the flood in the Kingsley Hotel last. Any vehicles in the underground carpark there must have been completely destroyed.
Lots of photos on Flickr and pix.ie (floods around the country), there’s even a Submerged Cork Flickr Group. Brian Clayton posted some outstanding photos of the floods on his blog.
Thanks to Margaret Jordan where I saw one of the videos above and prompted me to post this.
Links: Will has blogged about the various fundraising activities for the people displaced and affected by the floods, West Cork Wash out!, Flood in Cork, North Main Street.
I forgot to say, I was in town on Saturday and there was hardly any sign of the flood and the city was very busy!
Related Posts
(December 07, 2009 10:42 AM)
(December 07, 2009 06:11 AM)
(December 03, 2009 06:12 AM)
Powered by Planet!
Last updated: March 10, 2010 09:05 AM