2005/12/30

China, the USA, competition for resources

China eyes increased energy cooperation with US - Yahoo! News

It's interesting to watch as China's per-capita energy demands begin to approach those of the US. Latest development: China's top economic planning body recommends increased cooperation with the US on energy issues.

I should go read the details before posting this :) but it's encouraging that the Chinese govt are trying to plan ahead rather than wait until we are in direct conflict.

China has a chance to play leapfrog in technology for energy production and conservation, and in transportation. That's where the real opportunity lies for the US: in sharing the costs, and results, of improving energy efficiency. Worst of all worlds would be for us to be stuck with our current energy infrastructure while other nations move ahead.

2005/12/20

Bush's Snoopgate - Newsweek National News - MSNBC.com

I agree.

If we could just trust this president, or any president, then we wouldn't need the Congress and the courts.

Our executive branch has long kept secrets from its citizens -- classified documents, "black" military programs. The risk to the country in permitting the government to operate in secret, without accounting for its actions, is much greater than the risks which those actions are supposed to mitigate. The risk is that, once the habit of government secrecy is established, the ability of the country to detect and act against dangerous concentrations of governmental power will be lost.

2005/12/19

Honda plans to mass-produce solar cells

According to the article production will start in 2007. Once it reaches full capacity Honda will be producing enough solar panels each year to power 8000 homes.

"Honda said its solar cells would be composed of non-silicon compound materials, consuming half as much energy and generating 50 percent less carbon dioxide during production when compared with conventional solar cells made from silicon."

How will their efficiency compare to those of other types of solar panels? Dunno.

They're targeting the Japanese domestic market first.

2005/12/16

Javascript Animation: Tutorial, Part 2 - Schillmania.com

Look here for some clues on how to do animation, in JavaScript, without expensive page reflows.

The tutorial also describes ways to animate more efficiently, using a single timer. This evokes the realtime "executives" I used to see when I worked with flight sims in the aerospace industry.

2005/12/15

The Straight Dope: Did John Wayne die of cancer caused by a radioactive movie set?

"Thirty years later, however, half the residents of St. George had contracted cancer, and veterans of the production began to realize they were in trouble. Actor Pedro Armendariz developed cancer of the kidney only four years after the movie was completed, and later shot himself when he learned his condition was terminal."

Mom has wondered from time to time whether or not Grandpa's leukemia had anything to do with his filming venues. She has mentioned a filming location, fallout, and the names of a few actors who died of cancer after working there. But I could never remember the place names. This link which my girlfriend provided seems to point to the right places.

Treehugger: Vulgarity and Nature: Chapter from Robert Grudin's Upcoming Book - American Vulgar

One of the things that drove me out of Ohio was the local attitude toward "growth" – it was considered good, progress, an improvement. All Icould see was the suburbs of Cincinnati and Dayton growing together along the I-75 corridor.

One of my friends and co-workers had this view of development. He was proud to live in one of the development communities that was spreading out over what had been farm land. (The community, whose name I have since forgotten, was featured a couple of years later in a National Geographic article about urban sprawl.)

Couldn't help thinking of my friend and his McMansion while reading this excerpt from Robert Grudin's "American Vulgar":


Growth is not just a cultural obsession. Growth has become a theoretical model for economists, executives and even civil servants. The idea is that economic entities[...] cannot remain robust unless they keep growing, and that this growth imperative has no chronological limit[...]The most colossal and preposterous of all vulgarities would be a civilization that, in the course of its busy, growing ways, paved over its environment and destroyed its only source of sustenance.

2005/12/13

LAMP vs. Java

This year I joined a team which is building web apps to teach cheminformatics. We do use a little Java because one of our vendors implemented its toolset in Java. (And those tools include 3D chemical structure depictors.)

We got started in the springtime, shortly before the appearance of TurboGears. But we're using a similar set of tools: PostgreSQL, Python, CherryPy and CherryTemplate, jsolait, and a fair bit of custom JavaScript. And HTML. And CSS 2.1. And R, at least for prototyping. And we're managing it all, to the extent that we're managing anything :), with subversion and Trac.

As the Businessweek article suggests, this set of tools works well. I don't see any reason to use any more Java than we absolutely must.

2005/12/12

Wired News: Cut Emissions and Pump More Oil

Some good news for oil, for a change?

Just how much CO2 is produced during oil refining, anyway? The article claims that pumping the gas back into oil fields in Western Canada alone could reduce "CO2 emissions to the tune of pulling more than 200 million cars off the road for a year".

The lifetime of the field where testing has occurred has been extended for another 20 years. The subsurface rock in that field is sedimentary; the article claims that, if the technique were tried in basalt fields, the re-injected gas would be converted to calcium carbonate in less than 18 months. From volcanic rock to chalk -- who knew.

2005/12/11

Sanyo Xacti VPC HD1EX | Digital Camera Review

Will Sanyo make HD video affordable?

Next in the Xacti VPC line: 1270x720x30fps, MPEG-4 format, 5MP digital imager, 10x optical zoom, recording to SD memory cards.

2005/12/10

New Mexico to be Virgin space hub | CNET News.com

Las Cruces will be moving up in the world.

2005/12/03

Weeping Eye

Flickr Photo

The Weeping Eye, a feature in Upper Antelope Canyon.


Okay, this is really just a test of Flock on Mac OS X. Flock integrates web browsing, blog editing and (Flickr) photo management/reference.


technorati tags: ,

2005/09/06

Digital Web Magazine - Writing Semantic Markup

This is a nice, concrete explanation of semantic markup and microformats.

2005/09/05

Summer Storm, Santa Fe Ski Basin


Summer Storm, Santa Fe Ski Basin
Originally uploaded by Chitch.
Just testing Flickr's blog-editing facilities.

DARPA Walrus

RED HERRING | The Pentagon's Flying Walrus

Also here.

"The usefulness of such a vessel for non-military purposes was evident as New Orleans sank into chaos after Hurricane Katrina left thousands of people stranded, thirsty, and hungry."

"...even a 1-foot-wide hole in the fabric of a 140-feet long airship would not bring the thing down in less than an hour."

"...there is plenty of demand in the private sector for a bigger cargo carrier. The largest fuel-guzzling Boeing 747 cargo plane can only carry 400 tons.

There has to be demand for an airship that could haul 500 tons directly from a Chinese factory to a Wal-Mart parking lot somewhere in the United States."

2005/08/22

A Wave of Marine Extinctions?

Scientists Fear Oceans on the Cusp Of a Wave of Marine Extinctions

Combined with the environmental costs of raising cattle, this kinda argues for a vegan diet...

"In the past 300 years, researchers have documented the global extinction of just 21 marine species -- and 16 of those extinctions [have] occurred since 1972."

"The large-scale industrialization of the fishing industry after World War II, coupled with a global boom in ocean-front development and a rise in global temperatures, is causing fish populations to plummet."

"Large-scale fishing accounts for more than half of the documented fish extinctions in recent years... ocean fish catches tripled between 1950 and 1992."

Not only the intended catch species are threatened: "...accidental bycatch alone accounted for an 89 percent decline in hammerhead sharks in the Northeast Atlantic."

"...conservationists said NOAA officials are reluctant to classify fish as endangered because it conflicts with their agency's mission of promoting commercial fishing."


How do they produce these numbers? Accounting for catch sizes seems straightforward -- just look at the books for the fisheries. But how does one figure out the total decline in hammerhead shark populations, let alone the fractional causes for that decline?

Still, the article provides plenty of food for thought.

2005/08/18

Java Jar file manifests, and Class-Path

I've been having trouble building jar files. I'm using Apache ant on Mac OS X. I have been unable to create valid Class-Path values when using ant to generate my MANIFEST.MF files.

The solution: compose my MANIFEST.MF file manually (based on the broken MANIFEST.MF created by ant). It turns out that Class-Path can be specified as a series of space-separated paths extending across multiple lines, with leading indentation. F'rinstance:


Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.4
Created-By: 1.4.2-50 ("Apple Computer, Inc.")
Main-Class: JChemLoader
Class-Path: /usr/local/jchem/lib/batik-core.jar
/usr/local/jchem/lib/chart.jar /usr/local/jchem/lib/dom4j.jar
/usr/local/jchem/lib/jchem.jar
/usr/local/lib/java/postgresql.jdbc.jar


As long as no single Class-Path entry is more than 70-71 characters in length, this should work.

The problem with ant-generated Class-Path values was that the values, when written out, were being split at arbitrary points. (The value I was supplying to ant was a colon-separated sequence of pathnames. Maybe that was part of my problem?) ant was trying to satisfy the rules for jar file formatting, as specified by Sun:


Line length:

No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).


Perhaps it's just my lack of familiarity, but I find Java, jar files, and CLASSPATH to be a vile combination. Python (PYTHONPATH) handles things much more cleanly. Even gcc and make handle library locations in a much more pleasant way.

2005/08/17

Green Car Congress: Solar-Power-Augmented Prius Takes the Grid Out of Plug-in

Green Car Congress: Solar-Power-Augmented Prius Takes the Grid Out of Plug-in

No greenhouse costs beyond those needed to make the PV array; ditto other environmental costs (e.g. poison leaching).

I wonder how much weight these things add? I wonder if they do anything at all to reduce the heating of the car interior? My Subaru is like an oven in the northern NM sun, just from heat radiating into the interior from the roof.

2005/08/06

Passing arguments to Mac applications

I'm building a suite of cooperating, cross-platform GUI applications. They're written in C++, using Qt. I'd like to be able to pass command-line arguments from one app to another, but on OS X I've had trouble doing so.

Mac GUI applications typically are launched via NSWorkspace (or, for non-Cocoa apps like the ones I'm building, via the underlying CoreFoundation functions). They're launched with no argv entries. Arguments typically consist only of pathnames to open or print, etc. Accessing them is no picnic.

The simplest solution I've found uses environment variables to pass the arguments around. It works on Unixes including OS X. It should work on Windows.

One gotcha is that you have to explicitly retrieve the environment arguments when your GUI app starts up, instead of having them initialized for you by the C/C++ runtime.

Another gotcha is namespace collisions. The names of the environment variables conveying the arguments must be chosen carefully to prevent them being used/modified by unrelated applications. Maybe some sort of Java-like "com.dmoonc.my_app_suite..." convention would be appropriate.

Anyway, this is probably good enough for now:

envargs.h


#ifndef ENVARGS_H
#define ENVARGS_H

#include <string>
#include <vector>

typedef std::vector< std::string > ArgList;

// Retrieve and clear the environment arguments
// passed to this process.
// Should be done as soon as possible
// after application launch.
void getEnvArgs(ArgList& args);
ArgList envArgs();

// Set environment arguments for passing
// to a process about to be launched.
void setEnvArgs(ArgList& newArgs);

#endif // ENVARGS_H


envargs.cpp


#include "envargs.h"
#include <iostream>
#include <sstream>
#include <stdlib.h>

using namespace std;

static const string C_NumArgsName("_appsuite_numargs");
static const string C_ArgPrefix("_appsuite_arg_");

void getEnvArgs(ArgList& args)
{
args.clear();

char *numArgsCStr = getenv(C_NumArgsName.c_str());
if (numArgsCStr)
{
istringstream ins(numArgsCStr);
int numArgs;
if (ins >> numArgs)
{
for (int i = 0; i < numArgs; ++i)
{
ostringstream argname;
argname << C_ArgPrefix << i;

const char *argnameCStr = argname.str().c_str();
char *argCStr = getenv(argnameCStr);
if (argCStr)
{
string arg(argCStr);
args.push_back(arg);
}
else
{
args.push_back("");
}
}
}
}
}

ArgList envArgs()
{
ArgList result;
getEnvArgs(result);
return result;
}

static bool cppsetenv(string name, string value)
{
bool result = true;
ostringstream spec;
spec << name << "=" << value;

result = (0 == putenv((char *)(spec.str().c_str())));
if (!result)
{
cerr << "Could not set environment variable:" << spec << endl;
// TO DO: Ditch the bool return value and throw an exception
}
return result;
}

static bool cppsetenv(string name, unsigned int ivalue)
{
ostringstream svalue;
svalue << ivalue;
return cppsetenv(name, svalue.str());
}

void setEnvArgs(ArgList& newArgs)
{
if (cppsetenv(C_NumArgsName, newArgs.size()))
{
for (unsigned int i = 0; i < newArgs.size(); ++i)
{
ostringstream name;
name << C_ArgPrefix << i;
cppsetenv(name.str(), newArgs[i]);
}
}
}

2005/08/03

RSS News Readers: Extrapolation

This claim is false:

"When people get an RSS feed, they need not go through standard Web site navigation patterns that we are accustomed to tracking. They look at just what they want, when they want."

The same claim could be made for the early web. The problem is not looking at what you want. The problem is finding what you want to look at.

What (I Hope) Is Next For RSS News Readers


RSS news readers help you find and read content which is of interest to you. They face challenges.

RSS Advertisements


News readers will become less useful if they cannot help you filter out RSS advertisements.

Redundant Articles


I already wish news readers could perform higher-order aggregation. My subscriptions reflect my interests, so they have significant content overlap. Just this morning, for example, I must have seen about ten different news items all providing roughly the same information about Mighty Mouse.

I wish my news reader could at least identify and group together "duplicate" articles such as these, so I could deal with them all at once. Click on one to read it, mark the others en masse as having been read, move on.

I wish I could use my system's standard search tools (Spotlight for me, who knows what for Longhorn^WVista users) to search through old feed articles.

Not to be a shill for Brent Simmons, but the full version of NetNewsWire seems to have begun to address these wishes.

It's nice that my most original ideas have already been had by others.

Soldier's Grove: Energy efficient public policy

WorldChanging: Another World Is Here: Disaster Recovery Done Right

"
Rather than rush to get buildings up and running as quickly as possible, the villagers took their time...

The village passed ordinances stipulating that new buildings be built to specific thermal performance standards and obtain at least 50 percent of their heating needs with solar systems...
"