Police Brutality in Barcelona

If you’ve been watching the news you probably missed the bit about the protests in Spain recently. I certainly haven’t heard anything about them on Irish radio stations and among those I follow on Twitter only Allan Cavanagh seems to be talking about it. Spanish TV stations aren’t talking about it either apparently:

Meanwhile, Barcelona TV has a cooking show; TV1 is covering an actress with depression; TV3 (Catalan) discussing bass guitars. #acampadabcn

He linked to a very distressing video showing Police brutality against unarmed protesters in Barcelona. Unfortunately (or thankfully depending on how sensitive you are to violence) I can’t embed it here.

I remember years ago a Spanish friend warning me that the Police there weren’t to be messed with, and she was only referring to traffic police.

THIS IS BARCELONA. THIS IS IN SPAIN WHERE YOU WENT ON HOLIDAY. WHAT THE HELL?

Howto: Build a contact form with a Polldaddy survey

I just added a contact form to the about page here using a Polldaddy survey. While it’s not as straight forward as installing a plugin to do the job, I think it’s worth doing because it touches on all aspects of Polldaddy survey creation. After you’ve created this contact form on your own blog you’ll know how to create a Polldaddy survey, a custom style sheet and how to change the language in the form too. It’s very flexible.

Here’s how I did it.

  1. Login to Polldaddy and on the dashboard create a new survey for your contact form.
  2. Give your form a descriptive name and select the custom stylesheet. You’ll have to create a new one. I use the WordPress 2010 theme so I based my stylesheet on the Plain White theme. Changes are minor, mainly to accommodate width and font size. Grab the css file here and copy it into your style.
  3. Now on to the questions. I created a simple Name, Email and Comment form.
  4. You need to tell the survey where to send responses. After saving, go to Reports->Data and scroll down to the Email Notifications where you can fill in your details. You can also subscribe to an rss feed or send responses to a HTTP URL.

  5. To embed the form in your website use the embed popup and choose “Website Inline”. The iframe code should be copied into the new page that will hold your contact form.

  6. You’ll have a form that looks like this.

  7. You’re not finished yet though. Submit the form and you’ll see the message, “Survey Completed”. That’s not exactly appropriate for a contact form is it? Go to the languages page and create a new Survey Pack. You can change just about every bit of text displayed in the form here. After you’ve saved the language pack go back to the edit survey page and select the correct language pack:
  8. The one final job to do is to adjust the iframe size. I made each field of the form mandatory but that raises errors when you submit an empty form. Those errors make the form longer than the default and the iframe is too small to hold it. I bumped the height to 900 pixels and no more ugly scrollbars! There’s more empty whitespace below the form but my contact form is at the end of the page so I don’t mind.

You could also use the Javascript embed method, but that loads the survey form in a css popup window. I prefer the iframe method.

As you can see, Polldaddy surveys are incredibly flexible and offer a lot of customization options. I work on Polldaddy code every day so of course I’ll say this but I’d have no hesitation in recommending the service to anyone needing polls, surveys, quizzes or ratings. Create a free account and give it a spin!

Moriarty Tribunal in Text

The Moriarty Tribunal cost the Irish tax payer more than 100 million Euro and all we got was a 2,400 page protected PDF.

If you view the report’s PDF files you won’t be able to quote from it by selecting and copying text. You’ll have to manually type out anything you want to extract because the files are protected.

Value for money eh? Anyway, I ran the pdf files through the tool “pdftotext” and came up with m1.txt and m2.txt.
Use the original PDF files to read the report but for your convenience these text files will be much easier to quote from.

Please don’t link directly to them, mirror them on your own site if you write about them!

Here’s a Wordle tag cloud of the findings created by Jamie Lawrence.

Amazon Appstore opens in North America

The Amazon Appstore for Android opened today and apparently Apple are already suing them for confusing consumers with a name similar to their App Store.

I wouldn’t really know because after downloading the Appstore app (beautifully simple procedure: click a link in an email/text to a .apk file) and logging into Amazon it refused to let me download the exclusive Angry Birds Rio game.

The Amazon Appstore for Android is not yet available in your region

Good thing I’m sick of Angry Birds, but it’d be nice if it worked over here too!

Spacelog: Apollo 13

From the Apollo 13 Spacelog transcript. Good thing nobody had to get out and push. (via)

Jack Swigert (CMP): Okay, Joe. I’ll tell you, I’m just trying to figure out where we are here.
…..
Joe Kerwin (CAPCOM): Roger, Jack. We see that. Of course, there’s a lot of cloudcover and you see it more clearly than we do, but it does look like the Earth, not the Moon.

Filed under travel because, well, you can’t travel much further than the moon and back. Right?

WP Super Cache 0.9.9.8

WP Super Cache is a full page caching plugin for WordPress that makes your website run much faster!

Version 0.9.9.8 has been released and has a number of bug fixes and changes including:

  1. CDN updates: it can be switched off. Multiple CNAMEs can be used for serving static content to improve performance.
  2. Uninstall process improved. Files that the plugin creates are removed, and the wp-config.php and .htaccess files are fixed. If the plugin can’t do any of these steps it will display a message explaining what to do.
  3. Cached dynamic pages can now be stored in Supercache files and compressed. No need to use legacy caching any more.
  4. 1and1 Webhosting fix. They use “/kunden/” in some of their paths but not others.
  5. I removed the “log by email” functionality as it caused problems for users who were inundated by email.
  6. Many more minor fixes and changes.

The old uninstall process has been completely revamped. Now all you need to do is deactivate it on the plugins page. It will then remove wp-cache-config.php and advanced-cache.php. It will also remove the extra code it added to wp-config.php and the .htaccess file. On the off chance it can’t remove those files it will print a helpful message asking you to fix the problem. Unfortunately this class of plugin (full page caching plugins) are by design more complicated than regular plugins and are more invasive.

Got a problem with the plugin? Use the support forum please. Support queries posted here may be ignored or deleted.

Reverse Engineering the MOS 6502

This is the first part of a great presentation given by Michael Steil at 27C3 last year. The 6502 was the CPU used on many 8 bit computers of the eighties like the Commodore 64, Apple I and II and NES.

It’s an hour long presentation split into 6 parts, I’ve only watched the part above but it brings me back 20 years when I used to code in assembler using an Action Replay cartridge on my C64.

Check out this post for the rest of the presentation. I’ll be watching them later tonight.

cSprites for PHP 5.3.1/2

Joost posted a great article on reducing http requests on WordPress sites recently and one comment caught my attention. Nabil mentioned cSprites. It’s a WordPress plugin that merges the images in your posts into one file and uses CSS to position the single merged file in place of the original images. Here’s a good post explaining how this technique works.

Unfortunately it hasn’t been updated in over a year, and the current version doesn’t work if you have PHP 5.3.2 (and probably 5.3.1) as it trips over this PHP bug. The fix is simple, get rid of call_user_func_array() and call the functions directly.

I had it installed here and it worked well enough but not perfectly. Here’s the post I made on the plugin’s support forum if anyone’s interested.

I don’t think the author will update the plugin again and in fact he’s looking for someone else to take over. Anyone?

The plugin has been running on my photoblog for the last hour ago and I haven’t noticed any problems yet. As a bonus, it also stops people right clicking and stealing saving my photos for their own use. I’ve since removed it as visitors were only seeing blank images. Oh well.

So, want to give a “fixed version” a go? Grab csprites-for-wordpress.zip and install it in the usual way. Support queries should be directed towards the plugin support forum. 😉

Oh yeah, there’s also the SpriteMe bookmarklet if you don’t want to go fiddling with WordPress plugins!

Better uninstall for Supercache and other things

I need your help. Go grab the development version of WP Super Cache off the download page and give it a whirl. I’m working on making the uninstall process less painful than it is in the current release.

I added an action on the deactivate hook for the plugin so when you deactivate it on the Plugins page it deletes the files the plugin created and removes the WP_CACHE definition from wp-config.php. It doesn’t yet remove the mod_rewrite rules from the .htaccess file though. Sometimes people put the WordPress rules in the same block of that file so removing the rules would stop the site serving requests! I will of course gladly accept code patches to do that job.

No more messing with uninstall.php now, just deactivate on your plugins page.

Besides that, the CDN page has an on/off switch and can use multiple hostnames now. The cache can be cleared when caching is disabled and dynamic pages can be served by using PHP mode rather than the slower “legacy mode”.

There are also numerous bug fixes so if you have a development site and a few minutes to spare why not give this a go? Please?