Currently:
2003-08-11»
python templating»
Well, the weekend's over, and I'm sticking with Python. I caught up to
where I was with the Perl implementation pretty quickly, and in far fewer
lines. To be fair, I think a sizeable part of that may have come from me using
the Test::Unit / unittest suites to do my test-first development. Both are
derived from Kent Beck's Smalltalk framework and are very OOP-oriented, which
favours Python over Perl5. I was beginning to stumble
into some hairy data structures with Perl, all of which turned out a lot
simpler-looking in Python. That, and I'm doing some email mangling in this
part of the coding, and Python's built-in email
module has much of what I need. There are some even better libraries
in CPAN
(as usual), but I was greatly spoilt for choice and
little spoilt for time.
Anyway, this still leaves the problem of a decent
templating solution for Python. I got loads of very useful
suggestions, which I'll attempt to summarise here:
Aaronsw wrote back to say that he uses cheetah and sqlobject . He wrote
back suspiciously fast. I think it may have been one of his bots talking.
Both cheetah and sqlobject look tempting - especially as sqlobject supports
sqlite, and I'd like to stick with that very basic SQL implementation until my
lusting and hunger for relational database power become known to more people,
as the Boney M
song has it [1].
Noted real-world Python user Zooko said that the Mnet gang would probably be going
for whatever templating Twisted
had. Then he confessed that they probably wouldn't have much need for
templating at all. His most abiding point was, I think, to exclaim w00t python
w00t, which I took to heart.
Jonathan Moore says "all the cool kids have quit templating and gone to
XSLT", which I subconsciously knew. But then if the cool kids jumped off the
Post Office
Tower, would I join them? Naturally, because cool people are usually
into BASE jumping and stuff
like that, and would be cool enough to help me with basic safety precautions.
And, besides, how cool does jumping off the ... I digress.
My thoughts: XSLT is one of those technologies best kept for either times
when someone is paying you to learn it, or you've lied on your resume and said
that you wrote the W3C spec, and now you find you have the job of your
"dreams". I'm in neither position, for once.
David Jeske wrote an informed recommendation for ClearSilver, which isn't surprising
as he's been hacking on it for yonks. ClearSilver looks really
interesting. It has a nice, simple, theory
behind it. The original, closed-source version drives Yahoo Groups
. Jeske
and friends' open source re-implementation is used at Weather Underground. It doesn't get much more
hardcore than that.
Van Gale backed up the Clearsilver recommendation, and also put it in a
plug for Cheetah and TAL (the Zope templating system untimely ripped from the
rest). Van has a soft spot for PyMeld too, but wasn't
sure if it could cope with high-performance sites. Richard Jones likes SimpleTAL.
When I hit my templating problems, I think I'll hit them back with either
ClearSilver or Cheetah. Which one will depend on the size of my problems and
on what speed I'm plummetting into disaster at the time.
[1] - Rasputin would make a great name for an open
source project.
2003-08-09»
py vs pl»
I've got a new medium-sized project to be working on. It's just me coding
it at the moment but at some point (if it comes together), I do want to be
able to pass it on to someone else, preferably without apologising first.
I'm utterly torn between Perl and Python. My first choice in this case
would be Python, because bad Python code doesn't seem to be quite so
personal. I've seen people spit blood at other coder's Perl, just
because it's not the way that they would do it. Perl demands rather more
sympathy with your predecessor than does Python. With Python, it's just more
code to stare at.
That said, your successor does need to actually know the language. Most of
the people I can imagine maintaining this code will know Perl but not Python.
Python doesn't take that long to learn, but reading Python to take on someone
else'se project just isn't much *fun*. Sitting down to learn someone's Perl,
while tough, does teach you about the way they were thinking when they wrote
the application. Python's clarity, I think, cuts down on its expressiveness
in depicting why certain decisions were made. When I had to hunker down and
learn POE or Moveable Type, for instance, I came away with a very deep
understanding of how it was supposed to work. It was fun, albeit
time-consuming. I sometimes have problems doing the same with slabs of Python
code, just because they can be very lacking in personality.
That said, I'm not paid to be a programmer. What is fun is a hobby can be
skull-crackingly frustrating in a job with a deadline.
I eventually made the decision to go with Perl and Mason - mainly because of Mason. I know
a lot of people who know Mason who I can ask when I got stuck, and there's a
fair bit of this code that will end up being on a Website, eventually. There
don't seem to be any Python templating solutions that stand head-and-shoulders
above the crowd (and whose implementors I know). I felt that going with Perl
would provide my successor with a clearer understanding of the whole project,
and not necessarily lock me into an immature Web tech that no-one knows.
Now, a couple of days into it, I've begun to seriously reconsider. I'm
nowhere near the Mason bit of the application, and I'm getting continually
bogged down in Perl style issues that really don't have anything to do with
what I'm trying to write.
To be honest, I think this is my Perl rustiness kicking in; and I think it
may go away after a few more days hacking. Worse, though, is the effect of
something I thought would be a real boon - CPAN. There's a bunch of useful
utilities there that I'd love to suck in and use in my program. But they all
have different idioms - all of which I have to sit down and learn. Plus
there's the whole dependency issue: sooner or later I'm going to have to
install all of this on the working server, and there's a real penalty to be
paid for being dependent on a lot of scattered Perl modules. Will they work?
Will they still be maintained? Which of alternative implementations should I
choose?>
So, I'm going to spend this weekend having a bash at a Python
version. My XPish working
style has recently become dependent on a lot of Python features, and the
Python core library has most of what I need in the way of modules. I really
haven't written much code, so there's not much time lost. And I figure that if
it all goes to hell in Python too, I'll learn my lesson quickly and go
slinking back to Perl with my tail between my legs. Plus, no-one's paying me
to be decisive here. As if anyone would.
I still don't know of a good, solid, Python templating language though. Or
rather, I know of three or four, but I don't know anyone who has used any of
them seriously in high-volume production environments. I'm not interested in
Zope or Twisted (tempting though they are) because I'd be obliged to wrap my
solution in their terms, but I really don't know whether I should go for
SkunkWeb or WebWare or Spyce or any of the
others.
Right now, I'm delaying the decision until I'm a bit deeper into the code.
Which feels a bit uncomfortable. But under the terms of XP, perhaps forgiveable.
2003-08-07»
dirty, dirty junk mail»
There's a US federal law which lets individuals prohibit companies from
sending unsolicited sexually provocative or erotically arousing mail.
According to the postal ruling implementing this law, ""Postmasters may not
refuse to accept a Form 1500 because the advertisement in question does not
appear to be sexually oriented. Only the addressee may make that
determination."
Kayne McGladrey is doing the obvious thing: declaring that all those
Sharper Image catalogues and coupon collections are quite filthy, and
should be exorcised from her letter box. Instructions
included.
vim tips RSS feed»
Learn something new every day, with the vim.org tips RSS
feed. (Thanks, Phil!)
2003-08-06»
at the court of homeland security»
A friend of mine was going to drop by while on a trip to San Francisco in
a few months. Not anymore. He's a french citizen living in the UK. When he
went to renew his passport, he discovered that the french consulate can't
provide him with a machine-readable passport. And from October the 1st, the US
is refusing visa-waivers to
anyone without one. You have to get a normal visa. Male visa
applicants aged between 16-45 also have to fill in this new extra form, DS-157.
Questions on the new form include:
- Mother and father's full name.
- All the countries you have entered in the last ten years (with
year)
- Your last two employers (with address, telephone number and
supervisor name)
- All professional, social and charitable organisations to which you
belong or have belonged, contribute or have contributed or with which you
work (or have worked)
- All educational institutions you attend or have attended (excluding
elementary school)
- A list of specific locations you will visit in the US
Understandably, he objects to filling in this form. So he's not coming.
There's a lot of problems with demanding info like this, but I just want to
concentrate on one.
Most American voters will never see this form, and neither will the
citizens of countries that the US media listens to.
But the majority of people visiting the US will. Any male between 16-45
coming from these countries will:
Afghanistan
Albania
Algeria
American Samoa
Angola
Anguilla
Antarctica
Antigua and Barbuda
Arctic Ocean
Argentina
Armenia
Aruba
Ashmore and Cartier Islands
Atlantic Ocean
Azerbaijan
Bahamas, The
Bahrain
Baker Island
Bangladesh
Barbados
Bassas da India
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
British Virgin Islands
Bulgaria
Burkina Faso
Burma
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Clipperton Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo, Democratic Republic of the
Congo, Republic of the
Cook Islands
Coral Sea Islands
Costa Rica
Cote d'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Europa Island
Falkland Islands (Islas Malvinas)
Faroe Islands
Fiji
French Guiana
French Polynesia
French Southern and Antarctic Lands
Gabon
Gambia, The
|
Gaza Strip
Georgia
Ghana
Gibraltar
Glorioso Islands
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and McDonald Islands
Holy See (Vatican City)
Honduras
Hong Kong
Howland Island
Hungary
India
Indian Ocean
Indonesia
Iran
Iraq
Israel
Jamaica
Jan Mayen
Jarvis Island
Jersey
Johnston Atoll
Jordan
Juan de Nova Island
Kazakhstan
Kenya
Kingman Reef
Kiribati
Korea, North
Korea, South
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Lithuania
Macau
Macedonia, The Former Yugoslav Republic of
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Man, Isle of
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Micronesia, Federated States of
Midway Islands
Moldova
Mongolia
Montserrat
Morocco
Mozambique
Namibia
Nauru
Navassa Island
Nepal
Netherlands Antilles
New Caledonia
Nicaragua
Niger
Nigeria
|
Niue
Norfolk Island
Northern Mariana Islands
Oman
Pacific Ocean
Pakistan
Palau
Palmyra Atoll
Panama
Papua New Guinea
Paracel Islands
Paraguay
Peru
Philippines
Pitcairn Islands
Poland
Puerto Rico
Qatar
Reunion
Romania
Russia
Rwanda
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia and Montenegro
Seychelles
Sierra Leone
Slovakia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
Southern Ocean
Spratly Islands
Sri Lanka
Sudan
Suriname
Svalbard
Swaziland
Syria
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad and Tobago
Tromelin Island
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
Uruguay
Uzbekistan
Vanuatu
Venezuela
Vietnam
Virgin Islands
Wake Island
Wallis and Futuna
West Bank
Western Sahara
World
Yemen
Zambia
Zimbabwe
|
And this is what they will learn of this country: that it requires that a
large amount of biographical data be handed over to its government. It
obligatorily requires anyone to reveal any and all organisations, political or
social, of which they are a member. That its government also demands to know
the location of those within its borders, and the precise time of their
movements. And that men and women are to be treated differently.
I think it's one thing to require visitors to a country to obey its laws,
and comply with its values. But to propose a set of rules like this that seem
to me to represent the very opposite of those values - well, that seems to be
not only wrong, but a strong danger sign.
I keep on asking: if this bureacracy, this data collection, this process is
necessary or even useful, why is it not applied to all Americans too? Or, if
the administration is only worried about foreign terrorists, all
visitors?
I cannot imagine that the percentage of terrorists in the sum of non-visa
waiver countries is much larger the some total of terrorists globally. Either
way, it is a tiny fraction. Why are we collecting so much data on the rest of
the world? And if it is not a problem - a minor inconvienience - why don't we
subject ourselves or the majority of Europeans to it, too. What do we have to
fear?
I really think that these questions should be universally required, or not
required at all.
Or is it simply because we know that Europeans, and Americans have a
greater voice; can declare these questions to be against their natural rights?
Do they have more natural rights than others? Is that what the bill of rights
means? That these rights are reserved only for American citizens and their
companions? Is that what the creators of these rules propose?
I worry about this, and I worry about any number of other proposals that
seem to go through without the slightest oversight by all the checks and
balances of this country. And I worry that the people who are in charge don't
seem to consider what they are doing might be wrong.
The point at which the Constitution becomes little other than a crucifix
one waves at powerful figures who have no understanding or sympathy with the
values it represents, is a point I believe it at risk of becoming useless,
even to those few who can still shelter behind it.
me vs it»
My editor mailed me to ask about that last entry, and whether we should
rewrite the piece. He said someone had pointed it out to him.
Someone, my foot. Do you see what this is? This is the Internet getting
back at me again. Leave me alone, Internet, I say, waving my fist in
an indescribable direction.
And I've finished the CD-ROM piece (it was all right), even though when I
started to do some last minute research, the first site that came up for my
google search terms was my own QuickTopic page. Oh very clever, Internet. Very
sarcastic. Just because you don't want to do all the work.
I'm not linking to anything on this entry, just to punish it.
Oh alright, here's some nostalgic reminiscences about people's first
computers.
You liked me then.
2003-08-04»
me vs. them»
I've just spent about two weeks researching various Wi-Fi contention and
multi-hop routing issues for an article. And within minutes of
finishing it, Slashdot runs two stories
that would have saved me most of that time. And which, anyway, now transform
my ingenious point into common knowledge for most /. readers.
I hate the Net. Hates it, hates it.
petit disclaimer:
My employer has enough opinions of its own, without having to have mine too.