Inert Detritus The Internet's dust bunnies

Posted
9 November 2008 @ 5pm

Comments Off on Delicious Will Eat Itself!

Delicious Will Eat Itself!

Almost two years ago, Jason Kot­tke pub­lished del.icio.us will eat itself. I was intrigued by this recur­sive process on deli­cious, and want­ed to find out how deep this chain went, so a year lat­er, I decid­ed to write an app to descend the del.icio.us hierarchy.

Well, almost twelve months, one OS bug, and one new lap­top lat­er, here it is.

Caveats:

  • You’ll need to fill in a deli­cious user­name and pass­word in three places in MPAppController.m: I tried to imple­ment a dia­log and Key­chain caching for cre­den­tials, but nev­er suc­ceed­ed. (See the three #warning‑s for these locations).
  • The app uses a com­bi­na­tion of syn­chro­nous and asyn­chro­nous NSURL­Con­nec­tions to work with deli­cious. Your mileage may vary on how respon­sive the app stays.
  • This code is pret­ty old. Things in OS X have changed, and I’ve got­ten bet­ter at Obj‑C and Cocoa since then, so apolo­gies for any par­tic­u­lar­ly ugly or wrong parts.
  • I hard­cod­ed a five sec­ond delay between API requests to avoid smash­ing deli­cious to bits. If you remove this and I get nasty emails from them as a result, I’ll find you and punch you for it.

Feel free to pull it, fork it, run it, what­ev­er. I’m done with it, so I fig­ured I’d kick it out into the world. There’s an Excel sheet in the root that’s got the book­mark num­bers I found when I ran it back in August. Again, it’s all avail­able on github.


Posted
7 November 2008 @ 11am

1 Comment

Cinematography and Michael Clayton

The cin­e­matog­ra­phy of this movie so far is excel­lent: great shots, light­ing, et cetera.

One thing, though, is dri­ving me to drink: most scenes were shot with an anamor­phic lens, which, between the lens and lat­er con­ver­sion process­es, leads to an oval-shaped bokeh for out of focus light sources. I found this out on a forum post dis­cussing the cin­e­matog­ra­phy of the movie.

Michael Clayton.avi


Michael Clayton.avi

After grow­ing used to round, or even geo­met­ri­cal­ly-shaped bokeh (straight-blad­ed shut­ters like some cam­era lens­es mean hexag­o­nal or hep­tag­o­nal aper­ture shapes), this is dri­ving me a bit mad.

How­ev­er, it does look neat with close­ly grouped light sources, because they all blend togeth­er and give a great back­ground light texture:

Michael Clayton.avi

Posted
5 November 2008 @ 11pm

3 Comments

Tabs? Spaces? Yes.

Tabs ver­sus spaces is one of the life­long debates between pro­gram­mers. “tabs ver­sus spaces” has as many hits on Google as “vi ver­sus emacs”: it’s that big a deal. (VI 4 LYFE!)

Argu­ments on both sides are quite valid. Pro­po­nents of tabs defend the flex­i­bil­i­ty of defin­ing a \t char­ac­ter to what­ev­er width you desire. Pro­po­nents of spaces defend the con­sis­ten­cy of align­ment of mul­ti-line com­ments and mul­ti-line method calls or mes­sages, as are so com­mon in Objective‑C.

Before we go any fur­ther, I need you to leave one thing at the door: your sense of supe­ri­or­i­ty about code formatting.

“I’ve nev­er worked with code writ­ten or com­ment­ed how you showed it!”

You obvi­ous­ly work with some­one who shares your cod­ing style pref­er­ences. Con­grat­u­la­tions, you’ve nev­er worked on a team before.

“I’d imme­di­ate­ly refor­mat it to suit my taste! Damn their style, it’ll be writ­ten how I want it!”

I’d rather spend my time read­ing their com­ments and under­stand­ing what they’re doing with the code, not being angry at the way they wrote it. An SVN com­mit set that sim­ply turns tabs into spaces or vice ver­sa is frowned upon by all who work on the codebase.

With that out of the way, let’s look at some examples.

Let’s say Joe Java put some com­ments at the end of the line, like so. This looks insane at first glance, but I’ve seen edi­tors and IDEs that enable it, and I’ve seen code com­ment­ed like this.

TabsSpaces.java


This style works well for the author, regard­less of his pref­er­ence for spaces (shown above) or tabs (show below, four spaces per tab as Text­Mate shows at the bottom):

TabsSpaces.java


What hap­pens when I view it with a tab set to two spaces? Life becomes miserable:

TabsSpaces.java


What about Ollie Objective‑C? He loves his mul­ti­line meth­ods, because Objective‑C hasThisWay:ofBeing verbose:whenItComes toParameterNames:andValues.

Here’s a snip­pet from the source for CPU His­to­ry:

TabsSpaces.m

This is fan­tas­tic with spaces! What if I set Text­Mate to tabs, indent this a bit, and ask it to realign things with control‑q?

TabsSpaces.m

That did­n’t work. Now, if some­one views this code with tabs set to any­thing oth­er than four spaces, that whole block is misaligned:

TabsSpaces.m

The new rule for inden­ta­tion and align­ment: “use tabs for achiev­ing an inden­ta­tion lev­el, spaces for char­ac­ter align­ment with­in an inden­ta­tion level.”

This achieves the flex­i­bil­i­ty of let­ting indi­vid­u­als define their own width for a tab for how deep an indent lev­el trans­lates to in columns, while still pre­serv­ing align­ment between lines at a giv­en inden­tion level.

Edit­ed to add: @boredzo decid­ed to steal my thun­der and write a sim­i­lar post. I make the case for the scheme, he asks IDE and edi­tor devel­op­ers to Make It So. We’re a one-two combo.


Posted
26 October 2008 @ 10am

Comments Off on Hard drives and tire blow-outs

Hard drives and tire blow-outs

The most trag­ic hard­ware fail­ure in com­put­ing today is the loss of a hard dri­ve. It dies, tak­ing your bits with it, and get­ting them back is an expen­sive propo­si­tion. I hear about it all the time, from friends, peo­ple online in forums, and even in blog posts.

Hard dri­ves are tires for your com­put­er. You can’t go any­where with­out it, and over time they wear out and need replac­ing. The dif­fer­ence between wear­ing down a tire and wear­ing out a hard dri­ve? When your tires need replac­ing, they usu­al­ly don’t blow out when you’re doing 80 on the high­way. But your hard dri­ve will.

Hard dri­ves fail fast. An arma­ture will go from hap­pi­ly seek­ing to per­ma­nent­ly parked in a mat­ter of sec­onds. A spin­dle motor will be spin­ning fine, until it’s not. My disk fail­ures have all been abrupt: wak­ing up to a click­ing iBook, or a dri­ve enclo­sure mak­ing a god-awful scratch­ing noise. The above-linked author’s point about this is con­cern­ing, as it reveals what he thought before now:

Hard-dri­ve fail­ures can occur with­out warn­ing. In the past, I’ve always known a disk was going to fail because I’d get some sort of warn­ing (strange sounds, error mes­sages). Not this time. I had been telling myself that I didn’t need to back up because every­thing was run­ning smooth­ly. I was wrong.

That should read some­thing more like this:

Hard dri­ve fail­ures will occur with­out warn­ing. Don’t count on hav­ing advance notice from strange sounds or the sys­tem giv­ing any indi­ca­tion that some­thing is afoot. Keep your data safe, because a blow-out can real­ly ruin your day.


Posted
12 October 2008 @ 9am

4 Comments

Geotagging and Fuzzy Locations

I’ve been look­ing at geo­t­ag­ging more of my pho­tos late­ly, either by hand after the fact, or auto­mat­i­cal­ly with the help of ded­i­cat­ed hard­ware. I’ve found a lot of links so far for hard­ware, but I haven’t found exact­ly what I’m look­ing for.

In the mean­time, I’ve been tag­ging a few on Flickr, but am increas­ing­ly dis­pleased with their approach: it’s all or noth­ing. You either don’t tag your pho­to at all, or you give it an exact lon­gi­tude and latitude.

I don’t have the patience or mem­o­ry to tag the exact loca­tion for every sin­gle pho­to, but I feel like drop­ping 50 pho­tos on a pin where they obvi­ous­ly aren’t from is doing more harm than good. I’d love to grab the pho­tos, define a cir­cle on the map, and say, “these pho­tos were all tak­en some­where inside here.”

I real­ize the EXIF tag­ging for­mat prob­a­bly does­n’t sup­port “fuzzy loca­tions”, but it would be a great option to have.


Posted
17 August 2008 @ 9pm

9 Comments

The Folly of Minimum Wage

I just watched Min­i­mum Wage on Hulu, linked from Mike Ziray on Twit­ter. If there’s one thing I learned in school, it’s to take your knowl­edge and apply it in the real world. We did­n’t cov­er min­i­mum wage in any depth, but we did cov­er price floors and ceil­ings, and it’s easy to make con­clu­sions about the mar­ket’s behav­iour from there. I’m assum­ing basic eco­nom­ic ter­mi­nol­o­gy, which isn’t the eas­i­est if you don’t know it before­hand, but I’m lazy, so my apologies.

Briefly, when a price ceil­ing is enact­ed on some­thing, and is priced below the equi­lib­ri­um price, two things hap­pen. First, sup­pli­ers aren’t being paid enough, so they pro­duce less. Sec­ond, since the price is so low, con­sumers demand more. Think of rent con­trol: land­lords are only allowed to charge, say, 600 bucks for a flat in Mis­sion. Well, for $600, every­one wants to live there! They might live in one room, and rent anoth­er, and 12 peo­ple want to live there. If the price were able to change, the land­lord might sud­den­ly decide he’s bet­ter off mov­ing out of his apart­ment in the build­ing, and rent­ing two rooms at 900 bucks per. Less peo­ple will be will­ing to pay 900 bucks for the place, and so those who are will­ing and able to pay for it will be able to live there.

A price floor is equal­ly odd. If a min­i­mum price is set for some­thing, and it’s above the equi­lib­ri­um price, you get this:

Price floor - Wikipedia, the free encyclopedia

In short, there’s a lot of peo­ple who would love to work for 6 bucks an hour, but not so many com­pa­nies will­ing to pay that much. This isn’t to say that this is the sit­u­a­tion across the Unit­ed States, but it is in some places.

Min­i­mum wage isn’t a cut-and-dry issue, not by any stretch. But in some cas­es, it breaks things.

Now, I’ve nev­er thought of a rea­son for a price floor, a com­pelling rea­son. If you can think of one, leave it in the com­ments. This is some­thing best under­stood by bounc­ing ideas off someone.


Posted
11 August 2008 @ 11pm

Comments Off on Mondays, Tired Mondays

Mondays, Tired Mondays

A Retro Blockbuster Storefront

As seen in Wood­side, CA on my way home from Safe­way one evening. (crop­ping idea and blog post for­mat shame­less­ly bor­rowed from Chris Glass)

The last few days have seen me search­ing for a new place to live. I came out to Cal­i­for­nia with a two-step hous­ing dance in mind. First, find a sub­let for a cou­ple of months, since they’re eas­i­er to find from afar, and less like­ly to burn you long-term if they turn out poor­ly. Then, find a longer-term place to live, some­where I’ve explored and like, since that’s some­thing you need to do in person.

I missed my thrice-week­ly run­ning sched­ule this morn­ing. Between a half-restored iPhone, and stay­ing up late the night pri­or send­ing emails, I did­n’t make it out of bed until it was too late. Per­haps tomor­row I’ll make it out the door.

Rac­quet­ball last Thurs­day destroyed me: I have knees and elbows that are bruised from los­ing bat­tles with walls. it’s the first time back at it since a cou­ple of games this spring. I had a blast, so I’m hop­ing to sched­ule it as a week­ly self-harm sports session.


Posted
25 July 2008 @ 9am

Comments Off on What’s the Deal with CPU History?

What’s the Deal with CPU History?

Devel­op­ment on CPU His­to­ry has stalled while I speak with my man­ag­er about it. I hope to be able to start back up on it soon, but I can’t make any guar­an­tees. It’s on GitHub, so fork it and start hack­ing if that’s your style. I’m work­ing on a round-up of advice and improve­ments stem­ming from my (Re-)Designing a Pref­er­ences Win­dow post, and this should pro­vide a good jump­ing-off point for any­one that’s interested.


Posted
24 July 2008 @ 10pm

Comments Off on The First Day

The First Day

A month ago yes­ter­day, I began my first post-col­lege job: work­ing for Apple. I’ll bor­row a page from a sim­i­lar post on Antipode and say sim­ply this:

Quite obvi­ous­ly, noth­ing I say here is speak­ing on behalf of the com­pa­ny: trust me, they can come up with much more inter­est­ing ways to announce things than through my cor­ner of the inter­net. I don’t plan on shar­ing any job par­tic­u­lars in any way. I’m still quite active on Twit­ter, and blog posts about CPU His­to­ry and oth­er top­ics are forthcoming.


Posted
21 July 2008 @ 11pm

1 Comment

A post from an iPhone

I’m writ­ing this on my phone. Not because I have to, but because I can.

I just real­ized that my first day at Apple post nev­er went up like it was sup­posed to that morn­ing. I guess I can rewrite and pub­lish it late. Way late.


 ← Before  After →