Climate Pathways app enables everyone to investigate climate change

My first app for iPhone and iPad has been published in the App Store by my development partner Climate Interactive. I started with the idea of publishing an ebook with embedded simulations to explain the science behind global warming and climate change. The climate system is complex with many surprises in its behavior. I thought it would be interesting for people to find out for themselves how delays in the system mean we have to reduce greenhouse gases now, before the really bad impacts have become apparent.

I needed a climate model that would run fast enough on an iPhone. This led me to Climate Interactive and their C-ROADS model. They work with policymakers, helping them understand how various greenhouse gas emissions scenarios will play out. Their first outreach to the public, the Climate Scoreboard, was a big success, and they wanted to do more. They had just developed a simplified climate model in JavaScript that I could embed in an iOS app.

When Drew Jones at CI proposed an app that would deliver the key insights in a focused way, I ditched the ebook idea and worked with the CI team on realizing Drew’s proposal instead. The result is Climate Pathways.

There’s a thermometer on the left that shows the temperature rise at 2100. To use the app, you trace a greenhouse gas emissions curve from 2010 to 2050. The gray curve shows our current, disastrous path for reference. The app instantly calculates the temperature rise in 2100. Your task is to find a scenario that results in a temperature rise of 2ºC (3.6ºF) or less.

If you get stuck, you can try “auto mode” and sweep your finger around to find 2ºC pathways calculated by Lori Siegel at CI using the full C-ROADS model. The little info button gives you some background information on the climate system and our current situation.

The app page at CI features a demo video showing the app in action, narrated by Drew Jones of CI. This video shows how effective an interactive simulation can be for illustrating the behavior of a complex dynamical system.

Climate Pathways Demo

The Climate Interactive team took iPads to the UN climate conferences in Cancun and Durban. People there really liked how it gets the point across. Hopefully, we’ll be able to do a lot more with it soon.

Testing C-ROADS for iPhone at COP16

So if you have an iPad, iPhone, or iPod Touch, head on over the App Store to download your free copy of Climate Pathways today!


How to update Nook books

Science fiction author Rudy Rucker has published his Complete Stories at his new Transreal Press. I downloaded it from the Nook Book Store. But when he updated the book, I couldn’t see how to get the new version on my Nook Simple Touch. I finally figured out a workaround.

There’s one big caveat though: if you update a book, you will lose your notes and bookmarks for it.

1. Go the Library of content on your Nook.

2. Double-tap on the book you want to update. (If you single tap, you will open the book.)

3. Tap the Archive button. This will remove the book from your Nook. Like all the books you purchase from the Nook Book Store, it is still stored in your online account at B&N. Tap OK to proceed.

4. Now tap Unarchive to get the book back on your device. It will download the latest version, updating the book.

How to upgrade to DRM-free iTunes music tracks

Some friends were telling me about problems putting music from the iTunes music store on their Android phones. I realized the problem was most likely old tracks protected with DRM (Digital Rights Management). They didn’t know that Apple had stopped using DRM and they could get new DRM-free copies of their music.

Here’s how to remove the DRM from old iTunes music purchases. This is the official Apple way, which involves buying an “upgrade”. There are other tools you can find that will remove the DRM without the upgrade. I haven’t tried any of those.

This page gives all the details. The short version is that in 2009 Apple made “iTunes Plus” versions of all their music available. This is what you have been getting since then. You can upgrade your old tracks to iTunes Plus. This gives you DRM-free tracks and improved sound quality (they re-encoded the tracks at twice the previous bit rate). The cost is $0.30/track or 30% of the album cost.

This link will open iTunes and show the old tracks that you can upgrade and how much it costs. I tried it myself and saw this in iTunes:

The tracks are still in AAC format (not MP3) so you might want to verify that your music players support 256 kbps AAC before plumping for the upgrade. Or just try one track first to see if it works.

ZippGo moving boxes: roomy, sturdy, easy, ecological

I move a lot—every year or two. I hate buying lots of expensive moving boxes only to throw them away after a couple of weeks. It wastes trees and energy. But now there’s a better way if you live in the San Francisco Bay Area.

For my last few moves, I used a stack of file boxes from the office supply store. File boxes are relatively inexpensive, assemble quickly without tape, and are sturdy enough to hold heavy loads like books.

This time I stumbled on a San Francisco startup company with a great new idea. ZippGo delivers big, plastic boxes to your old home, and then picks them up two weeks later after you move. The boxes can be reused hundreds of times. The cost is about the same as buying cardboard boxes. My ZippGo boxes were roomy, sturdy, easy, ecological—what’s not to like?

I started by ordering the 24 box package online. I wasn’t sure from the website how big the boxes are, or if there was an assortment of sizes. 24 boxes turned out to be enough for my one bedroom apartment, with 10 of the boxes devoted solely to books. I had to use a few old file boxes too.

The ZippGo order form allowed me to request two, 2 hour windows on my delivery and pickup dates. They called me the night before to confirm my delivery. One thing I didn’t like is that they charged extra for delivery because I had an elevator in my old apartment. That didn’t slow things down at all. The new place had stairs and a gate to deal with, which did require a lot more work. I can see charging extra for stairs, but not for an elevator.

I was surprised how compact the boxes were. They stack up like food containers. I had visions of piles of boxes turning my apartment into an obstacle course, but it wasn’t like that at all.

I was also surprised at how big the boxes are inside. This is really helpful for bulky items like kitchen equipment and clothes. Here’s a picture of a file box inside a ZippGo box to show the size.

The boxes come with adhesive labels and several colors of cable ties. You don’t need tape with ZippGo boxes. You just shut the cover and hold it closed with a cable tie. The different colors enable you to indicate to the movers which room the box should go to. ZippGo removes the labels after your move, so you don’t have to deal with that. I guess it’s part of cleaning the boxes (and they were all very clean).

Notice the boxes don’t have an URL on them, only a phone number and a Twitter @ name. Thinking ahead there!

The boxes are made of heavy plastic. You can easily stack them four or even five high. This was really great after the move. They didn’t take up so much room that I felt like I had to dig myself out right away.

ZippGo provides a special dolly that fits under a stack of boxes. The movers really liked this.

I had two weeks after the boxes were delivered to move and unpack. The pickup time was scheduled when I ordered, but I was ready to turn them in a couple days early. I emailed ZippGo and they immediately scheduled an earlier pickup.

The ZippGo truck shows their whole value proposition. It looks like a web page on wheels to me.

And here go the boxes.

I would recommend ZippGo boxes for anybody who would throw away their moving boxes after they move. The cost is the same, unless you are reusing random boxes from the grocery store dumpster, but I stopped doing that a long time ago. The service is only available in the Bay Area for now, but hopefully they will expand their range in the future.

How to install two cable modems with Comcast Internet

I recently rented an apartment that is part of a larger house. My landlords have Comcast high speed Internet service. The cable in my apartment is an extension of their cable wiring. They didn’t want to share their wireless network, so I needed to install my own cable modem.

Is a second cable modem without independent cabling from Comcast possible? A quick web search revealed mixed opinions that struck me as unreliable. And of course, Comcast’s own support site had nothing useful to say about it. So I just had to dive in and give it a try!

The short version

  1. Get a cable modem. You can lease one at a Comcast store and set up your account at the same time, but that’s not what I did. I bought a Motorola SB6120. It implements DOCSIS 3.0 and is compatible with Comcast. You can use any cable modem on the compatibility list.
  2. Connect the cable modem and let it sync until you get steady Power, Receive, Send, and Online lights.
  3. Write down the MAC ID found on the bottom of the cable modem.
  4. Call Comcast customer service at 1-800-266-2278 and set up a new Internet-only account. I got a special rate for the first year.
  5. Customer service will transfer you to tech support. Read them the MAC ID. They will provision the modem while you wait.
  6. You are now online!

A twisty maze of passages, all alike

Here’s the full story of how I developed this procedure through a series of discoveries and false starts. There’s a lot more explanation than the short version. I describe what I learned from each dead end. The only steps you need to follow are in the short version above.

You have the choice of supplying your own cable modem or renting theirs. You can pick one up at a Comcast store and set up your account at the same time. I elected to buy my own, which enabled me to do everything over the phone. Comcast has a list of cable modems they have certified as compatible with their system. I chose the Motorola SB6120 based on its easy availability at Best Buy and its solid reviews there and at Amazon.

The first thing I tried was connecting the cable modem and starting a browser. After waiting a few minutes until the Power, Receive, Send, and Online lights were on and no longer flashing, I opened my browser and got a Comcast activation page. I entered my landlord’s account number. It then told me to download and run the Comcast Installer Wizard. It dragged me through a long process, only to tell me, “An existing High-Speed Internet cable modem has been detected on your account.”

I took the choice, “I am adding an additional cable modem.” It then dumped me out with, “In order to add an additional cable modem to your Comcast account, please call 1-800-COMCAST for assistance.” This message doesn’t mean what it says, though, because when you call, you will find out that you can’t add a second cable modem to the account. You have to open a new account.

I called 1-800-266-2278 and got customer service on the line. (I started with tech support, based on the misleading message above, but they eventually transferred me to customer service.) The person I talked to did not understand the second cable modem issue very well. Just tell them you are adding a second cable modem and need to open your own account.

At first, they tried to foist a $50 “activation fee” on me. Don’t fall for it. Tell them you have your own cable modem and don’t need any help installing it. It’s all synced up and ready for them to bless it. That reduced my “activation fee” to $2. Whatever. I got a special discounted rate for the first year of service, month-to-month with no contract.

The customer service representative will give you your new Comcast account number. Be sure to write it down, because you’ll need it if you require help later.

Next, you get punted to tech support to provision or “activate” your service. They will ask for your cable modem’s MAC ID. You will find it on a sticker on the bottom of the cable modem. With that, and your account number, they will reach out and program your cable modem remotely. This takes a few minutes and restarts the modem. After that, you should be ready to go. Try pulling up a web page to test the connection.

If you arrived here after trying the Comcast Installer Wizard, you may find (like I did) that it left behind HTTP proxy settings in your browser that will now prevent it from working. (Thanks, guys!) If your browser no longer works, look through your browser settings for a proxy server with “comcast” in the name and delete it.

After fixing my browser, the connection worked perfectly. If I had been able to find out what I’ve written here before I started, the whole process would have taken less than half an hour.

Why is this fair?

Why is Comcast charging you for a whole extra account at the same location? I can’t speak for Comcast, but I may be able to shed some light on this. Cable Internet differs from DSL (telephone) Internet service in that all customers in a neighborhood share a common cable. As far as Comcast is concerned, you are a separate customer needing your own account, even though you might be located in the same house as another customer. After all, you’ll be using a certain chunk of bandwidth like every other customer.

Continue the conversation

I hope this article shed some light on how Comcast handles two cable modems in the same house. It is based on my own experience in California as of May 2011. If you had a different experience, I’d love to hear about it in the comments, so everyone can benefit.

NSString UIKit additions provide vital Quartz text drawing enhancements

One of the distinctive features of Objective-C is categories. They allow you to add methods to a class without changing the original class’s source code (or deriving a subclass). I mostly use categories as a way to keep private methods out of the public interface of my own classes. But Apple has used them in the iOS SDK in the way they were originally intended.

I was struggling with drawing text in Quartz 2D when I stumbled on the NSString UIKit additions. There’s really no other good way to measure text before you draw it. You’ll need to do this to position text on a chart, for instance, as in my Climate Pathways app. The additions make Core Graphics much easier by allowing the use of UIKit objects. Now I use them everywhere to draw text.

They’re pretty straigtforward, but I got stuck when I tried to use them in CALayers. The additions assume they will be used in a view. They get the current graphics context for you by looking at the context pushed on the stack before drawRect: is called. If you are drawing dirctly in a layer, the context is not pushed on the stack. You have to do it yourself before calling the additions.

- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)c {
	[messageColor setFill];
	[messageText drawAtPoint:textPos withFont:messageFont];

Note that the text coordinate system does not need to be flipped when drawing text this way.

Philips LED lamp is the real deal

I’ve been using compact fluorescent bulbs for 20 years, back when they were a fringe item at Real Goods. I’ve been trying the new LED lamps for several years with uniformly disappointing results. Until now.

LED lamps use white LEDs, which emit “cool white” light with a bluish tint that many people find unpleasant. This is the same problem that compact fluorescent lights had until recently.

The big problem with LED lights is that they just aren’t very bright. Buyer beware: a “40W equivalent” or “60W equivalent” lamp probably isn’t.

That’s why the new Philips LED lamp from the EnduraLED line is such an exciting development. It really is 60W equivalent–a full 800 lumens. And the light is soft white. I’d say the light is not quite as warm as an incandescent bulb, but it’s pretty close.

When I first saw the package, I thought it must be a spotlight because of the opaque yellow sides. But when you turn on the light, the whole bulb illuminates in soft white light.

Philips 12 watt LED bulb

This lamp only seems to be available at Home Depot in the US so far. It’s pricey at $40, but then it should last 30,000 hours or over ten years. The Philips part number is 409904. If anybody can find an alternate source, I’d love to hear about it in the comments.

Philips 12 watt (60W equivalent) A19 Ambient LED Soft White Light Bulb at Home Depot

LOG_EXPR makes NSLog debugging easy

I find interactive debuggers too tedious for most problems. Xcode is no exception: you have to dig through the object hierarchy to display the values you want to look at, and even then, Xcode may not display the value in a useful way.

Years of web application development got me in the habit of “printf” style debugging with a log file. This works great in Xcode using NSLog, but now there’s an even better way.

Vincent Gable’s LOG_EXPR macro automates the tedious work of writing labels for your debug values. Give it most any expression, and it will print the expression and its value. For example, writing:


in your code gives you the following console output:

touchLocation = {95, 413}

LOG_EXPR knows how to format most common C and iOS Framework types. You can format the values for your own types by overriding the - description method of NSObject in your class. This also comes in handy for ad hoc debugging with the gdb print object command.

By the way, when you still want to use NSLog, there’s a useful shortcut in Xcode. Simply type “log” and press Esc. You’ll get an autocompletion list, with a nicely formatted NSLog statement at the top. Just hit Return and fill in the placeholder.

How to connect a wireless mouse…without a mouse

Sometimes I need to turn off my Apple Magic Mouse after my Mac is already started: to clean it, or change the battery, for instance. I have consistently been unable to reconnect the mouse by just turning it on again. The green light flashes endlessly until I give up and restart the computer. Curiously, this doesn’t ever seem to be a problem with the Magic Trackpad, but I still use the mouse sometimes to give my finger a rest from all that tap-tap-tapping.

If you do have both the mouse and trackpad, you can always turn on the trackpad and go to the Bluetooth system preferences panel to connect the mouse. But what if you don’t have a trackpad?

Here’s how to connect a wireless mouse using the keyboard. These instructions are for Snow Leopard, but you can apply the same idea to earlier versions of Mac OS X, where the Bluetooth settings are part of the mouse preferences.

  1. Turn on the mouse.
  2. Press control F2 to access the Apple menu. If this doesn’t work, try Fn control F2 instead.
  3. Press ↓ until you reach System Preferences.
  4. Press ↩ to open System Preferences.
  5. Press control F2 to switch back to the menu.
  6. Press → until you reach the View menu.
  7. Press ↓ until you reach Bluetooth.
  8. Press ↩ to open the Bluetooth system preference pane.
  9. Tab to the list of devices. You will know you are there if you can press ↓ to highlight different devices.
  10. Press ↓ until you reach the mouse.
  11. Tab 3 times to the gear button below the list. If you can’t tab to the buttons, press control F7 to turn on tabbing within dialog boxes.
  12. Press ↓ until you reach Connect.
  13. Press ↩ to connect the mouse.

That seems like a lot of steps, but it becomes obvious after you do it a couple of times.

If you take more than two minutes to connect the mouse after it is first turned on, the mouse will stop trying to connect. You’ll see the green light stop flashing. Just turn it off and back on again to start over.