All posts by Alistair Lattimore

About Alistair Lattimore

My name is Alistair Lattimore, I'm in my very early 30's and live on the sunny Gold Coast in Australia. I married my high school sweet heart & we've been together for longer than I can remember. Claire and I started our family in September 2008 when Hugo was born and added a gorgeous little girl named Evie in May 2010. You can find me online in the typical hangouts, Google+, Twitter & facebook. .

Farewell Gizmo

Gizmo, the Lattimore family pet.One day about in about 1990, my cousin Rachel turned up at my place with a tiny golden Pomeranian cross Corgi puppy. From memory, mum & dad were not that pleased about the situation since they had no notice what so ever! None the less, the cute fluffy puppy soon became part of the family.

I don’t recall who named her, however she got her name “Gizmo” from the 1984 movie Gremlins. When Gizmo was still very tiny, she hadn’t grown quite into her ears yet. As such, when she was on her back – her ears deflopped and sat up nicely, she looked very cute.

Gizmo, one of the lead characters out of the 1984 Gremlins movie.As she was growing up, she was the most beautifully natured dog. About the only problem we ever had with her in that regard was that, at times, she could be a little snappy around little kids. She would never really bite, however if they were patting her too hard or doing something to annoy her – she’d give a little snap in their direction and it soon brought the kids back inline. One of my clearest memories of Gizmo happened regularly in the evening when George (read: Dad) would return home from work. As soon as Dad made any noise as he was pulling into the driveway, Gizmo would bolt flat out from one end of the house to the other. She would arrive at her destination with gusto and excitement, tail wagging furiously just begging to get a pat! Unfortunately, as she was growing up her excitement often got the better of her bladder and she would piddle near the door!

Gizmo also loved riding in cars. Our family owns an old Ford Falcon ute which we restored many moons ago. It doesn’t get used for a lot of stuff these days, mostly heading out to the dump and for convenience. Since it was an old ute, it had a very distinctive sound to the engine and exhaust; Gizmo knew it well. As soon as we’d turn it over, she’d be normally be there in a snap hoping she could come for a drive. She’d sit on the parcel shelf, and stick her head out the window in the wind, she loved it. For those uninitiated, the parcel shelf is the small shelf that is at about shoulder height when sitting in a ute and is immediately behind the seats.

In the last few years, Gizmo’s health has been quietly deteriorating. She has been nearly totally deaf for the last two years and as old age set in, her general mobility has decreased too. In the last year, that has since become more of an issue as her arthritis started to really hinder her movement. Getting up and down steps had become difficult and you could see her back hips and legs had become a little weak. Its really sad to see your family pet get old and its a shame that we outlast them I think, but it is just part of the life cycle.

I’d prefer to remember all of the great times she has brought our family and friends over the years. You’ll be missed Gizzy.

WordPress Plugin: Hicksdesign Style Archives

The Hicksdesign Style Archives plugin now has a permanent URL.

Looking for a better way of displaying your blog archive list than a list of links to your monthly archive pages? There are many ways to display an archive list of posts, most common is a series of links to your ‘monthly archive’ pages. While perfectly functional, it just wasn’t working for me.

After looking around, I really liked the way that Jon Hicks displays his blog archive list. Using Jon’s method gives a little more substance to an otherwise fairly sparse page and the post titles break up the page nicely with their varying length.

Usage

  1. Download arl_hicksdesign_archives.zip
  2. Unzip the file locally
  3. Upload arl_hicksdesign_archives.php into your plugins folder (normally: /wp-content/plugins/)
  4. Enable the plugin via your administration console
  5. Edit your appropriate WordPress template file and add a call to arl_hicksdesign_archives()

Download

Zip: arl_hicksdesign_archives.zip
Source: arl_hicksdesign_archives.phps

ChangeSet

  • 2006-05-01:
    • Implemented get_permalink() to fix bug
    • Implemented get_month_link() to fix potential bug
  • 2006-04-29: Fixed spelling mistake in plugin name, arl_hicksdesign_archives().
  • 2006-04-26: Initial release.

Upcoming WordPress Plugin Releases

Quite regularly I attempt to do something in WordPress, which I can’t find a simple way to achieve through the use of the Templating Tags. When this happens, I usually whip up a very simple plugin – which in most cases is just a simple function I can then reuse somewhere else.

In the coming days, I’ll be releasing some of the plugins I’ve written. A few of them had previously been written, however I reinvented the wheel so I could gain an understanding of how the WordPress works on the inside.

Currently slated for release:

The plugins should be considered in beta, as I spent as little time on them as required to get the job done. That being said, they are enabed and have been running here error free for quite some time.

Ragdoll Retriever

Since you are all familiar with Princess now, I’m going to reveal a new talent that she has developed in the last fortnight – retrieving! Yes, you are thinking of the right thing – just like the Labrador Golden Retriever.

We first noticed it when she found a pink peg in our laundry basket and was having a merry old time playing with it on the tiles. When she finished batting it around on the tiles, we’d pick it up and throw it again; at which point she would chase and subsequently play with it again. Soon enough, we’d throw it and she’d play with it and started bring it back to our general vicinity.

The video below was taken not long after we found out about this new skill, so the second retrieval is a little sketchy. We now play fetch with Princess regularly and she loves it. She is now taking to initiating the game herself by finding her toy and bringing it to us so that we’ll throw it!

If you’re having trouble viewing it above, you can view it directly on YouTube at http://www.youtube.com/watch?v=iriOxbeoyIE.

More to come.

Oracle DECODE Function

The Oracle DECODE function provides similar functionality to an IF-THEN-ELSE statement. The general format for an Oracle DECODE function is:

DECODE(expression, value1, result1 [, valuen, resultn], [default])

In the above example, expression represents what you want to evaluate. The valueX fields represent what you would like expression evaluated against, while the resultX fields are the values you want substituted if a match is found.

Anything you can do with an Oracle DECODE function, you could just as easily achieve with an IF-THEN-ELSE block. You would normally use a DECODE function over the IF-THEN-ELSE when you have a simple comparison or you prefer the readability of a DECODE function.

As a practical example, consider the small block of data below which might represent a subset of data from a multi-user system.

userid username power
10 john 1
11 cameron 2
12 al 5
13 simon 4
14 lucas 0
15 sally 3

If you issued the following SQL statement against that data, you should expect the output below:

SELECT userid, username, DECODE(power, 1, 'Registered', 2, 'Trusted', 3, 'Moderator', 4, 'Author', 5, 'Administrator', 'Pleb') As status FROM Users;

userid username status
10 john Registered
11 cameron Trusted
12 al Administrator
13 simon Author
14 lucas Pleb
15 sally Moderator

The caveat of using the Oracle DECODE function is that the expression must evaluate to a single value. As such, you can not use an evaluation which has multiple possible values. In such a circumstance, you would need to find a way (read: algorithm) to make each possible value evaluate to a single value. By doing so however, you are removing the simplicity of the DECODE function and an IF-THEN-ELSE block would probably suit better.

Next time you’re going to reach for the trusty IF-THEN-ELSE block by default, consider using a DECODE function – in the right circumstances, it’ll make your SQL simpler.