a glob of nerdishness

September 19, 2007

Gas upgrade pricing

written by natevw @ 6:27 pm

Nerdishness comes in many forms, and a certain electrical enginerd friend has got the equations to prove it. His observation: “Since the 10 cent difference between each grade is constant, as gas gets more expensive, that extra 10 cents per gallon makes less of a difference.”

As gas prices go up, the percent increase in gas mileage is unaffected, but the “upgrade fee” for the premium grades goes down. There’s a simple formula and explanation based on your car’s habits and current prices that will let you know if it’s worth the jump. He notes that “the worse your overall gas mileage is, the more potential you have to save money by buying the right grade.”

September 15, 2007

[widget setPreference: for:] is not JavaScript!

written by natevw @ 12:08 pm

Widgets can get and set persistent preferences without much hassle. It’s as easy as calling widget.preferenceForKey(key), which will return the value set for the key.

However, sometimes this doesn’t seem to work, because the developer swapped the arguments when setting. The correct order widget.setPreferenceForKey(value, key) is swapped from, say, element.setAttribute(name,value). This one has gotten me way too many times when developing Dashboard widgets.

How did this bizarre ordering come about? I’m guessing it’s because the widget object is actually written as an Objective-C plugin and the developers felt obligated to make the method idiomatic in that language: (void)setPreference:(NSString*)value forKey:(NSString*)key. But the function name is rewritten between Obj-C and JS anyway — I wish they could have broken the idiom a bit and used (void)setPreference:(NSString*)key toValue:(NSString*)value as the method signature, for the sake of the end users.

(Updated to fix method names from original post.)

September 13, 2007

Leopard’s price to drop $370 next month

written by natevw @ 2:48 pm

I’m looking forward to Leopard’s upcoming release, but part of me is already wondering what exciting features 10.6 might bring. While I can’t say there’s anything I personally resent in Leopard (except perhaps the iChat special effects), nothing is particularly compelling either. Nothing on the outside, that is. Under the hood is an entirely different story, explained quite in depth by the 3 part Developer’s-eye view of Leopard series at InfoWorld.

As an aspiring developer, I’m eager for the budget-friendlier Leopard start kit, even if it doesn’t include a hardware discount or technical support.

September 12, 2007

A link to JPEG compression explained in some depth, but with light still reaching the bottom so as to not be too scary.

written by natevw @ 6:02 am

Via Jeff Atwood, “an excellent visual explanation of how JPEG works“. Includes both JPEG and JPEG 2000, with an emphasis on explaining the algorithms well.

September 8, 2007

Picture Lobbyists Association of America

written by natevw @ 5:42 pm

About two weeks ago, James Duncan Davidson’s comment traffic shot up after he politely complained about online photo attribution. Although he lamented about opening a “can of worms”, what I saw publicly was a civil discussion about image netiquette.

Really, photos have got it pretty good these days. We “manage rights” by the good old-fashioned techniques of asking, encouraging, trusting and forgiving. When necessary one can complain, informally or formally. I haven’t heard of any photography coalitions sobbing before Congress about the Internet-induced collapse of all that Is Right and Proper. Google Images lives on, for better or for worse, with no federal agents seizing servers. Nobody’s putting pressure on Apple to make iPhoto automatically delete “pirated” images — my wife can even drag a picture from my shared library into hers when she wants.

The biggest threat to a photographer’s livelihood is competition, not piracy. But unlike certain other industries, this is not a new phenomenon. A new market condition like crowdsourcing (further reading here, here and here) isn’t the end of the world for the photographic trade, just like the Brownie camera wasn’t the end of anything much. I’m glad to be a developing participant in a guild that reacts to change with creative solutions and resolute improvement.

September 1, 2007

Coding morning

written by natevw @ 5:32 am

In an article encouraging a balance between action and talk, Jeff Atwood (intentionally overstating a bit, perhaps) said that “Pundits only add ephemeral commentary to the world…”.

This morning I considered finishing one article or another to post here. Writing is a worthwhile use of my time, as is at least a good fraction of the reading I keep up with. Yet, I also have some small personal projects that can’t ship until more time is invested in them. Sometimes code doesn’t need to be “inspired” so much as typed.