Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Wednesday, February 8, 2012

the Maginot Line

Our friends at Wikipedia remind you of what you once knew about the Maginot Line:

The Maginot Line (French: Ligne Maginot, IPA: [liɲ maʒino]), named after the French Minister of War André Maginot, was a line of concrete fortifications, tank obstacles, artillery casemates, machine gun posts, and other defences, which France constructed along its borders with Germany and Italy, in light of its experience in World War I, and in the run-up to World War II. Generally the term describes only the defences facing Germany, while the term Alpine Line is used for the Franco-Italian defences.
The French established the fortification to provide time for their army to mobilise in the event of attack, allowing French forces to move into Belgium for a decisive confrontation with German forces. The success of static, defensive combat in World War I was a key influence on French thinking. Military experts extolled the Maginot Line as a work of genius, believing it would prevent any further invasions from the east (notably, from Germany). It was also a product of a historical inferiority in population and birthrate, exacerbated by the losses in World War One, which had been developing for three generations.[1] The fortification system successfully dissuaded a direct attack. It was strategically ineffective, as the Germans indeed invaded Belgium, defeated the French army, flanked the Maginot Line, through the Ardennes forest and via the Low countries, completely sweeping by the line and conquering France in days.[2] As such, reference to the Maginot Line is used to recall a strategy or object that people hope will prove effective but instead fails miserably. It is also the best known symbol of the adage that "generals always fight the last war, especially if they have won it".[3]

 So, right.

A commenter on my last post suggested running Ruby on Rails on Heroku.  I had a look at Heroku and was transfixed - this looked like a way to try out all sorts of programs without getting mired down in all the downloads and installations and what-have-you that mean it can easily take a week to get through the preliminaries before you can actually try out whatever it is you thought you might like to learn. Preliminaries that would undoubtedly take half an hour if you were already up to speed in all sorts of techniques you hadn't realized you needed to know, but which take a week (or more) if you have to scour around online to find out how to implement the two lines of instruction that accompany whatever it is you actually want to be working on.

So, right, I have a look at Heroku, which looks great, and I think I might try this out on Python since I have been working on Python. I am then told that over and above having Python to hand I must also have pip and virtualenv.  Bear in mind that the attraction of Heroku comes largely, at this point, from the fact that I have just spent a day untarring tarballs, attempting to upload from my Mac's simple FTP facility, attempting the same from Cyberduck, succeeding at last via FileZilla, creating a database on my server, attempting and failing to find the relevant files in the unpacked Drupal folder via myPHPAdmin, scouring around online for alternatives, attempting and failing to follow the steps sketched out on various websites, investigating the possibility of changing servers, and at last discovering the various bits of information from my server that needed to be fed to Drupal for successful installation.  Bloodied and not noticeably unbowed, I wonder whether life might be easier if I defected to Heroku. Only to find myself blundering through attempts to download and install pip and virtualenv, scouring around online for tips when all goes less smoothly than one might have hoped . . .

Revenons à nos moutons.  To get back to the Maginot Line.  If you're a writer, you need protection. You can hire a lawyer, an accountant, an agent.  But the protection you hire never costs your time; it never sets a value on what you might achieve if you could invariably get the technical resources you needed in 2 seconds. The protection you hire will wrangle happily over deal points; it will wrangle over percentages of rights. It will NOT factor technical support into the value of a deal (this is not a deal point), it will NOT provide in-house technical support as facilitating completion of ambitious new work which might be sold for a handsome advance. It ignores both the greatest threats to a writer and the greatest opportunities.  And there is nothing to be done.

Except, of course, to soldier on. Install, presently, pip and virtualenv.  Tomorrow is another day.

Sunday, December 25, 2011

Feliz Navidad

Javier Moreno has translated That Obscure Object of Desire (published in a recent edition of Bullett Magazine) into Spanish - the language in which it should clearly have been written in the first place.

Exhibit A:

Incertidumbre e información son las mismas cantidades, la pérdida de incertidumbre es igual a la ganancia de información.
Códigos y Criptografía, Dominic Welsh

Exhibit B:

La rampa de concreto bifurca; él se dirige a la izquierda y sale a un mercado de verduras al aire libre.

[It's 'La rampa de concreto bifurca' that's so lovely.]

The point is, the piece is now saturated with the language of Borges. (Writing in a café, so do not have the oeuvre to hand, but a line that was a mere inert quotation from Codes and Cryptography now brings to mind La Lotería de Babylon : He conocido el incertidumbre.)

Moreno will be publishing the piece in HermanoCerdo in January.

Have been talking to my mother about Wallace Stevens; I might have been happier all these years if I had had a job in insurance and a briefcase with compartments.  If I had had the sense to get a job in insurance, or train as a programmer, or, or, or, years ago, I could write a piece in whichever language seemed best for the piece without worrying about - what shall we say - Acts of Copy-Editor, Typesetter, &c. All as comprehensively excluded from the protection offered by an Agent as are Acts of God from a cautious insurance policy, the difference being that Insurance favours small print rather than unwritten rules.

(16 lessons into Python The Hard Way. THANK you, Zed Shaw, this was exactly what I wanted for Christmas.)

(-- Well, I wouldn't mind also having my hobbyist's edition of Mathematica, which arrived just after I left DC to talk to Michael Miller in the Tik Tok Diner; I wouldn't mind having my SUDO MAKE ME A SANDWICH t-shirt, which also arrived too late, too late. Er, I wouldn't mind having an accountant with superhero powers to grapple with my UK tax return. But these are minor cavils. Merry Christmas, one and all.)

Thursday, December 22, 2011

LPTHW

I hope it was not bad form to clarify a few points that were not quite right in Michael Miller's piece; I am not convinced that I would have done a better job if I had had to grapple with a) a long, complicated saga and b) the place where language breaks down.

Also - if you have a long history of depression and worse you realise that most people, mental health professionals included, can't deal with it. The people who can tend to be people who have been through a bad time themselves. I remember meeting someone I had known in London, Sara Jenkins (now Valentine); she talked about a time when she had had what she called 'bad thoughts', and the mind responded to the voice like a hurt dog. I think I imagined that Bill Clegg, who had been through a bad time, might be like that; he wasn't, but I don't know that his behaviour was abnormal.

In any case, I just wanted to thank the reader who recommended Learn Python the Hard Way. This looks like exactly the sort of thing I need (and in fact, if I had been able to work my way through LPTHW during bad times, they would probably not have been so bad).


Monday, December 19, 2011

How Shape Influences Strength

Rereading Alex Martelli, How Shape Influences Strength, Bridge World Jan & Feb 2000.

NS Tricks // N has 7222 // N has 7321

6 // 4019 // 4455
7 // 10778 //11089
8 // 14016 // 12307
9 // 10811 // 9886
10 // 5371 // 6146
11 // 2344 // 2869
12 // 532 // 1033
13 // 178 // 215

It is clear from this table [cd not work out how to use tabs in Blogger] that the variation is higher for the slightly more shapely hand, which fits in well with our intuition: A 7-3-2-1 hand is more likely than a 7-2-2-2 to meet with either a particularly unsuitable hand for partner (with wasted values opposite the singleton, perhaps holding the partnership to six or seven tricks) or a particularly suitable one (with values opposite the tripleton, often allowing the partnership to take from 10 to 13 tricks.)

I used to think that anyone who had seen hundreds of books published would have a bridgeplayer's sense of fit; would see that writers rarely have balanced hands, so that a fit with an agent or editor is likely to be very good or very bad.

It seems not to work that way. There are disciplines, cultures that value intellectual elegance and economy. A serious bridgeplayer does not have to explain the value of elegance to his peers. A programmer does not have to explain the value of elegance to other programmers. A mathematician does not have to explain the value of elegance to mathematicians. Explanation comes into play only when one deals with what dance schools call beginners and improvers. Whereas.

Over the last 15 years I have had conversations with many, many people in the industry. Mainly agents and editors, but also accountants, lawyers, designers, production managers, publicists, marketers, booksellers - the number of people who have to get paid out of the cover price of a book is not small. These conversations have certain features in common.  Blank looks. Incomprehension. Disbelief. Comment: 'I've dealt with hundreds of authors, and no one has ever wanted this before.'

So I think it may be necessary to do something else.  I thought I might be happier in IT, but the programmers I know have not been very helpful in suggesting entry-level jobs.  It may be best to go back to London and work again as a legal secretary for a few years; if I had an evening job I might do a BSc. during the day. It's possible that a public blog will turn out to be incompatible with that sort of job, in which case pp may have to go offliine. We'll see.

(Martelli, by the way, is also a member of the Python Software Foundation, author of Python in a Nutshell and co-editor of The Python Cookbook. Wikipedia: 'According to Martelli's self-evaluation, his proudest achievement is the articles that appeared in The Bridge World (January/February 2000), which were hailed as giant steps towards solving issues that had haunted contract-bridge theoreticians for decades.' If you are a writer who is haunted by the kind of issue that bothers contract-bridge theoreticians, you are probably in the wrong line of work.)

How do we get back, from those average numbers of tricks taken by the partnership, call it P, to the "strength of North's hand," call it N? Well, if we knew N, we would estimate P through the forumla, P = N plus one-third (of 13 minus N), because, by symmetry, on average partner's hand can be taken as supplying one-third of the "remaining" tricks, 13 minus N.  From that equation, it follows that
N = (1.5 times P) minus 6.5

Applying this to the earlier values (7222 Average 8.26 and 7321 Average 8.33 yields hand-strength estimates of 5.90 for Hand 7222 and 6.00 for Hand 7321.

How can Hand 7222, that will surely take six tricks itself, be worth a bit less than six tricks in this scale?  Because the hand-strength values were computed under the assumption that the ratings of th North and South hands would be added to produce a partnership total.  When North holds 7=2=2=2, his shape will (on average) destroy some of the values that South will count on.

Friday, December 7, 2007

simplicity



Levitation aside, there is a vocabulary test engine called Lavengro that is written in Python (one you can use, in other words, to build your own vocabulary tests); I started learning Python months ago and then something came up, but I'd like to go back to it.