Duncan’s blog

August 31, 2008

How not to do error messages – Flickr

Filed under: Web — duncan @ 6:35 pm
Tags: , , , ,

Added a photo to Flickr. Clicked the ‘Send To Group’ button. Saw the following helpful error:

Flickr error message

Instead of dumping out raw XML to a Javascript alert, this might have been more useful if they’d actually output just the msg value from the err element, and ideally into the page rather than a modal dialog box.

August 30, 2008

ASP.NET gets no Respect; does Coldfusion?

Filed under: Coldfusion — duncan @ 8:44 pm
Tags: , , , ,

Read this interesting post on Rick Stahl’s blog: ASP.NET gets no Respect. Basically looking at some of the reasons why ASP.NET isn’t considered as highly as say the LAMP stack. I thought it might be interesting to see if the same reasons apply to Coldfusion. We occasionally see articles about the death of Coldfusion, but rumours of its demise are greatly exaggerated. However I think Coldfusion has the same battle against the perceived coolness of PHP, Python, Ruby on Rails etc.

I’ve just taken Rick’s sub-headings and reworded them to be CF-specific where relevant. I’m going to keep this fairly brief, but please feel free to comment at length!

Competing with Free

This is probably an even bigger problem for Coldfusion than it is for ASP.Net, simply because of the relatively high initial cost. Sure, us CF developers know the overall cost will be lower due to speed of development, but that’s rarely considered.

Barrier of Entry

This sort of crosses over with the above; the high initial cost is the big barrier. It will be harder to find free or cheap hosting companies offering good Coldfusion hosting.

Learning Curve

Not applicable. CFML probably has the lowest learning curve of any server-side web development language that I’m aware of.

Coldfusion is a Different Web Metaphor

Not applicable. Coldfusion lends itself to being picked up quickly by anyone who knows HTML and has a basic understanding of programming constructs.

The Loss of Cool

This is definitely a problem. Coldfusion, being really the oldest surviving web application server, is frequently referred to in disparaging terms by people who maybe used it last in the 1990s, unaware it’s moved on a lot since then. And most of the cool sites are definitely being done in PHP and Python. In part I think this could be due to the bedroom-startup nature some of them have.

Possibly the open source release of Railo might help combat some of that.

Coldfusion has gone Stale

Apart from the occasional mistaken references to Coldfusion being dead, it’s not stale at all, with a new version released every 1-2 years.

Ajax – stuck in the Mud

With some of the Ajax features in CF 8, I think we’re not bad here. Also we integrate pretty well with Ajax stuff like jQuery, Flex etc.

Adobe Stigma

I’m not aware of there being one in the same way there is a Microsoft stigma.

Overall I think Coldfusion actually wins out on these points over ASP.NET. However it has its own failings and reasons for not getting the respect it sometimes deserves.

August 29, 2008

Where We Are

Filed under: Photos — duncan @ 9:23 pm
Tags: , , , , , ,


In 2007, The Lighthouse organised the Six Cities Design Festival. This “celebrated Scotland’s designers and the importance of design in our everyday lives“. As an off-shoot from that, they have produced a guidebook, “Where We Are: Design Guide to Scotland’s Six Cities“.

A while back I was contacted by The Lighthouse via Flickr, asking my permission to use a few of my photos in the book. I received a couple of copies of Where We Are through the post the other day, including all the photos I’d said they could use.

The book itself is quite nice, paperback journal size. It’s divided up into two parts. The first part goes through each Scottish city, following the same format:

  • a short essay about design in that city, by various authors
  • a categorised list of cool places in the city, e.g. nice cafes, shops, architecture, local design landmarks etc
  • street map of the city

The lists of places is pretty much on the mark, all good places that I’ve heard of or like the sound of.

Princes Street Gardens

The second part of the book is a profile of 15 different designers working in Scotland. These consist of a single page feature, an ink illustration of the designer(s), and a few pages of pictures of their work.  Designers featured include graphic designers Graven Images, textile designers Timorous Beasties, illustrator Nigel Peake and computer games developer Realtime Worlds.

The book uses photos from Flickr throughout, which is a nice idea. I assume this kept their costs down. It also means it is full of interesting photos of a variety of styles and standards. I don’t think the three photos of mine they selected were necessarily great photos even by my own standards, and I’m sure they could have found better photos of some of the locations. Maybe the difference was I use a Creative Commons licence on all my photos.

Silver Darling seafood restaurant

The book is launched September 3, and should be in shops soon after (although it’s not listed on Amazon yet).  From their press release:

Where We Are features the people and places that are creating Scotland’s new design landscape. Introductions to fifteen of our best designers reflect the increasing success of designers who choose to live their lives and build their design businesses in Scotland. These are accompanied by contributions from design-conscious locals, who know their cities inside out, telling you the unique places to visit, sleep, eat and shop.

The guidebook focuses on design and architecture alongside the strengths and successes of the Six Cities Design Festival 2007. Created as a practical legacy document, the book promotes the work of the best of Scotland’s designers through a series of insightful essays and photography. It includes opinion pieces on current design issues, profiles of the most original and inventive Scottish designers, full city listings of where to go and what to do alongside detailed maps.

Agacan

Designed by Marque Creative the book is a beautiful example of what Scottish graphic design companies can produce. Specially commissioned illustrations are included alongside a series of photographs that have been specially sourced and selected from Flickr. These create visual portraits of the cities illustrating the listings which have all been compiled from recommendations received from architecture and design aware citizens creating diverse and personalised selections.

Will code for food

Filed under: Funny, Web — duncan @ 7:39 am
Tags: , , , ,

This is so true:

As spotted on Derek Perez’s blog originally.

August 28, 2008

Browser detection still sucky

Well, just after being surprised by some Browser detection preventing me using a travel insurance site with Firefox, I stumbled across another example in the same week. I’ve just upgraded to Firefox 3; I know I’m a bit slow off the mark here, but unlike many who work in IT, I don’t usually classify as an early adopter. Anyway it seems pretty good, and faster than Firefox 2.

Went to access the Traveline Scotland Journey Planner, which is an indispensable but imperfect tool for finding bus and train times. Greeted with this strange warning:

I could just downgrade to Firefox 1.5 (superseded by 1.6 in February 2004) or Internet Explorer 6 (superseded by IE 7 in October 2006). Or maybe Traveline Scotland could just review their browser support.

August 27, 2008

Browser detection sucks

Not seen one of these for a while:

AllClear browser detection page

I was looking online for travel insurance, and at one point looked at allcleartravel.co.uk. Except their site didn’t like the fact I was using Firefox. Installed Chris Pederick’s User Agent Switcher Firefox extension to get around it and see why/how they were doing this. (Incidentally, did you know Chris Pederick also wrote the invaluable Web Developer extension? If you do any web development work at all, it’s essential). Here’s the simple bit of script they’re using to get rid of 20% or so of their potential customers.

<!-- FF detection script -->

if(navigator.userAgent.indexOf("Firefox") != -1)
{
   window.location = "http://www.allcleartravel.co.uk/images/alc/alc_firefox.html";
}

Their site certainly uses a lot of Javascript but I couldn’t see anything that would obviously give Firefox a problem. Although when clicking the ‘Get a Quote’ button, it takes forever and then ends up redirecting to a blank screen at https://www.allcleartravel.co.uk.

August 22, 2008

Holiday reading

Filed under: Books — duncan @ 9:38 pm
Tags: , , , , , ,

So I’m off on holiday soon, and need to buy myself a good book. Something to read on the plane and beach when I’m not amusing myself with other diversions. Nothing too big or demanding – I realised recently that I don’t enjoy reading books of 600+ pages. I devote so much time to them, and usually they’re not the greatest book; but by the time I’ve realised that I’m more than half-way through and don’t want to quit, just for the sake of not quitting, not because I’m enjoying the book so much.

I had a couple of ideas of what I could buy:

1984
obey_1984.jpg
Originally uploaded by radeondt

1984 by George Orwell. I’ve already got a copy of this, albeit in a large unwieldy hardback format. This paperback would be a bit handier. It’s one of my favourite novels, and I love the cover design by Shephard Fairey.

There’s a bit of discussion worth reading on the Penguin blogs about this new edition of 1984 and Orwell. From that I found this interesting article about Shephard Fairey’s plagiarism.

Did you know there’s now a George Orwell blog, re-publishing his diary entries? So far it’s mostly about country life, but I’m hoping it’ll pick up in time.

The other book I am thinking about for holiday is World War Z: An Oral History of the Zombie War. I bought a copy of this for a friend’s christmas present a year or two ago, and thought it looked pretty good. Not the sort of thing I’d usually read though.

Year 2, Day 10: Not now, I’m reading!
Originally uploaded by PunkJr

Apart from that, no really strong ideas. Maybe A Scanner Darkly by Philip K. Dick. I’ve read a few of his other novels and enjoyed them, and I’ve got the film on DVD.

Any suggestions? What have you been reading, or can you recommend any ‘must-read’ books? Here’s the last few books I’ve read recently:

August 21, 2008

Cartesian join versus ListAppend

Filed under: Coldfusion — duncan @ 7:29 pm
Tags: , , ,

Over on Ray Camden’s blog there was a recent discussion about the best way to “create a list of all possible combinations” if you have two lists you want to join together. e.g. you have a list of colours and a list of sizes, and you want to get all possible combinations of colours and sizes.

Ray used a simple nested loop with ListAppend to generate a new list. I thought maybe it would be even simpler just to do a cartesian join on the options.

Gary Funk rightly pointed out this wasn’t necessarily a great idea:

Should I mention that it is bad form to use a cartesian join in production. If you have 100 items in table A and 100 items in table B, you just returned 10,000 records. I’ve never met a DBA that that allows a cartesian join, except in testing.

I’d read a great post recently on the Aliaspooryorik blog comparing string concatenation methods for performance. ListAppend was always the slowest method. Remembering that, I thought there’s no way Ray’s method could be any better than a cartesian join for Gary’s theoretical 10000 rows.

Here’s the code I used to test that (using the exact same methodology as Aliaspooryorik).

<!--- try a long list: --->
<cfset colorList = "">
<cfset sizeList = "">
<cfloop index="i" from="1" to="100">
	<cfset colorList = ListAppend(colorList, "color#i#")>
	<cfset sizeList = ListAppend(colorList, "size#i#")>
</cfloop>

<!--- ListAppend --->
<cfset startTime = getTickCount()>

<cfset comboList = "">
<cfloop index="c" list="#colorList#">
	<cfloop index="s" list="#sizeList#">
		<cfset comboList = listAppend(comboList, c & " " & s)>
	</cfloop>
</cfloop>

<cfset endTime = getTickCount()>
<cfoutput>
	ListAppend : #endTime-startTime#ms<br>
</cfoutput>

<!--- use a query --->
<cfset startTime = getTickCount()>

<cfset Colours = QueryNew("colour")>
<cfset QueryAddRow(Colours, ListLen(colorList))>
<cfloop index="i" from="1" to="#ListLen(colorList)#">
	<cfset QuerySetCell(Colours, "colour", ListGetAt(colorList, i))>
</cfloop>

<cfset Sizes = QueryNew("size")>
<cfset QueryAddRow(Sizes, ListLen(sizeList))>
<cfloop index="i" from="1" to="#ListLen(sizeList)#">
	<cfset QuerySetCell(Sizes, "size", ListGetAt(sizeList, i))>
</cfloop>

<cfset endTime = getTickCount()>
<cfoutput>
	Generate Queries : #endTime-startTime#ms<br>
</cfoutput>

<!--- Query of Queries --->
<cfset startTime = getTickCount()>

<cfquery name="CartesianJoin" dbtype="query">
	SELECT Colour, Size
	FROM Colours, Sizes
</cfquery>

<cfset endTime = getTickCount()>
<cfoutput>
	Query of Queries : #endTime-startTime#ms<br>
</cfoutput>

Of course, I’m not using a real query to the database in this example, just creating it with the QueryNew function. I split the time out from creating my two original query objects, as normally you wouldn’t do this, you’d just run the second query. So overall the execution time for my method is probably a bit off what it might be in production. However the real eye opener is the slowness of ListAppend. I suspect if Ray amended his code to use ArrayAppend, it would be very quick over large numbers of rows.

The time I got back first time I ran this (on CFMX 7) was
ListAppend : 30703ms
Query of Queries : 172ms
And this was typical of timing for subsequent runs. Your mileage may vary.

August 18, 2008

Push ups, fitness and motivation

Filed under: Uncategorized — duncan @ 7:00 am
Tags: , , , ,

I started going to the gym again at the start of July, after a lapse of over two years. One thing I decided to do differently from the outset was to use the web to record my progress in some way. After checking a few similar sites out, I signed up with Gyminee. There seems to be three main aspects to this site:

  1. Record your weight
  2. Record your diet
  3. Record your workouts

I don’t need to lose or gain any weight, so only the third option is really of any interest to me. It seems to have a wide range of exercises available to choose from, with some video clips showing how most of them are done. If it doesn’t have a particular exercise, I think you can add your own.

Then after about a month of going to the gym, I read articles on Lifehacker and also the New York Times about doing push ups. From there I ended up checking out the one hundred push ups programme. That site just tells you how many to do, it doesn’t have any way of registering to track your progress. I could just have used the Gyminee site, but instead I registered at GiveMe27, a site which does one thing and does it well – lets you record the number of push ups you do each day.

I’m not convinced the one hundred push ups programme has helped me massively. I started out being able to do 100 push ups in one set, and I haven’t really progressed beyond that. Some days I do much more than 100, just in multiple sets of smaller repetitions. so in that respect I’m doing a lot more push ups than I would have otherwise. As I could already do 100, I set myself a goal of either doing 150 or 200 by the end of the programme. I also decided to do it every day, instead of every second day. Possibly not giving myself rest days wasn’t a good idea. I’ve effectively finished the 100 push ups programme, but haven’t yet achieved 150 in a set. So I’m going to just do my own thing on the push ups for a while; instead of lots of sets of 15 – 25 repetitions, I’m going to do just a few sets, maxing out the repetitions each time.

And finally, I setup goals on Joe’s Goals for going to the gym and doing push ups. This is a nice Coldfusion-powered site for recording goals, both positive and negative. For instance if you were trying to lose weight, you could have a positive goal of going to the gym, and a negative goal of eating chocolate. The idea being you’d have lots of ticks for your positive goals and not so many crosses for your negatives. If you’ve read the Lifehacker article Jerry Seinfeld’s Productivity Secret, then Joe’s Goals is a perfect web app for following Seinfeld’s advice:

"After a few days you’ll have a chain. Just keep at it and the chain will grow longer every day. You’ll like seeing that chain, especially when you get a few weeks under your belt. Your only job next is to not break the chain."

August 17, 2008

Man on Wire review

Filed under: Film — duncan @ 12:11 am
Tags: , , , ,

I went to see Man on Wire at the cinema on Saturday. It’s a documentary about Philippe Petit, who in 1974 walked between the Twin Towers on a tightrope. It’s done with a combination of interviews with Petit and his friends who helped him, archive footage of the Twin Towers, re-enactment of some scenes, and extensive film footage and photography taken by Petit and friends at the time. In fact that footage they shot lends a huge amount to the film, and they seemed to show real foresight to have filmed so much, their training for it, their conversations while plotting how to do it, etc.

Spoilers below
(more…)

Next Page »

Blog at WordPress.com.