Tuesday, January 6, 2009

EXIF/IPTC Data on Resized Images

Erik Barzeski notes that Flickr only includes EXIF/IPTC information on your original images, not on the thumbnails and smaller versions. Amazingly, the Flickr staff seems to see this as a feature. I prefer to keep photos on my own servers, but none of the PHP-based gallery software that I’ve seen supports metadata on resized images, either. I wonder how easy it would be to add this using getimagesize and iptcembed. The ATPM galleries do include this metadata because the images were resized on my Mac using sips.

Abstracting Away From Exceptions

Michael Feathers:

Exceptions seem to encourage “controlled abort” as an error handling policy. You throw an exception, it travels up the stack, and you catch it someplace else. All of your work is unwound (you hope) and then you are left with the task of logging the error or trying something else.

The comments are interesting, too.

I think exceptions are especially bad in Cocoa as a way of handling expected errors. Catching them is verbose, so the natural tendency is to do so as little as possible. Secondly, methods don’t declare whether they raise exceptions, so there’s no easy way to make sure you’re catching all the ones you should. NSError, ugly though it is, actually seems to be a pretty good system for managing and propagating errors generated by different layers of code and even different languages.

Monday, January 5, 2009

Picasa for Mac

Google:

Picasa for Mac looks and works almost exactly like Picasa on other platforms.

In other words, they ported it using a cross-platform toolkit, and it doesn’t look or work like other Mac applications. Also notable: it doesn’t run on PowerPC-based Macs.

Update: Dan Benjamin:

I’m hoping that a future version of Picasa might be designed for Mac OS X, as opposed to running on Mac OS X. Now that would be a killer app indeed.

KeyRemap4MacBook

Apple’s newer notebooks have a second Option key on the right instead of the more useful Enter key that was present all the way back to the original PowerBooks. KeyRemap4MacBook is a kernel extension for remapping this key (and others) to do what you want (via Ken Case).

Thursday, January 1, 2009

ATPM 15.01

The January issue of ATPM is out:

The Art of the Title Sequence

The Art of the Title Sequence is an excellent site featuring still images and QuickTime excerpts of movie and TV titles (via Geoff Tsai).

Wednesday, December 31, 2008

Frozen Zunes

The cause of the Zune freezes seems to be an infinite loop in the clock driver’s handling of leap years (via Greg Titus). This looks like the sort of bug that could be detected via static analysis.

Update (2009-01-05): More analysis of the bug and possible fixes.

Tuesday, December 23, 2008

BBEdit 9.1

BBEdit 9.1 can exclude dictionary words from the completion list, and projects now store relative references to files.

Saturday, December 13, 2008

The 99-cent Message

Manton Reece:

I’ve bought apps for $5 and $10, and now many of those prices have either been cut in half or lowered to 99 cents. I felt like I got my money’s worth at the higher price, so I’m not complaining that I was ripped off. Instead, I just feel like a fool.…Apparently the way to buy iPhone software is just to wait a month for the price to drop.

Indeed. When apps I’ve bought go on sale, their icons get “Sale” badges in my iTunes Applications pane. I already feel somewhat like a fool for the apps that I wouldn’t have bought if there had been a trial available. Now there’s a way to reduce the satisfaction of having purchased an app that I do like.

Tuesday, December 9, 2008

Higher Order Perl

Mark Jason Dominus’s excellent Higher Order Perl is now available for free in PDF and MOD formats. This is the kind of book I like to read on paper, though.

Monday, December 8, 2008

On Leaky Abstractions and Objective-J

Francisco Tolmasky:

Everybody is writing “abstractions” around JavaScript…I mean EVERYBODY, including Prototype, Dojo, and jQuery. Yes, you read correctly, all the major JavaScript frameworks are essentially doing the same thing we are to some degree or another—we’re really not that original. The sole difference between their approach and ours is that when they add new language features to JavaScript, they’re not taking the extra step of introducing new syntax.

He goes on to explain that they chose Objective-C syntax not because they were targeting Objective-C programmers but because they faced the same issues extending JavaScript that Stepstone faced 25 years ago extending C.

From C++ to Objective-C

From C++ to Objective-C (PDF) looks like a concise and useful book for experienced programmers who want to learn about Objective-C (via John Haugeland). Unlike the various paper books I’ve seen, it isn’t full of step-by-step example projects. Unlike Apple’s book, it has lots of comparisons with C++ and advice about common techniques. However, it could use some technical review. For example, page 25 cites Wil Shipley’s incorrect recommendation to avoid self = [super init]. In fact, this idiom makes sense and is recommended by Apple.

Saturday, December 6, 2008

Let’s Talk About Python 3.0

James Bennett:

Although at the start I paid only the most cursory attention to the Python 3.0 development process, every time I looked into it in any detail I was struck by the amount of time and thought which went into the changes which have been made to the language. There are, so far as I can tell, no frivolous “we just did this because we liked it” differences between Python 2.x and Python 3.x; every breaking change seems to have been discussed to death, justified based on real-world problems and even then carefully considered and reconsidered just to see if a backwards-compatible way could prevail. Python 3.0 came out of a years-long process of development by people who were simultaneously actually using Python and taking notes on how it could be better, and it shows.

Thursday, December 4, 2008

Python 3.0

Python 3.0 is now available. It includes a huge number of forward looking but backwards incompatible changes.

Wednesday, December 3, 2008

Cocoa Bindings and Arrays

Peter Hosey has some good examples of what to do and what not to do when modifying an array controller’s content.

Tuesday, December 2, 2008

Quarz Event Taps

Rainer Brockerhoff:

Both Quay and Klicko do part of their seeming magic with a technology called “Quarz Event Taps” (PDF file). This was introduced in Tiger, and perfected in Leopard. Briefly, an event tap is a C callback routine that is called to filter low-level user input events at some points in the system's event processing, which is actually quite complex. Events can be generated, examined, modified or even suppressed before they're delivered to an application. Since user input events are usually routed to the foreground window (that is, to the foreground application, even if it has no window), this makes event taps quite powerful.

Monday, December 1, 2008

ATPM 14.12

The December issue of ATPM is out:

AnchorFree Offers Free VPN for iPhone

Glenn Fleishman:

To work around these problems, AnchorFree chose to add to Hotspot Shield a VPN type that the iPhone has built in: L2TP, which stands for Layer 2 Tunneling Protocol over IPsec (Internet Protocol security). L2TP is an extremely strong method of creating a secure connection, and is one of three methods that the iPhone 2.0 Software and later support. (Alas, the iPhone can’t maintain a seamless VPN connection when you roam among Wi-Fi networks or between Wi-Fi and cell data networks; you have to disable and then re-enable the VPN connection for each network move.)

Don’t Use NSOperationQueue

Mike Ash discusses a bug in NSOperationQueue that can cause crashes:

Indeed, just about the only thing that seems to help is to only have a single NSOperationQueue running at a time. Since you can’t prevent framework code from running its own NSOperationQueue, this is an untenable solution.

Update: His solution is RAOperationQueue.

License Plate Sabotage

Mark Dominus:

…for a number of years I have toyed with the idea of getting a personalized plate with II11I11I or 0OO0OO00 or some such, on the theory that there is no possible drawback to having the least legible plate number permitted by law. (If you are reading this post in a font that renders 0 and O the same, take my word for it that 0OO0OO00 contains four letters and four digits.)

Friday, November 28, 2008

Scoped Objects in Objective-C

Guy English shows how to use GCC’s attribute feature to automatically send -release messages to objects when they go out of scope.

Wednesday, November 26, 2008

Dropbox

Dropbox is certainly a promising technology—in many ways, what iDisk should have been—but it currently has some serious problems. It does not support Mac resource forks, extended attributes, or packages. Worse, it does not tell you that it doesn’t support these features. It just silently throws away those parts of your files. Until this is fixed, it should only be used by technical users who are sure that these limitations will not cause problems for them.

Tuesday, November 25, 2008

A Web-focused Git Workflow

Joe Maller:

The key idea in this system is that the web site exists on the server as a pair of repositories; a bare repository alongside a conventional repository containing the live site. Two simple Git hooks link the pair, automatically pushing and pulling changes between them.

Inside Safari 3.2’s Anti-phishing Features

MacJournals:

The Apple Customer Privacy Policy says nothing about Safari sending any information to places other than the Web sites you’re visiting—but as of Safari 3.2, it does exactly that…If the URL of a page you want to visit matches the hash prefix of a known malicious page, Safari 3.2 appears to send that prefix to Google and ask for the entire 256-byte hash to make sure that this really is a malicious page (and also to verify that the page hasn’t been removed from Google’s lists since Safari’s last list update). Millions and millions of URLs could produce hashes that start with the same 32 bits, but if Google gets several requests for the same value, the company could reasonably infer that people were visiting the malicious page it had tracked—and since the request from Safari to Google comes from your IP address, Google might infer data from that as well.

Script Debugger 4.5

Script Debugger 4.5 is a $49 upgrade that adds full Unicode support, horizontal and vertical window splitting, regular expressions, customizable key bindings, and some nifty dictionary-aware auto-completion features. It also brings back the “Edit with BBEdit” feature and the scriptability of Script Debugger itself.

Safari in iPhone OS 2.2

John Gruber:

To make better use of the available space in the location field, Safari no longer shows the “http://” or “https://” protocol scheme. You do see the protocol scheme, however, when you tap the location field to edit the URL…But it’s hidden, sort of like file name extensions in the Mac OS X Finder, in the normal display view.

I agree that, at least if you know what the magnifying glass means, the new search field is a waste of space. What I don’t understand is why the reload button is now inside the location field. The × button inside a search field makes sense because you’re clearing the field, but the reload button applies to the page.

Update: Jesper adds:

…if you’re editing, there’s a white cross in a grey circle in the right end of the URL field that means “empty the text field”, and when a page is loading, there’s a UI teal cross in the right end of the URL field that means “stop the page from loading”.

Monday, November 24, 2008

The Netflix Prize and Napoleon Dynamite

Clive Thompson (via Jason Kottke):

Mathematically speaking, “Napoleon Dynamite” is a very significant problem for the Netflix Prize. Amazingly, Bertoni has deduced that this single movie is causing 15 percent of his remaining error rate; or to put it another way, if Bertoni could anticipate whether you’d like “Napoleon Dynamite” as accurately as he can for other movies, this feat alone would bring him 15 percent of the way to winning the $1 million prize.

Guide: Writing Testable Code

Miško Hevery:

To keep our code at Google in the best possible shape we provided our software engineers with these constant reminders. Now, we are happy to share them with the world.

TaskPaper 2.0

TaskPaper looks much-improved, with a more advanced query language, theming options, and a quick entry window. I’m glad to see that the toolbar is back at the top of the window.

HandBrake 0.9.3

HandBrake now leverages the FFmpeg project so that it can convert video from all sorts of different formats, not just DVDs. This should make it the clear replacement for the recently discontinued VisualHub. For unstated reasons, Handbrake no longer has built-in DVD decryption, although if you have VLC installed it will use VLC’s libdvdcss and work pretty much the same as before. Despite the version number, this looks like a big upgrade. As far as I know, HandBrake is the easiest and fastest way to convert video for use on an iPhone.

Update: Ars Technica adds:

Jon Rubin, one of HandBrake’s developers, got in touch with Ars to explain the true reason behind the removal of the DVD libraries: “One of our developers works for a large company and felt more comfortable concerning his employment if what he did in his free time didn’t raise IP issues.…”

Friday, November 21, 2008

Scala?

Guido van Rossum:

Steve [Yegge] characterized Scala as “static typic’s revenge” […] and went on to make fun of the incredible complexity of Scala’s type system, which contains such esoteric concepts as type erasures, variance annotations, existential types, polymorphic method types, and many more (just scan the ToC of the language reference).

I have to agree with Steve—if this is what it takes to have compile-time type-safety in a language, I’ll take dynamic typing any day. There’s got to be a better way—perhaps Haskell?

Thursday, November 20, 2008

Google Mobile Uses Private iPhone APIs

John Gruber:

Third-party iPhone development is purportedly a level playing field. If regular developers are forced to play by the rules, but Google is allowed to use private APIs just because they’re Google, the system is rigged.

Erica Sadun at Ars Technica has some more information about this.

Tuesday, November 18, 2008

GitX 0.5

GitX (via Jonathan Rentzsch) is a graphical interface for Git with a real Mac interface, unlike gitk. Right now you can view the history (by commit, but not by file), browse trees, and make new commits. Excellent work.

Sunday, November 16, 2008

How to Price Your iPhone App Out of Existence

Andy Finnell:

There will be an iPhone app bust. The current prices simply aren’t sustainable. Either developers will crash out of the market when they discover they can’t make a living off their current prices, or the gold rush developers will lose interest and leave when they realize they can’t make a quick buck off the store. The developers left standing will be the ones who set reasonable prices for their applications.

Open Radar

Open Radar is a second place to file your Apple bugs so that other developers can see them (via Dave Dribin and Jonathan Rentzsch).

Thursday, November 13, 2008

KTUIKit - Layout Managers for Cocoa

Cathy Shive has released a framework called KTUIKit that provides better view controllers, easy ways to set view background colors and borders, and a basic layout manager class. I think NSView’s spring and strut system is the weakest part of Cocoa. It works fine in simple cases, but when you have multiple panes in a window or you need to resize a window through a wide range of sizes, it falls apart. KTLayoutManager looks like a good start at solving this problem, although ultimately I think it should be addressed in Cocoa itself.

Wednesday, November 12, 2008

AutoZone Source

The source code for AutoZone, Apple’s Objective-C garbage collector, is now available (via Bill Bumgarner):

AutoZone is a scanning, conservative, generational, multi-threaded garbage collector. Specifically, it is the garbage collector used by the Cocoa frameworks within Mac OS X Leopard and Xcode, the premiere development environment for Mac OS X and iPhone application development, is one of several garbage collected applications that shipped with Leopard.…While AutoZone was tested and deployed with a focus on supporting Cocoa application development, the implementation is language agnostic.

Tuesday, November 11, 2008

Wikipedia License Hacking

Charles Miller:

Most invocations of GNU/FSF licenses (including Wikipedia’s) permit distribution under any later version of the given license, so…The Wikimedia Foundation prevailed upon the Free Software Foundation to release a new version of the FDL specifically giving Wikipedia (and wikipedia-like “Massive Multiauthor Collaboration Sites”) a time-limited option to switch to the Creative Commons Attribution Share-Alike license.

Drobo and Time Machine

Erik Barzeski:

One thing that’s somewhat annoying: the Drobo, when it gets nearly full, will insist that I change a drive. It’ll turn the light(s) yellow and everything. Can’t it be told that it’s a Time Machine drive and that Time Machine will automatically remove old data to make room for new data?

Monday, November 10, 2008

HFSDebug 4.0 and New HFS+ Features

Amit Singh (via John Siracusa):

The most interesting technical things about HFS+ are not its features, but how several of the newer features are implemented. With the goal of retaining backward compatibility, new features have often been retrofitted, or shoehorned, if you will, into HFS+. Knowing such implementation details invokes different reactions in different people, ranging from “That’s a nifty way to implement this!” to “Gross!” This is something you can decide for yourself with the help of HFSDebug, which can show you exactly how the file system works.