Tech Archives, page 25

All things technology. Very popular here on Justinsomnia.

Fixing Broken Windows

Recently there was some chatter in the blogosphere on something called the broken windows theory from Malcolm Gladwell’s book The Tipping Point. All of a sudden everyone was all “broken windows this” and “broken windows that” and I was like, “broken windows what?” So I turned to my trusty Wikipedia and discovered an entry on Fixing Broken Windows. The article describes a theory from a book of the same title based on an article from the Atlantic Monthly in the early 80s. The following excerpt explains the gist:

A successful strategy for preventing vandalism is to fix the problems when they are small. Repair the broken windows within a short time, say, a day or a week, and the tendency is that vandals are much less likely to break more windows or do further damage. Clean up the sidewalk every day, and the tendency is for litter not to accumulate (or for the rate of littering to be much less). Problems do not escalate and thus respectable residents do not flee a neighborhood.

I thought to myself, “Hmm. I like this theory. Whether or not it’s true in some kind of empirical way, I think it’s a good way to live. A personal ethic, if you will.” So I linked to the Wikipedia article on my blog and went about my business.

Until a friend replied with a link to an article on Ward Cunningham’s patterns in software development wiki called FixBrokenWindows. The wiki page relates this sociological concept to programming and computer systems—which caused this catchy metaphor to creep through my consciousness. What they had to say on the matter I found very compelling, and perhaps more importantly, I found it to be immediately applicable in my daily work, and I’m probably not alone.

Here’s a choice excerpt:

Context: Software seems to be subject to entropy. Things that used to work stop working. Ideas that seemed good at the time, seem poor 3 months later. Interfaces get ugly. It’s easy to find yourself surrounded by code that has niggling things wrong with it, or that’s just plain bad.

The problem: When you’re surrounded by ugly things, your attitude and outlook change. You become pessimistic, and your expectations are lowered. Soon you start accepting that “that’s just how things are.” You start producing ugly things yourself.

Therefore: Don’t live with broken windows. Fix things when you see them. Refactor when you can. If you can’t make the change right then, put some kind of flag in place (like a FixmeComment) to at least acknowledge that you’ve recognized a problem, and to tell people that someone cares and is on top of it. Stop rot while it’s isolated.

The Flipside: People respect well maintained things. Beautifully restored vintage cars are treated with reverence. People take off their shoes when entering well-cared for houses. A good way to get other developers to treat your systems with respect is to keep it looking cared-for.

This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.

Get photos off your cell phone without paying Sprint $15 a month

Update: Before leaving a comment on this post, please realize that I do not support BitPim nor am I one of the BitPim developers. I simply downloaded and installed BitPim in order to download photos off of my cellphone. If you are looking for information on BitPim support for your particular cellphone model, please consult the BitPim Help Page rather than leaving a comment here. Good luck!

Sprint offers optional wireless internet service called PCS Vision. For an additional $15 a month, you get unlimited Sprint TV, picture mail, video mail, email, instant messaging, and web access. None of which I really want—except the ability to move the photos I take to my computer. Without the Vision service, it costs 2¢ for every kilobyte transfered off the phone.

Let’s do the math. Average file size of a 640×480 pixel jpeg: 55KB. Cost per photo uploaded: $1.10! A buck to take a crappy cellphone picture!? I mean, I’d pay $5 a month if I could configure Sprint to upload the pictures directly to my WordPress blog, but that’s unlikely any time soon.

I just want to get the photos off my phone, and I don’t want to pay Sprint in order to do so.

First thing I need is a cable. Don’t expect to find that in any Sprint store. After a little Googling around, I discovered that my Samsung SPH-A840 phone (aka the PM-A840) accepts a Samsung USB Data Cable (PCB113BBEB). I got mine from WirelessGround.com for $15 (including shipping). Just arrived today.

Of course it came with no software or drivers. I found some some drivers online, but these were only intended to turn my cell phone into a wireless modem. Handy, but I really just want to copy my photos to my laptop. Ain’t no way I’m paying $70 for DataPilot. This should just work! Update: Mike left a comment to say that actually the drivers are necessary for BitPim to communicate with the phone. And he offered what will hopefully be a more permanent link to the download them. Thanks Mike!

In the end, it was an almost year old article from Microsoft (of all places) called Camera phone options that pointed me to BitPim, a free, open source cell phone syncing application. It had trouble downloading my phone book entries, but no problem downloading my photos!

Drive home from work along Occidental Road, Sebastopol, CA
Driving home from work along Occidental Road

Yay, I win!

How to download cameraphone photos using BitPim

  1. Start BitPim with your cellphone attached to your laptop
  2. Goto Data > Get Phone Data …
  3. Check the “Wallpaper” checkbox and click OK
  4. BitPim will start downloading your photos (on some occasions BitPim has crashed here, so usually I just unplug my phone, restart BitPim, and start over)
  5. In Windows, the photos should be downloaded to a folder called “camera” under “My Documents\bitpim\bitpim.db_blobs”.

Justinsomnia Maps

I’ve been working on this for an obscene amount of time. I’ve been working on it for so long, I can’t even remember when I started it. I think it was back in February, and then I got interrupted by another slightly more important project, so progress stalled.

I’m occasionally thinking about ways to expose my archives. One of my first attempts was creating the random image plugin for WordPress which displays, at random, one of the 400+ photos I’ve included in my blog posts, with a link back to that post. It’s like visual serendipity.

Then it occurred to me that many of my blog posts, especially since moving to California, have a geographic focus. Usually they’re about a place I went and often include a photo or two (or three).

Anton Zuiker's Travels MapIt got me thinking about Anton’s travels page, powered by this flash app called IndyJunior which displays some of the places around the world that he’s been. Of course Anton’s pretty lucky, he spent time in Vanuatu doing Peace Corps, so his travel map looks awesome. But at the same time, it only really works well if you put in very granular data about the states or countries you visited.

Then it occurred to me, what if I could associate some geospatial data with my blog posts? Data that I could then extract and display on a map…using the Google Maps API, for instance. As long as I remembered to enter the metadata with my posts, the map would stay automatically updated, and it would provide a neat visualization of my archived posts and the places I’ve traveled. Here’s a screenshot:

Map of Justinsomnia blog posts

The hard part was going through my archive of several hundred posts (almost 4 years!) and entering latitude and longitude data as precisely as possible for all relevant posts. 152 coordinates in all, so far. That was like 152 mini-research projects. Hmm, where again were those botanical gardens just outside of Accra, Ghana?

Of course it turns out that some posts necessitated multiple coordinates, but thankfully many, especially the earlier posts, had no geospatial associations. Luckily Google Maps is a great tool for gathering latitude and longitude data. Just center the map on your location, click “Link to this page”, and the coordinates for that point will be accessible in the URL as the ll query string variable, e.g. ll=33.66121,-95.556507. Consider it the poor man’s geocoder.

For the WordPress geeks out there, I stored this data as a custom field called geographic_coordindate in the format latitude,longitude;location where location was a short description of the specific location. This was especially useful for posts with multiple coordindates. Then I wrote a script that selected all those posts from the database and generated the javascript function calls necessary to build the markers and info bubbles in Google Maps.

Eventually maybe I’ll release a plugin or some code so others can do this, in the meantime, just leave a comment or send me an email if you’re interested.

Otherwise, go forth, explore my geospatial history.

New cellphone, yay! Sprint, grrr!

My old cellphone developed an annoying affliction. Since St. Patrick’s Day, when someone called me, every so often they got the following message:

The PCS telephone number you’ve dialed is temporarily not in service.

Message 262. 3.

Since I dial my own phone number to check my voicemail, I also started hearing the message occasionally. Too occasionally. Usually it would happen when there was a significant gap of time (a few hours) between incoming calls. When someone dialed my number again, they’d most likely get through.

The only problem with always-on voicemail is that it conditions us to expect to ALWAYS get through. When you get a unexpected message like the one above, people think I didn’t pay my cell phone bill, or my phone number is no longer good. And they don’t always try to call back. Which means just like that, Sprint has begun providing me with an unacceptable level of service.

But I couldn’t determine if the problem was my trusty but ancient, monochrome Samsung SCH-A460, or if there was an issue with Sprint’s network. Predictably, tech support was little help. In the end, they suggested I get a new phone. I was long overdue for an upgrade, and apparently I could get a $150 rebate with a new 2 year contract. Yay. Let me take this opportunity to say that I HATE CELL PHONE CONTRACTS.

Samsung PM-A840 cell phoneI shopped around, but in the end I really just wanted a cellphone that made phone calls. The only improvement I could imagine would be finally having the ability to send and receive text messages. So though I cooed at the Motorola phones offered by T-Mobile, I ended up sticking with Sprint, having 7 months still left on my current 2 year contract. Plus they had a decent looking phone, actually their only decent looking phone, on clearance for only $19.99, the Samsung PM-A840.

I was hoping I’d get the phone for free with that $150, long time customer “New for You” rebate program, but it turns out in a feat of devious marketing, the $200 clearance rebate that brought the phone cost down to $19.99 was actually same as the “New for You” rebate. And then as if to add insult to injury, they charge me 8% sales tax on the full price of the phone even though the rebate was instantaneous. Is that even legal? So I ended up paying $37.59 for my shiny new phone. And they tack on trial “PCS Vision” services I can’t decline unless I call customer service in a few days. What a scam. At least I got a new plan for the same price with 100 more minutes.

And guess what. The annoying message that started off this whole process is still happening. Except now I can receive text messages.

The CSS line-height property can accept unitless values

Remember how I was angsting about increasing the line-height on our articles, but worrying about affecting all our style? Well, this doesn’t exactly fix that, I’d still just want to affect article content, but it’s related.

Eric Meyer: The property line-height can accept unitless number values.

And for future reference (unrelated to line-height), Dave passes along this A List Apart article: In Search of the Holy Grail (of CSS Layouts)

This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.