Tuesday 1 December 2009

Using MySQL to retrieve substring from the middle of a string

In MySQL it's hard to grab part of a string out of the middle of a VARCHAR or other text-based field, especially if you don't know exactly how far into the string the text you want begins, and it's of variable length, so you don't know where it ends either. Here's a way to do it.

Tuesday 17 November 2009

Capturing screenshots on your Blackberry

****UPDATE September 16th 2011 - download link updated****

Ever since I first got a Blackberry I've been looking for a good way to capture screenshots of apps running on the device. Including, of course, our very own GyPSii. Now, thanks to Amit Agarwal's blog entry, I've found it.

Friday 25 September 2009

Vanishing formula bar in Mac Office Excel 2008

A couple of weeks ago my formula bar in Excel 2008 on my Mac just vanished into thin air - gone. I tried various remedies to get it to reappear, but none worked, including the obvious, turning on "formula bar" in the view menu. Eventually I managed to track down a Macrumors forum thread where someone had fixed the problem. Here's what you do:

- Close Excel and any other running Office apps
- In Finder, go to your home directory and then to /Library/Preferences/Microsoft/Office 2008/
- Delete the file called "Excel Toolbars"
- Restart Excel

This should restore the formula bar for you.

Thursday 6 August 2009

Getting MySQL running with PHP on a Mac

I've just been trying to get PHP and MySQL running with Apache on a Mac (PHP 5.2.8 and MySQL 5.1.33 running OS X 10.5.7). Somehow I kept running into the following error when trying to get a PHP script to connect to MySQL:

mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

Here's how I fixed it.

Monday 3 August 2009

How to configure an Airport on/off shortcut key on a Mac


****Update - 10th February 2010****
This worked well in Leopard, but I haven't got it to work since upgrading to Snow Leopard. Does anyone have a fix?

The Problem
One of the things which has always bugged me about my Mac is the lack of a shortcut key to turn the Airport WiFi on and off. At home I connect using WiFi and in the office I plug into a wired ethernet connection, so I wanted to be able to turn the Airport on or off with a shortcut key instead of having to use my fat fingers and the mouse to click on the fiddly little Airport symbol in the menu bar. Unfortunately, Apple didn't build an Airport shortcut key into OS X. I'd been looking for a solution to this problem for ages, and now I've finally got it worked out.