Brain Dump

Thoughts on my latest research, recently discovered tricks and so on.
Flash, PHP, MySQL, Linux and all things Internet.

My new game, Concentrika now on iTunes app store
Wednesday, August 04, 2010

My new game Concentrika hit the iTunes store yesterday and is selling well!

Make your work day mornings a little easier with OS X and Automator
Monday, July 19, 2010

When I find myself doing anything repetitive, I usually question whether there is a way to automate in order to save time and get onto more interesting things.

I generally find these days, that computers are awesome for what you pay for them. That has led me to be less accepting of waiting for computers to complete a task. A few people have called me a power user. I think they just mean I'm pretty quick to get around my computer and my programs because I've learned and use as many keyboard shortcuts as possible and generally use efficient techniques to be more productive and less bored! Here's something new I started doing recently to save time and I love it. Here's what I found was happening every morning:

I get in, I turn on my computer, I wait for it to start up, I log in (from the OS X users screen), I wait for my dock to show up, then I start opening all the programs I'll need for the job I'm working on. For one job that might include, Email, Flash Builder, Adium, Skype, Things, and Flash CS5. For another job it might include Titanium, Coda, Adium, Skype and Photoshop. Sometimes after clicking one or two apps, the dock becomes unresponsive for a time so I have to wait a bit before I can click the next app. Multiply this by the number of apps and you have some annoying wait time between app launching plus the app launch time itself. Wouldn't it be better to go grab a coffee, fill up your BPA-free water bottle or go to the bathroom?

Solution: Use Automator to create a job launcher.

Create a folder called "job launchers", drag that folder into your dock. Right click it and select Display as Stack. Open Automator (use spotlight to search for it). Search in Automator's spotlight field for 'launch'. Drag the item in the middle column, 'Launch Application' to the right. Choose your app from the list. If it doesn't appear, choose Other and go find it. Drag another item below the first and repeat. For some reason Automator gets stuck when it launches Flash Builder (Eclipse), so I just make that the last app to launch in my list. Save this workflow inside the job launchers folder you created as an Application (not workflow). You might want to name it after the job or type of job you're working on, such as Flash application.

In the future, if you ever want to modify your app launch list, drag the application from the Finder (not the dock onto the Automator icon).

Now, click the job launchers folder in your dock. The job app should appear with an Automator icon. When you click it, it should launch all of the applications in your list while.

Remember a watched pot never boils so go and take a break while your computer does your first task of the day for you!

We’re in The Future | A Perspective on Living with Technology
Monday, March 29, 2010

Click here to read the post

Regular Expressions 101 for Designers, content managers and other non-programmers
Thursday, March 25, 2010

Most programmers know what Regular Expressions (aka REGEX) are for. In my experience, few non-programmers do though. While programmers might find REGEX useful more frequently and extensively, I often think when I use them how I'm saving myself time on tasks that aren't specific to programming. I think about how Designers who are managing larger amounts of HTML text or plain text content are probably doing some tedious work-arounds when they could be using REGEX instead.

I recently tried to explain the usefulness of REGEX to a friend of mine who is a graphic designer, who also get into coding HTML content. She didn't really get it and I didn't really explain it right either. Today I had a task to do where REGEX came in handy and I noticed that it was a more simple example that everyone should be able to relate to.

Regular Expressions, which are often referred to as REGEX, are essentially a fancy and more powerful way of searching text. It can also be a fancy and more powerful way of doing search and replace of text. Everyone needs to do that at some point, not just programmers. In fact, it was a designer who introduced REGEX to me about 10 years ago when I was a graphic designer myself (these days I'm primarily a developer).

Here's the task I wanted to perform today:
I have a tonne of text in a document. The text has dashes in it here and there. It has lots of phone numbers too. The phone numbers were all written with dots, like 604.123.4567 but I wanted to change the format to use dashes like, 604-123-4567. So, using REGEX in my favourite text editor, I search for this:

([0-9]{3})\.([0-9]{3})\.([0-9]{4})

and replace with this:
\1-\2-\3


The round brackets denote groups of the search. So, ([0-9]{3}) is one group.

The dot character in REGEX has special meaning but in this search I just mean a regular old dot character, so I escape it with a slash. We must write . as \. to help the REGEX interpreter know that the dot is just a plain dot with no programmatic meaning in this particular search.

The [0-9] part means look for numbers in that range. The {3} is related to the square brackets part before it and means that we're looking for exactly three of them (numbers in this case). Thus the search for a phone number is made up of these components:


  • a group of three numbers (this is our first search group)

  • a dot

  • another group of three numbers (this is our second search group)

  • a dot

  • a final group of four numbers (this is our third search group)



In the replace part, \1 means put whatever was found in the first group in place of \1, \2 in the second group, \3 in the third group and so on for as many groups as we searched for (we only had three groups in this search).

Regex can do simple things like this or very complex patterns like thorough email address validation:

^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$

When I was getting started with REGEX I found it helpful to refer to a cheat sheet. There are so many, you had best take your pick.

Regex can get very complex as I say, so if you're trying to write a search pattern that you're having trouble getting right, try googling forums for terms like, "regex email address" or "regex visa number". Those examples are patterns that have already been solved so you should try and find them online before reinventing the wheel.

Many text editors can do REGEX searches. Its usually a checkbox in the Find dialog to tell the text editor that you want to search in REGEX mode. Here are a couple free ones to get you started:

Windows: Notepad++
OS X: TextWrangler

How to develop iTunes Extras
Wednesday, November 18, 2009

Well that's what I googled for and while I didn't find specifics I did find quite an interesting read with some insight into my query.

Skype for iPhone and iPod touch now available in Canada
Thursday, September 10, 2009

I heard about it on the news yesterday and dowloaded Skype for free to my iPhone. It works beautifully and has a nice interface that seems to cover everything.

Web 2.0
Tuesday, August 04, 2009

Some people love this term, others hate it. The general reason that it is disliked is that communicating about it is problematic. There is a lack of consensus on the definition. For one thing, there never was a Web 1.0. The Internet is an organic medium that is not controlled by any body that is able to draw a clear line between 'versions'. The best definition you find will probably talk about how Web 2.0 is more application like, or community-centric. If you want to communicate clearly, without ambiguity to someone about something you are looking for in a site or something you want to build that is in your mind Web 2.0, you are better off being specific about the types of functionality you are interested in. These may include terms such as user
membership, connecting people to one another, rating content, cool functionality where the whole page doesn't need to refresh etc. That doesn't sound like such a big compromise does it? It just may save your bacon if someone expects something different after you tell them you want "Web 2.0".