The value of a good backup

I've got a 2TB Western Digital drive that's showing the early signs of failure. It corrupted a 1GB file the other day. The thing is that corruption could be caused by the NTFS driver (Tuxera NTFS for Mac), or even the media encoding software that produced the file (Handbrake). Only time will tell when either a second file is corrupted, or the drive entirely fails.

Firefox showing spinner indefinitely for HTML 5 (video.js) .ogg embed

One of my sites uses HTML 5 to show video on the homepage. The VfE embed worked fine in Safari/Chrome/IE but had stopped working in Firefox. It just left the loading spinner spinning indefinitely and refused to play. I tracked it down to the source=".../video.ogg" line.

Co-innovation in fridge stacking

One of the most exciting things I encounter in teams is co-innovation. I love being part of a group who are creating something together, something that no one person could do by themselves. Today I happened across a great example of co-innovation, in the field of fridge stacking.

Google Maps tile display bug for KML layers

I've encountered a problem with the Google Maps API, specifically with the KML layers on my Surfy Survey map. The KML-enhanced tiles occasionally fail to load and default back to the normal tiles. This produces a map that shows part of a heatmap, as the two images below illustrate. This behavior is non-deterministic.

array_walk snippet on php.net

I wrote a small explanation of a call-by-reference problem. Taken from php.net's array_walk description, it reads:

I wanted to walk an array and reverse map it into a second array. I decided to use array_walk because it should be faster than a reset,next loop or foreach(x as &$y) loop.


<?php
$output = array();
array_walk($input, 'gmapmark_reverse', $output);
//
function gmapmark_reverse(&$item, $index, &$target) {
$target[$item['form_key']] = $index;
}
?>

Can't test if a non-image file exists on a remote server

I've been messing around with javascript, trying to find out if a javascript file exists on a remote server before loading it. It turns out the same origin policy thwarts my ajax attempts and <img> tags can only test for images.

Vertical centering in CSS for content of unknown height

I read this excellent article on centering and as the comments are suspended, I thought I'd post about it instead.

I think the floater div position is inconsistent. In 'Which Method?' the floater is a closed tag above the content. In Method 3 the floater wraps the content.

Also a potential con for Method 3 is that you need to know the height of the content, where as you don't for Method 1.

I went with Method 1 as IE9 supports it, though for wider compatibility I should include the IEx hacks.

Interviewed by Engineering and Technology magazine

I did an interview for Caroline Elliott's article in the IET's Engineering and Technology magazine, entitled "Enterprising Careers". Really pleased with the quote:

Drupal code formatting for Zend Studio or Eclipse

This post started out about code formatting, but it's grown to include all my Eclipse setup.

History
Originally I built a PHP formatter in Zend Studio, but I had difficulties setting up the free Eclipse PDT with this config. I followed instructions at: http://drupal.org/node/75242, then tweaked some of the configuration. I pulled it into Eclipse (Juno), changed the XML paths and ignored the warnings, then resaved it out again from the wizard to get it in the right format.

Eclipse setup

PHP development IDEs and why you should have one

I've been doing a lot of development in PHP recently. I started programming in C/Codeworks, but it wasn't until I did some work in OpenCV and Visual Studio that I started seeing the value of IDEs. Having a good debugger is essential to resolving bugs in a timely manner. While it's possible to integrate a text editor, profiler and version control system with a debugger, it takes time to setup and maintain this tool chain, time that I'd rather pay someone else to spend.


Alex Stanhope is a Technology consultant to the UK Creative Industries and Venture Catalyst. This is my personal website.
Bristol | Lightenna | ManKind Project | goodkarma
All material copyright (c) 2006-2010 | Website by Lightenna, featuring N.Design's GlossyBlue theme.
Syndicate content Syndicate content