More Mongrel2 / OS X notes

Having a bit of spare time this Sunday, I’m continuing to work through the Mongrel2 manual (it’s good, as such things go).

There are still places where Mac OS X does not behave according to the expectations of the manual (written for a GNU/Linux environment).

  • Most of the shortcut code in S4.5 doesn’t work on OS X.
  • When chowning files, remember that OS X does not have a root group — it’s called staff. So “chown root:staff” instead of “chown root:root”.
  • When you’ve configured procer to launch mongrel2, running ps aux | grep procer won’t show procer right away. It takes a second or two. Mongrel2 itself doesn’t seem to launch properly … until you issue the -murder command to m2sh. Then procer steps in to resurrect the undead …
  • To run the chat demo, you need to have installed the mongrel2 library and dependencies. Go to (mongrel_dir)/examples/python and run python setup.py install. You also need to install the python-zmq library for your system — I used macports.
Posted in Technical Notes | Leave a comment

Building Mongrel2 on OS X with MacPorts

The documentation says “make all install” — use “make macports install” instead.

That’s what I get for not reading the damn makefile first.

Update: To build the procer utility mentioned in the Mongrel2 manual, a quick-and-dirty hack is to copy and paste the macport target lines from the main makefile into the procer makefile, then run “make clean macports”.

Posted in Technical Notes | Leave a comment

“Wall Street: Money Never Sleeps”

It’s pretty obvious that there were two versions of the script. In the original version of the script, which has no doubt lain in a filing cabinet for several years, there’s the plot involving Gordon Gekko and Forgettable Protagonist. Then, some time after 2008, they shoehorned in a second plot which is a thinly veiled coverage of the early GFC, based on the Rolling Stones account of events, but this time Forgettable Antagonist loses.

It’s a train wreck between these two almost completely isolated plots. As movies about the Evils of Greed go, this was the laziest attempt to cash in on a topical issue since The Day After Tomorrow. And it made about as much sense.

A cameo by Bud Fox, the protagonist from the original Wall Street movie, both cunningly winks at Charlie Sheen’s womanising character in the excremental sitcom Two and Half Jokes and simultaneously undermines the entire character development arc of the first film. Far from being a wiser, chastised Bud Fox, this Bud Fox is a smug git who managed to poop all over Gordon Gekko. Far too Star Wars prequels-esque for my taste.

My final complaint is that because of the shotgun marriage of two plots, the movie has about two dozen endings. It’s like Return of the King all over again.

Posted in Films and TV | Leave a comment

Hiatus

I’m flying to Perth for Christmas, so things will be quiet hereabouts.

Posted in Diary | Leave a comment

Oops

So I’ve started working on exercise 2A. I was about an hour in before remembering I’m supposed to be tracking every defect, no matter how minor. So I have two in the defect log so far, both with estimated repair times.

Otherwise, uneventful so far. Writing a physical LOC counter is pretty straightforward. A logical counter will be more interesting.

Posted in PSP | Leave a comment

Exercises R1 and R2 are done.

Remarkable how productive one can be when the internet is broken.

My thinking for exercise 2A (which is based on R1 and R2) is to build a SLOC counter using LPeg and Leg. This exposes what is to me a hole in the PSP 0.1. How does one account for researching time? Does it go under Design? In a more elaborate PSP I can only imagine that it deserve its own heading.

Posted in PSP | Leave a comment

Agile plans

One of the books I have going at the moment (I tend to multi-task books) is Mike Cohn’s Agile Estimating and Planning, a fairly concise take on how to obtain these qualities from agile projects.

I think that the central allergy of agilistas is to the Gantt chart, that famous diagonal artform of ribbons and spilling arrows. The Gantt chart is notorious for its inflexibility in practice and in giving a false sense of certainty.

Yet, despite the central messages of agile methods pointing to the ability to pivot the project in response to customer contact, planning is still a part of the process. It’s just wrapped up in low-precision formats.

Currently in A Discipline for Software Engineering I am working through Chapter 3 on planning. Here are the 4 “general things you need from a plan”, according to Watts Humphreys:

  • Job sizing: How big is this job, and how long do you expect it to take?
  • Job structure: How are you going to do the work? What will you do first, second and so on?
  • Job status: How do you know where you are? Are you going to finish on time and are the costs under control?
  • Assessment: How good was your plan? Did you make any obvious errors, what mistakes should you avoid in future, and how can you do a better job next time?

All these questions don’t just apply in the PERT-and-Gantt world Humphreys came from — the IBM mainframe and DoD universe. They’re also answered by agile practices:

Plan requirement Agile practice
Job sizing Planning poker, story points, ideal days
Job structure The planning game, backlogs
Job status Velocity, burndown charts, kanban boards
Assessment An infinity of blog posts :D

Burndown charts, coming from the Scrum methodology, have a companion in Humphrey’s world of the Earned-Value chart. You might think of EV as a more elaborate version of burndowns, with all the good and ill that entails.

Similarly, planning poker can be seen as a cut-down version of the Wideband Delphi method introduced by Barry Boehm. Pair programming can be seen as a kind of code review. And so on.

Truly, there is nothing new under the sun :D

Posted in PSP, Software Engineering | Leave a comment

Exercise 1A completed.

So I’ve just finished exercise 1A from A Discipline for Software Engineering.

Switching to more idiomatic Lua (see my last post) made a big difference in the subjective easiness of the work; but I still spent almost as much time in the Test phase as I did in the first design.

Nevertheless, the code now runs and passes the miniscule test suite based on the data in the book (Table D5). I wonder whether it would have been worth to write a fuller suite to cover the functions I put together — for example, the std_dev function is tested directly by the suite, but not the avg or sum functions.

I’ve also started putting my work online at Github. Pretty rudimentary stuff, but at least it gives me a motivation to do the exercises if I imagine that somebody is checking out the code & logs and going over them.

For testing I used the lunatest package. Missing from lunatest is a capability to provide precision deltas on the assert_equal function. In ADFSE, the standard deviations of the sample data are given to 2 decimal places and are rounded. Lua doesn’t have rounding built in, so it was necessary for me to include a little rounding function to equalise the results. Other testing frameworks I’ve seen allow you to pass in a delta value — a degree of permissible variance that still counts as “equal” — which saves a lot of the bother.

So that’s it. I’m looking forward to the next exercise.

Posted in PSP | Leave a comment

Exercise 1A

So I’ve been working on the first of the PSP exercises. The requirement is to write code that calculates the average and standard deviation of a linked list.

My first attempt hasn’t ended in failure, so much as the realisation that I took the wrong approach. I’ve marked this down as a design defect in my error log.

The emphasis really ought to be on the standard deviation and not on the data structure. I’m writing in Lua, a language which among other things includes a flexible standard data structure called ‘tables’, which can at various times behave like arrays, hashes, stacks, queues and so on.

My next revision of the code will focus on using tables as-is, rather than bodging up a linked-list structure composed of tables with two elements. I expect it will probably be much easier to write, too, due to Lua’s support for easy iteration over table structures.

Posted in PSP | 3 Comments

Phew

Both of my regular readers (I’m just kidding, nobody reads this blog regularly) may recall this primal scream at “high fashion”.

But it’s not all bad in fashion-land. Apparently some photographers actually play to their model’s strengths. For example, see some relatively recent photos of Clare Venema below the fold and compare them to the previous batch.
Continue reading

Posted in Beautiful Women | Leave a comment