Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Sunday, November 04, 2007

A brief review of XCode 3

Spent much of Saturday getting in to XCode 3 which ships with Leopard. My project was to build a Cocoa native version of the AppleScript Studio app I built last week to read and ultimately control a Yaesu FT-817 radio via a serial interface.

Having used Microsoft's developer studio, Borland's C++ Builder and the beloved Metrowerks CodeWarrior, the old XCode seemed like a step backwards in programmer friendliness.

XCode 3 is a major step forward. 

It's taking me a little while to stop fighting it and go with the new work flow. Here's my observations:
  • You don't really need to go to the debugger window, variables are now inspected by rolling over them. The open up so you can inspect structures within objects very nicely.
  • The output console doesn't open automatically and until I found it I used the system-wide console to view my NSLog() printouts. 
  • Interface builder has been completely re-written and the vast array of available NIB objects are available in an easily searchable window.
  • I'm having a bit of trouble with the synchronizing between my XCode project and Interface Builder, I end up putting declarations in my .h file and dragging it to IB each time.
  • There's a handy link at the bottom of the IB window to take you to the XCode project.
  • When there are build errors they appear in red balloons right in between lines of your code. At first I found this a bit annoying but now I think it's pretty clever.
  • Code focus is where you put the mouse in a little left margin and blocks of code are highlighted - it's a bit alarming when you first do this by accident but now I think it's neat.
Still to try out
  • Cocoa 2 with garbage collection and automatic synthesis of getters and setters.
  • Project versioning - although I'm loving having Time Machine taking care of me all by itself (tip, watch the console for a while and see all the clever things it's doing)
Cocoa compared to AppleScript

It took me a lot longer to get this going in Cocoa compared to AppleScript mostly because I had to figure out how to drive the serial port. In AppleScript I found an extension that did it all for me, in Cocoa I found some classes from Andreas Mayer and others that are fantastic.

In AppleScript I used the idle handler, in Cocoa I had to use NSTimer.

I'm really enjoying Cocoa now that I'm up and running. It feels really solid and my only complaint is the sheer richness of the library, it's getting really huge and when you can't remember the method name you have to hunt through a huge list. It would be great if code completion could first show the most commonly used methods rather than the whole list.

We desperately need a new edition of Hillegass.

Sunday, June 17, 2007

Bonjour (zeroconf) fun at an airport hotspot

I attended a great session on Bonjour at the WWDC presented by my hero Stuart Cheshire. The dream of zeroconf is that you can simply plug a device in to your laptop, with no other network infrastructure (such as DHCP servers, or DNS), and simply browse for it and start using it.

Stuart demonstrated a shared disk product from LaCie that did just that. Plugged it in and it came up as a file share, a web page for admin, and even a streaming music server in iTunes. Great stuff.

Another great technology is wide area zeroconf where you can grab a Bonjour control panel and add extra, non local, domains to it that will be searched as well. This multicast DNS stuff works on a local subnet, but I was wondering if it would also work within a hotspot at an airport... it does, I'm on a T-Mobile hotspot at Seattle airport and above is the visible shares I can see via the bonjour browser in Interarchy.

Clearly there's a potential security problem here and Mac users should be aware that their name and machine is visible. I had a look at the web pages that showed up and they were just the Apache welcome page in both cases.

Saturday, June 16, 2007

WWDC over for 2007

The Apple conference was huge this year. A record of more than 5,000 attendees. Fantastically organised but it's so big that there were queues for everything. 

When Leopard ships later this year it's going to be great. I can't wait to see what developers build on top of it.

As always with conferences, I got snippets of valuable information from the sessions, but the greatest insights came from conversations with other developers during breaks. Met a bloke today who builds highly scaleable apps in python which are deployed on Linux for telcos - he explained to me how they manipulate the global interpreter lock so that their heavy lifting threads make use of additional cores.

People came from all over the world, such as Mr Xin above, who assured me that his organisation looked fine on the web form. (From a distance I first thought it was that famous AACS key again).

I've had a hard time with jet lag this year. I seem to be in some unknown third time zone, not San Francisco, and not Sydney. Wide awake at 4am local time.

Incidentally, this is being created using the Safari 3 public beta which seems excellent to me.

Tuesday, January 16, 2007

Speed up your Mac


I'm familiar with "bit rot" where Windows computers seem to slow down over time and in the end seem to need a clean install to get them right again, but it seemed to be happening with my Macs.

The built in Activity Monitor is a wonderful tool for seeing what's going on. I ran it and found that I had forgotten about some of the things that were running, including postgresql, mysql, various daemons for scanners, printers, pda's and even cameras.

The worst offendor was Caplio Mounter, an abomination that was taking gobs of memory and using too much CPU for something that is idle but waiting for a camera to connect.

Select a process in Activity Monitor and "inspect" it, you get wonderful, readable information about what it's up to and even all the files it has open. Very interesting.

Regrettably, there is no framework for uninstallers on the Mac. This really needs to be fixed! I had to trawl around the /Library/StartupItems directory moving things out. There is a Control Panel called Diablotin that does a pretty good job at managing Startup Items too.

After turning off a bunch of unused things, (I even had Apache running), my machine is clearly faster to start up and more responsive.