BP Oil Spill in Perspective

Govt. Estimate of oil leak quoted in Wall Street Journal 6/9/2010
-------------------------------------------------------------
    642,994,775,000,000,000 gallons of water in the gulf (est).
                  1,800,000 gallons per day of oil leaking into gulf (govt. est).
                         50 days of leaking.
                 90,000,000 total gallons leaked so far (govt. est).
            0.0000000139970 % of the gulf—by volume—ruined so far.

NOAA Estimates of gulf oil leak
-------------------------------
                  4,200,000 gallons of oil per day (NOAA est).
                         50 days of leaking.
                210,000,000 total gallons leaked so far (NOAA est).
            0.0000000326597 % of the gulf—by volume—ruined so far.

Ocean-wide calculations
-----------------------
446,450,767,880,000,000,000 gallons of water in the world (est).
                  1,800,000 gallons per day of oil leaking into gulf (govt. est).
                         50 days of leaking.
                 90,000,000 total gallons leaked so far (govt. est).
            0.0000000000202 % of the world's ocean—by volume—ruined by the gulf leak so far (govt. est).

                  4,200,000 gallons of oil per day (NOAA est).
                         50 days of leaking.
                210,000,000 total gallons leaked so far (NOAA est).
            0.0000000000470 % of the world's ocean ruined by the gulf leak so far (NOAA est).

My personal estimates of how long it will take to stop the gulf oil leak
------------------------------------------------------------------------
                    180,000 Barrels of oil leaking per day.
                  7,560,000 gallons of oil per day (my estimate).
                      1,095 days of leaking (3 years).
              8,278,200,000 total gallons will leak (that's over 8 and a quarter billion).
            0.0000012874444 % of the gulf—by volume—will be ruined (not nearly as small a number as it looks).
            0.0000000018542 % of the world's oceans—by volume—will be ruined.

My reason for doing this.

The Gulf of Mexico oil leak awful, but humans are still pretty small part of the world&emdash;by volume. Not that we aren’t trying our damnedest to be a big part. This just sucks and I have a hard time believing we can do anything about it.

Wear Your Mass Quantities of Code

http://www.headlineshirts.net/mass-quantities-of-code.html

Backup Apps From iPhone to iTunes (If the normal ways aren’t working)

I finally just solved an annoying problem: I had downloaded an app on my wife’s iPhone that was no longer available on the App Store (ResistorCode, by Christopher Brown), but because of iPhone sync issues was unable to transfer it to iTunes from the phone.

Back Story

So my wife got the iPhone 3G when it first came out, and along the way it was synced with multiple computers, and upgraded to iPhone OS 3.0 (then 3.1, 3.1.2 etc.). This caused it to stop being able to transfer purchased apps from the phone to iTunes or the mac.

Since I didn’t have a phone yet and was interested in some apps for when I did finally get one, there were some applications that I downloaded on her phone and figured I’d be able to move to my phone later.

Normally this wouldn’t be a big deal, since the apps can be re-downloaded from the App Store free of charge as long as you use the same account. The problem is that for whatever reason this app is no longer available on the App Store. And all the other applications (free or not) don’t work as well as this one for the tasks I need.

Solution

Wife gets new iPhone 3GS, and I take old iPhone3G…

OOOOOOOOORRRRRRRRRR

Enter PhoneView which is an OS X application that allows you to view SMS, Contact and the DCIM folder on the iPhone without any iPhone modifications (read “no jailbreaking needed”). When I loaded it up with her iPhone it contained a folder name ApplicationArchives (which is empty on my new phone btw), and appears to be leftover from some revision of iPhone OS 2.0-1. In this folder is a bunch of zip files with the application package names (ie. com.christopherbrown.resistorcode.zip), but not all apps on her phone interestingly. Downloading them and unzipping them only left me with a folder with iTunesArtwork, iTunesMetaData.plist, and a Payload folder.

Turns out that’s what in those .ipa files stored in the Mobile Applications folder by iTunes!!! And—how convenient—ipa’s are just renamed zip files! So I renamed the zip file from T4342SFMV3.com.christopherbrown.resistorcode.zip to ResistorCode.ipa and put it in ~/Music/iTunes/Mobile Applications withe the rest of the apps, and… wait… nothing’s showing up in iTunes.

Until I stumbled on this post (see message #7) and low and behold, all I had to do was double click the newly renamed ResistorCode.ipa file, and it was added to itunes and able to sync with my new iPhone 3GS!

Disclaimer

This likely only worked because we are both using the same iTunes account on computers that are both authorized on said account. The app was also a completely legitimate appstore download at the time it was purchased (though free), and is simply no longer available for download from iTunes.

This also doesn’t fundamentally solve the iPhone syncing problem with my wife’s phone, which appears to only be fixable by a factory reset, and manually syncing the apps back to the phone (you’ll find that restoring the phone after a factory reset also restores the syncing problem).

I’m going to download all the remaining apps from that ApplicationArchives folder when she gets home tonight, and at least have backups in iTunes, before we decide that it’s worth wiping out all that data from her phone (so many saved games and book lists to risk…)

Tabs and Linefeeds (Newlines) in XML driven TextFields

Man Flash can be annoying sometimes. So I’m showing some settings as a list, like
Item: value1
Item Two: value2
Item Three: value3

And the client asks if we can align the values vertically, and thinking like a programmer who likes to keep his code clean I’m thinking «Sure, that shouldn’t be a problem, I’ll just add some \t’s to the XML file and we should be all set,» but all that comes out is, “Sure, should only take a few minutes to add.”

So I add some \t’s to the XML and what does flash do with them, it prints out all literal backslashes and ts.

SO then what? Well I was being lazy and specifying xml.node not xml.node.text() to get the text values. Switching it does nothing. So then I start tracing things and looking around the Goog. Finally it becomes apparent that Flash is urlencoding the XML text in the background when processing it, and when it urldecodes it, some things are kept that shouldn’t be, like all escaped string characters that would normally not print.

Oh yeah, condenseWhite was false.

So I start with just doing a simple replace(/\\t/g, “!!!!”) to find out if I can even find the damn things, and I get no exclamation marks… or dirty words. Then a forum entry that was so buried I haven’t even found it again to link to, suggested using unescape(xml.node.text()) for a close, but ultimately unrelated problem.

To make a long story short here’s the solution:

?View Code ACTIONSCRIPT
1
2
3
	var tabs:RegExp = /\\t/g;
	var newlines:RegExp = /\\n/g;
	txt.htmlText = unescape(wagerText).replace(tabs, "\t").replace(newlines, "\n");

Go figure right?

As always if anyone has a better solution I’m all ears, or at least all comment-reading… eventually.

New Boom Box find.

On our almost bi-weekly visit to the Goodwill store nearby, I found the Best Boombox yet. Feast your eyes on this:
Panasonic SG-J500 ClosedPanasonic SG-J500 Open

That’s right, a Ghetto Blaster with a turntable!

It’s no SHARP VZ-2500, but still I only paid $7.99 for it (plus tax), and it’s even featured on Engadget. Anyway I’m working on a modular plan to add iPod functionality to it like some other boomboxes I’m working on, but not the tape adapter rout, something that connects directly to the amp IC. Details coming soon.