Tracemonkey

November 29, 2008

According to the site, Mozilla wants to release Firefox 3.1 Beta 2 pretty soon, in early December, and as everyone should really know by now, it is one of the most exciting browser updates to be released for some time, particularly for Javascript developers. I used to work quite a lot in Java, a language similar in syntax, writing a(nother) version of the Game of Life, a graphics-light version of Geometry Wars and a little matrix applet, all of which were great fun to write. I really love Java; perhaps it’s because I had been using Visual Basic for several years before suddenly finding this far superior language. Or perhaps it’s the way it successfully merges an intuitive elegant curly-bracketed syntax with an convenient easy-to-use applet for interfacing with users.

Predictably Steve Jobs thinks otherwise: “Java’s not worth building in. Nobody uses Java anymore. It’s this big heavyweight ball and chain”. So iPhone apps will use Objective C, a fairly disgusting and overcomplicated and unconcise language in my humble opinion.

Click for full-size image.

Objective C Screenshot

Eclipse Screenshot

Returning to Javscript (Java really hasn’t got much to do with JS besides syntax), it’s also the case that most web apps use javascript (or AJAX) – it appears to set the standard for frontend user interfacing. So the Firefox developers decided to do something about it and have blown all the other browsers out of the water with an unbelievably fast javascript engine, Trancemonkey. It’s available in Beta, and being that sort of person I couldn’t resist giving it a spin. It was fast.

I ran some tests using the Sunspider Javascript Benchmark. The first four data points were recorded at home using my computer and the last three at school. Embarrassingly the school computers seem twice as fast at JS rendering than my own, possibly a function of my having about 15 tabs open (including JS pages such as Google Reader) and music running in the background, although the difference should really be minimal. Here’s a graph of results – displayed are the times taken to run the test; shorter bars are better.

Browser JS Comparison Graph

Browser JS Comparison Graph

Click here for full-size graph

Sunspider provides some really in-depth information which may be of interest (my computer is called ‘BTComp’ and time to run in ms is in [square brackets]):

BTComp FF 3.1 Portable + Tracemonkey [2,506]
http://tr.im/1msn

BTComp FF 3.1 Portable [4,346]
http://tr.im/1msv

BTComp FF 3.04 + Plugins [4,966]
http://tr.im/1mt1

BTComp IE 7 [42,283]
http://tr.im/1mte

School FF 3.0.3 [2,561]
http://tr.im/1mum

School Safari 3.1.2 [3,059]
http://tr.im/1muo

School IE 7.0.5730.13 [23,382]
http://tr.im/1muq


Technorati

November 25, 2008

I’m Technorati-fying my blog to move into the so-called ‘blogosphere’. To confirm my ownership of this I need to post this link. So here goes:

Technorati Profile

My blog should now be verified and tied to my Technorati account. Welcome to the Blogosphere.


My Stance on Global Warming

November 22, 2008

n2215691154_37700

I’ve just chanced upon Will’s ‘vlog’ post (it was a video embedded into a blog post – what else am I to call it?). It’s a bit old – I take time to chance upon things. So, the world is coming to an end because we are selfish and excessive in our use of energy. Apparently.

Officially, I like to refer to myself as a sceptic and positivist – I follow the doctrine that speculation on ultimate causes or origins is futile and believe in the system of obtaining knowledge through systematic doubt and continual testing. Thus my stance on global warming is neither that of the maniac eco-warrior nor that of the inexorable cynic. However whatever the case it’s always important to take a multifaceted analysis of any situation and think outside the box (to use the old cliché), instead of dogmatically pursuing a mere single thread which exists as a relatively insignificant decoration on a thick quilt of intrinsically interwoven issues.

An aspect of the entire oil and global warming debate which is often overlooked or perhaps deliberately ignored is the economic and political aspect of it. If you think about it, nowadays oil is equivalent to power. This is very much an economic phenomenon projected onto the plane of political power in which Middle-eastern countries and Russia are at liberty to exploit their massive amounts of black gold, an unfortunate precedent which can be and in fact is unashamedly translated into a disproportionate amount of undeserved political influence. I’m sure I’m not alone in my (personal, biased and subjective) dislike of the idea of all this scarcity power being in the hands of the countries which happen to have all this oil and gas; I’d hate to see America and Britain on their knees begging Putin (we all know he’s still wearing the trousers over there) or some militant religious extremist group for a few barrels of oil. In other words this political leverage is all about the scarcity power of oil. This constitutes my primary reason for supporting a long-term move to abandon oil and other fossil fuels as a source of energy: oil is a commodity on which the world is increasingly reliant and whose natural residence is apparently countries which unnervingly frequently end up in political turmoil (I think it’s fair to say) so my personal opinion is that it seems after a little consideration a fairly bad idea to build the world up around it. I’m therefore a great fan of alternative, particularly renewable ways of producing power which don’t involve the use of such a messily obtained substance.

oil_rigsresizeoriginal image

Returning to the argument considered by most eco-warriors, I think Will is in part absolutely right (please ignore my seemingly nonsensical juxtaposition of words) about the warming aspect of, global, err, warming – whether it be us or pixies or cosmological factors who/which are at fault, there exists quite unequivocally a problem and it undeniably requires attention. However, personally undecided about the verity of the claims about the anthropogenity (neologism I believe, but a good one) of global warming, I’d argue an engineering solution rather than a human / social / lifestyle one is needed here – a protective rather than preventative solution. The Earth’s atmosphere is simply so complex that few people can claim to understand its workings in any great detail, let alone work towards an accurate model of cause and effect; by my logic it follows intuitively that any attempt to tackle a perceived cause may well be in vain if not deleterious (for example the questionable proposal of filling the atmosphere with sulphur dioxide) – far more propitious a solution would be simply to be pragmatic and do what we know we can do: consider methods of protection against predicted conditions which can themselves be more reliably extrapolated than an attempt of analysis on dubious and often erroneous data.

In fact, even if it were true that humans were the cause of the earth’s positive temperature gradient (against time), I’d be willing to bet that any attempt to reverse the trend would be futile, be it too little, too late, or both. A single word sums up the impossibility of the task of reducing Carbon emissions: China. As some may know, I blame China for many things, including milk, red tape and Communism; in this case though I feel it would be unjustified to blame her, even if her factories were indeed the cause of such future strife and suffering. Allow me to elucidate my uncharacteristically sympathetic attitude towards the developing world. I’m one of those cynics who believe the world, or at least the majority of it – certainly the influential parts of it – are driven by two main wants: money and power. In addition, everyone knows that just about everything runs off electricty. No business could function without it: transport, computers, buildings and manufacturing all slurp up vast quantities of electricity. So if money is everything and everything is electricity, there’s a lot to be said for electricity in money terms. China was blessed with unfair amounts of coal naturally available to the country, making coal a cheap source of energy. Chinese businesses (probably with the help of the government) merely exploited this by building coal power stations en masse, something the West would undoubtedly have done in the past, and which it would probably still do today. We got damn close with ‘drill baby drill’. China’s population situation is also geared towards high energy consumption: it doesn’t take a great leap of faith to conclude that 1.3 billion people squashed into 9.6 million square kilometres will require more than a few wind farms to power, and at the time China began developing at its unprecedented and scarily rapid rate (around when I was born) nuclear power was still very much an experiment and the world was still reeling from Chernobyl; the only way to supply power affordably to such a large population with so little space was to use cheap and cheerful methods: fossil fuels. So is it fair to blame China for making use of her natural resources partially out of necessity? I certainly don’t think so.

china_gdp
original image

So returning to the problem of global warming, it seems unlikely that China will wilfully do anything about her carbon emissions. Meanwhile, even if both the UK and US manage the 2050 target (I’m sure it used to be 2012…), the effect will be minimal, to say the least, even if it is true that global warming is our fault. My argument about protection rather than prevention seems to make sense.

So why don’t I join environment committee? In fact, there are several reasons, but the main problem for me is that the committee stands for something which I don’t: working off the assumption that global warming is by definition anthropogenic, it seems to work primarily to reduce Carbon emissions, a measure which I consider ineffective at best, and simply wrong at worst, and the fact that some of its aims happen to coincide with my personal ambitions for the world, e.g. renewable power, isn’t enough to convince me to join. Regardless, I still wish them luck in whatever they do; I’m good friends with one of the main figures in the society and am confident that he has good intentions and indirectly or otherwise yearns for a future unreliant on oil, and therefore also on the Middle East.


Physics Lectures at the IoE

November 16, 2008

On Wednesday I was shipped off along with the rest of the L8 Physics population to a series of Physics lectures. There were five lectures, some of which caused some controversy among us. Here’s my take on matters:

The first talk was on avalanches. In short, the lecturer gave a quick run through of how avalanches occur, introducing concepts of fluid dynamics and elucidating key points about avalanches, including the different ‘flavours’ on offer (as he described it) and various methods of protecting against them. I personally think this was quite a good talk – his explanations of how avalanches form were clear and accessible to anyone who happened to be listening. There were some breathtaking shots of scenery and amazing clips of avalanches in full flow, and I really felt interested in what he had to say. His exposition of defence mechanisms against avalanches were a nice resolution – the case study of Iceland was well chosen and I enjoyed being led through the story of how various attempts to divert avalanches failed and the (sometimes) ingenious systems which were eventually adopted. He even showed us a clip of a simulation of an avalanche that used ping pong balls which looked a great deal of fun to conduct! Some of my peers dismissed it as a distinctly unscientific lecture, but my opinion is that it was more a discussion of the engineering problems faced by inhabitants of avalanche-prone areas and an interesting supplementary brief of the different types of avalanche as a means to better understanding of possible defence systems rather than an attempt to get an audience to understand the Bernoulli Principle.

We were then treated to almost an hour of someone talking about dark matter. Well, someone talking about general cosmology. Well, someone chatting about general cosmology, with a mention of dark matter at the end. My credentials entitle me to absolutely no authority whatsoever to comment on this lecture: the greatest height I’ve achieved in terms of credibility is becoming the Physics editor of the Science magazine at St Paul’s – an impressive-sounding title, but ultimately one of little significance. In essence, I’m a layman commentator; however I felt the lecturer failed to do such a promising topic justice. Dark matter is a hugely exciting topic – so much theory goes into it and it’s a conjecture which springs from measurements which seem to fly in the face of believable science – it’s on the border between Physics and fantasy and a controversial subject. However I felt the style in which the talk was delivered was contrived in such a way that those who already knew and understood the stuff the lecturer was talking about ended up bored since explanations and mathematics were distinctly lacking, while those who didn’t know much about this area of science got confused as almost none of the assertions were justified or explained in much detail and much knowledge and understanding was incorrectly assumed. It was almost like one of those horrific ’science appreciation’ lectures which I so abhor and I felt the topic was betrayed by such an exposition. Perhaps the subject was ill-chosen for such an audience – a lecture on dark matter and dark energy pitched at AS-level students is doomed from the start: none of the interesting mathematics is yet accessible and everything falls apart and becomes a jumble of words.

I was horrified in the following lecture to discover that at least one member of the audience couldn’t tell the time and another didn’t know the speed of light, evidence to support my point about dark energy being a poorly chosen topic for the audience. This next lecture was about time travel and this time, despite the apparently difficult subject matter, the topic was unravelled very skilfully with appropriately chosen and utilised equations. I particularly enjoyed the way the lecturer managed to get the most rowdy member of the audience to volunteer to sit inside a (wire and fabric?) Tardis for five minutes and subsequently declare his experience ‘impressive’ – skilful manipulation on the part of the lecturer and congratulations to her. Again the now *very* familiar Lorentz (I’ll get it right this time) factor appeared (though tragically obscured by the Tardis) to explain forwards travel in time relative to a stationary object. Some of the reasoning was still circular, for example defining the limit of the speed of light as, well, the limit of the speed of light, although to be fair, with the level of mathematics available to members of an audience who cannot tell the time, the Lorentz factor (the reciprocal of a radical, oh horror) was probably already too great a stretch. But overall I thought this lecture was a well thought-out summary of the concepts of time travel and the paradoxes involved (both Grandfather and twins).

After a Tesco lunch (I’m not an M&S snob) we were all made to feel stupid by an engineer demonstrating to us why our brains are rubbish and why we should think laterally. After getting every single question he posed wrong (fine, I exaggerate), I listened intently as he explained the fundamentals of lateral thinking. Lateral thinking is something which is unfortunately not taught or even encouraged at any level in the National Curriculum. Exam questions invariably involve some standard procedure, and if any other method is employed, the poor GCSE / AS / A2 marker will just get confused, have a good head bash and give you zero for that question. I actually distinctly remember being told in English lessons not to try to write something original in the exam – ‘by all means be creative when doing homeworks but just do something standard that ticks all the boxes for the exam’. I feel at this point inclined to thank one of the many variants of the imaginary creator of the universe to get planning permissions for a school as good as mine – I’d be willing to bet that schools which aim for their pupils to attain a C at GCSE level produce very linearly thinking students, so to speak.

The final lecture was by far the most entertaining – a pseudo-magician taking the piss out of real magicians and abusing the sciences, specifically a Van der Graaf generator, a Wimshurst (sp?) machine, a whip and a Barbie doll. What more needs saying?

Overall I felt it a highly stimulating series of lectures. Almost every discipline associated with Physics was covered, from engineering to cosmology to relativity to logical thinking. Although I suspect few people actually learnt anything particularly new and deep from any of the lectures (except perhaps the lateral thinking one), every lecturer had something new and interesting to say, and it was a great way to spend the middle of a week.


Hitchens v Dawkins

November 8, 2008

dawkins

It may strike one as a strange pair to pit against each other: the two are leading religious sceptics, battling shoulder to shoulder against the forces of stupidity, misunderstanding and retardation of scientific progress – they generally tend to be on the same side. However I feel their styles when debating are very different and it’s worth making some comparisons. I’ve known about Dawkins and his struggle against insanity for a long time; I’ve read his books (well, got about half way through one of them to be precise) and watched some of his debates (specifically the one against Lennox) and have quite a good picture of him. I thought he was alone in this world until someone told me about Christopher Hitchens, another religious sceptic with similar aims, and have only recently taken the initiative to watch his debate with Boteach. The two debates contrasted starkly.

johnlennox-large1

For one, the opponents were very different in nature. Dawkins had the misfortune to be debating against an apologist, a supposedly religious person who seems to have no real convictions about anything. Lennox was perfectly happy (I seem to remember) to agree the bible is … dubious in nature. Lennox is an adamant supporter of science. I seem to remember the two energetically agreeing with each other on some things, particularly where the acceptance of Science came in. Boteach on the other hand was amazing. The sheer incorrectness of his arguments amazed me. The fact that he was bold enough to make such ungrounded assertions in public amazed me – it was almost embarrassing to watch! Boteach is a creationist: in other words, he is an anti-scientist. His arguments about evolution were so warped, jaded and universally and categorically wrong that it made me cringe to have to listen. He also seemed to rest half his arguments on the fact that religion is a more palatable concept. What utter rubbish, and what joy it brought me to watch a master pick it apart in as pseudo-polite yet also gleefully rude manner as Hitchens. It also made Hitchens’ life a lot easier – picking apart arguments made by a jittering idiot is always easy. Believe me, I do it myself, though not quite as well.

hitchens

The key difference between the two debates I think is the sceptics’ method of argument. Dawkins brought much science into it: he tried to use his knowledge of biology and physics to construct clear and rigorous scientific assertions to back up his arguments. I suspect it didn’t work so well for that debate – Lennox’s scientific leaning helped him get round the problem of having a stereotypical-religious-nutter image and he was able to discuss the science intelligently and make non-stupid points, part of the whole apologist guise. He also knew when to agree with Dawkins and which religious anti-science arguments to avoid (the ones which are clearly wrong such as those that attempt to dispute evolution). Dawkins’ book also draws heavily on current and past scientific research and his arguments are constructed intelligently from there. Hitchens on the other hand almost ignored science in his debate against Boteach. After all, as he said right at the beginning, he thinks it is so utterly clear religion is false that it’s pointless arguing over its verity; why bring in science? Instead he concentrated his energy on trying to prove why religion is pernicious, why be believes religion is actively harmful to the world and why it is outrightly contrary to everything human progress holds dear. Perhaps this is a better way of debating: the average religious nutter (Boteach included) will try desperately in an attempt to seem intelligent to find some loophole in science that creates a crack of uncertainty in which God may reside and at the same time dig for himself one heck of a hole in which to reside himself. Hitchens knew Boteach was going to make a stupid argument about science – why not let him introduce the incorrect pseudo-science and watch the show?

boteach150

Another difference, certainly taking those two debates as examples, was the ‘niceness’ of our two heroes. Dawkins really did his best to be nice. He spoke fairly kindly about Lennox, was considerate when making arguments making an effort to confine his counter-arguments to the topic rather than making the other look like a fool. I was almost ashamed that he was too apologetic – he didn’t seem assertive enough. Lennox grabbed the wrong end of the stick when it came to faith – he completely misinterpreted the concept of what faith means and asked Dawkins whether he has faith in his wife, of which Dawkins really didn’t make much of a meal. Hitchens on the other hand was outrightly nasty right from the beginning, making the ensuing exchanges so much more interesting. He began with such a delightfully contemptuous tone that Boteach was enraged to the point of incoherence (maybe his incoherence was due to something else, who knows), and had such an obviously disgusted attitude towards religion that I really believe his anti-belief rubbed off on the audience. Even the title of his book, ‘the Missionary Position’, reflects the hilariously contemptuous nature of his methods of setting out arguments. His tone and hatred are truly in tune with mine (well, maybe not hatred) of religion. I really don’t see any reason to be polite about such things, and Hitchens really has the right idea as far as I’m concerned.

Overall I think I personally prefer Hitchen’s way of debating: loud and clear. Both clearly believe religion is pernicious, and quite rightly too. It’s damaging both mentally, physically and economically … but that’s for another blog post. Dawkins however attempts to intellectualise arguments too much. It is impossible to debate a true religious nutter by employing reasoning – the opponent simply will not understand. If he is convinced enough about the existence of God to debate against a sceptic he clearly has no concept of logic and as an utter inability to follow logical thoughts and mathematically accurate arguments, so why bother? But either way, I wish them both the best of luck in their anti-religion campaigns. Whatever the case, religion is wrong, stupid, pernicious, but above all, funny, and I’m glad both have picked up on the last one.


Firefox Wallpapers

November 3, 2008

Just found this post – linked to from a friend:
http://usingmac.com/2008/7/1/inspiring-firefox-wallpapers

Firefox wallpapers, some of which are really awesome. Here are my picks:




















Some of these are really beautifully yet subtly made, and succinctly done – congratulations and thanks to whoever made them.