Monday, August 31, 2009

Best feature of Snow Leopard - Dashcode 3

There's an amazing rapid application development tool for the web bundled with Snow Leopard called Dashcode. I always thought it was for making dashboard widgets, but it seems to have broadened its focus.

You drag and drop your user interface in Dashcode, choosing from a decent array of nice looking widgets.

Screen shot 2009-08-31 at 6.53.39 PM.png


To connect to a back end server, you create "dataSource" objects which have a nice interface for setting the query strings and then automatically parse either returned xml or json.

Screen shot 2009-08-31 at 6.56.05 PM.png


Objects in the UI, such as the value of fields or the animation or visibility of the activityIndicator are key:value bound in a way similar to Cocoa's Interface builder (by drag and drop linking the little dot at the right of the fields).

Here's the onClick() code for the Calculate button:


function calculateClickHandler(event)
{
amountField = document.getElementById("amountTextField");
rateField = document.getElementById("rateTextField");
resultField = document.getElementById("resultTextField");
var dataSource = dashcode.getDataSource("calculatorDataSource");
dataSource.setValueForKeyPath(rateField.value, "parameters.rate");
dataSource.setValueForKeyPath(amountField.value, "parameters.amount");
}


On the web it looks like this:

Screen shot 2009-08-31 at 6.58.35 PM.png


The back end that does the calculation is just this:


#!/usr/bin/env python

import cgi
import cgitb
cgitb.enable() # errors to the browser

def main():
form = cgi.FieldStorage()
rate = form["rate"].value
amount = form["amount"].value
result = float(rate) * float(amount)
response = ' { "result": %s }' % (result)

print "Content-Type: text/json"
print # blank line, end of headers
print response

main()


(My host doesn't have the json module installed so I've done the json printing manually for now).

I'm still coming to grips with all this but the design UI is magnificent and the concept of webservices as "datasources" with key value coding is just fantastic. While developing you can point it at an xml or json service and you get a wonderful structure inspector that lets you drill down and choose which parts get linked to parts of your UI.

It looks like Dashcode will deploy your app to MobileMe but I haven't figured this out yet, for now I'm getting it to ftp to a Dreamhost service which works rather smoothly. (I hope Dashcode supports sftp soon!)

Other great things in Snow Leopard


  • Column selection in Preview

  • The display colour just looks more vivid

  • Speed - particularly Safari

  • Cisco VPN client

  • Andale Mono font

  • The extra disk space I got back

  • Screen shot date and time stamps



I've had a few crashes today, mostly while printing in Pages, but I blame the Sharp printer driver which does all sorts of bad things according to Console.app.

Dashcode = Awesome.

Friday, August 28, 2009

Snow Leopard in Sydney

I'm waiting for the Chatswood Apple store to open.



They have stock and might open up a little early.

The staff are being briefed by the looks of it.



Here's the staff preparing to open the door:



And here's the queue:



The store opened half an hour early for us, very kind. They applauded as we ran in. The mystery guy waiting said he wanted the Exchange integration so I said I wanted the Cisco VPN. Ben just wanted a new Tee shirt.

Update

Back at the office now, installing on my laptop.

It took 47 minutes to upgrade from Leopard. I got 23Gb of extra space as a result of the install. All seems to be working smoothly so far.

Two issues

I had Mail crash after our internet connection was interrupted and more annoyingly I don't seem to be able to print at home to our HP LaserJet 1022n Printer any more.

Screen shot 2009-08-28 at 5.55.32 PM.png


Found the driver at HP and all is well again.

The Cisco VPN client is outstanding. Easy to configure and really fast to connect - certainly better than the official client from Cisco I've had to use in the past. (It was so bad there was an application that just gave users a better user interface to the same underlying code).

Negative trash count

Noticed a negative remaining count when emptying the trash. I guess the Finder re-write left a few minor bugs around.

Negative Trash.png


The thermometer progress was fine so no real drama.

MacPorts

I noticed that mysql5-server hadn't started after the upgrade. It seems that MacPorts, which needed to be upgraded to 1.8 to run, now builds in 64 bit mode by default (the default in Snow Leopard). The problem is that some existing libraries (zlib in the case of MySQL) were 32 bit.

Still working this through but I think the best approach might be to uninstall MacPorts and build it all freshly.

Old libraries

I'm running in to a bunch of issues relating to libraries I've built in the past that are 32 bit and the fact that under Snow Leopard python 2.6 runs 64 bit by default. (You can set an environment variable to make it switch to 32 bit but that would be a shame - man python for more).

The error message is clear and I go and delete the old library and rebuild.

Everything is getting there, I've installed the 64 bit MySQL server and got python-mysqldb running now.

Sometimes, for a developer, a clean install might be more straight forward.

Thursday, August 27, 2009

Bring on Snow Leopard

I'm queuing at the local Apple store in the morning, always nice to get an operating system update.



Will post a review after a bit of use.

Saturday, August 22, 2009

Blue mountains amateur radio Winterfest

Dropped in to the BMARC annual "Winterfest" today and the new venue seems to have worked out very nicely.

DSC02904.jpg


Inside there were displays of old equipment and new equipment available for sale. A wonderful collection of morse keys were on show.

DSC02900.jpg


My favourite club, the NSW Home Brew club had a table manned by John VK2ASU and Peter VK2EMU.

DSC02915.jpg


Outside there was "trash and treasure" on display to pick through.

DSC02909.jpg


Congratulations to the organisers for a very professional "fest", it was great to catch up with some radio friends and look at all the bits and pieces on display. I did not buy a spectrum analyser or 6kHz - 2GHz signal generator.

Monday, August 17, 2009

TomTom for iPhone in Australia review

tomtom icon.PNGI have used a TomTom navigator in the car for a year or so and I'm pretty happy with it in most respects. Having said that, I want fewer gadgets and the car navigator has a few disadvantages - it's flat mostly, it is left in the car and risks being a target for a break-in, having to select the suburb before choosing the street is annoying (as sometimes the street isn't in the suburb people give you).

When TomTom for iPhone in Australia appeared in the store this morning I didn't hesitate to purchase it, even for AU$99. The download is 157.1Mb, which seems modest given that the maps are built in. I'll give my existing hard TomTom to my wife so it's not really a duplication.

Choosing a destination involves choosing the major city, like Sydney, and then searching for the street which is an improvement. The map is no-where near as nicely designed as Google maps.

IMG_0427.PNG


When you pan the map it erases and completely re-draws, which is a step backwards from the browser based Google Map. I'm assuming at this point that the routing algorithm is the same as their other devices so probably pretty good but we're hitting the road shortly and I'll report back soon.

IMG_0428.PNG


Obviously I'm now in the market for a car mount with charger.

In Use

The Australian "Ken" voice sounds loud and clear through the iPhone speaker. The interface is familiar to users of the normal TomTom devices. Route re-calculation is really fast.

When you turn the phone on its side, the screen re-orients to that format as you'd expect.

The biggest disappointment is that there are no computer synthesised voices so there is no pronunciation of street names. This is a significant disadvantage compared to the "hard" units and I hope it will be fixed in a software update.

During operation the screen stays lit and the iPhone feels warm so my guess is that a car power source will be needed for full time use. Position updates are very frequent and I feel that the GPS hardware in the iPhone is possibly better than in a hard unit.

Thursday, August 13, 2009

Neighbour with a valve fettish

I've discovered a local resident who loves old telephones and radios with valves. Over the weekend he called on 80m and I dropped in to see the latest gadgets.

A "coffin" radio:

IMG_1986.jpg


Magic eye for tuning:

IMG_1987.jpg


Spares:

IMG_1989.jpg


Rob's an amazing chap, I very much enjoy my visits.

IMG_1990.jpg


He's the only person I know who doesn't use the internet. I'm sure he was pleased to receive a printed phone book last week.

Damn you Sensis - stop the phone books

phone book.jpgOnce again, despite my repeated attempts to halt delivery, the phone books turned up again.

In 2007 I formally opted out through Sensis's call centre and then again through their web site. The books came again in 2008. The so called "Green Office" program is a sham.

We never use the printed phone book. It will go - still wrapped - into the paper re-cycling again.

Update: It's 2011 and I'm pleased to report that instead of receiving a phone book I just received a card saying that they had received my request not to get it.


They go on to say that my request will be honoured for three years and then they'll revert to delivering books again unless I let them know again.

So, good on you Sensis at last.