Thursday, June 28, 2007

New lines aren't allowed with this version of the echo command, so only one line can be written at a time. The problem is that system calls aren't very fast: who knows why, perhaps a new shell is created internally each call? Anyway, writing a file of more than a couple of lines is noticeably slow to the user. So we need a way to do this with less system calls.

'printf' does the job perfectly as it allows multiple line writing. Build up the string to write, separating lines with the '\n' character. Then write the whole file in one call....

Tuesday, June 12, 2007

I just installed the Safari 3 Public Beta, it's very nice but without AdBlock and to a lesser extent Greasemonkey it's never going to replace Firefox. Anyway, after firing up Dashcode Public Beta I noticed that there are rendering problems. Just creating a simple widget and resizing the front design is suddenly very problematic. I suppose Safari 3 has an updated version of Webkit that Dashcode Beta isn't ready for.

Uninstalling Safari 3 fixes things with Dashcode. A bit of a pity as Safari 3 was noticeably quicker that Safari 2 and much much faster than Firefox.

Incidentally, maybe a bonus reason for the release of Safari on Windows is to increase the number of plugins available. Plugins are certainly a big differentiator between Firefox and the other browsers, and while Safari is marginalized only on OSX it won't get the volume of [quality] plugins developed by 'the community' that Firefox does.

While being embarrassed for a room full of grown men enthusiastically cheering and whooping at the announcement of a new 'Finder', I spotted that Steve Jobs was sharing the WWDC 2007 stage with a huge OSX feature that he somehow neglected to mention: My ZX Spectrum widget.It's on around minute 45, blink very slowly and you'll miss it.

Note the use of the path to the executable in the system call. Looks like the widget doesn't have a good path variable set up in it's shell. Not sure why, but it's easy enough to find an executable location by typing 'which java' in Terminal.

Make sure that the widget has the attribute 'Allow Command Line Access' turned on or instead you'll get a non obvious exception when executing the system call.