AppleScript is not dead (yet)

Jason Snell @ Macworld has an article reacting to Jonathan “Wolf” Rentzsch‘s declaration that AppleScript is dead.

Hrm… get this. That previous link to AppleScript takes you to the developer web pages for AppleScript. I originally wanted to link to Apple’s user/commercial page for AppleScript: www.apple.com/applescript. But if you click on that, notice what it takes you to: Automator. That tells you what Apple thinks about AppleScript as a technology.

It’s scripting for the rest of us.

Continue reading

Snow Leopard’s file system changes

Mac OS X 10.6 “Snow Leopard” brought a slew of under the hood changes. There are two distinct but related changes that Apple made that most users will probably never notice and many developers probably never will either. But if you happen to be someone who works with the file system, these changes may affect you. These changes are:

1. KB vs. KiB. That is, is a kilobyte 1000 bytes or 1024 bytes.

2. file-system-level compression of files

Since I recently went around with these, I felt it’d be worthwhile to share what I discovered, since there isn’t much information out there on the topic. The only thing I found that remotely discussed the matter was this page of Ars Technica’s Snow Leopard review.
Continue reading

Mac OS X x86 debugging

It’s been ages since I’ve had to do anything dealing with assembly language. And while I may not have to do much programming in it, it’s still a useful thing to know when it comes to debugging.

Today I’ve been trapped in debugging hell. We’ve got some code that works fine on Mac OS X versions prior to Snow Leopard (10.6) but seems to hang under 10.6. The code flat out executes differently. I watch how our code is invoked and things just don’t happen in the same order across the OS versions. Apple must have done some major under-the-hood changes to NSBrowser and NSTreeController. And since we’re using Cocoa Bindings, it’s a bitch to debug. Everything that’s happening is happening because of Key-Value Observing (KVO). I get somewhere into the bowels of NSBrowserBinder and it appears to be looping… looping… and never exiting the loop for some reason.

Now that we’re in the new x86-based world order of Macs, I went looking for some tips to help me work with debugging the x86 assembly so I could see what the OS was doing. I found a few useful resources.

Greg Parker at the Hamster Emporium has a great article about crashing in objc_msgSend and how to decipher the crash. I wasn’t crashing, but still there are some nice gdb commands and interpretation of the registers.

Then over at the Google Mac Blog, a 2 part article on spelunking. Part 1 and Part 2. These aren’t debugging articles (more like trying to hack around and discover how undocumented functions work), but they still explain a bit about how the x86 ABI works, AT&T syntax, and how Mac all mesh together. Note that Avi Drissman previously published the same article in his own personal blog, but edited it a bit for republishing in the Google blog.

Clark Cox provides a handy table on how to inspect Objective-C parameters in gdb.

And you thought the only thing I knew how to blog about was guns. 😉

Why did Apple do this?

No sorry… nothing about today’s Apple fan-boy event. More as to why I didn’t post much today.

Apple’s new OS version is 10.6, named “Snow Leopard.” Snow Leopard brought about a lot of under the hood changes to the OS. One of them is fairly well covered on this page of the Ars Technica review.

Basically, Apple did some stuff very very low level to help with reclaiming some disk space but also taking advantage of the volume format layout of HFS+ and how they can use that to their advantage to speed things up… RAM and CPU’s are wicked fast these days, and disk drives are still abysmally slow by comparison (physics can only go so far). So Apple did some neat things to improve speed and access times, and for the most part it works out great. Most people will never notice.

But in the line of work I do… I’m not most people.

The software I develop in my day job does a lot of working with the file system. So all of these changes that Apple made are actually wreaking havoc and hell on me right now. Long held maxims like a file’s logical size will never be larger than its physical size…. out the door. That calculating sizes is now base-10 instead of base-2 (i.e. 1 kilobyte is now being calculated as 1000 bytes instead of 1024 bytes)… changes a lot of things.

I’ve been reevaluating our entire codebase (which is huge) and this just doesn’t play well with us. All I can do at this point is formulate a lengthy email to Apple’s Developer Technical Support and ask for some help and guidance.

It’s been a trying couple of days.

I’m glad I have Kali class tonight. That should relieve a little stress. 🙂

4.5 out of 5 stars

I write Mac utility software for a living. A software bundle the company creates, CheckIt 2 Performance Suite, was just reviewed and received 4.5 out of 5 stars. The particular product I work on, Spring Cleaning, is the flagship software in that bundle.

What stood out to me in this review versus other reviews of the product is the reviewer seemed to look at the entire product and didn’t overlook key features. Many reviewers seem to only focus on the “pretty icons” and the basic tools, as if they just gave the product a 5 minute look over and then wrote a review. This reviewer appeared to fully examine the product and review based upon that:

Spring Cleaning comes with other features that are used to modify and limit how the other features work, allowing you to choose areas or files that you don’t want it to include. Finally, and very importantly, is the ability to schedule any or all of these functions to be performed automatically. For instance, it is probably a good idea to repair disk permissions once a month, and it is a good idea to allow the Unix maintenance routines to run. Using Spring Cleaning, you can easily set these up to automatically run when it works for your schedule.

Talked about things like Exclusions, and most importantly, the Scheduler. That’s one of the biggest strengths of Spring Cleaning, that you can easily set up automated schedules to keep your Mac running in top shape. As Ron Popeil was fond of saying, “Just set it and forget it!”

We understand a lot of functionality here is something an über-geek could do on their own, but not everyone is an über-geek. We strive to bring a lot of power and functionality “for the rest of us” so that anyone can keep their Mac running well.

I was just happy at the excellent review. Now go buy a copy and keep me in a job. 😉

Treemaps for space-constrained visualization of hierarchies

If the title made your eyes glaze over, no need to click this link to read Ben Shneiderman’s paper on treemaps.

I’ve been buried in working with them all day today at work. Just conceptual and design at this point, haven’t started to write algorithms just yet. It’s pretty cool stuff, at least for geeks like me.

Even if you’re not, the graphical representation of treemaps can look pretty cool. I really like these circular treemaps.

Who knew examining the composition and state of your computer’s filesystem could be so trippy. 😉

of SQL and other programmer joys

I know it’s been a light posting day. I’ve been buried in code.

I’m an application programmer. I tend to write most of my stuff in Objective-C and C++ (and Objective-C++ and sometimes straight C). Sometimes I do some work in Python. A few other bits of dabbling now and again.

I haven’t looked at serious database work in almost a decade.

But today I needed to consider using SQLite as a solution, so I had to pull out my SQL book and remind myself just how it all worked.

Of course by the end of the day I came to the conclusion that going straight to a relational database wasn’t going to be the best avenue to solve my problem. Instead, I think I’m going to use Core Data. I’ve used it numerous times in the past but didn’t feel it was the right fit for the work at hand (given Apple’s design intent/constraints on Core Data). But the more I thought through things, the more I think it’s going to be the way to go. At least, that’s my thinking right now. Could change tomorrow when I start prototyping.

Yeah, this probably doesn’t make a lot of sense to most of you. But I’ve been nose-down in that all day, thus minimal blogging.

Snow Leopard (almost) free

In my day job as a Mac software developer I’m certainly excited by the prospects offered in the upcoming Mac OS X 10.6 release codenamed “Snow Leopard“.

But that’s just the thing. I’m excited because I’m a developer and Snow Leopard offers a boatload of awesome things for developers and other under-the-hood improvements. As an end-user, I’m not really sure what benefits I see from Snow Leopard, especially in terms of enticing me to plunk down a big chunk of money to buy that OS version.

Adam Engst at TidBITS wrote an article that articulates the matter better than I ever could. I think there’s a good argument for making Snow Leopard as low-cost as possible, especially because yes a lot of people are still hanging on to Tiger (Mac OS X 10.4). Anything to help get people to move along is useful.

CocoaScriptMenu

My day job entails working as a software engineer writing Mac software. I just went through an ugly experience dealing with a particular 3rd party API, so it was a welcome experience to deal with a well-written bit of 3rd party code.

Jay Tuley’s CocoaScriptMenu is a terrific piece of reusable software. It does one thing: allows you to add a Scripts menu to your application, and it does it very well. I obtained the code, made a few small modifications to fit it into our build environment, dropped it into my application, and viola… it just works. Furthermore, it has just about every bit of functionality and customization that one could want. I mean, as I was thinking about how to implement this feature on my own I came up with a list of functionality, and CocoaScriptMenu satisfies every single one of them and a little bit more. Plus the licensing terms are reasonable.

Thank you, Jay Tuley, for creating this and releasing it. Good work indeed!