Monday, August 25, 2008

Build Your Own Bundle

Seth Dillingham is selling bundles of Mac applications to raise money for fighting cancer. Go build your own.

Friday, August 8, 2008

iPhone Apps That Go Beyond Entertainment

Adam Engst has a nice list of iPhone productivity applications. My favorite, by far, is OmniFocus. I also like PCalc.

Apple Ad Sets the Wrong Expectations

Jason Fried:

This ad borders on bait-and-switch and it’s disappointing to see Apple go there. If the ad wasn’t about speed it might be a different story. If they were just showing off as many features as they could in a 30 second spot it would be understandable. If they exercised poetic license and cut out a few frames to make a different point we’d understand.…But Unslow is about selling speed.

Thursday, August 7, 2008

Using OpenDNS for Phishing Protection

Rob Griffiths:

Changing your DNS servers isn’t very difficult to do, and by using OpenDNS, you’ll get the benefit of an active and constantly-updated anti-phishing tool, regardless of your browser of choice. If you don’t feel you’ll always be able to spot a potential phishing scam in your e-mail, using OpenDNS is a great solution that will allow you to keep using Safari with some peace of mind.

Via John Gruber, who says “it makes web surfing noticeably faster than using the default DNS servers I get from Comcast.”

Without a Trace

Applications quietly removed from the App Store:

Update (2008-08-07): John Gruber relays a theory about I Am Rich.

Update (2008-08-08): The LA Times reports that I Am Rich was not removed at the developer’s request (via Dave Dribin). Apple removed Slasher from the App Store, citing “objectionable content.” The developer has removed the popular PhoneSaber since THQ Wireless owns “the rights for Star Wars apps on mobiles” (via John Gruber).

Update (2008-08-14): Now Playing is back, although it still appears as BoxOffice in the search results.

Tuesday, August 5, 2008

Git Magic

Ben Lynn has written a Git cookbook:

As Arthur C. Clarke observed, any sufficiently advanced technology is indistinguishable from magic. This is a great way to approach Git: newbies can ignore its inner workings and view Git as a gizmo that can amaze friends and infuriate enemies with its wondrous abilities.

Rather than go into details, we provide rough instructions for particular effects. After repeated use, gradually you will understand how each trick works, and how to tailor the recipes for your needs.

Sunday, August 3, 2008

Unit Testing Roadblocks

Daniel Jalkut:

I’m ashamed to admit that this is how many a unit test has been put off. Other laziness incubators include the friction of adding a suitable unit test bundle target to a project, and the difficulty of deciding how to factor your unit tests so that they make sense in the context of your project.

[…]

But now you’re bound to run into a vexing question: “how the heck do I debug this thing?”. Since unit tests are generally built into a standalone bundle, there’s nothing for Xcode to run. But when you come across a failing unit test and you can’t figure out why, you find yourself wishing you could step through the code just as you might in an application.

Jalkut points to various tips for unit testing with Xcode. That’s how I originally wrote and ran my unit tests (using ObjcUnit, since Xcode didn’t yet have built-in testing support). Now I’m taking a different approach: using Python and PyObjC to write the tests and py.test to run them. You may prefer not to deploy an application written in Python or Ruby, but that’s no reason not to take advantage of those languages during development. The strengths of dynamic languages are a good fit for writing and debugging unit tests, and the weaknesses don’t matter so much in the context of testing.

Welcome to iPhone: Your Crappy Mac of Tomorrow, Today!

Mike Ash:

I’ve come to realize that the iPhone platform is really pretty crappy in a lot of ways. And these ways are mostly not due to hardware limitations, but rather artificial limitations put in place by Apple. And mostly these are limitations which have been put in place For Our Own Protection, and which have been, shockingly, praised from many quarters.

Well, there was also a crowd who praised the announcement that developers would only be able to write Web applications and ridiculed those who wanted native ones.

Apple’s focus and attention seems to be on the iPhone, and the sentiment coming out of Cupertino is one that the iPhone is good, all of the stupid, crippling restrictions on how it works are good, and Apple always knows best.…This is the same keynote, let’s remember, where high-up Apple people ridiculed the idea that anyone would ever have a legitimate reason to run applications in the background. Unless that application is made by Apple, of course. And then they came up with their brilliant idea of push notifications, which totally replace the need for background processes, unless you’re writing a music player, or a Web browser, or GPS logger, or a terminal emulator, or file downloader, or….

I think most of what Apple has done is defensible. With a new platform and limited engineering resources, a case can be made for a conservative approach that starts with a very closed platform and slowly opens it up. You don’t maximize the device’s potential, but you prevent any bad surprises from occurring. Theoretically, by controlling everything, you can keep the quality of the experience high while you build market share. You can get away with this for a while because there are no significant competitors. This is not the approach I would have taken—I like Ash’s idea of third-party developers stepping in to do what Apple won’t or hasn’t yet—but I can easily believe that Apple thinks it’s a good idea, and they may be right.

What’s not so defensible is what Apple has been saying these past few years. It’s been spinning like crazy. They introduced the iPhone as a platform that included Cocoa and lots of great developer technologies, but soon it became clear that these were only for Apple’s use. First there was, “Cingular doesn’t want to see their West Coast network go down because some application messed up.” As far as I can tell this was just FUD. Then: “You can write amazing Web 2.0 and AJAX apps that look exactly and behave exactly like apps on the iPhone. And these apps can integrate perfectly with iPhone services.” Turns out there were significant look and behavior differences compared with native applications, and nearly all of the phone’s data and services were off limits. It was reasonable for Apple not to have an SDK ready at that time. It was not reasonable to suggest that Web applications, which we already knew would be supported, were something new and “innovative” and “a very sweet solution.” Since Steve Jobs said that this was something Apple had just “come up with,” some people assumed that there would be a JavaScript API or perhaps a widget environment. In fact, there was nothing. The touted integration ended up being that Google Maps and YouTube URLs would open in those applications rather than in Safari. Then, finally, the SDK was announced, and developers saw that far more was missing from the OS than the Mac desktop patterns and sounds. How would iPhone applications be developed and deployed? With music, Apple had given the appearance of being against DRM, but for applications it delivered one that was even more restrictive.

On the Mac side, Apple encouraged developers to write 64-bit Carbon applications, but then quietly removed this option. Developers would have been better off following the conventional wisdom, that Carbon was a transitional API and Cocoa was the future, than listening to Apple’s explicit statements to the contrary. At WWDC 2006, Steve Jobs declined to demonstrate Leopard’s top secret features because “We don’t want our friends to start their photocopiers any sooner than they have to.” Once Leopard shipped, we saw that there were no such features. At WWDC 2008, Jobs looked sickly and Apple PR claimed that he just had a “common bug,” though he eventually admitted off the record that this wasn’t true.

Ash now worries about what Apple has planned for the future of the Mac. It could be bleak. It seems like a crazy idea, but Apple is known for betting (often successfully) on crazy ideas. I don’t think Apple would go that far, but it’s frightening that it would be possible.

I think the bottom line is that, because of the way Apple has behaved, people don’t trust it as much. This makes them less willing to give it the benefit of the doubt. And it increases uncertainty, which makes it difficult to plan. Mac developers were encouraged to learn how to write Web applications when a Cocoa-based SDK was just around the corner. It ended up being better to act based on supposition (that there would be an SDK) and experiment with a jailbroken phone, than to do what Apple had recommended. I’m not suggesting that Apple should reveal all the details or make commitments prematurely, but in most cases I think the spinning is counterproductive. I would prefer candor. If the reality doesn’t match the rhetoric, people will find out. They could be unhappy that they were talked down to and misled, or they could appreciate being told the straight story, even if it’s less than insanely great.

VMware and OS X

Gus Mueller:

Why is this so important to me? As a developer (and specifically an indie developer) setting up and testing my applications on a clean install of Mac OS X can be a pain in the ass. I’m not the type to have multiple machines for this purpose since I can’t stand the clutter. Plus, once I’ve run my one of my apps on the clean system, it will leave little bits of debris around the file system in the form of preferences

I’ve been using multiple Macs and SuperDuper, but using virtual machines would be better in some ways. This would be best for testing with older versions of the OS, some of which require older hardware that I might not want to keep around. For how long after a version of Mac OS X Server is discontinued does ADC provide serial numbers?

Friday, August 1, 2008

ATPM 14.08

The August issue of ATPM is out:

Tuesday, July 29, 2008

Remote vs. iPod

Tom Reestman has a nice post showing differences between the Remote application, for controlling iTunes from an iPhone, and the built-in iPod application (via John Gruber). I agree that Remote is much nicer, although it’s missing a few features. It would be nice if iTunes’ unzoomed controller could show the cover art and controls like that.

Turning Off Apple Data Detectors in Mail

I don’t like the data detectors that Apple added to Mail in Leopard, because I never use them and they interfere with selecting text. I just figured out that you can disable them by entering defaults write com.apple.mail DisableDataDetectors YES in Terminal. Normally this type of hidden preference would be easy to look up in Google, but I only found a bunch of ideas that didn’t work, and as of this writing there are zero hits for “DisableDataDetectors”.

Sunday, July 27, 2008

PR Rule #1

Dan Lyons:

If down the road it turns out Steve was lying and someone from the SEC or some lawyer in a civil suit wants to find out what was said in that conversation, they’ll have to subpoena Joe Nocera, and the New York Times will fight that request. Even if Joe Nocera wants to tell the world what Steve Jobs told him, he can’t. He made a deal. He went off the record. Even if Steve turns out to be lying, Joe Nocera is stuck.

Thus Steve Jobs gets to protect his stock price and give Wall Street the message that he wants them to hear, and should any of this turn out not to be true, well, Steve and Apple now have Joe Nocera and the legal department of the New York Times to act as their ally and firewall.

Friday, July 25, 2008

Apple’s MobileMess

David Pogue:

And it’s a little mind-boggling that today, nearly two weeks after MobileMe’s official opening, Apple still hasn’t solved the problem. That’s got to be a record in the short history of cloud computing.

But the real problem is how Apple is responding. For a company that’s so brilliant at marketing, it seems to have absolutely no clue about crisis management.

Update (2008-07-26): Apple’s added a status page and an RSS feed:

Steve Jobs has asked me to write a posting every other day or so to let everyone know what’s happening with MobileMe, and I’m working directly with the MobileMe group to ensure that we keep you really up to date.

And Glenn Fleishman comments on it. I agree with Fleishman: why is it written in the first person but unsigned?

Update (2008-08-04): Glenn Fleishman:

MobileMe’s launch should have been staged. First, iPhone 3G owners should have had access when signing up for new accounts. Then iPhone 3G and original iPhone owners with existing .Mac accounts or who wanted new accounts should have been given access. Then a slow transition for users who weren’t interested in the sync changes could have happened over weeks.

Tuesday, July 22, 2008

On the Counter-intuitiveness of Speed

Ned Batchelder:

I’m no expert in these matters, but I’ve read enough about pipelines and caches to know that this is entirely plausible. When the code is uncluttered with detours, it goes much faster than when the end of the loop pauses to consider whether to invoke the progress function. Ironically, actually calling the function and invoking all of the Python overhead is insignificant compared to the time lost to simply deciding (in C!) whether to call it.

Sunday, July 20, 2008

WebKit Performance on iPhone OS X 2.0

John Gruber:

The results are obvious. WebKit JavaScript performance has improved steadily and significantly in just one year, with a huge jump between 1.1.4 and the new 2.0.0.

And yet his MacBook Pro (which may be running a less optimized version of Safari) is still 40 times faster. Macs are fast these days.

Update (2008-07-24) from John Gruber:

Recursion depth, in and of itself, isn’t particularly important. It’s just a particularly simple way to distinguish pre- and post-SquirrelFish versions of WebKit. And so since we now know that the iPhone isn’t yet using SquirrelFish, it means further dramatic performance improvements are on the horizon.

Monday, July 14, 2008

Bugging

Craig Hockenberry describes how Apple’s tight control over what can be installed on an iPhone impedes developers’ efforts to debug and test their products. This can’t be a surprise to Apple, but it’s unclear what, if anything, they plan to do.

Update: More from Brent Simmons.

Sunday, July 13, 2008

iPhone 3G Display Color Warmer by Design

Jason Snell:

To set the record straight, I talked to Apple’s senior director of iPhone product marketing, Bob Borchers. Borchers indicated that this definitely isn’t a bug or a display defect. Yes, the display on the iPhone 3G has a warmer look—and that’s by design. The previous iPhone’s white was more of a cool blue (Borchers likened it to harsh fluorescent lighting), while this one’s is warmer and more of a sunny yellow.

I like the old color better. It’s true that it’s “more blue,” but I don’t think it really looks bluish. To my eyes, the whites look white, whereas the iPhone 3G looks like a dirty yellow. The original iPhone screen looks very good, even at low brightness levels.

AppleInsider has more photos.

Saturday, July 12, 2008

iPhone Settings

Ken Case (via Lukas Mathis):

Settings which appear in the built-in Settings application can’t have any code associated with them, they can only use standard controls which store data in a few limited data types. We wanted to provide the ability to copy synchronization settings from a Mac on your local Wi-Fi network, which involves code—making it impossible to put our settings in the global Settings application.

The above point makes this moot, obviously, but in general another important factor to consider is whether the user might change a setting more than once or whether it’s really just a one-time configuration. If you’re talking about something like Mail settings, it’s pretty much fire and forget—but in OmniFocus’ case, the user might want to quickly switch between looking at all their completed items and then switch back to looking at just their available actions, and they wouldn’t want to have to relaunch OmniFocus each time they did this.

It’s not clear to me why Apple wants applications to use Settings, except that it reduces the need for a button in the application. It’s a pain to have to quit an application to change a setting, and it’s not always clear what’s a setting and what’s application data. I’ve only changed the locations in the Weather application maybe half a dozen times in the past year, yet I’m happy with them being in the application rather than in Settings.

Wednesday, July 9, 2008

On Switching to Git

Fraser Speirs:

I work solo, only moving between a desktop and a laptop, so I’m not making huge use of the distributed capability. My previous writing on Git was occasionally mildly criticised for “ignoring” that aspect of Git. I’m not ignoring it, but I lack an understanding of how it really helps me. No, what’s great about Git so far is the power of the tools for everyday operations.

Friday, July 4, 2008

Who Owns Your Online Documents?

Mike Gunderloy:

One thing that’s clearly missing is any sort of backup guarantee. While you may feel more secure storing your documents on Google’s or Zoho’s or Adobe’s servers than your own, that security is not something that you’re promised. Any of the three can lose your documents or terminate your ability to get to them at any time for pretty much any reason, and you’re out of luck. So if you do put important things online—back them up somewhere else.

The Truth About Unicode in Python

Christopher Lenz:

The unicode support in Python is generally considered to be pretty good. And in comparison to many other languages, it’s good indeed.

But compared to what is provided by the International Components for Unicode (ICU) project, there’s also a lot missing, including collation, special case conversions, regular expressions, text segmentation, and bidirectional text handling. Not to mention extensive support for locale-specific formatting of dates and numbers and time calculations with different calendars.

Wednesday, July 2, 2008

Adobe Reader 9

Gus Mueller makes fun of Adobe Reader 9. Good to know you can get the “recomposition” status down to a tenth of a percent. By the way, there’s still no universal binary.

Update (2008-07-04): Mark Pilgrim comments, and John Gruber writes:

Adobe today reminds me a bit of Apple in the mid-’90s. Tremendous engineering and design talent in the company. A loyal base of users built over 20 years. But management that just doesn’t get it at all, and seems hell-bent on running the company into the ground.

WP Super Cache

I recently installed WP Super Cache to speed up my WordPress blogs. The regular WP-Cache plug-in saves processed copies of pages, reducing the database and PHP processing overhead, but the pages are still served via PHP. WP Super Cache takes this to the next level, using mod_rewrite to send requests directly to cached HTML files:

RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*s=.*
RewriteCond %{QUERY_STRING} !.*attachment_id=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{DOCUMENT_ROOT}/blog/wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/index.html -f
RewriteRule ^(.*) /blog/wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/index.html [L]

If a page isn’t yet cached, the -f test will fail, and the request will be directed to the regular WordPress PHP script (using WP-Cache). It’s a nice system, but I hit a few snags setting it up, so I wanted to document them here.

The first problem was that the super cache was not being generated. Every request was being handled by WP-Cache. It turns out that WP Super Cache (sensibly) doesn’t add a page to the super cache unless $_GET is empty. I was using a .htaccess file from a much older version of WordPress, and it was packing the query string with elements of the path:

RewriteRule ^archives/?$ /blog/index.php?pagename=archives [QSA]
RewriteRule ^category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /blog/wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^category/?(.*) /blog/index.php?category_name=$1 [QSA]
RewriteRule ^author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /blog/wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^author/?(.*) /blog/index.php?author_name=$1 [QSA]
RewriteRule ^([0-9]{4})/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
RewriteRule ^([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /blog/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
RewriteRule ^([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /blog/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /blog/wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /blog/wp-feed.php?feed=$1&withcomments=1 [QSA]

Updating .htaccess file to let WordPress itself parse the path:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

fixed that problem.

Now the posts were being saved to the super cache, and served from it, but the feeds were only using the regular cache. WP Super Cache is hard-coded not to cache feeds in order to avoid serving them with an incorrect content type (a.k.a. media type or MIME type). Feeds are supposed to be served as application/rss+xml or application/atom+xml, and Feed Validator will complain if they aren’t. But the super-cached files are all stored as index.html so Apache will serve them as text/html. (This isn’t a problem when using WP-Cache, because it sends the proper HTTP header depending on the type of feed being generated.)

To fix this, I modified WP Super Cache to generate local .htaccess files inside the super cache:

if (is_feed()) {
    $type = get_query_var('feed');
    $type = str_replace('/','',$type);
    switch ($type) {
        case 'atom':
            $mediaType = "application/atom+xml";
            break;
        case 'rdf':
            $mediaType = "application/rdf+xml";
            break;
        case 'rss':
        case 'rss2':
        default:
            $mediaType = "application/rss+xml";
    }
    $htaccess = @fopen ("{$dir}.htaccess", 'w');
    if ($htaccess) {   
        fputs($htaccess, "AddType $mediaType .html");
        fclose($htaccess);
    }
}

For example, the file blog/wp-content/cache/supercache/mjtsai.com/blog/feed/rss2/.htaccess changes the content type for the index.html file:

AddType application/rss+xml .html

Then I modified WP Super Cache’s wp-cache-phase2.php to remove the is_feed() check from the line:

if( !empty( $_GET ) || is_feed() || ( $super_cache_enabled == true && is_dir( substr( $supercachedir, 0, -1 ) . '.disabled' ) ) )

Now the feeds are super cached and served with the correct content types.

Tuesday, July 1, 2008

ATPM 14.07

The July issue of ATPM is out:

Disabled Menus Are Usable

Daniel Jalkut:

Sure, it’s frustrating when you can’t figure out why a menu item is disabled. But what would be unbelievably frustrating is drowning in a sea of enabled menu items, for which the application offers no immediate usability guidance. Instead of skimming past disabled items, a user could be forced to select several, each time receiving a valuable instruction (punishment) as to why it was a worthless move.

Tuesday, June 24, 2008

Netflix Profiles Feature Going Away

Netflix Community Blog:

Continuing to maintain the profiles feature for the passionate few who use it (including myself) distracts us from the mission of presenting to all our members the easiest way to find the best titles for them from the 100k plus on DVD and the 10k plus available instantly.

There are already more than 1,000 comments on the post. Besides losing a useful feature, customers will lose their queues and all the rating data they’ve entered. Even if this doesn’t cost Netflix customers, it can’t be good for their recommendations engine to have multiple people rating movies under the same account/profile.

Update (2008-06-30): I just received an e-mail from Netflix:

You spoke, and we listened. We are keeping Profiles. Thank you for all the calls and emails telling us how important Profiles are.

We are sorry for any inconvenience we may have caused. We hope the next time you hear from us we will delight, and not disappoint, you.

-Your friends at Netflix

And they’ve also written a blog post. It’s still not clear to me why they thought that removing the feature would make the Web site easier for the people who didn’t use it in the first place, or why they were so willing to throw away user data.

Saturday, June 21, 2008

Subversion’s Biggest Hole

Ned Batchelder:

The thing I miss that Subversion is lacking is a repository setting for globally ignored files. You can set a property on a directory to ignore (for example) *.pyc files. And you can set your client to always ignore *.pyc files in any working tree on your machine. But there is no way to set a repository to ignore *.pyc files anywhere they appear in the tree.

Friday, June 20, 2008

Installing the OS on a MacBook Air

Steven Frank:

No problem, right? Plug the external SuperDrive and the HD into an powered hub? Nope, doesn’t work. The SuperDrive for the MacBook Air only works in one situation: when it is plugged directly into the USB port of a MacBook Air.

Wednesday, June 18, 2008

On Software Bundles

Paul Kim:

I’d say it was worth it, but not in the way people would expect. It was worth it to me in that I got a nice check afterwards without having my sales adversely affected. As for exposure, there may be better ways to get people to know about your app without practically giving it to them. I don’t have a paid upgrade planned out yet so that was not even a consideration for me. For me to do it again, I think I would have to be offered a good deal, percentage-wise. My sense is that these promotions are more effective in the short term than long term.

Monday, June 16, 2008

PMC Call For Developers

Seth Dillingham is looking for software developers to donate their wares to be auctioned off for cancer research and treatment. Last year he raised $5,000, and the goal for this year is $10,000.

All proceeds will be donated to the Pan-Mass Challenge, and in turn to the Jimmy Fund, for the research and treatment of cancer at the Dana-Farber Cancer Institute. The Pan-Mass Challenge is one of the most efficient charities in the world (over 99% of all rider-raised funds are passed through directly to the Jimmy Fund).

Donate Software, Fight Cancer

Friday, June 13, 2008

Firefox 3 for Mac OS X: Under the Hood

Josh Aas:

The context menus, dropdown menus, the toolbar, the search bar, the buttons and text fields within Web pages—they are not actual Cocoa controls. For example, instead of using actual Cocoa buttons for “Submit” buttons we just draw the image of an Aqua “Submit” button into an NSView, one of the basic Cocoa objects we use. Gecko 1.9 has Aqua form controls because we now draw images of Aqua form controls when appropriate, not because we use actual Cocoa controls. The reason we don’t use actual Cocoa controls isn’t because we are lazy or we can’t figure out how to use them or because we are constrained by our cross-platform requirements—Apple’s WebKit doesn’t use actual Cocoa controls for things like “Submit” buttons or popup buttons in Web pages either, at least not the last time I checked.

Sure, but Firefox 3 also uses the fake controls throughout the application: the preferences window, the browser toolbar, the bookmarks editor, etc. Even without clicking on anything, it’s obvious that the interface was built using a cross-platform framework.

Update: Johan Sanneblad has screenshots of some of the differences (via John Gruber).

Thursday, June 12, 2008

DVCS Myths

Derek Slager:

A number of the responses were interesting and thought provoking, while others were so full of FUD and misinformation I couldn’t help but wonder if they were serious. I’ll admit that I was surprised by some of the negative backlash against DVCS. I have explained it to many former users of centralized systems, and it simply never struck me as a very controversial technology. I don’t want to just completely ignore the criticism, however. This post is an attempt to respond directly to some of the more common criticisms, and hopefully convince some of the skeptics that even if DVCS isn’t the solution for you, at least it won’t start your computer on fire.

Tuesday, June 10, 2008

When a Price Drop is Really a Price Increase

Kirk McElhearn:

Since you can’t buy a phone without activating it, and without committing to a two-year AT&T contract, the actual selling price doesn’t mean much. What counts is the total price over time. And Apple’s clearly caved to AT&T to allow this to happen. I guess it’s part of the price they have to pay to get more users of the iPhone, but it’s still dishonest.

I don’t live in an area with 3G coverage. It would be nice to have the GPS receiver, but I don’t mind waiting until there’s more software for it than Google Maps. The other hardware changes in the iPhone 3G were minor. App store aside, the software improvements in iPhone 2.0 were also minor, at least as relates to me, and they’ll be available on the original iPhone. So, although I like the iPhone 3G, yesterday’s announcements had the perverse effect of making me glad to have purchased the 1.0 hardware. It was kind of like getting a 2 GHz PowerMac G5, and a year later they weren’t at 3 GHz after all.

Sunday, June 8, 2008

MDI on the Mac

Lukas Mathis:

Mac applications used to have many windows. Recently, this has started to change, mainly due to Apple’s influence. […] However, these applications do not have MDIs. Neither of these applications are multi-document applications. They are either media managers (iPhoto, iTunes, Aperture), or they are typically used to open only one document at a time (iMovie, iDVD, Final Cut Pro).

[…]

Unfortunately, some companies have taken Apple’s new one-window-approach to UI design as a hint that they should introduce MDIs (or an MDI-like approach to UI design) on the Mac.

Saturday, June 7, 2008

Garbage Collection and the Optimizer

There’s an interesting edge case in the Objective-C garbage collector that’s being discussed on Cocoa-dev. The collector treats variables on the stack as rooted, but the contents of the stack may not match what the programmer is expecting. If gcc’s optimizer determines that a particular variable will no longer be accessed, it can replace it on the stack before it goes out of scope in the Objective-C source. Ordinarily this is safe, but it can cause problems when dropping down to the C level. If the variable points to an NSData, the object can be collected while a pointer to its contents is still in use. Mike Ash describes it nicely:

The problem here is that you’re expecting one pointer to keep a different pointer live, which the GC does not make any guarantees about.

Basically, under GC, my impression is that it should be considered invalid to return a pointer to a caller which depends on the lifetime of the parent object.

Unfortunately, there isn’t a simple fix because NSData’s contents are not always a simple block of collectable memory.

Tuesday, June 3, 2008

AppleScript Is Broken in Firefox 3

Luis de la Rosa:

There’s two pieces of data that’s critical for several apps to get from Firefox: the current URL and the current Title. The title portion is broken in Firefox 3. That’s a regression from Firefox 2. Except, it isn’t officially, since Firefox never officially supported AppleScript. There were just some good programmers who added it in.

So what happens when you request the title? It returns random garbage data.

I’ve also gotten reports of intermittent problems getting the URL via AppleScript.

Announcing SquirrelFish

WebKit’s new JavaScript engine:

SquirrelFish is a register-based, direct-threaded, high-level bytecode engine, with a sliding register window calling convention. It lazily generates bytecodes from a syntax tree, using a simple one-pass compiler with built-in copy propagation.

Oh, and it’s fast.

Apple’s Script

Daniel Jalkut:

Apple should make JavaScript its default scripting language.… It sounds a like I just said “Apple should kill AppleScript,” but I didn’t. You see, the Open Scripting Architecture, on which AppleScript runs, is designed from the start to support multiple languages. Think of the “Open Scripting” part of the system as the part that lets a script tell another application to do something. The specific scripting language you use to accomplish the rest is really of no concern whatsoever. Two languages, such as JavaScript and AppleScript, can easily live side by side.

Agreed. OSA is great, but AppleScript is holding it back.

Monday, June 2, 2008

ATPM 14.06

The June issue of ATPM is out: