Octopodial Chrome

Stuff that Made Sense at the Time

The Personal Weblog of Bob Uhl


Monday, 31 December 2007

Goodbye, 2007!

I like to write my 1s with a little tail, as is common in Europe, Mexico and various other places; the only problem is that it can be confused for a 7 (which I write with a stroke, to differentiate it). Back in 2001 I was very happy because every cheque I wrote had the 1 in 2001 on it, thus preventing confusion. At the end of 2001 I was so dejected because the next year with a 1 or 7 would be 2007, which was so very far away. Now 2007 is almost over, and it seems like just yesterday it was 2001.

I’m headed downtown to celebrate the new year—until 2008, I remain your host, Bob Uhl.

Man Finds Rare Pearl on Plate

A Florida man bit down on a rare purple pearl which was in a plate of clams he was eating. It turns out that it could be wroth a few thousand dollars. Not too shabby for a $10 meal!

Backup Tip

Way back in 1994, Rob Horn gave an excellent tip: randomly restore one file from backup every week. If you have data which you care about (and you do, whether you know it or not), it needs to be backed up. And if it’s being backed up, you need to test that backup system regularly to ensure that you’ve not forgotten something or been bitten somehow. Restoring one random file per week is a good practise to follow.

How Childbirth Went Industrial

Dr. Atul Gawande explores the history of childbirth. It turns out that there’s a very good reason for the prevalence of C-sections: the outcomes are better when average over the population of physicians (that is, the alternative methods are better with a highly-skilled obstetrician but worse with normal ones, so on average a C-section is safer). Reading the article, I am intensely glad that I am a man.

How Starbucks Helps Indie Coffeeshops

Slate points out that Starbucks actually helps mom-and-pop coffeeshops. It turns out that Starbucks creates a market for coffee consumption, and that this generates a spill-over effect for other (better) coffeeshops. One guy in Los Angeles actually opens new coffeehouses near existing Starbucks locations! It’s pretty cool how economics can be counter-intuitive sometime—and a good warning who’d like to interfere with the market.

Cars Fully Loaded with Debt

The Los Angeles Times reports on the growing prevalence of upside-down car loans. One couple bought five vehicles in three years (trading in as they went), owing $43,000 on two trucks worth no more than $29,000. The problem boils down to this:

  1. People want cars they cannot afford
  2. Lenders offer them longer payback periods so that the monthly payments are more reasonable
  3. The cars depreciate faster than the loan is paid off, leaving the owners owing more than their cars are worth
  4. The owners trade their cars in for larger, more expensive cars—and tack the old debt onto the new loan, perpetuating the cycle

This is similar to the sub-prime loan crisis, with a key difference: there’s a chance that a home will appreciate but no chance that a car will.

It’s getting to the point that I wonder why I save. These people and the sub-prime morons did stupid things and will no doubt be bailed out, with the money I’ve been saving. So why don’t I just go spend, spend, spend my way to a happy tomorrow, and let someone else pay for my mistakes?

Hooded Progressivism

From reason comes a great article, Hooded Progressivism: the secret reformist history of the KKK. It reinforces the thesis of Liberal Fascism—that progressivism is inherently anti-liberty.

It turns out that the KKK of the 1920s was racist, anti-Semitic, anti-Catholic—and politically progressive, pushing for such progressive ideas as eugenics, compulsory public-funded education and alcohol prohibition.

Lawyer Keys Marine's Car

A Chicago lawyer keyed a Marine’s car and is resorting to shenanigans to get out of it. On the first of this month, Jay R. Grodner (a Chicago-area lawyer) keyed the car of a Marine due to return to Iraq on the 2nd of January. He was arrested and issued a citation; when the bill for the damage came it totalled $2,400 which makes the charge a felony; the lawyer offered to settle for paying the Marine’s deductible and letting the insurance company pay the rest; the Marine refused; Illinois is refusing to pursue the felony charge.

The next court date is today, the 31st; the lawyer plans to file for a continuance because in two days the Marine is headed back to Iraq. Publicise this, and let anyone you know in the Chicago area about what’s happening.

Infantilising Christ

There’s a disturbing trend in popular Christianity: the infantilisation of Jesus Christ. Presidential candidate Mike Huckabee said, and I quote, it’s the same power that helped a little boy with two fish and five loaves feed a crowd of five thousand people. Ummm, it wasn’t a little boy who fed five thousand: it was a grown man.

The film Talladega Nights made reference to this absurd phenomenon when the hero (a stereotype of a redneck) is always praying to sweet baby Jesus.. It did this so much I was almost offended—but then I realised that there are people who do perceive the Lord, God and Saviour as a perpetual child. Yes, Jesus was born as a child; He then proceeded to grow up, preach, teach, suffer, die, conquer death and rise from the dead. The Pre-eternal Word may have been born into this world as a baby, but He left it as a man.

I think this is related to the change in understanding of the angels. In the Bible and the Fathers, angels appear as young men; they are wise and powerful creatures. Angels are not pretty young women; in fact, calling a girl or a baby an angel shows a very deficient understanding of the word. The cherubim are the second-highest rank of the angelic powers; they have four wings and many eyes; one’s reaction to seeing one would be fear and awe. A cherub is not a cute little baby with wings; it’s pretty much the opposite in terms of majesty and dignity.

Airport Security Follies

Patrick Smith writes about the absurdity of our airport security measures. They are intrusive, they are ineffective, they are simply an exercise in theatre: the TSA pretend to do things that will protect us; we pretend that we are protected.

Sunday, 30 December 2007

An Efficient Gas-guzzler

Here’s a cool video of how a man turned his 5.3 mpg gas guzzler into a 36 mpg truck. Now that’s impressive!

Pat Schroeder Hates Libraries

Former representative Pat Schroeder (embarrassingly, from my own state) hates libraries. To quote her, we [meaning publishers] have a very serious issue with librarians. Good to see yet another Democrat standing up for civil liberties. You can always rely on a Democrat, whether it’s freedom of speech, freedom to read, freedom to bear arms or the simple freedom to live: they’re on your side. Not.

I also like how she says, Technology people never gave their stuff away. I’m writing this blog entry in emacs, a text editor written by Richard Stallman, using the HTML-editing mode written by James Clark; it’s running on Linux, a kernel written by Linus Torvalds; that’s bundled together with GNU and many other pieces of software to form Fedora. I’m reading Mrs. Schroeder’s nonsense in Firefox, a web browser originally written by Netscape engineers.

Every last piece of software I’m using was given away. I do have a single piece of proprietary software on my computer: JungleDisk, to handle remote backups. I’ll get around to rewriting it one of these days (and giving my own code away for free), but for now I’m fine using it.

So stick that in your pipe and smoke it, Pat Schroeder!

Saturday, 29 December 2007

The Smartest Article on the Drug War

Slate recently turned me on to the smartest article on the drug war you’ll read all year. It’s really good, examining how we spent thirty-five years and $500,000,000,000 on losing the War on Some Drugs. Mark Kleiman has a similarly excellent article in American Interest, which you also need to read.

We shouldn’t be fighting drugs: we should be fighting the crimes which surround drugs. Exxon and British Petroleum station owners don’t shoot one another on the street; rival liquor stores don’t hire thugs to intimidate customers of their competitors; pharmacists don’t attack one another—neither need drug dealers. We can eliminate drug-dealer violence completely.

Despite that car owners are more addicted to gasoline than a heroin addict, they don’t kill to get their gas; the rate of theft due to alcoholics stealing to buy booze is fairly low; the number of people who mug in order to afford their Prozac is minimal. We can reduce drug-user violence a great deal.

We’ve used the War on Some Drugs to prop up failed states who promise to stamp out drug production; we’ve used the War on Some Drugs to knock the feet from under the War on Terrorism (we are starting to fail, badly, in Afghanistan because this administration is so blinded by anti-drug hatred that it is willing to lose its only Middle East success story); we’ve used the War on Some Drugs to drastically alter the balance of power between citizen and state (take a look at the civil asset forfeiture statistics some time); we’ve used the War on Some Drugs to deprive those in pain of recourse; we’ve used the War on Some Drugs to attack what is a basic human right: the right to determine what does or does not enter your body.

When will you step up, do what is right and oppose it?

Friday, 28 December 2007

Why Boys Should Be Allowed to Play with Guns

The Daily Mail reports that playing with guns is a vital part of boys’ development. The response from nannies and teachers? To stick their fingers in their ears and pretend that little boys are little girls instead.

Liberal Fascism

Todd Seavey has a top-notch review of Jonah Goldberg’s new book Liberal Fascism: The Secret History of the American Left, From Mussolini to the Politics of Meaning. It covers the connexion between progressivism and statist authoritarianism, detailing the fundamental similarity between Wilson, Roosevelt, Stalin, Hitler and Mussolini. It sounds like an absolutely fascinating book.

Thursday, 27 December 2007

DEA Arrests Man for Buying Cold Medicine

The DEA proudly announces that they have made their first arrest for buying cold medicine.

It’s fairly probably that Mr. Fousse did actually intend to produce methamphetamine from the cold medicine. I’m puzzled, however, as to which provision of the federal constitution gives Congress the right to forbid said manufacture, or to forbid the purchase of more than a certain amount of cold medicine in a month.

Messrs. Gilbride and Flynn should be ashamed of themselves. I wonder how they sleep at night.

Profiling's No More than Cold Reading

We’ve all heard of the exploits of criminal profilers—the psychologists who take a look at a crime scene and provide a profile of the criminal responsible. It’s pretty common now for a whodunit television series to feature a profiler; Criminal Minds is about an entire team of profilers.

I’ve always been a little suspicious of their utility, since a lot of their guesses seem like no-brainers. It’s pretty much a given that a criminal is a man (not that women aren’t criminals too—just that female criminals are much rarer, and so absent pretty convincing evidence to the contrary it’s best to focus on guys); it’s pretty much a given that he’s twenty to forty (less than twenty and he’s a kid; more than forty and there are good odds that a criminal is incarcerated or dead); even predicting race isn’t too difficult, given the distribution of crime-committing across the races.

It turns out that I was right: criminal profiling is essentially cold reading (the technique used by sham psychics): it uses techniques such as the Vanishing Negative, the Fuzzy Fact and so forth to form a profile. After the fact, when the villain is apprehended, people think that the profile matches the villain—but in fact the profile is vague enough to appear to match pretty much anyone!

Return of the Puppet Masters

Half of the world’s population—three billion souls—host a parasite known as Toxoplasma gondii; this parasite is known to change behaviour in rats (it makes them lose their fear of cats), and it appears to do the same in man. Is half of the world’s population being controlled by a microbe? This would possibly explain the popularity of football.

Mock Constitution Mocks Constitution

A fool of a professor at the University of North Carolina at Chapel Hill has led her students in a frivolous, self-important mock constitutional convention, complete which over-serious theatricality and rights which aren’t rights at all, e.g. a right to affordable housing, a right to sports and the other such addled products of juvenile minds and a yet more juvenile professor.

It’s truly pathetic what has become of our educational system. We no longer produce free citizens of a free republic; we now produce thugs who would gladly use the State to take from some and give to others, and expect to be thanked for their efforts.

How the Christians Stole Christmas

Back in 2005 Steve Kellmeyer wrote a pretty good indictment of the modern holiday season in two parts. He points out some stuff I didn’t really know (but have since confirmed), the most interesting of which is that the Christmas season didn’t stretch from Thanksgiving to Christmas Eve but from Christmas to Candlemas. This accords with my own sense of the seasons as an Orthodox Christian (Mr. Kellmeyer is a Roman Catholic): every feast is preceded by a fast, and followed by a festal season; thus it’s appropriate that Advent (or Christmas Lent, as we are wont to call it) be a penitential season of preparation and that Christmastide be a festal season.

It also makes sense from a social point of view (remember that for centuries Christianity was the backbone of society): give people a season of fasting immediately after the last harvests so that they don’t run through their winter food supplies too quickly, then when winter is half over relax the restriction so that they might have a little fun as spring approaches.

Kellmeyer also notes that Michælmas (the twenty-ninth of Septemeber) had become the day to settle rents and collect accounts. At first I wondered if this is why the government fiscal year starts in October, but it turns out that until 1976 it began in July. The Wikipedia entry on fiscal years does not that the tax year in the United Kingdom is based on the ecclesiastical calendar (in that instance, taxes are due on the Gregorian conversion of the Julian Annunciation).

Seven Medical Myths Even Physicians Believe

Courtesy of the New York Times comes this list of a few medical myths that even physicians believe: that one should drink eight glasses of water a day; that we use but 10% of our brains; that hair and fingernails continue to grow after death; that shaving hair causes it to grow back faster, dark or coarser; that reading in dim light ruins one’s eyesight; that eating turkey makes one especially drowsy; and the cellphones create considerable electromagnetic interference in hospitals. Just goes to show that even a degree is no guarantee of correctness.

Wednesday, 26 December 2007

Five Myths About the Middle Class

Economist Stephen Rose bursts five myths about the suffering middle class with some facts—something generally in short supply.

Predicting the Future

Back in 1989 Alan Kay (the creator of SmallTalk) gave a talk on predicting the future to the 20th anniversary meeting of the Stanford Computer Forum. It has many insights, but my favourite is that we predict evolutionary changes, not revolutionary ones.

An Introduction to Cluster Ballooning

Cluster ballooning is tying oneself to large numbers of helium balloons and flying therewith. This looks so fun.

Fifty Years Since Little Rock

This past September’s Vanity Fair had a great article about the legacy of the Little Rock school integration as seen through the life of Elizabeth Eckford. Reading all that now, it’s hard to imagine that people cared that much about something as stupid as preserving segregation.

Man Arrested for Defending Home

A Florida man defended his apartment against burglars; the police arrested him and let the burglars go. Why exactly are we paying for police forces which isn’t legally required to protect us, which doesn’t protect us and which stops us from protecting ourselves?

Christmas Past and Present

From the Joy of Tech, Christmas past and present.

The Write Stuff

Mark Bauerlein reviews Reading Literature Through Peace and War at West Point, a memoir written by an English professor at the United States Military Academy. The book sound interesting; the review is certainly worth reading in its own right. Its conclusion? Literature, history, and philosophy matter, and they do so less to students and teachers in the cozy quads of the college campus, ensconced in libraries and symposia, than they do to bedraggled, bored, and anxious officers sweating it out in the desert.

Hat-tip to Maj. D——.

Tuesday, 25 December 2007

How to Save Oil

Here’s an interesting fact: you save more gasoline going from 15 to 18 miles per gallon than from 50 to 100 mpg. This doesn’t seem to make sense at first—100 mpg is twice 50 mpg—but it’s actually true. The problem is that miles per gallon isn’t a linear measure. This is why in Europe they use litres per 100 kilometres (a somewhat ugly measurement, but that’s the Europeans for you); here we could use fluid ounces per mile.

Thus my car would get 3 ounces per mile, while a Toyota Prius gets 2.7 ounces per mile, a Honda Civic gets 4 ounces/mile, a Toyota Tacoma gets 5.6 oz/mi and a Dodge Durango gets a whopping 8 ounces per mile. Yes, that’s right: every mile you drive in a Durango burns an entire cup of gasoline!

A car which gets 15 mpg burns 8.5 ounces per mile; a car which gets 18 mpg burns 7.1—the switch saves 1.4 ounces/mile. A car which gets 100 mpg burns 1.3 ounces/mile, while one which gets 50 mpg burns 2.6—that switch only saves 1.3 ounces per mile.

This shows why averaging fuel economy figures just doesn’t work. Imagine a fleet with a dozen cars getting 14 mpg and one car which gets 48 mpg: the average fuel economy is 16.6 mpg which leads one to think that the fleet as a whole would burn 7.7 oz/mi. But convert those numbers to ounceage: 12 @ 9.1 oz/mi and 1 @ 2.7 oz/mi averages to 8.6 oz/mi—the fleet’s average mileage is really 14.9 mpg, not 16.6 mpg!

Miles-per-gallon is simply a deceptive unit.

-mas

We’re all familiar with Christmas (= Christ’s Mass), but do we recall the other old names for holy days? Here’s a brief list:

Childermas
The Feast of the Holy Innocents
Celebrated on the twenty-ninth of December, it commemorates the murder of children by Herod the Great in his attempt to kill Jesus.
Candlemas
The Feast of the Presentation of Christ
Celebrated on the second of February, it celebrates Christ’s presentation at the temple. In the West, it marks the end of the forty-day Christmas season.
Hallowmas
The Feast of All Saints (All Hallows)
Celebrated on the first Sunday after Pentecost (on the first of November in the West), this feast commemorates all the saints.
Lammas Day
Celebrated on the first of August, Loaf-mass Day is a harvest festival celebrating the first-fruits of the wheat crop; it’s traditional to bring a loaf of bread made from the new wheat to church on that day. It’s possibly a pagan survival, but I think it’s a commendable feast.
Michælmas
The Feast of Saint Michæl and All Angels
Celebrated on the eighth of November (on the 29th of September in the West), it commemorates archangels Michæl, Gabriel, Raphæl, Uriel, Selaphiel, Jehudiel, Barachiel and Jeremiel.
Martinmas
The Feast of St. Martin
This is celebrated on the eleventh of November. Interestingly, St. Martin was a Roman soldier and is considered a patron saint of soldiers, and his feast day is more widely known as Veterans’ or Armistice Day.

Those were all I could find. Anyone else have others?

Merry Christmas!

Joy to the world—the Lord has come. Let Earth receive her king. Today Christians across the world (well, those on the Gregorian calendar anyway) celebrate the birth roughly 2,000 years ago of God. Think about that for a minute: we’re celebrating the birth of God. How is that even possible? How can God who predates time itself be born? How can He who is larger than the universe be held in a womb, or in His mother’s arms? And yet that is exactly what we believe: that the eternal God entered time, incarnated Himself in the virgin Mary and was born, and that His becoming a man is what enables Θεωσις.

Christmas is one of the twelve great feasts of the church. What it is not is a day of giving, or sharing, or charity, or family or any other such claptrap. Those things are good and proper in their place, but they are not what Christmas is about. Christmas is most definitely not about materialist consumer spending. It’s God’s birthday, period. Certainly, it’s appropriate to celebrate that birthday by giving gifts to loved ones and strangers—but that gift-giving is not the reason for celebrating, and the celebration is not its own reason for being: the Nativity of Jesus Christ is the reason for celebration, and what more reason do you need?

Merry Christmas!

Monday, 24 December 2007

Unix Makes Computer Science Easy

I just found an article which details how Unix took a lot of difficult computer science stuff and made it easy for an end-user. Even in 1979, Unix had a lot of great capabilities. There are two problems: first, Unix hasn’t progressed very much since then; second, no-one else has even gotten this far (or at least, hasn’t gotten this far and succeeded). By now we should all be using Lisp machines; instead we’re all using technology that’s older than I am.

Effective Emacs

Jacob Gabrielson wrote a nice blog post giving some tips for effective use of emacs. I’ve managed to reduce my emacs start-up time from six seconds to one, which ain’t too shabby.

The World's Most Toxic Value System

Steven Dutch writes about Thar, the world’s most toxic value system. A good examination of a major source of the world’s problems.

Sunday, 23 December 2007

How Monopoly Helped Free POWs

It turns out that secretly modified versions of Monopoly contained escape kits during World War II. Very cool stuff: they hid compasses, metal files, silk maps and so forth in the boxes, then had the Red Cross deliver them to POWs. The Germans didn’t examine the board games very closely, and so the stuff made it through.

I wonder if the Red Cross colludes to help all POWs escape, though. That might not be the best long-term idea, as it’d discourage states from allowing Red Cross care packages to prisoners of war…

Hat-tip to my brother Tom.

Why Macros Rock

A lot of people don’t really understand why Lisp’s macros are so useful. I spent some free time this past week rewriting my beer tasting notes site, and here’s an example of an instance where Common Lisp’s object system and macros really came in handy.

A common need when writing CRUD web apps is to display one of a given class: information about a particular model of car, or an employee—or in my case, a particular brewer, beer, bar, style or whatever. After writing my first function I had something that looked like this:

(defun display-brewer (name)
  (let ((brewer (select 'brewer :where [= [name] name] :flatp t)))
    (if brewer
        (with-template (format nil "~a @ Tasting Notes" (name brewer))
            (modification-date object)
          (:table
           (:tr (:th "Average rating")
                (:td (str (if (rating brewer)
                              (make-sequence 'string 
                                             (rating brewer) 
                                             :initial-element #\*)
                              (htm (:em "No beers"))))))
           (when (plusp (length (notes brewer)))
             (htm (:tr (:th "Notes") (:td (str (notes brewer))))))
           (when (plusp (length (address brewer)))
             (htm (:tr (:th "Address") (:td (str (address brewer))))))
           (when (plusp (length (url brewer)))
             (htm (:tr (:th "Website")
                       (:td (:a :href (url brewer) (str (url brewer))))))))
          (when (beers brewer)
            (htm (:h2 "Beers") (:ul (list-objects (beers brewer))))))
        (progn
          (setf (return-code) +http-not-found+)
          (with-template (format nil "Error: Brewer ~a not found" name)
              nil
            (:p (fmt "Could not find a brewer named ~a." name)))))))

This looks pretty ugly if you don’t understand Lisp, but basically I just defined a function DISPLAY-BREWER which displays some brewer identified by a name. It does this by looking up (selecting) the brewer in a database; if it finds the brewer, then it’s displayed, else an error message is displayed instead.

The thing is, every single display function will look similar, indeed almost identical: to display a bar (also identified by a name), I’ll look it up by name, then if it is found I’ll display it, otherwise I’ll display an error message. DISPLAY-BAR would be:

(defun display-bar (name)
  (let ((bar (select 'bar :where [= [name] name] :flatp t)))
    (if bar
	(with-template (format nil "~a @ Tasting Notes" (name bar))
	    (modification-date object)
	  (:table
	   (when (food-rating bar)
	     (htm (:tr (:th "Food rating")
		       (:td (str (make-sequence 'string 
                                                (round (food-rating bar))
                                                :initial-element #\*))))))
	   (when (owner bar) (htm (:tr (:th "Owner")
				       (:td (:a :href (link (owner bar)) 
                                                (str (name (owner bar))))))))
	   (when
	       (beer-rating bar)
	     (htm (:tr (:th "Drink rating")
		       (:td (str (make-sequence 'string
                                                (round (beer-rating bar))
						:initial-element #\*))))))
	   (when (address bar)
	     (htm (:tr (:th "Address")
		       (:td (str (address bar))))))
	   (when (notes bar)
	     (htm (:tr (:th "Notes")
		       (:td (str (notes bar))))))
	   (when (url bar)
	     (htm (:tr (:th "Website")
		       (:td (:a :href (url bar)))))))
	  (when (beers bar)
	    (htm (:h2 "Beers")
		 (str (list-objects (beers bar)))))
	  (when (foods bar)
	    (htm (:h2 "Foods")
		 (str (list-objects (foods bar))))))
	(progn
	  (setf (return-code) +http-not-found+)
	  (with-template (format nil "Error: Bar ~a not found" name)
	      nil
	    (:p (fmt "Could not find a bar named ~a." bar name)))))))

You notice something? There’s an awful lot of repeated code. For example, over the two functions I call (make-sequence ’string SOMETHING :initial-element #\*) three different times. What this is actually doing is taking a number and turning it into the same number of stars, e.g. turning 4 into ****. The obvious thing to do is to define a function STAR-RATING which does that, so I do (and I change it to use MAKE-STRING instead of MAKE-SEQUENCE, and to always call ROUND, which does nothing to integers but will turning real numbers into integers):

(defun star-rating (number)
  "Return a string consisting of NUMBER stars.  If NUMBER is a float,
  returns that number rounded off."
  (make-string (round number) :initial-element #\*))

This turns (make-sequence ’string (rating brewer) :initial-element #\*) into (star-rating (rating brewer)); (make-sequence ’string (round (food-rating bar)) :initial-element #\*) into (star-rating (food-rating bar)); and (make-sequence ’string (round (beer-rating bar)) :initial-element #\*) into (star-rating (beer-rating bar)). This is a nice savings on typing, and makes the code more readable, although it could be better (STAR-RATING isn’t the best name in the world, but it’ll do for now). Just about every programming language out there can refactor commonly-used code patterns into functions like this; indeed, it’s a major use for functions.

How about the rest of the code? There’s another pattern there: looking up an object, then either displaying it or an error message which refers to the type of the object being displayed. There are a number of ways to handle this, but the cleanest is to write a macro DEFINE-DISPLAY (which uses a function GET-OBJECT I’ve defined elsewhere; its use looks like (get-object ’bar "Falling Rock")):

(defmacro define-display (class function &body body)
  `(defun ,function (name)
     (let ((,class (get-object ',class name)))
       (if ,class
	   (with-template (format nil "~a @ Tasting Notes" (name ,class))
	       (modification-date ,class)
	     ,@body)
	   (progn
	     (setf (return-code) +http-not-found+)
	     (with-template (format nil "Error: ~a ~a not found" ',class name)
		 nil
	       (:p (fmt "Could not find a ~a named ~a."  
                        ',class name))))))))

This takes that pattern and turns it into a macro; I can then re-use the pattern like this:

(define-display brewer display-brewer
  (:table
   (:tr (:th "Average rating")
	(:td (str (if (rating brewer)
		      (make-sequence 'string 
				     (rating brewer) 
				     :initial-element #\*)
		      (htm (:em "No beers"))))))
   (when (plusp (length (notes brewer)))
     (htm (:tr (:th "Notes") (:td (str (notes brewer))))))
   (when (plusp (length (address brewer)))
     (htm (:tr (:th "Address") (:td (str (address brewer))))))
   (when (plusp (length (url brewer)))
     (htm (:tr (:th "Website")
	       (:td (:a :href (url brewer) (str (url brewer))))))))
  (when (beers brewer)
    (htm (:h2 "Beers") (:ul (list-objects (beers brewer))))))

That’s obviously a lot more readable than the first DISPLAY-BREWER I created. What’s more, when I define DISPLAY-BAR, I just have to do this:

(define-display bar display-bar
  (:table
   (when (food-rating bar)
     (htm (:tr (:th "Food rating")
	       (:td (str (make-sequence 'string 
					(round (food-rating bar))
					:initial-element #\*))))))
   (when (owner bar) (htm (:tr (:th "Owner")
			       (:td (:a :href (link (owner bar)) 
					(str (name (owner bar))))))))
   (when
       (beer-rating bar)
     (htm (:tr (:th "Drink rating")
	       (:td (str (make-sequence 'string
					(round (beer-rating bar))
					:initial-element #\*))))))
   (when (address bar)
     (htm (:tr (:th "Address")
	       (:td (str (address bar))))))
   (when (notes bar)
     (htm (:tr (:th "Notes")
	       (:td (str (notes bar))))))
   (when (url bar)
     (htm (:tr (:th "Website")
	       (:td (:a :href (url bar)))))))
	  (when (beers bar)
	    (htm (:h2 "Beers")
		 (str (list-objects (beers bar)))))
	  (when (foods bar)
	    (htm (:h2 "Foods")
		 (str (list-objects (foods bar))))))

The display functions are reduced down to their essential core and I don’t have to keep re-typing (and possibly mis-typing) the fiddly bits which don’t change. There’s still a lot of work which I could still re-do (e.g. one common pattern seems to be (when THING (htm (DO-SOMETHING THING))); another is (:tr (:th HEADING) (:td DATA))), but this is a good first start.

And it’s why Lisp rocks: other languages have functions which let one re-arrange functional abstractions; what they lack are macros, which let one re-arrange syntactical abstractions. In Lisp I can take the actual body which changes and plug it into the unchanging skeleton; I can take the name of the class and plug it in so that I can refer to it in the body. It makes life very easy and simple.

How to Cook Everything

Late this summer I purchased Mark Bittman’s How To Cook Everything: Simple Recipes for Great Food.

Bittman first gives one a tour of the various cooking techniques (e.g. roasting, frying, boiling &c.) and details how they affect food; he covers essential equipment (there’s really not that much); he covers the basic theory of cooking meats & vegetables. That done, he proceeds to give lots and lots of recipes, many with a number of variations.

His recipe for fruit jam is simplicity itself, but it works wonderfully. His recipe for pheasant braised with apricots and prunes is delicious. His procedure for pre-cooking grains is simple yet tasty.

This could very well be the only cookbook you’ll ever need. If you don’t have a copy, get one. If you know someone who’s just started living on his own, get him a copy. It’s a good book.

Off-the-Record Messaging

Typical cryptographic software provides assurances that a message was sent by a specific sender; this is generally what one wants. But what if one prefers plausible deniability? Off-the-record messaging provides encryption and authentication for the duration of a conversation, but after the conversation is completed anyone can forge messages within that conversation, thus one can deny that one ever said anything.

This could be useful for whistleblowers, those living in oppressive regimes and so forth.

Friday, 21 December 2007

Tasting Notes Update

I've updated Tasting Notes, my database of beer, brewery & bar notes, once again. Please take a look and let me know what you think.

Meet the Fockers

Well, I finally got around to seeing 2004’s Meet the Fockers, a sequel to the amusing Meet the Parents. My verdict? Absolutely atrocious.

What’s right with this film? Certainly not the Mr. & Doctor Focker played by Hoffman & Streisand: they are abominable people. Not Stiller’s Gaylord Focker: he’s a brainless twit, a simpleton along for the ride. Not Teri Polo’s nonentity of a fiancée (so forgettable I cannot remember her character’s name). There’s something wrong when De Niro’s paranoid, controlling CIA retiree is the most fully-realised and sympathetic character in the movie.

I think that we’re meant to like the Fockers—but they’re unlikable. Bernie Focker is a moron who has a shrine consisting of his son’s ninth- and tenth-place ribbons; he’s the sort of annoying putz who desperately needs to be punched in the face for at least half an hour. Roz Focker is, frankly, a disaster. She, along with her husband, has no concept of appropriateness, nor of boundaries, nor of discretion, nor of decorum, nor indeed of anything befitting civilisation whatsoever. They live in the present, ignoring the past and pretending there’s no future. The two of them have no wit, no learning; indeed, the only thing separating them from voiceless beasts is their incessant speaking. My world would have been a better place had I never been introduced to them.

Indeed, I would have been a happier man had I never seen this film. If it were possible to induce amnesia, I would. I am poorer and dumber for having seen it. May God have mercy upon my soul.

Improvements to the American Legal System

Mark Steyn suggests some incremental improvements to the American legal system. Here are my own thoughts:

Elimination of plea bargains
Plea bargains do encourage defendants to plead guilty to lesser charges rather exercising their rights to jury trials and that is a miscarriage of justice. Plea bargains are often used at a prosecutor’s discretion for first-time or middle-class offenders; a better system would simply have straightforward first-time penalties. They are also used to encourage guilty pleas on lesser charges in order to get testimony on greater charges against some other defendant. This is pretty wrong, essentially paying one defendant to testify against another. A jury would look askance at a witness paid $500,000 by the prosecution; they should be as sceptical of a witness given a six-month plea bargain instead of a six-year sentence.
Elimination of technical charges
Steyn’s example is mail or wire fraud: the crime is not the crime itself but the crime of send a letter or authorising a bank transfer in the course of a crime. If there was a crime, let the jury convict on that charge. This to me is similar to convicting Martha Stewart not for insider trading but for lying to investigators (IMHO lying to investigators shouldn’t be a crime; it’s not sworn testimony, just talking): she didn’t actually commit the crime being investigated, but was sent to jail anyway—essentially for annoying agents of the state.
Elimination of prosecutorial advantage
Yes, yes, yes! One of the great features of the Anglo-American justice system is that the defense is advantaged: the defendant is presumed innocent; the prosecution presents a case first, and a defendant can simply move that no case was made; if a case was made, the defendant can respond. Steyn indicates that assets can be frozen by the prosecution, making it impossible for a defendant to pay for a good lawyer—that’s obscene. He also notes that unlike the rest of the trial (where the prosecution goes first and the defense always answers), closing arguments are ended by the prosecution. I remember how surprised I was by that when first I served on a jury: here was a trial where every benefit of the doubt and advantage was given to the defendant, and suddenly at the end all that was upturned. As Steyn notes, every civilised legal system allows the defendant the last word.
Elimination of massive indictments
Apparently prosecutors tend to charge as many crimes as possible in hopes that a jury will be psychologically persuaded to give some to the prosecution and some to the defense. This is quite possible, and if it is in fact true needs to be changed. On the one hand it would be very expensive to mount a defense against a dozen charges one at a time (with jury selections for each and so forth); OTOH it seems very wrong to set up a system that takes advantage of psychological weaknesses on the part of jurors to convict defendants.
Elimination of statute creep
Yes, yes, yes! This is seen all the time: unreasonably harsh laws are proposed, but we are assured that they will only be used against the worst of the worst (e.g. terrorists or drug dealers or mafiosi); then we get used to them and they start being used against other criminals; then they start being used against innocent people who have committed no crime but are annoying the State (e.g. the use of RICO against non-violent, non-criminal pro-life groups).
Elimination of double jeopardy
Yes, yes, yes! This is even in the Constitution, and yet it’s a common feature of the current legal system. It’s bad enough when a man can be found not guilty of criminal charges but found civilly guilty of the exact same crime (this is a miscarriage of justice); it’s even worse when the State convicts a man twice by using two separate arms (in the case Steyn mentions, the US Attorney and the Securities and Exchange Commission).

Be sure to read the entire article yourself; it’s worth it.

More Things from Mil

Mil Millington (of the profoundly popular Things My Girlfriend and I Have Argued About) has released his forty-fourth web vignette. Reading his stuff makes me rather glad to be single—and when you read it, you’ll see why. The green? They don’t sell them in green.

Thursday, 20 December 2007

Lakota Indians Secede

The Lakota Indians claim to have withdrawn from all treaties with the United States.

The United States Cavalry have no comment, but have put in a requisition for a weekend’s target practise, 700 tons of ammunition but—oddly—have not ordered any paper targets.

Beer Shortage

The Economist reports on the distressing American beer shortage. Hop and barley fields are being ploughed under to grow corn for ethanol (ironically, itself the product of grain fermentation just like beer).

Somebody please stop the madness! Save the beers!

The Most Expensive Coffee at Starbucks

Given a coupon for any drink free, Billy Chasen set about building the most expensive drink possible at Starbucks. He ended up with a 13 shot venti soy hazelnut vanilla cinnamon white mocha with extra white mocha and caramel for $13.76.

He Must be Rich...

or have one hell of a personality.

Suburban with a Minigun

Yes! Take a look at a Suburban with a built-in pop-out machine gun position. I want three.

Wednesday, 19 December 2007

Size: Code's Worst Enemy

Steve Yegge blogs about size being code’s worst enemy. He mentions how more advanced languages offer mechanisms to compress code size and announces what he believes the Next Big Language will be: JavaScript running atop the Java Virtual Machine.

I’ve just recently been learning some JavaScript; it’s a cool language with some neat features. I don’t know if I’d go so far as to call it Lisp in sheep’s clothing as some have done, but it is definitely nicer than a lot of languages. I’ve not used it enough to tell if it’s more powerful than Python or not, but I am led to believe by others that it is.

I sure don’t like going back to braces-and-semicolons code again; Pythons whitespace and Lisp’s parentheses are much nicer IMHO.

octopodial-chrome.com

Those of you who are observant may notice that this site now resides at octopodial-chrome.com. The old hostname latakia.dyndns.org should continue to work for the foreseeable future (i.e. for at least another year or so), but it automatically redirects to the new hostname. I’ve also replaced my old boring front page with this blog.

Why yes, I do rock—thanks for noticing!

Traveller 5 on CD-ROM

Traveller 5 is almost out, and a CD-ROM is now available with rulebooks and data. Looks to be pretty cool.

Beowulf and the Anti-Christians

Raymond Ibrahim tears apart the new anti-Christian Beowulf film. I’ve no desire to see this latest mishandling of the classic.

Tuesday, 18 December 2007

Mediaeval Diets 'Far More Healthy'

A British physician claims that mediæval men had better diets than their modern descendants. This isn’t exactly surprising, to tell the truth, but it is nice to have confirmed. If you’re interested in details of mediæval cooking, I can recommend the following books:

Pleyn Delit
Pleyn Delit is the first mediæval cookbook I bought, and it’s an excellent one. All recipes are presented in two versions: the exact original (in Middle English, vulgar Latin, Old French or whatever) and a modern redaction. Having the original there enables one to do one’s own redaction if the modern one is unsatisfactory, or if one suspects it makes some unwarranted assumptions.
Take a Thousand Eggs or More
Another very good one in two volumes. The first volume consists of original recipes and redactions, the second of original recipes only, the assumption being that the reader will have gained enough skill with Volume I to do his own work with Volume II; this is a great scheme and one which I heartily approve of. This makes the perfect gift for the mediæval cooking enthusiast on your list.
The Medieval Kitchen: Recipes from France and Italy
My mother gave me The Mediæval Kitchen (for Christmas, I believe) and before I opened it I was afraid that it’d be something execrable like Fabulous Feasts (which has set back living history a generation with its recipes full of New World ingredients); I was pleased to discover instead that my mother had done her research and found a book whose authors had done the same. It’s really good, with lots of recipes and historical notes. I’ve it sitting on my coffee table right now.

Hat-tip to my brother Tom.

Thursday, 13 December 2007

The United States are Living Beyond Our Means

The Comptroller General of the Unites States has released a scathing video about America’s financial system. The numbers are bad, very bad. We’re looking at $156,000 per man, woman and child in liabilities. Apparently the Medicare increase incurred more expense in one blow than the entire United States have since the founding of the republic. We’re in bad trouble—and not a single politician seems to care. Except maybe for Ron Paul.

Watch this video. If we don’t solve this problem, we are going to have massive problems. Watch this video.

Bacon Chocolate Chip Cookies

It sounds disgusting, but it could work: bacon chocolate chip cookies. Sounds like one of Hervé This’s ideas.

Wednesday, 12 December 2007

Flying Men

Wouldn’t it be cool to fly without a parachute? It’s starting to become a reality, although the technology isn’t quite there yet. Here’s a video of a flying man. It’s a new extreme sport!

The Programmer Dress Code, Again

Justin Etheredge has even more crazy-looking programmers. You see, it’s imperative that I have long hair and a beard; it’s the norm for my culture and profession.

Misunderstanding Free Software

GetGNULinux.org corrects some misunderstandings about free software and demonstrates why it’s so important for you as a user to demand your freedom.

Tuesday, 11 December 2007

Solving the Library Problem

Those of us who read a lot accumulate a great deal of books (according to LibraryThing I have 438); how does one categorise and shelve them? My own system is rather esoteric (deliberately so); one man and his wife had 3,500 books and came up with a cool solution to the problem utilising off-the-shelf software, a barcode scanner, new shelving and other nifty stuff.

World War II in Colour

A collection of Second World War pics—the difference? They’re in colour!

A Guided Tour of Emacs

The Free Software Foundation has a guided tour of emacs up. Emacs, of course, is the absolute best text editor ever written.

It's Not Necessarily About Dynamic Languages

Chuck at nothing happens writes that the dynamic/static computer language controversy is more than a little artificial. I gotta be honest—I think that dynamic languages are more useful for exploring code before one knows what one needs to do (kinda like an artist’s pencils). But I understand that some of the new static-ish languages offer some features like type-inferencing which give one a lot more latitude to experiment; perhaps they’d be good in that case.

Then of course there’s the whole issue of what one means by dynamic and static…

M16/AR-15 failure Guide

The Army of the United States has kindly provided us with a study guide to common failure modes of the M16 (or AR-15, as the civilian-legal version is know). Useful knowledge no matter what sort of weapon you shoot.

Hat-tip to my buddy Capt. V——.

Making Bacon

Blog Sober has a record of making homemade bacon. I really, really, really want to do this. Bacon may not be good for one, but it tastes oh so good.

Monday, 10 December 2007

Brawndo: The Thirst Mutilator

A few years back Mike Judge released an excellent film called Idiocracy with Fox; Fox didn’t support it and it died. But now Fox are supporting Brawndo, a joke from the film. A satire of energy drinks. So what is this product based on a satire of energy drinks? It’s…an energy drink.

Saturday, 08 December 2007

60 Things Worth Shortening Your Life For

From Esquire comes this list of sixty oh-so-fun-to-do but oh-so-bad-for-you things.

The Power of a Checklist

Atul Gawande writes about a revolutionary development in medicine, one which reduces ICU stays by half and which increases patient survival rate. The development? A simple checklist. Yes, it turns out that having physicians follow a checklist and giving nurses the power to keep them to script is a sure-fire way to improve treatment.

An incredibly good article.

Police Assault Woman, Charge Her with Resisting Arrest

In New South Wales, police assaulted a woman, searched her bra and underwear in public and, finding nothing, charged her with resisting arrest. Because, of course, a little 64-year-old is capable of resisting anything.

A Survey of Common Lisp Implementations

Daniel Weinreb—one of the early luminaries of the Common Lisp community—has conducted a survey of Common Lisp implementations. Pretty good stuff; worth reading if you’re a Lispnik.

[