Observations RSS

Archive

Nov
7th
Sat
permalink
People shop for a bathing suit with more care than they do a husband or wife. The rules are the same. Look for something you’ll feel comfortable wearing. Allow for room to grow.
— Erma Bombeck (via thoughtsdetained)
permalink
Nov
6th
Fri
permalink
Nov
5th
Thu
permalink
Nov
3rd
Tue
permalink
Nov
2nd
Mon
permalink
Oct
31st
Sat
permalink

lesspipe: what a good idea!

How have I been using unix systems for over a dozen years and only now discovered lesspipe?  You just put

eval $(lesspipe)

in your .bashrc and suddenly less stops warning you that the pdf or tarball you asked it to less is a binary file, and starts doing what you mean, vis, pdftotexting or untarring it for you.

Works by file extension, and lets you configure your own filetype filters.  Fifteen lines of copy/paste from the manpage plus one line of change got it handling odt files using odt2txt.  It just needs an image to ascii converter and a code pretty printer.  Maybe even a reader for those proprietary formats people keep using for some reason.

http://freshmeat.net/projects/lesspipe/

Oct
28th
Wed
permalink

It's time for a game of ... "Bug or Feature?"

def foo():
    keepnames = []
    for name in ["one", "two"]:
        def keepname():
            name_copy = name
            print "my name is",name,"or",name_copy,"and my locals are", locals()
        keepname.name = name
        keepname()
        keepnames.append(keepname)
    return keepnames
nameds = foo()
print "Later..."
for kn in nameds:
    kn()
    print "its name is "+kn.name
    

print "Now with default parameters:"

def foo():
    keepnames = []
    for name in ["one", "two"]:
        def keepname(myname=name):
            print "my name is",name,"or",myname,"and my locals are", locals()
        keepname.name = name
        keepname()
        keepnames.append(keepname)
    return keepnames
nameds = foo()
print "Later..."
for kn in nameds:
    kn()
    print "its name is "+kn.name

You were desperately hoping that this would all be sane, but the output is:

my name is one or one and my locals are {'name_copy': 'one', 'name': 'one'}
my name is two or two and my locals are {'name_copy': 'two', 'name': 'two'}
Later...
my name is two or two and my locals are {'name_copy': 'two', 'name': 'two'}
its name is one
my name is two or two and my locals are {'name_copy': 'two', 'name': 'two'}
its name is two
Now with default parameters:
my name is one or one and my locals are {'myname': 'one', 'name': 'one'}
my name is two or two and my locals are {'myname': 'two', 'name': 'two'}
Later...
my name is two or one and my locals are {'myname': 'one', 'name': 'two'}
its name is one
my name is two or two and my locals are {'myname': 'two', 'name': 'two'}
its name is two

So: Is it a bug, or is it a feature?

Oct
26th
Mon
permalink
Oct
21st
Wed
permalink

Vote, as if the fate of the world depended on it!

Friends,

Our fair city of Cambridge, affectionately “the People’s Republic of Cambridge”, is holding municipal elections on Tuesday, November 3rd.  The definitive website for quickly familiarizing yourself with the basics of each candidate is wickedlocal’s survey:

http://www.wickedlocal.com/cambridge/town_info/your_vote

(you have to click on the candidates’ pictures to get at the substance)

I know only a little about the politics of the city, read the news, have attended some council meetings, but the major issue seems to be (and this is admitted by most of the candidates) that the elected officials of the city (the council) are somewhat impotent at the hands of an entrenched appointed city manager, Robert Healy, who has made some absolutely disastrous fiscal decisions, partly in salaries (e.g. he is paid over 300k), partly in the Gates case (he hired some friends to … make recommendations), and a large part of it to do with an employment discrimination case against the city brought by Malvina Monteiro, in which the city appears entirely guilty, and which he has spent enormous sums of money fighting.

http://www.google.com/search?q=malvina+monterio+cambridge

The candidates fall into the camps of 1. Healy loyalist, 2. folks who want to change the city charter to at least give the council power over the formation of committees, 3. folks who want to kick Healy out, and 4. the requisite nutjobs.  Voting is by ranking, and I plan to vote for the following mix of those folks (listed alphabetically) with some yet to be determined ranking:

  • Lawrence Adkins (um… idealist?)
  • Leland Cheung (MIT alum)
  • Silvia Glick (Attorney, maybe my top choice)
  • Neal Leavitt (BU philosophy prof.)
  • Charles Marquardt (BU law prof.)
  • Kenneth Reeves (incumbent)
  • Minka vanBeuzekom (sensible)
  • James Williamson (knowledgeable nutjob)

I look forward to hearing your ranking suggestions and other opinions!

I know even less about the school committee, and just reading the texts, there appears to be just one nutjob (Stead), and a whole host of bright, dedicated people.  I’m really impressed.  My favorites, again, just from the responses they provided, are Richard Harding and Nancy Tauber.   There appears to be an issue facing the next school committee asking them to balance the benefits of having dedicated subject teachers at a new facility for middle schoolers against the too few students that would remain at local elementary schools if the middle schoolers got their own facility.  Many candidates want to make the decision vewy vewy cawefuwwy or simply oppose the new middle school, but both Harding and Tauber had a bit more nuance in their responses.  Again, I welcome your input!

Grem

p.s., unless you’re reading this on Facebook, email me to comment.