Back to Python


Eleven of September again, troche but I am not thinking of 2001—which was terrible, I agree—but of 1973. I always stop for a minute to remember as an old political campaign said: without hate, without fear, without violence. I was six and still remember.

I am preparing lectures, really busy. I took the students after more than a semester and most of them appear to be clueless. I am going over a general review, again, because they have to learn. Always listening to energetic music when preparing lectures or running analyses. This time is Rammstein’s ‘Sehnsucht’. But, anyway, I also like to go back a few years and Yes’s ‘Close to the Edge’ (yes, from 1972) is now coming from the headphones.

I start writing most of the ideas in Writeroom and then copy the lot to TeXShop. Packages included in the document preamble for the notes:

%! program = pdflatex

Although the Statistics course uses Mendenhall & Sincich’s ‘Regression Analysis’ as the basic text, I am using quite a few other references:

  • Quinn and Keough’s ‘Experimental design and data analysis for biologists’.
  • Searle’s ‘Linear models’.
  • Harrell’s ‘Regression modeling strategies’.
  • Steel and Torrie’s ‘Principles and procedures of statistics’ (the first edition!).
  • Hamilton’s ‘Regression with graphics’.
  • Neter and Wasserman’s ‘Applied linear statistical models’.

In addition I am also preparing grant applications, so if you try to contact me please be understanding: I will not read my email (or act upon any emails) until Wednesday next week (around September 20th).

Moved to King Crimson’s ‘Discipline’. Now listening ‘Elephant talk’…Talk is ony talk…

Less than a month ago I bought a Panasonic DMC-TZ1 digital camera. Basically, buy information pills
it is a small ‘point and shoot’, approved
but with a very nice 10x optical zoom. Not really a substitute for the Nikon D70 (our main camera these days), physiotherapy
but with the advantage of having it with me most of the time.

It has quite a decent image quality, nice image stabilizer (really needed when using as a telephoto) and good screen. The flash is a bit flaky but, hey, it is tiny. Battery life is quite good and I really like the small charger.

The photo below belongs to the ‘first roll’, taken in the carpark at work (30 metres from my office).

Portrait: when you are not here

It all started last week with problems coming back from sleep mode. The MBP would wake up for a few seconds and then shutdown completely. It was an annoyance, ambulance
but given that I was still teaching and preparing lectures using the laptop, I just kept going. Last Monday 19th September it was happening often enough that I sent an email to the University’s IT support, for which I received an automatic reply on Tuesday saying ‘we got your message’.

Yesterday, Wednesday 21th September, the computer just ‘died’ four hours before my last lecture for STAT220. I would turn on and then shutdown almost immediately. I had prepared the last lecture at home, without a chance for the automatic network backup that I get at work. Therefore, I spent the last few hours frantically trying to recreate the lecture (in PowerPoint rather than Keynote) in a borrowed HP laptop. Not the best final lecture, but at least a decent end for my participation on the course.

Marcela dropped the laptop at MagnumMac, the authorised Mac reseller in Christchurch. We were presented with the following options: for normal guarantee work (which certainly was this case) I would need to wait until next week so the technicians had a look at the computer. That is, waiting at least from Wednesday until Monday so someone would touch the computer, not even repair it. The option: spend NZ$75 so the technicians would put my computer at the front of the queue—skipping another 14 computers—and start diagnosing the problem. Not having the computer is certainly worth much more than $75 per day for me, so I decided to pay, but the whole system sounds wrong:

  • The computer is under warranty (and with additional AppleCare), so Why should I pay to have it fixed in a reasonable amount of time?
  • MagnumMac’s technical support appears to be seriously understaffed if it takes them so long just to ‘have a look’.
  • At least in theory, people that choose not to pay the extra cost can be continuously pushed down the queue to have their computers repaired.
  • Apple did not offer any support so I can keep working while they repair my computer. My mechanic can lend me a car while he is fixing my vehicle, so how can that a computer company can not do the same? How do they expect me to continue working with my Keynote documents?
  • Several supposedly ‘lesser quality’ brands offer a much faster turn around for repairs.

Apple has not found the problem yet: I was told—after I called a couple of times—that they have reproduced the problem but that they are still trying to figure out what is its cause. Once that happens, it will take several days for me to get back my computer (tomorrow is Friday already): normally they order the parts from Australia, which may take several days, even weeks.

This is the second time that my computer goes back to Apple: the first time was a battery problem (before the big battery recall). It has been very disappointing to have these problems, particularly when they seem to be so common place.

By the way, I am still waiting to receive an email written by humans from the University’s IT support.

P.S. 2006-09-27. I received my laptop back on Monday 25th. Apple’s technician explained to me that they were able to replicate the problem but not to pinpoint the cause. They replaced 512MB of third party RAM for Apple brand and that seems to have temporarily fixed the problem. Today I had a shutdown when running on battery (with supposedly 67% of charge). It may be that the battery needs calibration; however, it may also be the same problem coming back. We’ll see.

P.S. 2006-09-28. Random shutdowns are back. Called tech support and they will order the next potentially problematic part.

P.S. 2006-10-05. The left I/O board was replaced on Monday 2nd October, got the computer back yesterday and it failed again tonight. I am returning it tomorrow and will ask for a replacement computer. The issue is now how to get a bit over 10GB of data backed up (mostly the multimedia part, the rest—around 2GB—is already safely stored in our network), while the computer is working. If it is not possible, we will need to access the hard drive from somewhere else.

P.S. 2006-10-10. I received a new Macbook Pro, which did not present any of the problems of the previous one. Annoyances aside, I received a faster computer (2GHz instead of 1.86GHz) and I used the opportunity to upgrade RAM from 1Gb to 1.5GB. All in all, I am a lot happier with the new computer. Apple was not very keen on exchanging the computer, but I refused to accept back the old one. At least some times it pays to be a real pain in the butt.

I started using Python way back at the end of 1996 or early 1997. I was working in my PhD, visit this site
for which the first project involved writing some simulations in FORTRAN. Originally I was using FORTRAN90, but then I needed to move my project to a server that had only FORTRAN77, so I was stuck with something that looked—at least to me—really ugly. While I was looking for alternatives (I used Mathematica, Matlab, SAS, Python and ASReml in my PhD), I stumbled on an article by Konrad Hinsen discussing using Python to glue FORTRAN programs. Intrigued, I downloaded Python and ordered a copy of Mark Lutz’s Programming Python (the October 1996 first edition). After reading the book for a while I was hooked on the language.

I used Python in and out for small projects, and later dropped almost all programming (that was not stats) around 2001. I have missed that quite a bit until yesterday when working with a list of words that Orlando is using. We had typed around 450 words in Spanish (and he uses around the same number in English) and I wanted to check if we had repeated words. I downloaded Python, wrote a few lines and presto! We did have around 20 repeated words and it was so nice to be able to write something in Python.

After that I did check a few web pages and I realised that the language has evolved quite nicely (although I rarely use the object oriented stuff) and there are at least two books that I will be browsing soon:

Both books are available as free downloads in a variety of formats, as well as in real old-fashioned paper. I will certainly buy the nicest one in a paper copy.

I forgot to mention that one of the great things about Python was the existence of an excellent set of libraries for matrix operations (at the time was Numpy) that has grown in to a great set of resources for scientific computing called SciPy.

Filed in programming, software

No comments yet.

Write a comment: