Tuesday, March 31, 2009

Building git from Source on Ubuntu 8.10 Hardy Heron

VMWare supports Hardy Heron as a guest operating system in Fusion 2, so that's what I use for Linux work.  The Hardy Heron version of git is 1.5.6.3 though, and today's version is 1.6.2.  Here is what I did to build git 1.6.2 from source.  It is a mix of command line and GUI tools

  1. Using the Synaptic Package Manager, mark git-core for installation and verify that zlib1g, zlib1g-dev, libexpat1, libexpat1-dev, and curlInstall git-core from the Synaptic Package Manager.
  2. Open a terminal window, make the directory that you want to hold the git tree (I used ~/work), change to that directory, and invoke git clone git://git.kernel.org/pub/scm/git/git.git
  3. Using the Synaptic Package Manager, remove git-core and install if necessary tk, libcurl4-openssl-dev, zlib1g, zlib1g-dev, libexpat1, libexpat1-dev, and curl.
  4. In the terminal window, change to the directory where you cloned git.
  5. make prefix=/usr/local all
  6. sudo make prefix=/usr/local install

Sunday, January 18, 2009

Base class ReferenceProperty in AppEngine


Google AppEngine






Mixed polymorphic and monomorphic classes


from google.appengine.ext import db

from google.appengine.ext.db import polymodel



class Base(db.Model):

  date_added = db.DateTimeProperty(auto_now_add=True,auto_now=False)



class Person(Base):

  name = db.StringProperty()



class Item(Base, polymodel.PolyModel):

  owner = db.ReferenceProperty(Person, collection_name="stuff")

  motive = db.StringProperty()



class Book(Item):

  title = db.StringProperty()



class Weapon(Item):

  name = db.StringProperty()

  battleground = db.StringProperty()



p = Person(name="Barack")



p.put()



Book(title="Quantum Mechanics", owner=p, motive="Curiosity").put()

Weapon(name="Wit", battleground="Debate", owner = p, motive="Education").put()



b.put()



for x in p.stuff:

  print "%s: %s" % (x.motive, x.date_added)




Tuesday, January 13, 2009

PEP 8 is prescriptive about the preferred location for import statements:
Imports are always put at the top of the file, just after any module
comments and docstrings, and before module globals and constants.
This has bugged me. I think it reminds me of the "include the world" messes I saw in C++ code that resulted in massive overdependency and lengthy recompilations. With the import remote from the use, it is easy for crud to accumulate. Someone writes a tiny method (for debugging, as an experiment, for a one-off) that uses something used nowhere else in the module and now everything in the module is (lexically) dependent on that import, and so is the module's every consumer. Ugh.

I wonder what the rationale is. A benefit is that missing modules will be discovered early: "cannot import" complaints will appear at startup, not after a possibly lengthy time of apparent stability when a rare event occurs. A drawback is that some refactoring, e.g. moving a class to its own module, is tricky to do perfectly. If I copy the entire import block to the new module, it is guaranteed to work, but there is a good probability that that block will be more than necessary, because the module was a candidate for refactoring in the first place.

So I prefer import statements to go in the class; and the basis of this preference is that I think of the class as the unit of reuse, not the module; and I think that because I am still speaking Python with a C++ accent.

Wednesday, November 19, 2008

I wonder if Somali pirates read Illuminatus.

Wednesday, November 12, 2008

The Kos diarist eugene has written an excellent summary of the arguments against mandatory health insurance as a means of achieving universal health care.

Sunday, November 02, 2008

Ecch.  "Maintaining user perferences after an email change" is not supported in the current Google AppEngine API.  Personal identity is tricky for the philosophers, and also for the grunt programmers who wish to implement signons.

Maybe OpenId instead of the Google User API?

Saturday, October 18, 2008

This anecdote by Thomas Bernhard resonates with the current crisis. This was the first I've heard of him.

Friday, October 10, 2008

George Soros on the advantages of the Danish mortgage model

I like this as much as the Swiss mortgage model.

Friday, October 03, 2008

From 2002: Recipe for conjuring a housing bubble with fiscal & tax policy.


Does one follow a recipe to conjure, or is the term "spell"?

The next four years are in his hands

2008.10.02 - 538 VP Debate-11
2008.10.02 - 538 VP Debate-11,
originally uploaded by Brett 538.
The black and white gives a patina of timelessness, don't you think?

Customers as investors


A restaurateur funds expansion from future customers. A principle of accounting is that costs should be matched to the period of benefit, and this mechanism works on this level. One risk is that enthusiastic customers might use their Comfort VIP cards too quickly, before the working capital represented by VIP Card balances can be replace from retained earnings.

Thursday, October 02, 2008

Image889


Posted by ShoZu

Natural science offers a respite from fretting about politics and markets. Welcome to the sea slug forum.

Sunday, September 21, 2008

If anyone has a French translation of Black Angel's Death Song, I would like to see it.

So far I have:

La myriade de choix de son destin
Set d'eux-mêmes sur une assiette
Pour lui de choisir
Qu'est-ce qu'il a à perdre

Pas un fantôme ensanglanté pays
tous couverts de sommeil
...

I like the twist of the meaning in line four from "What had he to lose," to "What he has to lose."

Sunday, September 14, 2008

SlickEdit for Linux (Ubuntu) has incomplete support for Perforce out of the box. The Manager command is missing. The Get command is broken.

Even after I set the Manager command (to p4v), the option is grayed out on the popup menu within the project.

Friday, July 18, 2008

I do not understand what it is about Al Gore that gets up the nostrils of the Cafe Hayek bloggers. Both Russ Roberts and Don Boudreaux are bright guys, but if Al Gore is involved, the quality of their arguments plummet.

In this particular story, we see Russ Roberts, a professor of economics, praising this line of reasoning:

  1. Al Gore proposes a national goal of generating all U.S. energy from renewable sources.
  2. The Pickens Plan is to generate one-fifth of U.S. energy from wind, natural gas, and biofuels, for an investment of one teradollar.
  3. Therefore, the Al Gore proposal will cost at least five teradollars.
  4. Bonus point: The Al Gore proposal is as fanciful as a lunar casino.


The conclusions are not supported by the premises. There is no evidence showing a necessary relationship between the Al Gore proposal and the Pickens Plan that would permit the cost of one to be used to compute the cost of the other. Russ Roberts would never let such logic-chopping go by in a student paper - would he?

Monday, April 07, 2008

I don't know Enrico Zoni, but I like the polite way he comments on Python's idiosyncratic commands module.

Thursday, April 03, 2008

The text search tool in SlickEdit 2008 has been renamed from grep to sgrep. Allegedly this was done to avoid conflicts with cygwin grep.

Monday, November 12, 2007

A defense of the Clintons as politicians.