Archive for May 2008

JavaScript frameworks hosted by Google

Tuesday, May 27th, 2008 – no comments

For a little while the YUI has been hosted by Yahoo; now Google is doing the same for jQuery, Prototype et al. There’s some documentation available but essentially you do e.g.:

<script 
type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js">

(You can select specific major/minor versions via different URLs, though this places some limitations on the expiry headers that get sent back.)

Google recommends that you load the frameworks via google.load(). What is the advantage of doing this? It seems to do nothing other than add overhead unless there are complicated dependencies.

The headers that come back are

HTTP/1.0 200 OK
Last-Modified: Sat, 24 May 2008 00:39:29 GMT
Content-Type: application/x-javascript
Expires: Wed, 27 May 2009 20:51:04 GMT
Date: Tue, 27 May 2008 20:51:04 GMT
Cache-Control: public, max-age=31536000
Content-Encoding: gzip
Server: GFE/1.3
Connection: Close

which seem pretty sensible. (Curiously, you only get a gzip response with a Accept-Encoding that includes gzip and a User-Agent Google recognises, like that of Firefox. wget –header=”Accept-Encoding: gzip,compress” won’t do it.)

I don’t know of any privacy or service guarantees. However, as Dion Almaer points out, they’re served from a ajax.googleapis.com, not google.com, so users’ google.com cookies aren’t available for tracking. As of now the service doesn’t set any either.

I’ve done a few quick tests, and serving prototype.js (30k, compressed) from Google to the UK and US is 4-5 times as fast as prototype.js from beebo.org (in Paris). For Australia, though, it’s only slightly faster.

When you aim at the king you had better kill him

Monday, May 19th, 2008 – no comments

The punishment meted out to an unfortunate Robert François Damiens, who attempted to assassinate Louis XV on 5 January 1757:

The said Robert-François Damiens has been convicted of having committed a very mean, very terrible, and very dreadful parricidal crime against the King. The said Damiens is sentenced to pay for his crime in front of the main gate of the Church of Paris. He will be taken there in a tipcart naked and will hold a burning wax torch weighing two pounds. There, on his knees, he will say and declare that he had committed a very mean, very terrible and very dreadful parricide, and that he had hurt the King … He will repent and ask God, the King and Justice to forgive him. When this will be done, he will be taken in the same tipcart to the Place de Grève and will be put on a scaffold. Then his breasts, arms, thighs and legs will be tortured. While holding the knife with which he committed the said Parricide, his right hand will be burnt. On his tortured body parts, melted lead, boiling oil, burning pitch, and melted wax and sulphur will be thrown. Then four horses will pull him apart until he is dismembered. His limbs will be thrown on the stake, and his ashes will be spread. All his belongings, furniture, housings, whereever they are, will be confiscated and given to the King. Before the execution, the said Damiens will be asked to tell the names of his accomplices.

Tim Blanning notes: “In the event, the actual execution was even more ghastly than this scenario suggests. The four horses proved unable to tear Damiens apart, not even after reinforcements had been hitched up, so the executioner was obliged to employ an axe to sever what parts of the limbs were still attached. The victim remained conscious throughout, repeatedly shrieking, ‘My God, have pity on me! Jesus, help me!’, and—according to one observer—was still alive when his torso was thrown on to the pyre.”

(From The Pursuit of Glory: Europe 1648–1815, by Tim Blanning, p. 203.)

Fortunately, peasants are human beings

Sunday, May 18th, 2008 – no comments

Late 17th C. attitudes towards peasants:

It is true that peasants are human beings, but they are somewhat less refined and are coarser than the others. One only has to observe their behaviour and their gestures to see how easy it is to distinguish a peasant from someone with manners … Their odious way of speaking and behaving is obvious to everyone … When they eat, they don’t use cutlery but thrust their hands straight into the bowl … It might almost be said that peasants should be treated like dried cod: they are best when they have been given a full load of work to do, for then they are disciplined and regimented. The peasant always wants to be master, if his master allows him to give himself airs and graces. No one knows better how stubborn the peasants are than he who has lived among them for a long time. And one thing is certain, no amount of just saying the right thing will change a peasant, the only thing that he understands is firm language supported by threats of corporal punishment.

(From The Pursuit of Glory: Europe 1648–1815, by Tim Blanning, pp. 186–187.)