Wednesday, November 18, 2009

Agora

I'm planning to create a new literary form that allows dialog to occur between thousands of people simultaneously whilst automatically removing spam and trolling.

I'm going to call it Agora, after the marketplace in ancient Athens where the first thinkers had their dialogs.

After thinking about it for a bit, it could be described as:

Like a newsgroup, but with reddit like karma for individual posters, and a graph structure rather than a tree.

Like a wiki, but where everyone is responsible for their own labeled pages, which only they can edit, but where everyone can take a copy of a page, and edit it themselves, after which it gets a credit like 'originally by A, edited by B'.

Like reddit and hacker news, but where the discussions persist permanently, and can link into other discussions, forming a web like structure.

There sort of already is one of these. It's called the internet. But on the internet it's hard to see the reply structure of page and counter-page. In Agora, the links will be manifest first class objects and both the links and the pages will be up and down-votable like comments in reddit.

I want a wiki that works like a newsgroup with a reputation system.

To write this, I clearly need to take the easiest to understand open source thing that is most like what I want, and grok it.

Grokking it may mean translating it into another language.

My favourite languages are Clojure, Python and PLT Scheme.

Clojure, although the most immature of the three, does have the advantage that its memory model is very like an in-memory database, which for a collaborative web site is probably a good structure.

Does anyone have any ideas where I should start?

Would anyone like to give me a hand? It will be easier with two.

If you're reading this, and see what I mean, feel free to go off and do it, and e-mail me the web address of the prototype as soon as you've got something running.

I don't want to own it. I am just fascinated by what it might look like, and how it might work.

And I think it might be fun.

My original thoughts about this are in the somewhat tedious blog post: http://johnlawrenceaspden.blogspot.com/2009/10/meta-tree-about-meta-trees.html
There's also:
http://johnlawrenceaspden.blogspot.com/2009/10/agoras-elevator-pitch.html

PERL is an anagram of LISP

This observation was made by the godlike Shriram Krisnamurthi in his talk 'The Swine before Perl' http://ll1.ai.mit.edu/shriram-talk.ppt but I thought it deserved a post of its own.



One of the nicest things about a traditional LISP environment compared to a traditional compiled language like C is the REPL.

A REPL is a read-eval-print loop. You can converse with the compiler by asking it questions and getting back answers.

> (* 3 2)
6

Read an expression, evaluate it, then print the answer.

In a decent editor, you can write a whole program this way. Write a bit, evaluate it, define some functions, test them. Use the editor to arrange the working bits above the interactions.

In most languages, you'd write the function that creates the REPL something like:

(print (eval (read)))
(loop)

or for those who like their brackets elsewhere:

print (eval (read())) ;
loop ;

So you might call it a print eval read loop instead.

PERL

No one's ever been sure what PERL stood for. Practical Extraction and Report Language & Pathologically Eclectic Rubbish Lister are the two traditional explanations.

But in a world of LISP and FORTRAN, PERL is clearly a descendant of LISP with a syntax taken from the UNIX scripting tools sh sed and awk.

So if you were wanting to write a LISP variant for performing sysadmin tasks, which is a pretty fair description of PERL, and you wanted to throw a backhanded compliment to LISP without scaring anybody away, what would you do?

Thursday, November 12, 2009

Trouble with lasers

As every schoolboy knows, the energy of a wave is proportional to the square of its amplitude. And when waves interfere, the amplitudes add.

This is a paradox. Consider:

Lasers produce coherent light. Pure waves.

If I take two lasers, and focus them on a wall, they will interfere.

If they interfere constructively, then their amplitude will double, so their energy will multiply by four.

If they interfere destructively, then their amplitude will be zero, and there will be no energy.

These energies are real and measurable things. I can buy two laser pointers from a store, connect them to mains power, and focus them on a thermometer.

I have found a method of heating my house that will either halve my heating bills or allow me to burn money without warming anything up.



When I was myself a schoolboy, I didn't know about lasers, but this question occurred to me about water waves, and I asked my physics teacher. He thought for quite a long time, and said that the answer must be that *whenever* waves interfere, they must interfere both constructively and destructively, so that whenever we win, we must also lose.

He was a clever man, my physics teacher. The answer shut me up, and I haven't thought about it since. But even at the time, I found the answer suspicious, because it seemed like the universe was conspiring to preserve the conservation of energy.

I didn't believe in a teleological universe then, and I don't believe in one now.

Water waves are made up of particles, and the particles do not calculate. It must be possible to explain why there are always both sorts of interference in terms of particles bouncing off each other. But I knew that I was not clever enough to do that, and my paradox had gone away, so I put the question on the back burner and forgot about it.



The reason that I have suddenly begun to worry about this problem again is that I am making one of my periodic attempts to understand quantum mechanics, and it occurred to me that the same mathematics, and the same paradox, occur in quantum mathematics.

If a particle has two routes to the same destination, then they must interfere. You can have the same sorts of interference.

Suppose you close one of the routes, but leave the other one open, and you leave your experiment running for a while, and count how many particles get to your detector.

And suppose you had got 1000 particles arriving in your detector. And it is the same for the second route.

And now you open both routes. Particles will start arriving at a rate that depends on how the apparatus is set up. You might get anything up to 4000 in an hour. You might get none.

What you will never find is that you can use these effects to create particles for free! You can't put 2000 particles in and get 4000 out!

The mathematics of it is exactly the same as the mathematics for the wave.



In quantum mechanics the conservation of particle number is explained by the calculating machinery that we believe nature must use to advance the state of the world.

The world proceeds through unitary operators. One way of looking at a unitary operator is that it is an operator that preserves lengths.

But since the lengths in quantum mechanics are just the probabilities of a particle arriving, we are not really saying much here except that 'the universe must play according to rules that conserve the numbers of particles'.



So I've been wondering how my laser pointer experiment really works. Why does the conservation of energy survive the superposition of waves?

My physics teacher thought that if there was interference, there must always be both types in equal measure. So perhaps the reason that the spot on the wall does not go away or shine four times as bright is that it is made up of some places where there is one sort of interference and other places where there is the other.

Perhaps it must always be that the spot made by two laser pointers has bright bits and dark bits?

Why would that be true for the laser pointers?

Well, I can't put the laser pointers on top of each other, but I can put them right next to each other. At that point, their waves will be coming into the spot at very similar angles.

But of course the wavelength of visible light is very small, so even the very small angles might be enough, if the spot is large enough. I would imagine that the spot will be made up of bright and dark stripes, like a zebra.

But surely, if I make the spot very small, and put the lasers very close together, and put the lasers far away from the wall, I can make it so that I just make a bright band, and not any of the dark ones?

Hmm, maybe.

If I shone the lasers at the moon, that might do it!

But perhaps the laser beams would spread out, and the spot would get too big, and the bands would still be there?

So perhaps I should use red light instead of blue, to make the bands spread out more?

But perhaps as I do that, the beams will spread out more, so that as the bands get wider, the spot gets wider too, and I still have bright red and black stripes. In exactly the right proportion.

I will begin to feel that the universe is conspiring against me.

I haven't done any of these experiments, or anything like them. I am just trying to work out what might happen from half-remembered school physics.



And it has occurred to me that another place where it can appear that the universe is conspiring to make troubling questions hard to ask is the uncertainty principle that prevents you working out which slit a particle has gone through in Feynman's two slit experiment.

And perhaps if I can work out why it must always be true for waves, which can be explained in terms of particles bouncing around, I might be able to work out why it is true for quantum mechanical probabilities.

Maybe. I have looked on the web for the answer, and I have not found one, and I have asked some physics students, and I have asked a friend who did a doctorate in light waves, and none of them has thought about it, so I have written this blog post and I am going to submit it to reddit and see what happens.

Advice to a talented child

I can't believe that I'm recommending this to a child, but I think I detect an exceptional intelligence.

Try SICP. The Structure and Interpretation of Computer Programs. Until recently it was MIT's introductory computer science course.

The book is a masterpiece. It's online and free. http://mitpress.mit.edu/sicp/full-text/book/book.html

There are videos of the authors giving the lectures. Watch them and read the book at the same time. Follow along and do the exercises as you go.
http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/

You will need a scheme. I found that the best by far was PLT scheme. http://www.plt-scheme.org/
And you will need to set it to use the version of scheme called R5RS for maximum compatibility. Even then it's not perfect, but google is your friend.

Don't worry if the book is too hard for you. It would have been far beyond me at your age. But I think you will be OK if you work hard.

It is a real university degree course in the maths part of CS. You won't be able to skim it. You need to do the exercises and play with the ideas in each lecture before you go on to the next.

Every exercise in the book looks hard, and most look boring. Once you get into them they are all well chosen, interesting, and do-able, and each one will teach you a valuable new thing.

If you can do it, then you will enjoy it as you have never enjoyed anything before. And you will be a much better programmer in any language. In fact you will understand that deep down all languages are the same.

Good luck, and beware that I may have overreached myself. If you don't like it, carry on playing with whatever interests you. Sooner or later you will have to read this book, or something like it, but you have plenty of time.

Wednesday, November 11, 2009

Mutual Independence

Suppose you did a statistical survey, and you found out that heart disease and diabetes had nothing to do with each other.

That's not publishable, so suppose you did another. To your despair, you found out that diabetes and overweight had no relation either.

In desperation you tried looking for correlations between overweight and heart disease.

But there was no correlation.

According to your data, diabetes and heart disease are independent, diabetes and overweight are independent, and heart disease and overweight independent.

How surprised would you be if your research assistant later showed, from the same data, that the three were never found together?

I.e. that heart disease, diabetes and overweight are not contracted independently. If they were, you'd expect some poor sod to get all three!



What do we mean by independence?

If you take 100 people at random out of the phone book and ask them whether they've got diabetes, you'll get a certain number, let's say it's 33.

Now let's take 100 people with heart disease and ask them. The answer's also 33.

It looks as though heart disease occurs independently of diabetes. Diabetes attacks one third of people, and whether you've got heart disease makes no difference as to whether you've got diabetes.

Same for overweight vs diabetes, and same for heart disease vs overweight.

Now if A is independent of B, B is independent of C, and C is independent of A, then surely the things are about as unconnected as they can get.

So how many people would you expect to have all three?
Well, a third of people get diabetes, a third of those are overweight, and a third of overweight people have heart disease.

Three threes are twenty-seven, so you'd imagine that one in every twenty seven people are unlucky enough to have all three.




But the real answer is that you have no idea.

Imagine three lights: red, green and blue.

Imagine that there's a mechanism that turns them on and off.

It decides, quite at random, whether it is going to light one, two, or no lights.

Once it decides that, then it decides, again completely at random, which light is going to be the odd one out.

One third of the time, the red light is on.
One third of the time the red light is on, the blue light is also on.

And since the situation is symmetrical, that's true blue vs red, red vs green, and green vs blue.

Which is exactly the situation we had above.

But the three lights are never all on at the same time.

The horror of programming

I've been roundly attacked, by programmers, for leading children astray. This comment is typical in its content, but more eloquent than most:

We should not fool children with this nonsense. Programming isn't about problem solving, fun, or beauty. It is about architecture, patterns, and tedious comma placement in templating languages. Give a child a copy of PoEAA. If the child enjoys it, steer that child into programming. Otherwise, encourage them to find a career that requires critical thinking, pride in one's work, and elegance; encourage them to be a carpenter.

I've edited that ever so slightly, the original is here:
http://www.reddit.com/r/programming/comments/a2wo7/why_programming_has_gotten_so_much_easier_our/c0flrcy


My initial response included the lines:
I've been a programmer for nearly 30 years, a professional for most of the last 20, and I've done very little that wasn't problem solving or fun. Some of it was beautiful too.

I spent this evening in the Kingston Arms in Cambridge talking excitedly about Clojure with a bunch of really nice, interesting geeks. It was immensely enjoyable.

And this came back:
Not at all, I should have set off my post with sarcasm tags and added an 'A' to make PoEAA.

In fact, I love programming, but the short time I've spent in industry (now just over a year) is a bit disheartening. At home, I love hacking my toy Lisp interpreter or working with profs at the local university. But in the supposed "real world" there is very little to reward excellence that goes much beyond keeping the system or application running as a whole. Even though it may cause future headaches, the short-sighted-cutting-of-corners is often rewarded. And furthering the state of the art is almost never a priority. Perhaps I am at the wrong place, but these complaints seem widespread.

Sorry for the sour grapes. Nearly all of my daytime posts are fueled by php frustration.

Now I'm really troubled. This is a young man, who likes programming so much that he writes LISP interpreters at home. I do too, and it's the sign of a truly lost soul. But one lost in the joy of it all!

(A quick google reveals PoEAA to be "Patterns of Enterprise Application Architecture", by Martin Fowler)

Now, it would be very wrong of me to slag off a book I haven't read, so I'll confine myself to judging its title, which I have:

"Enterprise" is a word I have come to associate with tedious overcomplicated unusable rubbish. Examples are legion.

So I'll guess that this book is a tedious overcomplicated unusable rubbish version of:

Design Patterns: Elements of Reusable Object-Oriented Software, by Gamma Helm Johnson and Vlissides.

And this original Patterns book was joyful in its spirit, but it should really have been called: 'How to do all the things you can do in LISP if all you have is C++'.

A point I believe the authors considered so obvious that they didn't bother making it. [citation needed]

So now I feel like a man who has been offering round fine cigars and whose friends have, as a consequence, developed 40-a-day cigarette habits.

------------------------------

And I'm not sure how to respond. Not long ago I showed python to one of the brightest people I've ever met. He took to it like a duck to opium, and within a couple of weeks had written a truly impressive program to take advantage of arbitrage opportunities on betfair by screen scraping.

As a result, he walked into a programming job in London, where he tells me that his daily work involved programming in a deservedly obsolete language. His shop mandated copy and paste programming on the basis that it was a safer technique than using GOSUB.

He's now moved on to writing Java as part of a large team, as part of his firm's 'advanced research' effort.

Every time I talk to him he seems a bit less full of the joy of life, and I wish I'd never shown him how to start that damned interpreter.

------------------------------

But here goes:

A well paid job which you do not enjoy is a curse. Once you start to depend on the money, it stops making you happy and you are left with an infinity of drudgery which has to be endured if you are not to lose the things you have bought. The philosophers are unanimous and clear on this point.

If you are in an environment where everyone else is well paid, you don't even get the warm glow that comes from high status. Instead you just find yourself craving larger and larger amounts of money.

The process ends in a very few cases with a yacht in St Tropez that you are too busy to visit, but which you own to impress your friends. And that's what it means to be successful. Such people may or may not be happy. How would I know?

It doesn't matter, because they are a set of measure zero. As rare as world-class footballers are in a world of dreaming children.

But in the vast majority of cases you have a tedious daily grind. Your soul dies, and all you have to show for it is the desire for more money.

If you enjoy programming, then you have something that you love.

If you want to be a prostitute, be a courtesan rather than a crack whore.

First you need to go cold turkey.

You'll need about £2000 pounds. Quit your job and go skiing. Snow is always falling somewhere in the world.

Find a resort where there are youth hostels as well as hotels, and stay in the cheapest hostel you can find, sharing a room and cooking facilities.

You will meet large numbers of enthusiastic young people who are making sacrifices to do what they love. They work long unsocial hours at menial jobs in order to ski. To do what they love.

They are the happiest people in the world, and they are great fun. They will take you in and drink with you round the hostel table. They will teach you to ski for the sheer joy of passing it on, and show you where the best bits of the mountain are.

You will be a student again. You will remember why the old speak wistfully of student days.

Eventually you will get bored. When you return home, the idea of a big house to yourself in the suburbs will no longer seem so compelling.

Rent a room in the centre, near the university, because that's where the clever interesting people of all ages are. Make sure that you share a house, but you are now permitted to have a room to yourself. The luxury!!

And now find a job.

Not a permanent job. Never ever, not unless you're starving.

Find someone who has something that they need doing quickly.

Agree to do it for them at an hourly rate. They will pay a freelance three times as much as a permanent employee for the same work, and there are good reasons why that's a good deal from their point of view too, so don't be shy.

Word of mouth contacts from your last job are the best way, but there are agencies for such things if that doesn't work, and you are even allowed to consult for the company you walked out of, as long as the arrangement is paid by the hour.

From now on, you might only work for six months in any given year.

But that's OK. You will still make more than you used to, and you're back to living like a student so six months work will keep you going for three years.

Never allow your expenses to increase to the point where you even notice them.

And suddenly you are free.

You are free to choose to do things that seem interesting. It doesn't matter a bit whether they are for someone else, or just things you want to do, which are of no possible value to anyone else, like lisp interpreters.

There are always enough interesting jobs to pay the rent.

-----------------------------------------------------

In case you think I'm some starry eyed idealist, preaching an impossible gospel,
I have lived like this since I was twenty five. It works a treat. Every time I've found my expenses creeping up to the point where I need to work rather than want to work, off to the ski slopes again for a detox.

And the thing is that there are plenty of companies round here that I'd be happy to work in as a permanent employee. Enlightened companies doing interesting things. I often work for them as a freelance, and their people are happy and fulfilled. But I value my freedom for itself.

And every time I do something, even a particularly mindless two week testing job that I once got tricked into, I learn something new. And as long as you're learning, you're enjoying. For me they are the same.

You said:

Otherwise, encourage them to find a career that requires critical thinking, pride in one's work, and elegance; encourage them to be a carpenter.

I have all those things. So do many of my friends. You might want to consider that a man who trains as a carpenter can set up his own business and make things that he loves for grateful clients for his whole life. Or he can spend his days on minimum wage in a gloomy factory operating one stage in an assembly line.

We programmers have the same choice. The only real difference is that programming is intrinsically more complex than carpentry.

Tuesday, November 10, 2009

A program for twelve year old programmers

When I was little, I would have found this program interesting:


import turtle

def fib(n):
    turtle.forward(30)

    if n<2:
        pass
    else:
        turtle.left(15)
        fib(n-1)
        turtle.right(30)
        fib(n-2)
        turtle.left(15)

    turtle.forward(-30)

turtle.reset()
fib(10)


I still do!

The program is in python.

Play with it. Change the numbers and see what happens. Make it be in colour. Make each branch a different colour.

Once you have done this, you will understand something fun.

Nick Rolfe has translated it into logo, so you can run it in a web browser. Unfortunately it has to be Firefox rather than Internet Explorer.
http://logo.twentygototen.org/ynJXcOr1
You can still play with it and modify it in Firefox, just like you can in python.




The program is in python. I can not tell you how to install python, because it is different on every computer. But some computers already have it. And it is very easy to install on the ones that don't. The best way to run the program in python is to use IDLE, which is part of python.

If you run it in IDLE, the turtle's window will not disappear when the turtle has finished. If you'd like to run it any other way, Steven's comment below will tell you how to stop the window disappearing.


My python is version 2.6.4, but I imagine it will work in any later python as well, and possibly some earlier ones too.

I am sure that I will be corrected if I am wrong.


Footnote for anyone coming via reddit


Forgive me.

The article before this has been the top hit on the programming reddit all day, with the title "Why has this got so much harder to do? Why kids don't program any more."
The associated discussion handed me my ass on a plate, so I wrote this new program to show how easy it was for a modern child to explore recursion, which wouldn't have been at all easy in ZX Basic thirty years ago.

I was assuming without thinking about it that people who read the first would read the second and vice versa, which was a bit dim of me.

Monday, November 9, 2009

Why has this got so much harder to do?

Behold, in its full glory, a program that I ran on my ZX Spectrum nearly 30 years ago:

10 FOR n=0 TO 255
20 PLOT n,88+80*SIN (n/128*PI)
30 NEXT n

It plots the mathematical function sin over a full turn. This little program was an inspiration to me. It was followed quickly by a program to plot cos, which looks very similar. The next one plotted points of the form (cos t, sin t) with t between -pi and pi, which looks like a circle.

It's no exaggeration to say that this program turned me on to mathematics.

At school at about the same time, we'd been going over sin and cos and tan, which were names for the ratios of the sides of right-angled triangles. I'd never seen anything so boring and pointless. There were all sorts of stupid rules for remembering which was which, and when some were supposed to be positive and negative. It was the dullest thing in the world.

And then suddenly it wasn't. SIN and COS were things I could use to draw circles on my computer screen. If I plotted (2*sin, cos), I could make ovals. It was all marvellous. It was obvious what SIN and COS were. They were the distances across and up from the centre of the circle as you were going round it.

Once you knew that, all the blether at school didn't just make sense, it was obvious. I couldn't understand why it had seemed hard. I still didn't see what it was for. But I was very interested in drawing things on my computer. And circles were a big part of that.

A bit later on, for a game, I used my computer to draw a cannonball as it flew. I figured that it would start off going right and up at a certain speed. After a tiny bit, it would have moved, but the speed it was moving up would have gone down a bit. I wrote a program to draw what happened as time went on. It turned out that it made a sort of arc shape like the underside of a bridge.

And a bit later, I worked out how it would change if instead of the cannonball always falling downwards, it always fell towards a certain point on the screen.

A bit later I was watching the moon go round the earth as the earth went round the sun.

When, about five years later, we got to projectiles and ballistics in A level maths, I already knew all the answers.

And when it came to orbital mechanics during my degree, I had a pretty good intuitive grasp.

And it turned out that sin and cos were pretty useful too.




The reason that I mention this is that 27 years ago, a twelve year old child with a new toy and a shiny orange paperback that told him how to use it could draw the graph of sin, and then play with the program to get more interesting programs.

Whereas now, in 2009, a forty year old professional computer programmer sitting in front of a box at least 1000 times more powerful with a screen one hundred times the size that can display millions of colours is having to google for how to do it. (I am trying to write a simulation of an imaginary diffusion equation.)

And answers are not easy to come by. One of the things that google offered up by way of answer was the ZX Spectrum manual. And childhood memories came flooding back.

And I wonder how the hell a modern twelve year old is supposed to write his orrery.







--------------------------------------------------------------------------------
Footnotes

P.S. I posted this on hacker news and it got some interesting responses:
http://news.ycombinator.com/item?id=930752


P.P.S. So I posted it on reddit too, where one answer was (in python)

>>> import turtle
>>> turtle.forward(100)

And this led me to:
http://us.pycon.org/2009/conference/schedule/event/65/
and (I hate to link to a ppt, but it's great)
http://us.pycon.org/media/2009/talkdata/PyCon2009/065/SevenWaysToUseTurtle-PyCon2009.ppt
Which answers my rhetorical question about as well as it could be answered!

Friday, November 6, 2009

more post titles

How much of a crime is stealing poppies?

Why I don't answer e-mails or texts.
Why did they bother inventing the telephone when we already had telegrams? How old is Cary Grant?

A confused Italian girl at a cash machine

The three slits experiment
It is not that the universe works differently when we're looking. Is it?

Why do we have to use classical reasoning to construct quantum mechanical thought experiments.

Aliens would transmit 2 pi. In binary that's just a bitshift. If we're transmitting pi, that will look to them like tau/2. Might they answer with tau/3 (2 pi / 3!!) to show they'd got the signal? What does that look like in binary?

Hilbert space is just arrows. Inner product is a similarity metric.  angle bracket arrow arrow arrow bar is a member of C^3

Teaching is research. The distillation of concepts into forms from which the next step is obvious is the essence of both.

Michael in the cafe on a blind date being creepy. The awkwardness of the Edharians before the Procians.

Maths is more interesting than sex. Even to teenagers.

Release from the cycle of being.

Concepts that you don't understand are gaps in the fabric of reality.
Words that you don't understand are signs of concepts that you don't.
Consider hermeneutics, semiotics and dialectics.

Is it OK to dismiss religious/ecstatic/drug/dream/out of body experiences as meaningless?
They are the traces of memories laid down in the brain when it is operating under the control of a shattered mind. Maybe a mind completely absent. Perhaps they are telling us something?

Are the other people in my dreams conscious?

Why can I not think about QM without becoming mystical? Is this true for everybody or is there something funny in the Markov Chain of my mind? Chaos theory is another thing often used in bollocks philosophy to spout about free will vs determinism, but that doesn't have the same effect. On the other hand, topology and particularly Riemann surfaces used to. And lambda-calculus still does

(double (double double)): toil and trouble

The Quantum-Stochastic Financial Dynamics of Superconducting Cosmic Strings in a seven-dimensional Universe of Discourse. Hoaxes in literary theory and in string theory.

Agora should be viewable on different time-scales. What's hot now, what's hot now with a different time constant, what was hot last week, what was hot in 2009. General weighted average needed. Perhaps do it as a zoomable graphic equalizer. If you have +ve and -ve votes then the sum is coolness and the difference is attention. People creating uncool things which get a lot of attention should be penalized heavily.

Agora ID. Any username, any id, total anonymity. Can set level in browser.

The mighty fork bomb: b(){ b|b& };b

Thursday, November 5, 2009

An Education (film)

A riveting, edge of seat coming-of-age drama about a schoolgirl under the sway of an older man.

There's a sense of moral ambiguity about everything. It's not at all clear who's going to get hurt, and the tension is amazing.
Like any English film, the whole thing is riven through with class issues played for laughs, and may or may not be comprehensible to outsiders.

I would have found the whole scenario, and particularly the mistake leading to the denouement, completely unbelievable if I hadn't had a friend who could well have been the leading man. Truth really is stranger than fiction. That's not just something that people say. Having seen that sort of thing happen in real life, I can forgive the script-writer his unbelievable plot twist.

But actually the thing I'll remember for the rest of my life about this film is the sense it gives of the impossible glamour of Juliette Gréco. I'd only thought of her before as a woman with a strange voice on some old French songs. But from drab fifties London she must have been going off like a lighthouse.

Wednesday, November 4, 2009

Notes on the Age of the Essay

On re-reading this: http://www.paulgraham.com/essay.html, I decided that I liked it so much that I'd try to make a summary. If you haven't read the original, go read the original. It's beautifully written. I'm suspicious of beautiful writing because you can end up believing things that aren't true if they're well expressed. So I'm trying to pick out the thread of the argument and some handy maxims for essay-writing.

School essays were dull.
Because they're about English Literature, and that's dull.
Even Dickens wouldn't be interested in an essay about symbolism in Dickens.
Why did we do them?

After the Dark Ages, people rediscovered the classics.
The Greeks and Romans knew much more than the Europeans of the 12th century.
Relearning their stuff was really important.
Study of ancient texts was most of what scholars did.
This period lasted perhaps 200 years.
But the study of ancient texts was considered the highest pursuit for 500 more.

Universities used to teach writing.
Until teachers were required to do research. What should the teachers research?
If it's worth studying old texts, it must be worth studying modern ones too.
So writing teachers have to be researchers into modern literature as well.
They end up teaching writing about modern literature.

Schools imitate universities.
The end product is that schoolkids write essays about modern literature.
This is an imitation of an imitation of a thing that's 500 years out of date.

School essays take a position and defend it.
That's also a fossilized idea.
The structure comes from medieval law schools.



Good writing should be convincing, but it should be convincing because you got the right answers, not because you did a good job of arguing.

If you write something unconvincing, talk it through with the person who finds it unconvincing. You may come up with a clearer way of saying it, but more often you'll find that you have to change what you're saying. If you can convince clever people, then you're probably near the truth.

In 1580, Michel de Montaigne published a book of essais, or "tries".
An essay is something you write to try to figure something out.
You don't know what it is yet, so you can't begin with a thesis.
You begin with a question.
Montaigne's great discovery is that writing ideas down helps to form them.
In a real essay, you're writing for yourself. Thinking out loud.
But having an audience makes a difference. It forces you to think well.

You don't always come up with answers. Don't publish those.
Anything interesting will do.
The Meander is a river.
Meandering is not a flaw in a search for the truth.
At each step, go in the most interesting direction.


Backtrack if you get stuck.
Clean up your train of thought, but not so much that you lose spontaneity.
Err on the side of the river

Interesting is the same thing as surprising.
How was it different to what you were expecting? is a good question.
Surprises are things that contradict things that you thought you knew.
How do you find surprises?
Only write about things you've thought about a lot.
Then things that surprise you will also surprise readers.

So you need things that you've thought about a lot, and the ability to ferret out the unexpected.

What should you think about?
Anything can be interesting, even working in fast food.

The author sees more things in his memories of being sixteen than he saw at the time.
So the ability to ferret out the unexpected must be learnable.

Consider history. The more you learn, the more connections you can make.

Collecting surprises is similar. Life gets more surprising as you get older.
Perhaps there are ways to speed the process up.

Ask why? about things that seem wrong.
Scepticism is helpful in this.

Pay attention to things that seem wrong in a humorous way. Humour is a sign of surprise.

Write down things that surprise you in notebooks. It's not necessary to read them, though.

Being cool is an impediment. Dwell on your mistakes.

Seek out situations where inexperience will make you look foolish.

Study lots of different things. Include history. History is 'all the data we have so far'.
History gives us confidence that there are many good ideas under our noses.

Above all, pay attention to things you're not supposed to. If you're curious, trust your instincts. Follow the threads that attract your attention.

Once, only a tiny number of writers could publish essays.
Now everyone can.

The web may make this the golden age of the essay.

And that's not something I realized when I started writing this.

Tuesday, November 3, 2009

Another thing about essays

Writing things down like this helps you to think about more that one problem at once.

It's difficult to keep more than one problem in your head, but writing them down means that you can forget about something for a while and think about new things.

That means that when and if you come back to reading the old things that you wrote about, you can start again from the same place. But of course your brain may have been working on the old things while you weren't watching it, so sometimes there are ready-made new thoughts that come to mind as soon as you read the old posts.

So it makes you more able to think about more things, and it makes you better at it.

Philosophical Tools

I know of two 'Philosophical Tools':

  • Occam's Razor: Don't use a more complicated explanation than you need.
  • Diax's Rake: Don't believe something just because you'd like it to be true.

What else have we got, and what gardening implements can we associate with them?

A list of tools would be really handy. Because when you're stuck, new approaches help. And a list of mental images for complex concepts would help you remember them.

Some handy maxims which need names are:
  • If you can't prove something, try to prove the opposite.
  • See if you can change the problem to make it easier.
  • Specific examples and generalizations illuminate each other.
  • Explain your argument to a child, a foreigner, an alien, a computer.
  • Try to write it down.
  • Sleep on it.
  • Leave it alone and work on something else for a bit.
  • Look around, and contemplate nearby objects and how they relate to the problem in hand.
Feynman and Sussman both tried to explain their ideas clearly, to mathphobes and computers. Montaigne explored his ideas through writing. But neither of these things remind me of any tools, or in fact any objects.

Can we go the other way? What about taking a list of tools and thinking what each one would mean if used as a metaphor for a way of attacking a problem.

Here are some tools I can see from where I'm writing:

The mirror, the lantern, the penknife, the swiss army knife, the thing for getting stones out of horses hooves, the pickaxe, the probe, the shotgun, the earplug, the key, the spoon, the zipper, the book, the flask, the camera, the paperclip, the paperweight, the radio, the tape recorder, the fire extinguisher, the magnifying glass.

Do any of these have philosophical connotations?

The radio: tell everyone you know about your argument and see what happens
The earplug: stop reading about other peoples attempts to solve it and see what you can do on your own for an hour or so.
The thing for getting stones out of horses hooves: See if there's a tiny sub-problem that's tractable.
The notebook: write down tiny notes every time you think of a new thing. You don't have to read them later. Just writing will do.
The probe: Find a new way of measuring something about the problem.
Magnifying glass: Just look at one part of the problem in isolation (really good for cryptic crossword clues)

That seems a more tractable approach to finding a list.

blog posts I'd like to write

Summarize "The Age of the Essay"

Quantum Mechanics. What happens if we take the quantum view of the world literally?
Consider the dual-slit experiment as a start state, two intermediate states, and a final state?
The system is static. What does it look like? What about other states? Why don't the probabilities of going via them mean that probabilities can't be conserved or stable?
What if we put a classical clock in the system? What does time even mean in a static phase-diagram type universe? What does a phase diagram look like if we look at it as a map for moving classical probabilities around?
What about a system with a single particle on a finite ring of states? What does momentum mean for it?
If that's a basis of position states, what does the corresponding basis of momentum states look like?

What happens if you make a random blog post inviting people to the pictures (I'm going to see either An Education or Fantastic Mr Fox at the Arts Cinema tonight at 21:00 if anyone wants to come.)

Condense the very boring ubuntu installation blog into something readable. Is this even possible?

How to solve the Workout in the Times? It's easy by hand, but what are we doing when solving it? How would a computer do it? How do we define hard? Is there a computer method which finds the same things hard as I do? What should the recursion be for generating all possible divisions of a square into rectangles? If we can do that we can generate puzzles with unique answers.

Another useful tool is "Try to explain it to a foreigner". Example is the controversy over parents cheating to get their children into better schools. Why are they doing anything wrong? They've both paid the same for their education. How can they be stealing off the people rich enough to live near the good schools? If we can think about it like that, why can't we say that rich people who live near good schools but are sending their kids to private schools are doing a public service and should be compensated?

Disabled baby case. Mother wants it to live, Father wants it to die. Needs judgement of Solomon. Remember two mothers fighting for baby. Not necessarily correct, but right. If we had a consciousness-swapper, how would we organise a literal contest between the two, using the prize of swapping their consciousness with the baby's? Would Solomon want to kill half the baby? What about killing half the baby's brain?

Lymington's secret dentist. Try to explain that to a foreigner. Perhaps a foreign dentist.

The life of Mohammed. Can't make a film because not allowed to depict prophet. What about making a first-person shooter? Can we do the voice of the prophet? What about God? A burning bush? If you can't record the voice of God, isn't the Koran blasphemous of itself? If it isn't, could the burning bush (possibly off camera) speak literal verses of the Koran? Could we do a life of Mo computer game? Should it be an FPS or should it be real-time strategy? What do we have to preach for the religion to spread. Other players could represent competing desert religions. The climax could be a battle for Mecca with all the followers so far recruited.

Blogging software should allow readers to highlight the boring/unconvincing/funny bits. If we want continuously variable colourings then do we have to pick three primary attributes?

What's wrong with revenge? Revenge is the foundation of civilized society. The first duty of the state is to prevent the blood feud, and it does this by nationalizing the duty of revenge.

Which bits are boring and which are unconvincing?

Hi,

I seem to be writing a lot of blog posts recently, and to my surprise a fair number of my friends seem to be reading them. I also have comments from people I don't know, so I must have an audience of some sort.

I've just re-read, "The Age of the Essay":

http://www.paulgraham.com/essay.html

Which gave me the idea of trying to work out what I think by writing it down.

In it he says:

When I give a draft of an essay to friends, there are two things I want to know: which parts bore them, and which seem unconvincing. The boring bits can usually be fixed by cutting. But I don't try to fix the unconvincing bits by arguing more cleverly. I need to talk the matter over.


That seems like useful information to have.


Anyone can comment here, anonymously or not, and I get to delete anything I really don't like, so please don't be shy or worry about giving offence.


Which bits are boring and which bits are unconvincing?


If you know me personally, I'm happy to buy pints in return for good counter-arguments!

Monday, November 2, 2009

Don't read this it's incredibly boring

Installing Ubuntu 9.10 (Netbook Remix) on my Dell Mini 10v (Live Report on first try)

First hurdle was that the download is an iso, rather than a flash image file.

It turns out that there's a program usb-creator-gtk which does the conversion.
Originally that failed to work for me, claiming that my usb drive needed formatting, but then doing nothing when I pressed the format button.
Eventually I tried formatting the USB disk myself, and it still didn't seem to work, until suddenly it did. Sigh.

It's now taking a while to write all the data to the flash drive.

Transferred flash drive to netbook.

Reboot.

Wow, it's taking ages to start up!

Now it wants a login! (As user ubuntu. What am I supposed to type? ubuntu fails. blank succeeds)

It's very pretty!

But there's no wireless connection. This is sub-optimal for a netbook.

After a while a message pops up to say that restricted drivers are available. There's a choice of two. Broadcom b43 and Broadcom STA. I don't understand the difference. Choose Broadcom STA because that rings a bell.

Ha! Now it tells me that I need to restart the computer in order to use this driver. Have I installed Windows by mistake?

I can already see an infinite loop forming, but I'll take it at its word and reboot it.


Well, it's been two minutes now and its not rebooted. Just sitting there with a little ubuntu logo pulsing slowly. Talk to me. What are you doing? Are you dead?

Alt-Ctrl-F1 has no effect at all. I'm beginning to suspect kernel death.

Suddenly the screen goes blank. Is this life?

After five minutes I give up. Alt-SysRq-B produces a reboot, though, so there must have been something in there.

Now its in its just sitting there pulsing mode again.

Five minutes later.

It's totalled! It's gone into some mad infinite loop, endlessly scrolling text too fast to read about bugs in the D-Bus library.

Well, after a bit of staring, what it's saying, over and over again, is:

This is normally a bug in some application call using the D-Bus library.
process 2039: arguments to dbus_pending_call_set_notify() were incorrect, assertion "pending != NULL" failed in file dbus-pending-call.c line 596 .

Ah, Alt-SysRq I has stopped the screen. Apparently it was process 2839. Silly me.


Try again:

Same result. Mad scrolling. Same error. Hmmm.

So far, this has taken one hour.

Was I just lucky the first time, or has the bloody thing actually tried to modify the boot disk in order to get this driver working and corrupted itself?

The md5sum on the iso file is correct. I'll try to remake the USB stick.

Weirdly the md5sum on the desktop iso is wrong. But I'm sure I didn't use that by mistake since I got the funny interface on first boot. As I say, it was pretty while it lasted.

Okay, I've remade the USB stick. On the ubuntu initial boot screen, there was something called 'check integrity of disc' It wasn't clear whether that meant my hard drive, or the USB stick, but I tried it anyway. Much pulsing of the little logo I am beginning to hate. Why won't they just tell me what's going on?

But the light on the USB drive is flashing steadily, so there must be some sort of check going on.

Okay, check finished, all fine, try again.

This is better, a nice ubuntu waking up noise, and the pretty screen again.

I am not going to fall for this 'installing Broadcom drivers thing again'.

So I've plugged it into the wall, but I'm now blogging from the netbook rather than from my desktop! Yay!

And I must say I'm fairly impressed so far. They've fixed the touchpad, which didn't work very well in 9.04.

When I got to www.blogger.com, firefox wanted to install a flash player, and I thought 'what the hell, it's not going to actually write to disk'. It then asked me if I wanted to enable the universe and multiverse repositories. I said yes, but then it failed.

OK, when the little box came up I gave in to temptation and enabled the other wireless driver, b43.

And this one hasn't demanded a reboot.

I'll save this post and then pull the network cable and see what happens.

Well, that didn't work. Pulling the cable just disconnected me.Plugged it back in now.

Camera works. Sound output works. Internet Radio works. Sound recording does not work.

Well, I am sufficiently happy to try installing it.

The installer so far seems very impressive, and I'm very impressed that I can keep using the computer while it's running. I wonder at what point it will actually disconnect from blogger.

I've set it up to obliterate the previous installation of 9.04, which was unsatisfactory in many ways. I never used it, preferring to use the Dell version of 8.04, which is actually pretty good once you turn off the Dell interface.

I want to try the 'require my password to encrypt my home folder' option, and I'm setting setup to import two of the three accounts on the Dell 8.04 installation, just to see what happens.

Nothing like putting it through its paces.

And off it goes. A slideshow is showing and things are being copied as I type.

Hmm, after a few minutes an error box pops up, something about devkit-disks-daemon crashing. That doesn't sound good at all. It asks if it can report the problem to base and I say yes.

However, there's now nothing going on. I imagine that's not good. I wonder if my little system is still bootable? Only one way to find out.

Wait.... The light on the flash drive is going. Is it still installing? Or is it firefox related?

top doesn't seem to think there's anything going on.

Just out of devilment, I'll try running the installer again.

It seems to work, repartitions the disks, starts to go through its slideshow, and then crashes. Only this time it's 'ubiquity' crashing, which is presumably the installer.

Repeat once again to make sure. Ubiquity crashes again.

It's been two hours since I started this.

I'm back to blogging from the desktop.

Now the netbook won't boot off the flash drive again.

These people have actually managed to create an installer that can destroy itself.

For minutes there's just that fucking pulsing ubuntu symbol.

Then it goes to a text screen, obviously in the middle of a very distressed init.
All sorts of file system errors scroll past, and the whole thing ends when it says initiating crypto disks [OK], and crashes.

Needless to say, if I bypass the USB disk, the netbook will not boot, because one of the installs has obviously got far enough along to destroy the master boot record.


I'm getting angry now. This isn't a little bug caused by incompatible hardware.
For that matter Dell sell 10vs in partnership with Canonical, so if they were going to test it anywhere it should have been on one of these.


This is just rank bloody incompetence. What a bunch of muppets.


I'm now in the situation where I can't boot my netbook in any way. I really don't want to start trying to use the remains of this flash drive to try to fix the problem, because I honestly don't trust it not to destroy my original 8.04 Dell version.


I'm going to find a version of 9.04 and burn that to my flash drive. That wasn't great, but I don't remember the installer itself being fucked up.


I think ubuntu and I might be through. The 8.04 version Dell supplied is great. But I don't think I'm at all keen on letting anyone who can write an installer as cripplingly rubbish as this mess about with any computer I care about.


Alright, calmed down a bit now. Did get as far as the 9.04 flash disk, but it's obviously the same installer. Maybe asking for encrypted disks is the problem.

Will try again with utterly vanilla version.

Sunday, November 1, 2009

Diax's Rake

In Neal Stephenson's wonderful novel Anathem, a character called Diax drives the numerologers out of the Temple of Orithena using a garden rake.

This legendary rake gives its name to a philosophical principle, Diax's Rake:

Be careful of believing things because you want to believe them.


In the book, it is also used as a verb. One can rake a sentence of its emotional content. At one point, a character speaks of "reforms". His interlocutor rakes his sentence, pointing out that the word "reforms" carries with it a judgement that the reforms were necessary. When they agree to use "changes" instead, the character of their argument becomes different.

Since I read this, situations where the maxim is useful have occurred to me almost every day.

For instance, the theory of evolution by natural selection is a peculiarly horrible idea. It implies that life is a terrible, and extraordinarily wasteful, war of all against all, and that almost every feature of every form of life is the result of the deaths of millions of innocent creatures whose only fault was not to have the feature.

Many people choose not to believe this awful idea because they have a theory that they would prefer to believe.

The most obvious current example is religious creationists, who have the much more comforting idea of a God of love, who cares about the fall of every sparrow.

There's an equally persistent view that evolution is a continuous process of improvement towards perfection. In this view, humanity is the most evolved of all the living creatures.  This is one of the most dangerous evolutionary fallacies. In fact the common cold virus has done just as much evolving as we have, and is in many senses much more perfectly adapted to its environment than we are.

Some people who call themselves Darwinists positively glory in the horror and cruelty of the Darwinian view of the world. Sometimes they come to believe that the theory of evolution has some sort of moral content, and that what is natural is also morally right.

The scientific establishment of the Soviet Union, mostly educated, clever men, could also not bring themselves to believe in the Darwinian theory, preferring various forms of Lamarckism. Lamarckism is also an evolutionary theory, but based on the transmission of acquired characteristics, such as the sons of blacksmiths inheriting their father's strength. The problem is that there's very little evidence that anything like this happens.

Since the emotional value of a theory has nothing to do with its truth, it strikes me that to prefer one theory over another because of its moral content is a fundamental error.

But it seems to be one which is very difficult to avoid.

I think that Diax's Rake is a philosophical fundamental, as useful as Occam's Razor (which also makes an appearance in Anathem, under the name of Gardan's Steelyard).

If a concept is that useful, it is very important to give it a name.

But I can't think of any philosophical principle that Diax's Rake is a paraphrase of.

Perhaps we should adopt it, and just call it by the name Stephenson gave it.

Followers