Cooking and Coding

Sometimes, when we programmers sit down to explain programmer, we resort to the hoary old cooking metaphor.

“Programming is like cooking”, we say. “We write recipes, and the computer carries them out”.

And sometimes methodologists apply it to our work too. “Our method is like a recipe”, goes the sales pitch to management. “Apply our method, fill out these 9 reports, these 4 strategies and those 27 reports and the soufflĂ© will rise.”

Well, maybe. But ask a chef about the secret of fine gastronomie, and they will tell that it’s the ingredients that count.

And if you ask any experienced PM or software engineering research about methodologies, they’ll tell you it’s the people that count.

The recipe is useful to prevent known, avoidable flavours. But no method can rescue a soufflé made with fish sauce and pine bark. You have to have the right ingredients first, or nothing good will come of the recipe.

Posted in Rants, Software Engineering | Leave a comment

It is done.

Just submitted by dissertation.

Alchemist:dissertation jacques$ date; texcount -nosub dissertation.tex
Wed 26 Oct 2011 20:15:06 WST
File: dissertation.tex
Encoding: ascii
Words in text: 11775
Words in headers: 283
Words in float captions: 632
Number of headers: 75
Number of floats: 35
Number of math inlines: 14
Number of math displayed: 0

What’s left: one project, one presentation, one poster, one exam.

Posted in Studies | Leave a comment

Another milestone

My dissertation draft has been reviewed by a few other pairs of eyes. I’ve also spent a few days going over it myself. Apart from getting BibTeX to display a sensible bibliography, I reckon it’s about ready for submission.

Wed 19 Oct 2011 10:30:15 WST
File: dissertation.tex
Encoding: ascii
Words in text: 11414
Words in headers: 275
Words in float captions: 613
Number of headers: 73
Number of floats: 35
Number of math inlines: 14
Number of math displayed: 0

Now for two massive assignments, a presentation, a poster and an exam.

Posted in Studies | Leave a comment

An important milestone

My absolutely unedited, unreviewed, unchecked, unimproved, uncorrected, un-followed-up-on-TODOs-yet draft of my dissertation is done!


FILE: dissertation.tex
Words in text: 9634
Words in headers: 252
Words in float captions: 590
Number of headers: 66
Number of floats: 35
Number of math inlines: 9
Number of math displayed: 0

Now for weeks of tedious editing!

Posted in Studies | Leave a comment

If you rely on refereed material …

Then a lot of stuff that happened just 10-15 years ago didn’t happen at all.

Some of my research is done “Just In Time”. I think of something I want to refer to, then I hit up IEEE Xplore and the ACM Digital Library to find conference papers or journal articles about it. A surprising amount of the time, I come up empty-handed, leaving me to rely on web pages for my citations.

For example, at the moment I want to refer to the 90s dot-bomb duo Beenz and Flooz. These two sites each have writeups on Wikipedia, but as far as the IEEE and ACM literature is concerned, they’re ghosts. Flooz appears in neither; the ACM has 4 articles which mention Beenz only in passing, not usable as a citation for the mere existence of these two firms.

I am not sure what to make of this. What our field needs is some historians to dig this stuff out before it’s gone forever. The IEEE had a journal for this — Annals of the History of Computing, but irony of ironies, it stopped publishing in 1991. The ACM have some conference proceedings on particular slices of history — programming languages and early PCs, for example — but nothing in general.

It’s a shame, but also very annoying. Against my own better judgement I am facing the possibility of having to cite Wikipedia in an honours dissertation.

Posted in History, IT and Internet, Studies | Leave a comment

Progress

According to SLOCCount:

SLOC	Directory	SLOC-by-Language (Sorted)
500     classifier      ruby=500
200     tracker         ruby=200
101     sql             ruby=101
59      publisher       php=59
8       https_experiment ruby=8

Totals grouped by language (dominant language first):
ruby:           809 (93.20%)
php:             59 (6.80%)

Total Physical Source Lines of Code (SLOC)                = 868

Mind you, the SQL directory contains … SQL. Not ruby.

And it’s not quite done. I’ve got the core protocol code working and its attending unit tests; what’s needed now is some end-to-end integration tests. Plus a bit more code on the back-end.

Meanwhile, according to TeXCount:

$ texcount dissertation.tex
FILE: dissertation.tex
Words in text: 1725
Words in headers: 122
Words in float captions: 77
Number of headers: 27
Number of floats: 6
Number of math inlines: 0
Number of math displayed: 0

I can usually bash out a few hundred words per sitting. I’m confident about getting the bulk required — approx. 50 pages, no more than 15,000 words.

One thing that really slows me down is digging up citations. So many ideas I’m writing about are from dimly recalled Slashdot stories, blog posts and textbook skimmings of yesteryear. Sometimes it takes a while to dig down to the actual sources.

Another slowdown is diagrams — but I think it’s worth it to visually support the text.

It’s weird how so much time and effort boils down to so little code and so few words!

Posted in Startup, Studies | Leave a comment

Hacked!

Those few of you who visit my blog will have noticed Google’s scary warning popping up when navigating to my site.

Until now I’ve hosted my personal blog at Dreamhost for several years. Mostly because it’s been easy to set up and my traffic is very low. However it seems that the Dreamhost install was hacked and was resistant to being fixed with an upgrade.

I played the “CBF” card for some time on this issue. Now, with a bit of DNS jiggery-pokery, I’ve relocated the blog to my Ozblogistan network. Hopefully the scary messages will go away.

Two things I’ve taken away: Dreamhost is so-so. Bottle Domains actively suck.

Posted in Site News | Leave a comment

Installing the pg gem on OS X with MacPorts

The pg gem, used to connect ruby programs to the PostgreSQL server, is notoriously difficult to install on OS X.

I’m using MacPorts and have PostgreSQL 9 installed. Here’s what I did:

jacques$ sudo bash
root$ export PATH=/opt/local/lib/postgresql90/bin:${PATH}
root$ env ARCHFLAGS="-arch x86_64" gem install pg
root$ env ARCHFLAGS="-arch x86_64" gem install rdbi-driver-postgresql

First, the code switches us to the root user to avoid various hair-pulling problems with using ‘sudo’ on commands starting with ‘env’.

Next we export the path where PostgreSQL lives in a MacPorts setup. You may need to adjust this path depending on the version you have installed.

Next, using ‘env’, we tell gem to install and compile a 64-bit version of the pg gem. Then we do the same again for the RDBI driver I’m using for a project.

And that’s it.

Leaving out any part, trust me, is a path to eternal madness.

Posted in Technical Notes | Leave a comment

It’s not every day you get to compete with Damon Kelly and Itte Detenamo

Here in Darwin, we host the biennial sports festival called the Arafura Games. At this year’s games, the weightlifting competition also included the Oceania and South Pacific championships.

As a resident of the Northern Territory, I was able to qualify for the weightlifting competition in the +105kg (super heavyweight) division.

Also entered in the competition were Damon Kelly, Australia’s Commonwealth gold medallist, and Itte Detenamo, the man Kelly beat for the gold in a thrilling contest in Delhi.

While this meant I didn’t expect to come even vaguely close to winning in such a phenomenal field of lifters, I was looking forward to lifting alongside them and representing my home state.

On Sunday, disaster struck. I began a training session at the end of a weekend coaching course. The course involved many hours of practical work drilling the snatch, clean and jerk progressions and I was physically and mentally exhausted. During the training session I felt a sharp sudden pain in my lower left back. I knew from experience that I had possibly hurt myself quite badly.

I decided that I wanted to compete, no matter what. Even if I had to lift an empty bar I wanted to compete. I saw physiotherapists on Monday, Wednesday and today (Friday). I was finally diagnosed as having a bulged disc in my lower spine – a minor herniation. On Monday I was in a lot of pain, and after standing for most of Tuesday I was in terrible pain on Wednesday. On advice from a physio, I went home and stayed in bed almost constantly for 2 nights and a day — and today I was able to walk and move almost without pain.

The physiotherapist I saw today pre-contest said he was surprised at how quickly I’ve healed, given that spinal discs have almost zero bloodflow. I credit the recovery to my weightlifting training.

And so it was that today, after having trouble walking, standing or sitting for almost a week, I was able to complete the competition.

My big shock this morning was discovering that under the IWF rules, I must declare opening lifts high enough that the total would be within 20kg of my qualifying total. My qualifying total was 170kg, which meant I would need to have snatch + c&j of 150kg or better declared at weigh-in. This was a shock as I had originally planned to make one token lift for each event.

I went down to warmup feeling apprehensive. Snatches were a bit painful at first, but by modifying my form to a Papuan style, I was able to lift without pain. However I had to powersnatch as overhead squatting began to hurt my back.

My opening snatch was 65kg and felt like it weighed nothing. I decided to change my plan and try for 70kg. It felt easy too — no pain. Almost a military snatch. Finally I took 80kg and lifted it without too much effort. My competition PB in the snatch is 110kg.
Next were C&Js. I had a lot of time to rest while the stronger lifters ran through their attempts. I started warming up. Because of the lower back injury, I switched from split jerks to power jerks. Again, squatting down in the receiving position caused pain, so I concentrated on powercleaning.

I started with 85kg, which again felt easy. Then I went to 95kg, and a small drama occurred. While cleaning the bar my left hand slipped clear off during the receive. I couldn’t pull my hand back by itself to get back under the bar. Remembering the rules about C&J, I decided to shrug the bar off my shoulders to reset the left hand — and succeeded. I was told later by some experienced weightlifters that they had never seen anyone recover from that situation before. I power jerked it successully. Finally I cleaned and jerked 105kg. (My PB is 131kg).

I had originally approached this competition hoping to lift 120kg/140kg, and I think that I would have made it easily but for the injury. The enforced bed rest meant that I went into the competition fully recovered and feeling fresh, apart from the soreness, niggles and occasional spike of pain.

By focusing on my form I was easily able to power snatch, power clean and power jerk my way to 6 lifts out of 6, with 3 white lights all the way. While the total lifted is a personal worst, in many ways this is the competitive effort I am the most proud of.

After I finished up, I got to watch Itte Detenamo smash 5 Commonwealth weightlifting records, including snatch, clean & jerk and total. He’s now the strongest man in the Commonwealth and the strongest man in Oceania. It was a thrill to watch because I, despite injury, despite not being a jot on these mighty lifters, got to compete on the same stage with them, on an equal footing. It’s an experience I’ll never forget.

Posted in Weightlifting | 4 Comments

Fixing blogger imports into Wordpress

I’ve been expanding my Ozblogistan network and have run into an interesting bug.

When importing from Google’s blogspot, all post titles and post content wind up with the ‘>’ symbol prepended. This is annoying.

If you have database access, the fix is fairly straightforward:

update wp_posts set post_title = trim( leading '>' from post_title );
update wp_posts set post_content = trim( leading '>' from post_content );

If you have multisite enabled, like me, you need to run this query for each affected blog, with the correct table number. So for example, if you have blogs 1-10, and blog 7 is affected, the table name might be ‘wp_7_posts’ instead of ‘wp_posts’.

Posted in Technical Notes | Leave a comment