2008/11/26

The government crash

Doc Searls:

The amazing thing about crashes is that you can see them coming...
Now we’re about to see the U.S. government crash, for the same reason.


The U.S. government is about to spend roughly 1/2 GDP to "fix" the economy.

It was a surprise this autumn to see foreign investors rushing to buy up more of our debt. Will we still look like a good bet after we've taken out a loan this big?

2008/11/20

Waxman topples Dingell for key panel chair - Yahoo! News

Waxman topples Dingell for key panel chair - Yahoo! News:

"Rep. Henry Waxman — a liberal ally of Speaker Nancy Pelosi — has wrested the chairmanship of the powerful House Energy and Commerce Committee from veteran Rep. John Dingell when the new Congress convenes in January."


I'm no fan of Waxman, but this could portend positive changes for the U.S. auto industry. Presuming, of course, that the best solution to our oil and carbon-emissions problems entails continued use of automobiles.

2008/11/18

LIFE photo archive hosted by Google | Photodoto

LIFE photo archive hosted by Google | Photodoto:

"LIFE has released over 10 million images on a new hosted image service from Google and in Google Image Search. They claim [...] that the collection contains ‘some of the most iconic images of the 20th century.’
LIFE is selling fine art prints (in partnership with Qoop it seems) of the collection and the photos are only available online as 1 megapixel scans."


Outstanding.




(I've seen a large print of this Margaret Bourke-White photo in a local gallery. A computer screen can't do it justice, not by a long shot.)

“New chapter” on climate change

From President-elect Obama promises “new chapter” on climate change | Change.gov:

The Global Climate Summit is a "2-day event arranged by California Governor Arnold Schwarzenegger to break gridlock on the issue ahead of next month's United Nations Climate Change Conference in Poznan, Poland."

President-elect Obama posted a short video expressing enthusiasm for the summit:

"...too often, Washington has failed to show the same kind of leadership. That will change when I take office."


Interesting times. It's easy to imagine this bit of cross-party consensus as the beginning of Friedman's e-tech economy.

Can't debug after updating to Flex Builder 3.0.2

I'm evaluating FlexBuilder 3, and have just installed the Flex Builder 3.0.2 update. All of a sudden I can't debug my AIR project.

The error dialog displays a lengthy message which ends with:

error while loading initial content


Thanks to Google and Adobe's public bug database, the fix is straightforward: edit the project's *-app.xml file and change the namespace (2nd line) to 1.5:


<application xmlns="http://ns.adobe.com/air/application/1.5">

2008/11/17

Prophesy of economic collapse 'coming true' - environment - 17 November 2008 - New Scientist

Prophesy of economic collapse 'coming true' - New Scientist:

Changes in industrial production, food production and pollution are all in line with [the predictions in "Limits to Growth"] of collapse in the 21st century, says Turner.
According to Herman Daly of the University of Maryland, Turner's results show that we 'must get off the growth path of business as usual, and move to a steady state economy,' stopping population growth, resource depletion, and pollution."

2008/11/14

.:: Aero-News Network: The Aviation and Aerospace World's Daily/Real-Time News and Information Service ::.

.:: Aero-News Network: The Aviation and Aerospace World's Daily/Real-Time News and Information Service ::.:

"United Airlines will become the first US carrier to demonstrate how next-generation technologies could save more than two thousand gallons of fuel and cut up to 55,000 pounds of carbon emissions on a single, trans-Pacific flight."
Within minutes of landing, United will calculate and publish the actual savings realized on this flight.


As a recovering private pilot I find this fascinating...

A former colleague has been working on a related software project, using genetic algorithms and frequently updated weather data to help commercial flights decide how to alter their routes — diverting in all three dimensions as necessary &mdash to find the cheapest path between two points. I wonder if he's involved in any way in this test flight.

2008/11/12

Why it's hard to reduce gross energy use

un_pop.png


Good news: we appear to be near an inflection point:)

Our numbers are huge, and a good fraction of us are trying to improve standards of living in a way which increases per capita annual energy expenditure. But at least our population growth is slowing.

Stewart Brand in Technology Review:
...in 2002, [the UN] adopted a new theory that shocked many demographers: human population is leveling off rapidly, even precipitously, in developed countries, with the rest of the world soon to follow...

The world's women... had fewer kids because they moved to town.

Cities are population sinks-always have been... A global tipping point in urbanization is what stopped the population explosion...

The environmentalist aesthetic is to love villages and despise cities. My mind got changed on the subject a few years ago by an Indian acquaintance who told me that in Indian villages the women obeyed their husbands and family elders, pounded grain, and sang. But, the acquaintance explained, when Indian women immigrated to cities, they got jobs, started businesses, and demanded their children be educated.

Solving for the Unknowns: The Pickens Plan

This Yahoo! News article has me wondering again about the pros and cons of the Pickens Plan:

"Billionaire T. Boone Pickens expects to know within 100 days of Barack Obama taking over as president in January whether the U.S. government is going to adopt part of his ambitious and controversial energy plan.
The plan calls for an eventual overhaul of the power grid and Pickens is also betting on huge growth in wind power. But he said, as a start, the United States can move toward using natural gas in trucks as well as more renewable power."

A couple of months ago the Climate Progress blog posted a criticism of the Pickens Plan. According to the author, Earl Killian, the proposal to build out a wind energy infrastructure is attractive, but converting ground transportation to compressed natural gas makes no sense.

CNG Trucking

For Pickens, converting long-haul trucking to CNG is probably the most attractive part of the plan. Killian asserts that, in order to make a dent in foreign oil dependency, we would also need to convert small cars to alternative fuels.

I think Killian may have set up a strawman, although he does provide evidence that Pickens is talking about both trucks and small cars. Regardless, his analysis is really interesting.

Killian finds that plugin hybrids would get more range from a given volume of natural gas, converted to electricity by a power utility, than would cars which ran directly on CNG:
It seems pretty straightforward that electric vehicles beat CNG vehicles almost 2:1, even using existing NG power plants. If the US upgraded its NG power plants to be 60% efficient, instead of 39% efficient, we would have 54% more TWh, or even better, use less 35% less NG.

As noted, Pickens is focusing on big trucks, not small cars. It would be interesting to see an assessment based on data from existing CNG truck and bus fleets.

Wind

Killian and others have a more favorable view of Pickens' wind power proposal. They are concerned that wind power could be unreliable and unpredictable since, well, wind varies. The Pickens Plan addresses this problem by building excess capacity into the wind grid, and by pointing out that it's unlikely the entire midwest wind corridor would be calm at any given time.

This seems reasonable given the experiences of other countries. For example, Wikipedia notes that Denmark, which derives 20% of its electricity from wind power, has suffered "no major problems" with wind variability.

Killian focuses on energy potential, so he doesn't assess the environmental consequences of building out the wind corridor. Aside from the wind turbines themselves, we'd also need lots of long-distance transmission lines, much of it running through land which has so far escaped damage by humans.

Sideline: Rail

I thought that rail was more fuel efficient than trucking for long-haul shipment of goods, and that trucking came to prominence by way of regulation. If so, that would beg questions:
  1. What would be the benefits of changing those regulations to reward efficiency?
  2. Would we be better off building up rail infrastructure, than converting trucking fleets to CNG?

Google says my memory of regulatory history is wrong. From "Basic Economics", by Thomas Sowell:
[The I.C.C.] sought — and received from Congress — broader authority under the Motor Carrier Act of 1935, in order to restrict the activities of truckers [emph. added]. This allowed railroads to survive under new economic conditions, despite truck competition that was more efficient for various kinds of freight hauling.

The CSX website claims that rail freight is three times more fuel efficient than long-haul trucking.
Since 1980, through technology and innovation, the railroad industry has improved locomotive fuel efficiency by over 80%.

So question 2 is still worth asking.

2008/11/06

TextMate CamelCase

Because I keep forgetting: In TextMate, you can toggle the selected text from lowercase_with_underscores to camelCase by typing Control-Shift-Minus (^_).

At last, an antidote to USA Today

When the lights go on at the New York Times, our work can start:

"But the Times is attracting an all-star team of information architects, interactive graphics designers, programmers, and media producers. And according to Gabriel Dance and Shan Carter, these folks are increasingly collaborating with reporters to marshall complex information in ways that make the newspaper’s stories deeper and more open to independent analysis and interpretation."

Jon's statement made me realize: NYT is providing an antidote to USA Today.

When USA Today first appeared, it was criticized for emphasizing glitz over substance. Its articles often oversimplified complex issues. Its graphics were colorful and, almost always, misleading.

USATodayParody.png


NYT is getting it right, especially with interactive graphics. Sure, they're often glitzy. But they also communicate clearly. And they make it easier to understand the data which they present, in part by making it easier to explore.

2008/11/05

One-line web server in Python

From Ed Taekema's weblog, a reminder[1] about how to create a web server in one line of Python:

python -c 'import SimpleHTTPServer;SimpleHTTPServer.test()'


This starts a server listening on port 8000, serving files from its launch directory. If you just hit the server (http://localhost:8000/) it will by default serve index.html; if index.html doesn't exist, it will give you a directory listing. Also, the server will provide only those files residing in or below the current working directory; e.g. http://localhost:8000/../ resolves to the default document.

Wish I'd seen Ed's note this morning...

This is handy when you want to experiment with things like interactions between Flex applications and JavaScript, or other situations in which you can't get by with simple file:/// URLs. This would be handy as a jqUnit test, as well.



[1] Reminder? It's been a long time since I read "Internet Programming with Python" :-)

2008/11/01

Removing old man pages from OS X Leopard

Back in January I posted about Leopard, 'ls -l' and extended attributes. The gist was that my man pages were out of date, so they didn't explain what the @ character represented, in 'ls -l' output.

Some threads on the Apple discussion boards have investigated why the man pages don't get updated. The conclusion is that Leopard installs a lot of gzip-compressed man pages without deleting the corresponding uncompressed man pages. (It may be that this is true only for upgrade installs.) A recommended workaround was to scan through the man page directories with a shell command, re-locating all uncompressed man pages which had corresponding compressed man pages.

I decided to be cowardly in doing this. Here's a Python script which moves each uncompressed man page only if it is older than its corresponding gzipped man page.

The script must be run with superuser privileges, e.g.

sudo python mv_old_man_pages.py

It processes all of the man pages under /usr/share/man, moving old, uncompressed man page files to ~/tmp/old_man_pages.

I would post this to the Apple discussion forums, but it's really overkill. The short shell scripts already posted should work fine, if you ignore the harmless error messages and process each man/man* directory manually.


#!/usr/bin/env python
# encoding: utf-8
"Remove obsolete uncompressed man pages on an OS X Leopard system."

import sys, os, logging

def candidateOldManPages():
os.chdir("/usr/share/man")
for dirpath, dirnames, filenames in os.walk("."):
for f in filenames:
if f.endswith(".gz"):
fOld = f[:-3]
if fOld in filenames:
yield os.path.join(dirpath, f), os.path.join(dirpath, fOld)

def findOldManPages():
for p, pOld in candidateOldManPages():
s = os.stat(p)
try:
sOld = os.stat(pOld)
except os.error, info:
# Some man pages may be broken symbolic links
logging.warn("Can't stat (%s, %s): %s" % (p, pOld, info))
if os.path.islink(pOld):
yield pOld
else:
if s.st_mtime > sOld.st_mtime:
yield pOld

def mvOldManPages():
topDestDir = os.path.expanduser("~/tmp/old_man_pages")
for relpath in findOldManPages():
dirname = os.path.dirname(relpath)
filename = os.path.basename(relpath)

destDir = os.path.join(topDestDir, dirname)
if not os.path.exists(destDir):
os.makedirs(destDir)
logging.debug("mv %s %s" % (relpath, os.path.join(destDir, filename)))
os.rename(relpath, os.path.join(destDir, filename))

def main():
"""Mainline for standalone execution"""
logging.basicConfig(level=logging.DEBUG,
format="%(levelname)s: %(message)s")
mvOldManPages()

if __name__ == "__main__":
main()