mike watkins dot ca : November 2007 Archives

November 2007 Archives

9 entries filed this month:

November 27 2007

QP and Durus on Nokia N800

/2007/11/27/nokia-n800-runs-qp/file/ce39f11e61fe/thumbnail?100

The attached image is a screen shot of a web browser running on a Nokia N800, a Linux-based internet tablet. Weighing only ounces, the wireless device is a great platform for Python developers as the language has more or less become the default dynamic language for the device and, it would seem, for Nokia. GUI developers commonly employ pygtk/glade for Maemo applications; I'm not aware of much web development being done on the N series tablets as yet.

Pictured is the output of a highly Pythonic web framework and object database combination, QP and Durus - the app is merely a template provided by running mkqpapp.py.

I wanted to see what QP and this little tablet, underpowered by laptop or server standards, could do - here is a benchmark between a fairly fast Unix desktop, across a fairly slow wireless link, generating 10 concurrent request streams to the device

frog# /home/mw% siege -b -c10 -t10s http://n800:8000/
Transactions:                164 hits
Availability:             100.00 %
Elapsed time:               9.85 secs
Data transferred:           0.06 MB
Response time:              0.58 secs
Transaction rate:          16.65 trans/sec
Throughput:                 0.01 MB/sec
Concurrency:                9.71
Successful transactions:     164
Failed transactions:           0
Longest transaction:        3.66
Shortest transaction:       0.19

Not bad, considering its a full stack web framework and object database running on a little machine weighing only ounces that also is running what amounts to be a Gnome environment, browser, mail and other apps, all powered by a lowly TI 320MHz Armel architecture CPU.

Out of curiosity I added a hit counter to exercise the object database and the transaction rate was a respectable 12.36/second.

Worlds smallest portable web application demo machine!

Once I figure out how to make Debian packages for the armel architecture I'll post a deb link for a one click install of Durus, QP, QPY and Dulcinea.

Incidentally, while sqlite is in common use on Nokia tablets, there's clearly no reason why Durus could not be used. N-series Python developers might find that to be an ideal persistence pairing to go along with their web or GTK apps.

November 26 2007

Wajid Khan Faces Charges

Floor-crosser charged under Elections Act

Over at ElectWajidKhan.ca you'll find a few links pointing to the latest dirt on former Liberal turned Harper's special advisor on the Middle East turned Conservative MP, who is now charged with violating Canada's Elections Act:

Tory MP charged with violating elections act (CBC): The charges [against Wajid Khan] stem from the 2004 election campaign, when Khan ran as a Liberal.

His former riding president and his car dealership, Dufferin Mazda, are also charged with paying for campaign expenses they weren't supposed to cover.

"Some people treat the election financing rules [as] voluntary guidelines," said NDP MP Pat Martin, who filed a complaint last January when he heard there were questions about how Khan financed his election campaign.

"They're not. They're hard fast laws and there should be consequences. If not, it's not fair to any of us."

Khan is scheduled to appear in court in early January.

November 16 2007

Run, Emerson, Run

At the start of the month I mused whether Emerson would be too chicken to run. Last week The Province ran a short piece quoting Emerson as saying that if he ran, he would run in Vancouver-Kingsway.

My letter to the editor in response was published in Sunday's paper and reads as follows:

Re "Emerson won't switch riding" (Thursday November 8), you quote party-switching MP David Emerson as saying "I will either run in Kingsway or I won't run".

Its long past time for Mr. Emerson to buck up and commit without reservation to face the voters in this riding in the very next election.

Speaking on behalf of the Campaign to De-Elect David Emerson, I wish to remind Mr. Emerson that our sole objective has always been to see him resign and run again, in order to give voters the opportunity - finally - to pass their judgement.

Over the course of the past year and a half our non-partisan campaigners heard one clear theme emerge out of the angry din: people feel their votes were devalued, their franchise robbed, and our electoral system has been cast in disrepute.

46,168 citizens in Vancouver-Kingsway voted in the 2006 election, and not a single one got what they voted for. What will electors here contemplate when they next look at a ballot?

I am quite certain that the electorate here will respond vigorously to ensure Emerson is not re-elected, should he be so foolish as to misread the public and run again.

But... I hope Emerson does let ego get in the way of common sense as his easy defeat will be an amusing and fitting end to his political career and a strong rebuke to Stephen Harper.

Upcoming: commentary on the various declared and potential candidates for all parties likely to run someone here.

November 14 2007

Django gets auto-escape

According to Simon Willison, Django now has auto-escaping of variable contents within templates. Good job.

I wouldn't even consider using a framework that didn't provide some sort of sane system for auto-quoting that which has not already been explicitly declared as safe. Both Quixote and QP have had this feature for many years.

Quixote's PTL template approach gained this capability circa 2002; QP's QPY, which is a very close cousin to PTL but decoupled from the web framework itself, has always had this ability.

In October 2003 one of Quixote's original authors, Neil Schemenauer, put forward a proposal that ultimately led to the implementation of a sane auto-quoting behaviour in PTL templates. (See also his PyCon 2003 talk)

In the fall of 2005 QP - a slightly more opinionated version of Quixote - was born of the same development shop, along with QPY, an unbundling of the PTL concept with string-like classes that make it easy to work with, virtually interchangeably, quote-aware and plain str / unicode objects.

QPY's smart string-like classes could be used by any templating system or web framework that hasn't solved this problem already.

November 11 2007

Is Harper Hiding Something?

On Friday Prime Minister Stephen Harper engineered a complete about face in his handling of the Mulroney-Schreiber affair, citing a new allegation.

Two things come to kind after watching this performance. First, the words Harper chose to use appear to this observer to indicate that there are more stones to turn over with respect to his relationship with Mulroney.

Second, Harper has been in possession for over seven months of the specific allegations made by Schreiber which Harper now claims have changed his mind on starting an inquiry. Why?

Looking at the statement Harper made on Friday, Mr. Harper's chosen words on the Mulroney-Schreiber affair raise more questions than they were perhaps designed to deflect.

Why did Harper not act on Schreiber's allegations when he first became aware of them seven months ago?

Harper said that he and Mulroney "did not discuss Mr. Mulroney's dealings with Mr. Schreiber during that visit", in August of 2006.

Harper did not say that he had never discussed the Mulroney-Schreiber affair with Brian Mulroney.

Likewise, Harper went out of his way to say that "Mr. Mulroney has never spoken to me on behalf of Mr. Schreiber".

Harper did not say that Mr. Mulroney had never spoken to him about Mr. Schreiber, which is quite a different statement.

"On behalf" is a curious turn of phrase to use, one that implies a much different meaning than "about". Is Mr. Harper using a Bill Clinton language device here? Will we see a debate on what the meaning of "is" is evolve in this case?

Will Harper come out and simply state that he has never spoken to Mr. Mulroney about the Mulroney-Schreiber affair? Can he state that without equivocation?

Unless proven otherwise, this observer will assume that Harper in fact has discussed the Schreiber-Mulroney affair with Mulroney. To what end or purpose, who can tell, but this entire saga is one unanswered question after another and its long past time that all the questions were put and responded to.

While most questions are Mulroney's to answer, one question for Harper at least must be asked: why did Harper not act on Schreiber's allegations when he first became aware of them seven months ago?

One week ago Harper declared there would be no re-opening of the Mulroney-Schreiber affair and bullied off the Liberals from agitating for further review. At that time Harper was already in possession of the allegations made by Schreiber.

Harper did a turnabout on the issue on Friday not because of new allegations but because information - which he had been in the possession of for seven months already - became public.

In that context, Harper's elusive words used Friday continue a pattern of evasion and rightly should draw further attention to the current prime minister's role in this affair. A public inquiry by a special prosecutor is necessary to clear the air.

November 04 2007

House: Where is the nuclear debate?

The end of the petroleum age is a notion which might have been laughed at fifty years ago but which is looking increasingly close on the horizon--for those who are paying attention. At the same time, climate change as a result of the burning of fossil fuels is an issue which, despite the best efforts of politicians like George Bush and Stephen Harper to deny and ignore, has garnered global attention and concern from every day citizens of the planet.

The conjoined issues of climate change and energy scarcity have created an environment where politicians can ram through bad policy.

We shall increasingly hear that nuclear power is the only way to meet green house gas reduction obligations while at the same time power our energy-hungry lives.

There has been precious little public discussion on the role of nuclear energy going forward, despite a clear acceleration of the nuclear industry's agenda by politicians in Canada, the United States, and Australia.

There are vast sums of money at stake: Canada is the world's largest producer of uranium, followed by Australia. The United States, China, and France are the worlds largest present-day or near-future consumers of uranium.

Vested business and military interests exist in both producer and consumer states, but particularly so here in Canada. We have AECL pushing for reactor sales; our world-leading uranium deposits eyed hungrily by miners; and the worlds largest nuclear consumer - the United States - directly across our borders.

In Stephen Harper, the U.S. has found a Prime Minister who quite happily will work on their behalf to create a policy and political under which an acceleration of nuclear-related exports can occur.

Canadians largely live under a cloud of illusion when it comes to our participation in the nuclear arms industry. Our uranium has ended up in U.S. nuclear weapons, by proxy or in actuality, it matters not. While our politicians have in the past called for a re-thinking of NATO nuclear policy, we've never backed up our policy with principled action.

Former foreign minister Lloyd Axworthy in his 1998 speech to NATO quoted a poll showing 93 percent of Canadians wanted Canada to take a leading role in the elimination of nuclear weapons. [1]

Yet it was Canadian nuclear technology that led to India becoming a nuclear power; our uranium finds its way, directly or by proxy, into the U.S. nuclear arsenal. Liberal governments allowed the transport of plutonium into our country for experimental test burns, despite prior recommendations from House of Commons committees that such a program was unfeasible. [2]

Given our historical inability to match our citizens' desires with working policy, what confidence should we have that the current government will do any better? In fact there is every reason to believe, and evidence to prove, that Stephen Harper will increase Canada's role on the nuclear stage, without having consulted parliament or Canadians at large.

Conservatives Back Liability Limitations Sought by Industry

Garnering little notice in the press, in early November members of the House of Commons were debating changes to the inadequate liability legislation covering the nuclear industry. Like the stock market passes risk off from insiders to a largely un-knowing public, the nuclear industry wants to pass practically all the risk off on to you and me. In other words, they keep the profits, we keep the waste and future problems. The potential liability is virtually immeasurable - hundreds of billions of dollars - but money means nothing when nuclear accidents can leave vast areas of geography uninhabitable.

U.S. Driven Nuclear 'Partnership'

In tandem, Stephen Harper's government has been quietly pursuing the Canadian nuclear industry's agenda on the international stage, a stage largely controlled by the United States.

According to censored documents obtained by The Canadian Press through an access-to-information request, the federal government has been "very interested" in the Global Nuclear Energy Partnership (GNEP) since 2006 when Canadian and American officials began discussions "to consider possible parameters of Canadian involvement."

Canada signing onto GNEP would be a "wet dream" for the country's nuclear industry, said Dave Martin, energy co-ordinator for Greenpeace Canada.

"It would mean a dramatic increase in nuclear exports and reprocessing, which is something they've wanted for a long time," he explained from Toronto. "But the cost in terms of proliferation and security risks is going to be enormous."

One obstacle to membership in the GNEP, Mr. Martin pointed out, is that Canada has a long-standing policy against repatriating radioactive waste–which contains plutonium–from the sale of uranium and CANDU reactors, designed and marketed by Atomic Energy of Canada Ltd. [3]

A Disturbing Change of Position

Embassy Magazine in its September 12 editorial quotes UBC professor Michael Byers who has detected since the Harper government was formed a significant shift in Canada's stated policy towards nuclear weapons.

In January 2002, Canada's policy called for "the complete elimination of nuclear weapons...through steadily advocating national, bilateral and multilateral steps," Mr. Byers points out in his new book, Intent for a Nation: What is Canada For?

[Recently the] foreign affairs website has been amended to say that Canada's nuclear weapons policy is now "consistent with our membership in NATO and NORAD, and in a manner sensitive to the broader international security context." As Mr. Byers rightly points out, this clause strips Canada's policy of any real meaning. [4]

I don't recall Stephen Harper stating anywhere during the 2006 election that a Harper government would be more, not less, tolerant of nuclear weapons. Did voters give Harper a mandate to expand our country's contribution to the arms race? To nuclear proliferation? Are we prepared to take on the worlds nuclear waste, as GNEP effectively mandates? [5]

If you disturb the land, terrible illnesses will happen in retribution. Disrupting one part of your life knocks the whole system off balance. Traditional Navajo Healer's Philosophy

Perhaps our native population can stand up and speak about the issue with a powerful voice.

Labrador's Inuit government is considering suspending all uranium mining and development on its territory because of concerns over the safe disposal of the radioactive element's waste. "The tailings disposal is a very big concern. How do you dispose of it and store it for hundreds and hundreds of years afterwards safely?" said William Barbour, Nunatsiavut's minister of land and resources. More >

Seems to me there ought to be a serious debate on this issue, not the pablum that is Question Period or most elections.

[1]Address by the honourable Lloyd Axworthy minister of foreign affairs to the North Atlantic Council Meeting (NATO, 1998)
[2]CNP Backgrounder: Weapons Nuclear Fuel (Campaign for Nuclear Phaseout)
[3]Harper, Howard and Bush: The axis of dirty energy (Greenpeace)
[4]Canada's Disturbing Change of Position (Embassy Magazine)
[5]Global Nuclear Group a Risk for Canada: Critics (Embassy Magazine)

November 03 2007

Harper: Inaction on Climate Change

This is the year of climate-change awareness, and politicians all over the globe are coming to recognize that their futures will in large part be decided by how they are perceived as acting on this issue.

Harper has so far been able to deflect much of the attention away from his own party's shortcomings - which are real and substantial - on the file. Yet the climate-change issue remains Stephen Harper's Achilles heel.

The Past

Fenced in by history on one side, and his support base on the other, Harper has no room to wiggle on policy even if he wanted to.

But the “battle of Kyoto” is just beginning. Ratification is merely symbolic; Kyoto will not take effect unless and until it is implemented by legislation. We will go to the wall to stop that legislation... Stephen Harper, 2002

Harper has for years championed the cause of the climate-change denial machine, an engine driven by big oil and big business. Confidants and supporters include noted climate-change denier Dr. Barry Gordon and his ineptly-named Friends of Science group, and Gwyn Morgan, former CEO of EnCana, the country's largest independent oil and gas company. Morgan too is a long-time foe of Kyoto, as well as a supporter of the Conservative Party. Unsurprisingly, Morgan was one of Harper's first appointment choices after becoming Prime Minister.

It is my earnest submission that signing the Kyoto Protocol would go down in history as one of the most damaging international agreements ever signed by a Canadian Prime Minister. Gwyn Morgan, former CEO EnCana Corp

In 2002 Harper, then Opposition Leader in the House of Commons, was squaring off daily against former Prime Minister Jean Chrétien. Kyoto, deeply unpopular (as are all things Liberal) in Alberta, wrote a fund raising appeal letter (attached) to tens of thousands of his Canadian Alliance party members. In it Harper said that Kyoto was nothing more than a socialist scheme, and, in lock-step with the organized denial machine, called climate change science tentative and contradictory while ridiculously suggesting that carbon dioxide (one of only many greenhouse gasses) shouldn't be a target for reduction because it "is essential to life". [1]

There is of course nothing tentative or contradictory about climate-change, despite the denial machine's attempt to blur reality, much in the same way that tobacco company executives used to testify that smoking was safe. Implanting doubt in the minds of Canadians - for we do try to be fair people - is an age-old technique of propagandists and marketers alike.

The Present

Riding to a minority election win in part on the coattails of Western angst over Kyoto, Harper delivers presents to the climate-change denial machine lobby. Immediately Harper's intentions are signaled as the inept, Alberta oil industry connected, Rona Ambrose - Ralph Klein's own Kyoto fighter - is appointed environment minister figurehead. With Ambrose fed to the press as a distraction, Harper proceeds with his long-stated plan to sabotage any real action on climate change. He said he'd scrap Kyoto [2] and he has.

Several months after the 2006 election, COMPAS completed a poll of business leaders for BDO Dunwoody (PDF attached) which underscores a truism that business is generally behind Harper in his crusade to abandon the mandatory GHG cuts that the Kyoto agreement calls for.

By a margin of at least 2:1, the COMPAS panel of CEOs and business leaders embraces the Asia-Pacific Partnership over the Kyoto treaty.

Why is business behind the so-called Asia-Pacific Partnership? Because it won't force them to change. Period.

The Bush nuclear program would turn Canada into an international radioactive waste dump. Greenpeace

In the late summer of 2007 we were treated to a photo-op of the APP ringleaders - Australia Prime Minister John Howard, U.S. President George Bush, Prime Minister Stephen Harper - and other world GHG producers agreeing to nothing more than aspirational targets, a euphamism for no hard targets, no limits, no penalties and no curbing of GHG emissions growth. Bucking the party line, John Howard's own minister of environment has been quoted as saying that an aspirational target is not a real target.

Canada has essentially operated under voluntary industry aspirational targets for two decades now, and the result: our emissions are way up.

Understandably, environmentalists are not happy with the direction Canada is headed.

In the face of environmental calamity, we have political cowardice. John Bennett, executive director of ClimateforChange.ca

[Our] new federal government seems bothered not a whit by such details. Instead, it has said that the Kyoto targets are too hard for Canada, so it won't even try to meet them - essentially thumbing its nose at the international community and the other Kyoto signatories (the majority of whom have already reached their targets or are on track to meet them by the 2012 deadline). David Suzuki [3]

Intertwined with rising GHG emissions are the rising expectations of the global nuclear industry, of which Canada, Australia, and the United States are major players. Canada and Australia have together a large percentage of the planet's Uranium reserves.

GNEP promotes the export of uranium and nuclear reactors, along with the return of the radioactive waste (spent reactor fuel) to the supplier countries for disposal and reprocessing. Canada, however, has a long-standing policy against repatriation of radioactive waste from uranium and CANDU reactors sold abroad.

“The Bush nuclear program would turn Canada into an international radioactive waste dump, and the Harper government has not allowed any public debate,” said Dave Martin, energy co-ordinator for Greenpeace Canada. [4]

Election 2006 should have been the environment election, but was instead focussed on the infighting between Liberals and the ineptness of Paul Martin's election team.

The Future

The next time Canadians head for the polls to elect any government - municipal, provincial, or federal, lets not allow politicians to spin other less important issues as distractions.

Stephen Harper's bunch truly are in bed with the large polluters and producers of GHG's; the Liberals have demonstrated over many years that they lack the political will, or capital, to make tough, meaningful, choices.

There are no easy answers to the dual problems of climate change and clean, sufficient, energy; but our current and traditional political leaders aren't even interested in asking the right questions. Its time to put motivated and un-beholden people into our House of Commons, our provincial legislatures, and city halls.

[1]Harper letter called Kyoto 'socialist scheme', January 30 2007 (The Star)
[2]Conservative government would scrap Kyoto: Harper, June 9 2004 (CBC)
[3]Canada's international reputation in jeopardy, May 19 2006 (Suzuki)
[4]Harper, Howard and Bush: The axis of dirty energy, September 6, 2007 (Greenpeace)

November 02 2007

Grassroots Democracy?

While on the campaign trail of 2004, Stephen Harper, trying to score points off the backs of Liberals who had been stung by nasty riding-level nomination battles, said:

We want to clean up internal party politics, beginning with grassroots democratic control of the nomination process. Stephen Harper

What a crock of crap.

Over the years its been made clear that Harper has never cared for "grassroots democracy" -- not as Preston Manning's policy sidekick, not as head of the libertarian/anti-government National Citizens Coalition, not as leader of the Canadian Alliance and certainly not as leader of the Conservative Party or government.

What nominal support he offers democracy is merely pretense; a platitude for the masses.

Taking the point to its logical conclusion, Harper doesn't much care for "democracy", not by any common definition of the word. Harper certainly doesn't believe in representative democracy, as the people's representatives are muzzled before, during, and after election, and made to conform in every respect, cookie-cutter-like, to templates set by a back-room bunch from National Council and the ever-ready election war room.

Usurping the people's choice apparently comes naturally to Harper. We've got Fortier and Emerson and Khan as concrete examples. And within just a few weeks recently, a hat-trick of electoral district associations are being dictated to from afar (or essentially have been replaced) and condescendingly informed that they may not select their own candidates.

While CPC president Don Plett might be taking the heat lately, the Manitoban Harper hitman answers only to his master in the PMO.

A Prime Minister who has at every turn demonstrated that the only voice which matters is his own, Stephen Harper has made it clear that he favours autocracy, not democracy.

November 01 2007

Emerson: too chicken to run?

Chicken running

Amid all the election speculation, I continue to wonder if David Emerson will be too chicken to run in Vancouver Kingsway (or anywhere for that matter).

Will Harper parachute him into another riding? There are three in Canada whose democratically elected candidates have been declared persona non grata by Harper's hitmen. Perhaps a fourth might be Vancouver Quadra, who despite the efforts of conservative don John Reynolds to get elected his hand-picked star candidate, Mary McNeil, chose to nominate UBC business school educator Deborah Merideth.

Reynolds, like Harper, doesn't like being dictated to by the peons in the party, so perhaps there's going to be more on the Quadra file to be said in time. Rumours have it that Emerson - who moved after his defection controversy brought press and public to his door - continues to live in Quadra. He might be interested in running there to avoid having to hang out with the diaspora he pretends to represent in Vancouver-Kingsway.

If Emerson runs, anywhere in the lower mainland, he'll have to contend with the ghosts of his stunning overnight defection to the Conservative Party, less than 24 hours after he was elected as a Liberal. It will be easy to remind local voters of how meaningless Stephen Harper considers their votes and voices, and Emerson will be sent packing.