Good choice (I think)

The U.S. Senate made the right choice rejecting the auto industry bailout.

This isn’t about class warfare: it doesn’t bother me that the CEOs took their bizjets from Detroit to Washington (CEOs take private jets so that they have more time to work on running their companies, not to show off), and many of the shareholders who stand to lose are private citizens’ 401Ks and pension funds, not rich industrialists.

This isn’t about environmental concerns: companies will make electric cars as soon as they think they can profit from them (would you buy an electric car as your principal car now, when you have to stop every 2-3 hours and plug it in overnight, the batteries are an environment catastrophe waiting to happen, and a lot of the electricity in the U.S. is generated from dirty coal?).

This isn’t about free-market purism: sometimes even healthy private organisations do need a little bridge financing to get through hard times, and in rare cases the government has to be the financier of last resort.

This is about not prolonging the agony: the existing three major North American car companies are obviously doomed, and all a little more money will do is delay the bankruptcies, mergers, and restructuring that might actually create a vibrant, healthy North American auto industry (maybe just one company instead of three).

No money pit

A bailout would also be a commitment to a money pit — after spending $25B$14B now, would the U.S. government be able to say ‘no’ to more in three months, when the industry burned through the first handout? What about another three months after that?

These aren’t healthy companies going through a rough spot — they were dying slowly even during the boom, when the world auto industry was way over capacity for demand, and Detroit was losing hundreds or thousands of dollars on every car they sold. GM burned through USD 4.2B cash in 2008Q3 alone, and that was mostly before the market meltdown.

Palliative care

The U.S. auto industry won’t disappear, but it has to change, and that change is going to be painful for the workers, their families, and their communities. It’s good that the U.S. government has decided not to make a pointless intervention leading to false hope and prolonged agony; now, though, it’s time to think about palliative care for the industry, while the workers grieve and then move on with their lives. Can the government help? How? $25B$14B to help communities would be a lot more useful than $25B into GM’s, Ford’s, and Chrysler’s petty cash boxes. But how to spend it?

Tagged , | 2 Comments

What's happening in Canada?

Canada just had an election six weeks ago, but we might have a new Prime Minister and cabinet from a different party in a week or so, without holding another election. What gives?

Background

If you don’t live in a country like Britain, or Australia, that uses the Westminster System, what’s happening in Canada right now — to the extent that you’re paying attention at all — must seem very strange. For our American cousins, here’s how our system lines up with yours:

U.S. Canada
President (directly elected) Sovereign, represented by the Governor General (appointed and purely ceremonial)
Senate (directly elected) Senate (appointed and mostly ceremonial)
House of Representatives (directly elected) House of Commons (directly elected)
House Majority Leader (indirectly elected) Prime Minister (indirectly elected)

A question of confidence

Since only our House of Commons — equivalent to the U.S. House of Representatives — is actually elected, it holds all the real power, and the leader of the ruling faction in the House — the Prime Minister — is the effective (but not constitutional) head of state and can appoint the other cabinet ministers (just like the party with a majority in the U.S. House can appoint the committee chairs).

The Prime Minister holds power, however, only to the extent that he or she can keep the confidence of the House of Commons. Any party leader can go to the Governor General and offer to form a government, but by tradition, the G-G will always give the first chance to the leader of the party that won the most seats. If that party has a majority of seats in the House, then forming a government will be a no-brainer (assuming that the leader can maintain party discipline); if the party has only a plurality of seats, then it has to prove that it can control the house and pass its major legislation; if not, then the G-G can offer a different party leader a chance to form a government.

Only MPs are elected

Although this might sound bizarre to people used to the American system, there’s nothing inherently undemocratic about it. Canadians elected 308 Members of Parliament (MPs) earlier this fall; we did not vote directly for a specific Prime Minister or a specific party. The Conservative Party won a plurality of the seats, but not a majority: that doesn’t guarantee them the government, only the first turn to try to form one. The Conservatives are about to bring their first major piece of financial legislation before the House, and if it is defeated, the G-G is required to conclude that the Conservative government does not have the confidence of a majority of the 308 MPs we elected, and (since the last election was so recent) to give another party leader a try if one can make a credible case.

Hubris

Last time around, the Conservatives had no problem governing with a minority government — they just made sure that at least one of the other parties would support each piece of legislation they brought forward, and the opposition parties — especially the Liberals — were too timid to force an election by defeating them. This time, though, the Conservatives foolishly pushed the opposition parties just a little too far, by trying to cut government funding for political parties. This would hurt the opposition much more than the Conservatives (who are better at fund-raising), and whether the move was morally right or wrong, it was politically ignorant.

Suddenly, two of the opposition parties — the Liberals and the New Democratic Party (NDP) — woke up out of their daze and realized that they could vote with the Bloc Québécois to defeat the Conservatives, then join together to form their own government. The Conservatives immediately panicked and withdrew the anti-funding proposal, but the genie was out of the bottle — the Conservatives’ only remaining hope is to try to appease the Bloc enough to keep their support.

Food for Junkies

So if you’re a political junkie who’s still in a slump after the end of the U.S. election, stay tuned — even Canadian politics can be exciting sometimes.

Posted in General | 14 Comments

Banking: blame and beliefs

The world banking meltdown is a lot like the Christian Bible: no matter what your personal beliefs, you can find something there, somewhere, to back them up.

Too little regulation? Lenders were able to use credit derivatives (such as collateralized debt obligations) to keep loans off their books, without any reliable way of assessing their risk (and thus, their actual value).

Too much regulation? Basel II (the regulatory response to previous banking crises) forced banks to reassess their reserves daily at market value — if the market started to fall, banks had to convert stocks to cash quickly to avoid falling below minimum reserve levels, massively magnifying even small stock market movements and encouraging banks to use credit derivatives to keep loans off their books.

Sinners? People (especially in the U.S.) went out and bought homes that they could never afford to pay for, on the assumption that home values would keep rising, then kept taking out more money against their mortgages to finance regular consumer spending.

Victims? Some of the financial instruments available to borrowers in the U.S., like negative amortization mortgages (pay less than the interest for the first few years), were deliberately designed to sucker in buyers who hadn’t quite mastered grade 5 math.

Too much government? By taking over bad loans from the banks, governments around the world have sent out the message that banks get to gain in the good times, but will be spared the pain in bad. Do they have any more incentive to be careful the next time around? Besides, all the government borrowing, especially in the U.S., has hardly helped the situation.

Too little government? Central banks could have stopped the housing bubble in its tracks by raising the prime interest rate (say, to 5 or 6% in the U.S.). Year after year, they passed on the opportunity, keeping interest rates low to keep the stock markets artificially high, and pumping more air in the housing bubble, leading to a bigger explosion this year than we really needed.

So, whether you’re a political candidate or just a Starbucks pundit, pick the statements above that best support what you already believe, and run with them. No matter what, you’ll probably be right.

Tagged | 1 Comment

sorry.google.com

See the update below. I was right: Google’s new bot detection is overly naive, and I’m not the only one having problems.

See also John Cowan’s comment below, for a different (personal) interpretation of Google’s terms of service.

Google Maps won’t show me satellite imagery this morning.

Google has recently set up a system to try to autodetect and block bots scraping their system, and it isn’t working very well — people are getting blocked even from Google Search simply because they have too many (human-generated) queries passing through the same proxy.

This morning, I suddenly discovered a different problem: the satellite view in Google Maps has stopped working for me — I get the “don’t have imagery at this zoom level for this region” error everywhere, at every zoom level. I can still see maps and terrain, but not satellite pics, and I noticed the host sorry.google.com setting a lot of cookies.

Is Google’s satellite imagery down for everyone else this morning, or has their software decided that I’m a bot trying to scrape satellite imagery?

Update

I was right — Google’s software had decided that I was a bot. They have a test link directly to a satellite to see if you’re being blocked:

http://khm0.google.com/kh?v=31&hl=en&x=0&y=0&z=1&s=

It took me to this page. I was able to renable access simply by entering a CAPTCHA.

What happened?

I wrote a couple of months ago about how to detect overzoom in Google Maps. My guess is that the overzoom protection in OurAirports — automatically zooming out every 4 seconds until there were actual satellite tiles available — triggered to bot alert, and I’ve disabled the feature for now.

That’s very bad news for any mashup that uses JavaScript to do more sophisticated things with Google Maps, like, say, panning at regular intervals. Google’s bot detection seems to be extremely naive, and any repeated action at regular intervals will fire it off.

Posted in Uncategorized | Tagged , | 3 Comments

Taking sides

I don’t believe that anything — especially a political argument — can be self-evidently true: people get together in groups and construct their realities, whatever those may be. In my reality, however, there are some arguments that just don’t go well together, and I have a lot of trouble respecting any commentator, politician, or even dinner-table pundit who supports both statements in any of the following pairs.

Age

  1. A 16-year-old is too young to vote.
  2. A 16-year-old is old enough to be tried for a crime as an adult.

This is a variation of the “no taxation without representation” idea that helped drive the American Revolution. Any person who is considered legally capable of making an informed decision as an adult should have a share in choosing his/her government. If a 16-year-old is capable of forming a plan to steal/murder etc. as an adult, then a 16-year-old is capable of voting as an adult. There is no excuse for the voting age to be different from the age of full criminal responsibility.

There are lots of variations: for example, an 18-year-old is too young to drink in most of the U.S., but plenty old enough to have his finger on the trigger of major ordnance in a war. The age of sexual consent also comes into play here. This is one that right-ish political parties, like the Canadian Conservatives or the U.S. Republicans, usually flunk.

Environment

  1. The government should do something to lower gas prices.
  2. The government should do something to lower carbon emissions.

So far, high energy prices are the only thing that seems to cut carbon emissions. If you don’t believe that carbon emissions are accelerating global warming or that global warming is a serious threat, then go ahead and push for lower gas prices; if you do believe that global warming is a serious threat, then you should be cheering for $20/gallon gas. Most North American politicians — especially those in left-ish parties (like the Canadian NDP) — flunk this test cold.

Military intervention

  1. Rich countries should never send in their armies to invade poor ones.
  2. Rich countries have an obligation to ensure that there’s never another Rwandan massacre.

This is a tough one for me, because I believe that the rich world has botched nearly every military intervention it’s made in the poor and developing worlds over the last 200 years (Bosnia stands as one of the partial exceptions). Isolationism is a perfectly consistent political view, but for the rest of us, if we do ask our governments to protect people in poorer countries from their own governments, we are implicitly asking them to go in shooting if economic sanctions and strong words on the floor of the U.N. Assembly don’t do the trick. The rich world could probably could have stopped the Rwandan massacre, for example, but there’s a good chance rich-world troops would still be stuck as unwelcome guests in central Africa today, as they are in Iraq and (to a large extent) Afghanistan.

This is another one that politicians from left-ish parties usually flunk.

Freedom

  1. Freedom is what makes Democracies [sic] better than other forms of government.
  2. When Democracy is under threat, security is more important than people’s rights.

No explanation required. This is another one that politicians from right-ish parties usually flunk.

Posted in General | 2 Comments

XML-in-Practice 2008: call for participation

The new name for IDEAlliance’s annual XML conference is XML-in-Practice (December 8–10, Arlington, VA), and it has just released its call for participation, with proposals due by 19 September and selected papers announced by 3 October.

I won’t be chairing the conference this year, but I’m looking forward to reading many of the submissions as a peer reviewer.

Posted in Uncategorized | Tagged | Comments Off on XML-in-Practice 2008: call for participation

Detecting overzoom in Google Maps

[Warning: as of 1 October 2008, Google is using an over-simplistic bot detection algorithm, and something as simple as zooming out at regular intervals can trigger it and temporarily block access to Google resources. I recommend waiting until they fix their algorithms to use this technique.]

Here’s a link to a web page showing how to detect overzoom with the Google Maps API.

Overzoom is a big issue for my site OurAirports, which shows a close-up satellite view on each airport’s page (e.g. the former Meigs Field). Unfortunately, there’s no documented way to use the Google Maps API to check if a satellite view is overzoomed (instead of a satellite picture, it’s showing the “We are sorry, but we don’t have imagery at this zoom level for this region…” message). That can be confusing for someone who isn’t a regular Google Maps user and hasn’t actually touched the zoom controls on the map.

The hack

The page above came up with the clever solution of counting paragraphs in the map container. If there is a “sorry” message, there will be HTML p elements inside the map container. Here’s a simple JavaScript function that checks to see if the map is overzoomed, and zooms out one level if it is:

function check_zoom (map)
{
    var zoom = map.getZoom();
    var count = map.getContainer().getElementsByTagName('p').length;

    if (zoom > 1 && count > 0) {
        map.setZoom(zoom - 1);
    }
}

Note that it doesn’t iterate — it just does one check and exits. The easiest way to use this is just to have it run every two seconds or so. If your map is available in a variable named map, this will do the trick:

setInterval("check_zoom(map)", 2000);

Examples

To see how it works, check out Vuotso Airport in Finland. Google Maps doesn’t have very good satellite coverage for Lapland in the far north, but OurAirports now detects that after a couple of seconds and zooms out one step. For a more extreme example, look at Alert Airport, the world’s northernmost permanent airport, in Nunavut, Canada — the code has to zoom out several times until you can see anything in the satellite view.

Caveats

The more elegant solution would be to detect when the map is finished loading after every event that can affect it, but that sounds like too much work to save a couple of milliseconds here and there.

Note that Google can break this at any time simply by adding or removing p elements — it would be much better to have an official, reliable way to detect when a satellite view is overzoomed.

Posted in General | Tagged , | 3 Comments

Widgets vs. Portlets

Widgets are web pages embedded in larger web pages, generally using iFrames — the content comes via a separate HTTP connection and has its own CSS stylesheet, cookies, etc. Final composition takes place in the user’s browser.

Portlets are software modules that produce fragments of HTML markup that are assembled into a single HTML page, sharing common CSS stylesheet, cookies, etc. Final composition takes place on a portal server, and a single page is delivered to the client browser.

Features

Portlets have a lot of features that iFrames don’t: they require fewer HTTP connections, they allow for common styling (one CSS stylesheet can style all the portlets on a page), and they can communicate with each other and take advantage of common authentication/authorization, etc. (so that a user doesn’t have to sign on to each portlet separately).

Portlets use a window-manager metaphor, allowing the portlet server to resize them, expand them etc. They also have modes, like edit and view, all of which can be accessed through a common interface. All of this happens on the server side.

iFrame-based widgets don’t normally do any of that, but they don’t require special portal servers, they can be embedded in more creative ways, and they offload the processing from the server to the client. They also introduce potential security holes, but only if they’re hosted somewhere that’s not under the original company’s control (the same applies to remote portlets using WSRP).

Users

Portlets are used mainly in intranets, to provide a collection of enterprise apps on a single web page for employees (e.g. a news feed, calendar, expense forms, bug reports, etc.).

Widgets are used everywhere else (e.g. embedding Google maps, Facebook applications, etc.). While widget authors/consumers don’t tend to know (or care) much about portlets, the portlet people haven’t failed to notice the popularity of widgets — most (if not all) portal servers now have an iFrame portlet that does little more than wrap an iFrame and allow it to be resized, etc.

Future?

Are the extra features of portlets compelling enough to justify the extra cost and hassle of running a portlet server? Now that we have browser tabs, AJAX, etc., do enterprises really need to continue to squish all their apps into a single web page that looks like a 1995 Mac desktop gone bad?

My guess is that the only portlet feature with compelling benefits is common authentication/authorization — once the web community gets behind a solution to that problem (OpenID or something similar), widgets will probably push portlets out completely, even in the enterprise.

Tagged , | 4 Comments

Structured community authoring

About 10 months after launching my OurAirports site for air travelers and pilots, I’ve finished the basic infrastructure to allow community authoring. Unlike Wikipedia, OurAirports contains information that is specialized, structured and finite (there are only so many airports in the world), and I’m interested to see the technical and social differences from the Wikipedia world.

More details are available in the announcement on my flying blog. Note, also, that all of the data collected is free for download (public domain).

Posted in Uncategorized | Tagged | Comments Off on Structured community authoring

Set and forget: 335 days and counting …

Late in summer 2007, I set up a dedicated Linux Ubuntu server at a site in San Diego to host OurAirports and my consulting site, megginson.com. The ISP has had some net outages, but the Ubuntu server itself has kept on chugging through. Here’s the uptime:

 11:18:31 up 335 days,  7:12,  1 user,  load average: 0.05, 0.06, 0.01

Since the ISP set the computer up with a minimal Ubuntu install and gave me the access info, it has run continuously — I know I should install an updated kernel some day, but it’s hard to bring myself to do that.

Posted in Uncategorized | Tagged | 2 Comments