Windows-based PHP profiling with Xdebug and Kcachegrind

The last few weeks of development have driven me to adopt some old technologies from my C days. I've got PHP setup with a debugger (Xdebug and the buggy Komodo IDE) and a profiler (Kcachegrind) under Windows (WAMP Server). Today I optimised one tiny part of the DiSCO codebase:

Kcachegrind screenshot, before

IE CSS transparency bug

As part of my experimentation for Thinkope, I'm often setting opacity on divs and their containers. I've exposed this IE transparency bug which renders correctly in Firefox but cuts a hole out of the top div in Internet Explorer.

Snapshot demonstrating cut-out bug

SPAM, a measure of success

I've had to move from a Math Captcha to an image one as unfortunately this site started getting SPAM'd. It seems that those pseky robots can do rudimentary mathematics, but I'm hoping they can't yet read wobbly text! On the plus side some great (real) comments coming through too thank you.

Dropping MYSQL tables that contain FOREIGN KEYS

I was patching CiviCRM earlier on when I needed to flash the existing database with a new snapshot. The snapshot SQL performs a progressive sweep of the database, using sequential:

DROP IF EXISTS <table name>

The problem is that some tables contain explicit FOREIGN KEY references to others. When the referred to tables are dropped before the referring tables, that violates the foreign key constraint.

The solution is to ignore the constraints during the drop operation using:


Executing multiple programs with one single windows shortcut

An alternative title might be "How to write a simple batch file to make Google Calendar Sync run at the same time as Outlook".

Create a text file (.txt). Use this syntax:

rem Outlook
cd "C:\Program Files\Microsoft Office\Office12"
start "" "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" /recycle
rem Google Outlook sync
cd "C:\Program Files\Google\Google Calendar Sync"
start "" "C:\Program Files\Google\Google Calendar Sync\GoogleCalendarSync.exe"

svn+ssh, secure version control

I have a Mac Mini which I keep connected to the Internet. In this world of DoS attacks and port sniffing, exposing ports to the Internet at large is risky. Yesterday I turned off HTTP (80), which was being used to allow access to mod_dav_svn, and migrated my systems to SVN over SSH. This has the advantage of only requiring the server machine to expose SSH (22).

The setup was quite involved.

Creating panoramic images in Adobe Photoshop CS3

  1. Open the images as separate layers into one single canvas using File -< Scripts -< Load files into stack.
  2. Select then align the layers using Edit -> Auto-align layers. This process takes a while but it's pretty effective in yielding a rough canvas of overlapping warped images.
  3. There are often a few frames which Photoshop couldn't align. I'm currently trying to find a way to resolve this particular problem.
  4. Finally Select Edit -> Auto-Blend to produce the final image.

How to embed a really simple Flickr slideshow in a Drupal blog

Really simple process:
  • Upload photos to Flick
  • View photoset
  • Click 'Slideshow' in top right hand corner
  • In slideshow view, click 'Share'
  • Cut/copy 'embed' code
  • Paste into Drupal node
  • Select Input Format 'Full HTML', or whitelist the necessary object tags for one of your existing formats
Here's a demo of what it looks like: A wander around Austin, Texas

Good reason to call jQuery.width() and not jQuery.css('width')

I've been experimenting with Chrys Bader's AutoGrow plugin for jQuery. Great stuff and I used the principal (dummy div to read textarea's height) in Free Range Feedback.

I found a minor bug relating to the use of .css('width') instead of .width(). I filed a bug report if you'd like a more detailed explanation of why to use the latter over the former.

Automated 'solutions' are changing the social media landscape

When it becomes possible to automatically build a Twitter profile with 100,000 followers, is the value of the medium compromised?

I would suggest no, but perhaps we will stop putting sway in the number of followers a person has and instead assess them by the quality of their tweets. The instant you introduce a metric to measure the impact of anything, be it a web page's importance (PageRank) or a Twitter's relevance (Followers), people will subvert the system to their advantage.

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