Category Archives: Software

In the wake of ScienceOnline2011, at which the two sessions I co-moderated went pleasingly well, my Blogohedron-related time and energy has largely gone to doing the LaTeXnical work for this year’s Open Laboratory anthology. I have also made a few small contributions to the Azimuth Project, including a Python implementation of a stochastic Hopf bifurcation model.

I continue to fall behind in writing the book reviews I have promised (to myself, if to nobody else). At ScienceOnline, I scored a free copy of Greg Gbur’s new textbook, Mathematical Methods for Optical Physics and Engineering. Truth be told, at the book-and-author shindig where they had the books written by people attending the conference all laid out and wrapped in anonymizing brown paper, I gauged which one had the proper size and weight for a mathematical-methods textbook and snarfed that. On the logic, you see, that if anyone who was not a physics person drew that book from the pile, they’d probably be sad. (The textbook author was somewhat complicit in this plan.) I am happy to report that I’ve found it a good textbook; it should be useful for advanced undergraduates, procrastinating graduate students and those seeking a clear introduction to techniques used in optics but not commonly addressed in broad-spectrum mathematical-methods books.

Gogo Proxy

Modern air travel! The worst trouble I had with the in-flight WiFi service (on my return from Skepticon 3) was that it didn’t work, or, rather, that it worked for less than the time necessary to load a page. A friend of mine travelling on the same day had a more interesting issue: the Internet connection gave him someone else’s identity. He went through the procedure to sign up for the Gogo Inflight Wifi, logged into Facebook and realized he was seeing someone else’s news feed. With someone else’s picture on the page. Using a total stranger’s account. Upon reloading, the same thing happened, but with a second stranger taking the place of the first.

HTTP Proxies are strange and mysterious things.

Python Exercise: The Logistic Map

Nostalgi-O-Vision, activate!

A month or so after I was born, my parents bought an Atari 400 game console. It plugged into the television set, and it had a keyboard with no moving keys, intended to be child- and spill-proof. Thanks to the box of cartridges we had beside it, Asteroids and Centipede were burnt into my brain at a fundamental level. The hours I lost blowing up all my own bases in Star Raiders — for which accomplishment the game awarded you the new rank of “garbage scow captain” — I hesitate to reckon. We also had a Basic XL cartridge and an SIO cassette deck, so you could punch in a few TV screens’ worth of code to make, say, the light-cycle game from TRON, and then save your work to an audio cassette tape.

From my vantage point in the twenty-first century, it seems so strange: you could push in a cartridge, close the little door, turn on your TV set and be able to program.

Right Skill, Right Time

OK, first of all, let me say that there exist few better ways to procrastinate than reading an essay on time management. Terry Tao has lots of suggestions; following a fraction of them would probably make me a better human being. One item, though, is worth special attention:

It also makes good sense to invest a serious amount of time and effort into learning any skill that you are likely to use repeatedly in the future. A good example in mathematics is LaTeX: if you plan to write a lot of papers, it makes sense to go beyond the bare minimum of skill needed to jerry-rig whatever you need to write your paper, and go out and seriously learn how to make tables, figures, arrays, etc. Recently I’ve been playing with using prerecorded macros to type out a standard block of LaTeX code (e.g. \begin{theorem} â€¦ \end{theorem} \begin{proof} â€¦ \end{proof}) in a few keystrokes; the actual time saved per instance is probably minimal, but it presumably adds up over time, and in any event feels like you’re being efficient, which is good for morale (which becomes important when writing a long paper).

The risk is that you might end up a freak like me: after you’ve defined a few macros for moments and cumulants and partial derivatives, you get bitten by a radioactive backslash key and start typing all your class notes in LaTeX while the professor is lecturing. That aside, thinking about the proper time to learn these “accessory skills” puts me in the mood for a rant. (Well, what doesn’t?)

MIT did an exasperating thing with its undergraduate physics programme shortly before my time. The way I heard the story, they’d been afraid of losing students to other majors, so they dumbed down the sophomore-year classes (virtually excising Lagrangian mechanics, for example). We were left with a “waves and vibrations” class which was rather a junk drawer of different examples; a quantum-mechanics course which lacked guts and thus forsook glory; a decent introduction to statistical mechanics; and a relativity class which, hamstrung by fear of sophistication, also suffered because it lacked a singing Max Tegmark.
Continue reading Right Skill, Right Time

A Survey for Curmudgeons

I have a simulation happily grinding away in the background, using one core of my spiffy new dual-core system, doing my work for me, so not only do I have a moment to procrastinate, but also I should be happy about new technology. However, the headphones which came with the iPod nano I got for Christmas picked today to fall apart. The earbug doodad is beside itself with the joy it feels at being part of a cultural icon, I suppose. Given that the iPod itself had to be reformatted twice and connected to three different computers before it was able to receive music, that the interface packs more absurdity into its purported simplicity than I would have imagined possible, and that consequently it has relegated itself to the status “device which plays “Mandelbrot Set” on demand,” having the headphones cheap out on me is rather like salting the fields after Steve Jobs has burnt the city.

All this to say that today I’m in a mood for appreciating old things which work.

Geoffrey Pullum wrote, four years ago,

Shall I tell you how The Cambridge Grammar of English was prepared? (I am not changing the subject; trust me.) The book is huge: 1,859 printed pages. The double-spaced manuscript was about 3,500 pages (yes, it actually had to be printed out and written on by a copy editor the old-fashioned way). It took over ten years to write. And it was done using WordPerfect 6 for DOS. Rodney Huddleston chose to upgrade to that around 1989, wrote a couple of hundred complex macros, and stuck with it. I learned the WP DOS macro language in order to collaborate on the project.

WordPerfect was basically in its final, completed form before Clinton first ran for office. It works. The file format is fine for authors, and records everything we need to record. Rodney and I are still using WP6 file format today to write our planned student’s introduction to English grammar. In all the years since the late 1970s, WordPerfect has not altered the file format: all the largely pointless upgrades in the program have been backward compatible. The format really does the job. But things are different with the WordPerfect program itself. The progress has largely been backward.

The things we have noticed about version differences are minor, but they all tell in the same direction: every upgrade is a downgrade.

Forget the Clinton administration: TeX basically solved the problem of representing mathematical equations as text, during Reagan’s first term. The LaTeX macro language, which handles document-scale organization, is almost as old. Perhaps we’re stuck at a local maximum, and with luck and pluck we could find a better way, and on some days, that seems almost mandatory. Still, we’re at a pretty darn good local maximum, as local extrema go.

(Something deep within me finds a resonance with PyTeX, an attempt to have Python sit on top of TeX the way LaTeX does, but the project seems to be moribund.)

The question for today, then, is the following:

What are your favorite Old Things That Work, and which changeless relics really do need a shake-up?

Previous surveys:

Comments on all the above remain open.

In Which Blake Fails

Not noticing the tiny, unobtrusive switch on the side of your laptop which is labeled “WIRELESS ON / OFF” and wondering why you are no longer detecting any WiFi networks: FAIL.

Trying to troubleshoot your switched-off WiFi by digging through kernel module configurations: FAIL.

Attempting to connect using the Ethernet card and a hub which turns out to be non-functional: FAIL.

Finally switching the WiFi to the ON position, connecting to the Internet and realizing, “Hooray, now I can get back to work on that proceedings book for the conference which happened four years ago” — EPIC FAIL.

Friday Geek Update

My aged and broken laptop is still broken and has not grown any younger. Moreover, the USB key on which I had a decently recent backup of my work appears to have died as well. Furthermoreover, the server on which I also had my work backed up is suffering from a bum RAID array. Mission for today is to extract the drive from the old laptop and wire it directly into the dilithium recrystallization coils — er, I mean, connect it to my new Sony VAIO C420. I note that Micro Center sold me a laptop with Windows Vista on it, but I forgive them, since Ubuntu gutsy (the installation disc I had on hand) installed without any trouble. Audio, wireless and all those goodies worked without extra effort; I haven’t yet had much success with the Bluetooth support it automagically detected, but the only device I’ve had to test it with has been a cell phone which doesn’t play well with anything else, either. I found a status-bar tool which displays the current weather conditions as reported on the Intertubes, and unlike the previous version I’d used, this one can display temperature in kelvins. A year in Lyon followed by a change to my laptop settings went a long way to making me “internally metric”; this may be the logical next step.

(By the way, I booted into Vista just once — so I could say I knew the enemy, and all — and it sucked. It took the duration of an entire Pinky and the Brain episode just to decide how best to phone in to the mothership and report the music library I hadn’t yet put on the blasted thing because I’d just taken it out of the box. Neil Gaiman was right to consider XP an upgrade.)

All that aside, it is now Friday afternoon in Cambridge, Mass. (which is across and down the river from Newton, Mass. — there’s gotta be a physics joke in that). Outside, it’s a partly cloudy 302 kelvins. Inside, it’s time for the Dandy Warhols, with “I am a Scientist.”

Incidentally, we like to have music playing while we cook dinner here at Château Sunclipse, and this was the song we had going when we discovered that enchilada sauce with a dash of hoisin made an excellent base for beef soup.

Query for the Hive Mind

A friend of mine is looking for a postage-stamp-sized computer which can run either a Java Virtual Machine or an entire Linux kernel for fifty dollars. Does anyone have any suggestions for a moderately cheap, Java equivalent of the BASIC Stamp?

Software Quirk of the Day

Suppose you want to know the skewness of a list of numbers, and luckily enough you have Python close at hand. The skew() function in the SciPy stats library returns a single-element array instead of a floating-point number. Why, I have no idea, but at least the developers seem to know about it. Trying to get the value out by a sensible method like, say, indexing the array returns the error message “0-d arrays can’t be indexed.” To get the value itself, subtract 0:

result = scipy.stats.skew(list_of_values) - 0

Just one more way life has found to make itself interesting.

Hacked

I think my site has been hacked.

The IP responsible is 58.65.236.89.

All sorts of stupid crap is appearing in my WordPress pages. Please hold while we resolve the difficulty and beat up the people responsible.

UPDATE (2:39 AM): I think the damage has been un-done. While for about thirty seconds I was panicked and a little flattered that I might finally have pissed off somebody important, it looks like it was just a script kiddie from Hong Kong. Now, I just need to see how it happened and how I can stop it from happening again.

UPDATE (3:29 AM): Well, the good news is, it doesn’t look like the problem is my fault. In fact, I’m rather expecting that every PHP and HTML file hosted on SiteGround has been tagged with two extra lines of code.

PHP Puzzlement

Did the meaning of the character sequence \f in PHP change overnight? I just had a bizarre error in my LaTeX rendering plugin, which I ended up fixing by adding a whole bunch of extra backslashes. LaTeXrender works by generating a LaTeX document from a formula in a webpage and then passing that document through the LaTeX interpreter, converting the output into an image which is placed in the webpage. This means that the peculiarities of LaTeX and of PHP must both be respected, and because both languages use the backslash character for special purposes, extra backslashes appear when those purposes collide.

For example, \n in PHP (and in C) stands for a newline character (yes, we are still slave to the teletype). So, if you want your PHP program to output a character string containing the LaTeX command \newline, you have to write \\newline. The first backslash “escapes” the second.

Suddenly, LaTeXrender started spewing out garbage: big blocks of image with bits of LaTeX commands inside, wrapped around a formula in the middle. Something must have started going wrong with the text being passed to LaTeX. How did I, the seasoned LaTeX guru and MIT graduate, solve this conundrum?

I threw backslashes at the problem until it went away.

No, seriously: all LaTeX commands starting with \f, like \formulabox or whatever, needed an extra backslash. I changed every instance of \f in the PHP source code to \\f, and now the plugin works again. Why this is necessary today but wasn’t necessary yesterday. . . I leave that as an exercise for the interested reader.

This is why I don’t have a nice post about the Dirac Equation for you today.

Sneak Preview: GIF of Life

As luck would have it, my day job will require me to teach a mini-class on writing computer simulations for scientific purposes next week, and one of the examples I thought I’d include turned out to be just the thing I needed to provide an illustration for the review of John Allen Paulos’ Irreligion (2007) I’ve got in the works. Since the details are a little beyond the scope of that review, I might as well make another post out of them.

First, the punchline:

This is a fifty-frame animation of Conway’s Game of Life which begins with a 32×32 grid of random values and successively advances by applying the transition rules of that famous automaton. The purpose of the exercise is twofold: first, to demonstrate some basic programming techniques and show how much you can do in Python with half an hour of free time; and second, to see how persistent and cyclic features arise from random configurations.
Continue reading Sneak Preview: GIF of Life

Blagging Behind: Software Issues

First, earlier this afternoon, I tried upgrading to WordPress 2.3.2, being that it’s an “urgent security release” and all that. In the process, it incinerated my categories, and nothing I could do would convince it to create new ones. I had to pull out the MySQL backup I’d made before the upgrade attempt and downgrade to the 2.2 branch again.

Second, Technorati seems to have dropped forty-odd days’ worth of blog reaction data. I think that’s a glitch on their end — hooray for any mistake it’s not my responsibility to fix!

X-Mas Update

I now have a camera phone which won’t talk to Apple computers and an iPod Nano which won’t talk to anything at all. In addition, I have a GPS-based automobile navigation device — the kind with an insistent female voice which never says “please” or “thank you” — of a brand which I just heard my cousin saying doesn’t work in Boston, thanks to all the tall buildings (and, probably, the non-Euclidean geometry of the roads).

Season’s greetings from gadget-geekery land. . . .

How Not to Abbreviate “Wikipedia”

Or, “Pet Peeve #3,007.”

Please, please, for the love of knowledge and factual accuracy, don’t abbreviate Wikipedia as Wiki. That’s like saying “Look in Book for more to read” when you really mean, “See the relevant article in volume 17 of the Encyclopædia Britannica.” A wiki is a general type of website, an idea of how to edit material collaboratively, and this general idea has been implemented many times, in many different programming languages: MediaWiki (PHP), Instiki (Ruby), Twiki (Perl), etc.

Remember, even Conservapædia is a wiki.

(Image: an irate Wikipe-tan at Wikimedia Commons. Conservapædia has one, too.)