Blog: 2009-05

Latest  2014  2013  2012  2011  2010  2009  2008  2007  2006  2005  2004  2003  2002  2001
-12  -11  -10  -09  -08  -07  -06  -05  -04  -03  -02  -01


I just made a quick plt-dir-enema script, which I expect to need more than once:

This simple shell script for Unix/Linux empties out your ~/.plt-scheme directory of everything except your file. This is a good way to fix corrupted PLaneT caches or remove sets of PLaneT packages that keep reinstalling each other on uninstall.

As with most things, 'figured I might as well toss it up on the Web.

There will be no graphic art for this blog entry.

New Desk Installed

 [photo of office with IKEA MIKAEL desk] Lulls in consulting work are a good time to spiff up the ol' home office.

The new desk from 2009-05-23 is installed. The home networking gear is moved out of the bedroom closet. No longer have to drape CAT-5 from bedroom, through kitchen, to office, every time I need to print. alyssa the LaserJet from 2004-05-27 is still going strong after five years.

Needs a plant, a better chair, and maybe a wall color that better complements the IKEA Birch Effect.

sicp-plt 1.13

I released a new version of SICP support in PLT Scheme with fixed streams support. Thanks to Vinay Sachdev for reminding me.

Quack 0.36

 [screenshot of test suite code with keywords fontified in Emacs] I've released Quack 0.36 with one useful small change: PLT-like #: keywords are colored in a subdued gray, to keep them from visually dominating your code.

Farmers' Markets

 [old bad photo of farmers at farmers' market] Someone just mentioned the cost of high-quality food.

The farmers' markets are now in season. You can typically get fresh, organically-grown produce from local growers, as well as things like bread, pastries, and cheese.

There are five in Cambridge (MA, USA) alone. In Massachusetts, check out the list of locations and times at the Mass. Dept. of Agricultural Resources site.


 [video capture of young child playing with nesting wooding boxes] "The Maggie Sort Algorithm," posted to YouTube by johnzwarich.

Specialized to a class of sequences, and employs sorted subsequences and random selection.

Turn Household Junk into Cash, Fast

 [photo of keyboard parts] In three easy steps, with the exclusive information in my exciting new winners kit. Put yourself on the road to financial success for just $9.99 plus shipping and handling, if you order now.

My latest exploit came after I sold my old, broken ThinkPad X20 laptop. I still had an extra keyboard for it with a broken keycap and a near-dead left TrackPoint button. I thought I'd sell it for parts, but the lint, hair, and stuff trapped beneath the keys could not be blown out. So I ended up selling it as replacement keycaps. When one is underemployed, an hour spent carefully disassembling a keyboard, for a few dollars, is a few dollars of pure profit.

One of my other recent scores in the "liquidate household junk" venture was selling the coffee table with perpetually tacky glaze to someone who was willing to refinish it. I only got $5 for the table, but selling the matching end tables with it covered the materials from my screw-up with the epoxy.

I've also been selling books I don't need. Not all books sell online, but one can make at least a dollar per book on ones that do.

PostgreSQL Interface for PLT Scheme

I'm implementing yet another PostgreSQL interface for PLT Scheme. I did about half of the initial coding of the libpq low-level interface bindings yesterday. I'm developing it with PostgreSQL 8.3.

Too Easy in Scheme

 [screenshot of repeat code in DrScheme Macro Stepper] I glanced at the Reddit self.programming forum over dinner, and noticed the provocative title, "Anything like this out there in the programming world? (See comments)". Curiosity piqued, I clicked. Sadly, some very new programmer was wanting repeat-n-times special syntax.

I'm not a big fan of gratuitous special syntax, and repeat-n-times with no other control or functional data actually occurs only rarely. But the commenters seemed to think this was a difficult problem, and were posting solutions such as unhygienic CPP macros.

Anyway, to promote Scheme, I banged out a trivial and hygienic repeat syntax, per request. This repeat is one of the easiest things to do in Scheme syntax extension. A Scheme programmer who is a beginner to syntax-rules would have little trouble whipping it up.

(define-syntax repeat
  (syntax-rules ()
    ((_ TIMES BODY0 BODY1 ...)
     (let loop ((i TIMES))
       (if (>= i 1)
           (begin BODY0 BODY1 ... (loop (- i 1)))

You can see it work in the DrScheme Macro Stepper.

HtDP and SICP: Together at Last

 [screenshot of DrScheme splash screen showing SICP icon] The SICP support in PLT Scheme is up to version 1.10 already, and finally has an icon for the DrScheme splash screen.

DrScheme chose to line up SICP right after HtDP; that was not my doing.

Guess What Was On Sale?

 [photo of six different boxes of Tofurky slices in fridge] Tofurky slices were on sale at Harvest Co-op (Cambridge, MA, USA).

I had to get one of each variety.

Back when I was omnivorous, I went through a turkey sandwich phase lasting for a year or three. I'd get turkey from the deli counter, and sometimes eat turkey sandwiches three or four times a day. This was after a couple years of surviving mostly on ramen noodles, so turkey sandwiches were quite satisfying and nutritious by comparison. Perhaps it was the tryptophan. Perhaps I shouldn't call that "omnivorous."

Anyway, one day, in the space of a few minutes, for no good reason, I decided to go vegetarian. My diet had already diversified beyond just turkey sandwiches, but turkey sandwiches still held a special place in my heart. Having sampled various veggie-safe imitation turkey products, I can tell you that they're a different beast (pardon the expression) than the real thing. However, the Tofurky roast is a good holiday substitute for one of those processed turkey loafs, and the Tofurky slices are superior to the packaged (not deli) sliced 'meat' products that I recall.

A girlfriend from omnivore period, met for lunch years later, upon hearing I'd gone veg, blurted out in mock alarm: "But what about turkey sandwiches?!" Now you know.

(Photography note: with real gear, I'd set up fill flash or a reflector, or at least expose for the boxes. But I just can't be bothered with the pocket point&shoot, and I don't know a satisfactory way to diffuse the tiny little on-camera. Oh, I'd probably also disable the fridge light, so that I didn't have to gel the strobes to match color temp.)

Making SICP Support in DrScheme Smooth

 [screenshot of DrScheme with a SICP-specific error message] I started working through SICP to assemble a regression test suite for SICP support in PLT Scheme. Only through section 1.2, I've already found a few missing procedures, and have added them. I also made the random procedure special-case an error that briefly had me assuming I did something wrong. The new error message:

You called "(random 0)". If you're doing SICP section 1.2.6, don't use 1 for the first argument of "fast-prime?".

Please feel encouraged so send me more tests, and to tell me what additional error messages would be helpful to people working through SICP.

Brazil Nuts

Brazil nuts are an effective means of spoiling an otherwise perfectly good selection of mixed nuts.

Not only are they too big and they don't taste all that good, but:

The saturated fat content of Brazil nuts is among the highest of all nuts, surpassing even macadamia nuts[citation needed] ...

Wikipedia: Brazil nut

I have nothing against Brazil or Brazilians; I just don't like their nuts.

Even Good, Odd B-AA-AAA-d

When I did photography, I had a fleet of NiMH AA batteries and three chargers. One of the things I was careful to do was to keep the batteries together in sets of four, so that they'd wear and charge evenly.

Nowadays, I need AA batteries only for household devices. I sold all but one of my chargers and all batteries except for the Sanyo Eneloops. I added some AAA Eneloops.

The Eneloop charger that I kept recharges only in multiples of two at a time. Unfortunately, I have at least three devices that take three or one AA or AAAs.

I have not thought of a good way to keep my battery sets wearing and charging evenly with the Eneloop charger when they use odd numbers of batteries. It's not just the recharger: non-rechargeable alkaline AA and AAA are almost always sold in multiples of two.

If you are designing an AA or AAA-powered device, I discourage using odd numbers of AA or AAA. If you are buying a device, I suggest penalizing ones that use odd numbers of AA or AAA. If you find an affordable NiMH charger that is guaranteed to do the right thing with odd numbers of Sanyo Eneloops, please let me know.

Update: Title is a gratuitous Animal Farm reference.

More 4am Gritty Cambridge

In the continuing saga of the dark side of Cambridge (see 2009-05-07), at approx 4:20am this morning, I hear the screech and thud of an auto accident. I run out my door with fire extinguisher while dialing 911. (I'm pretty slow-witted at this hour, so it takes me longer than it should, and then I'm blanking on the name of one of the cross streets.)

This being Cambridge at 4am, nobody is hurt, the drivers and passengers are all standing around having amiable conversation, 911 says they've already been alerted, and a guy coming up the sidewalk hurriedly while talking on his phone checks with me that everyone is OK.

Batman would be bored to tears here.

CoinStar Windfall

 [photo of screen of CoinStar machine] I don't like to carry coins. The ones that don't go to tip jars or panhandlers get emptied immediately from my pocket when I get home. Quarters go in the laundromat jar, and smaller coins go in the other jar.

The other day, I cashed out my small coinage stockpile. $40.98 from the CoinStar machine (after their $4 cut) buys a week's work of groceries, which is nothing to sneeze at.

What Passes for Gritty Mean Streets in Cambridge

Up early this morning, I think I might've seen a middle-aged woman trying to pass (what looked like, in the briefest glance I got) a comically fake $100 bill at a convenience store at 4:30am.

My first thought: "Photo-- no camera in pocket, sigh." Then the guy seemed to have it under control, politely examining the paper while giving backchannel cues in a thick accent to her tortured pitch. So, I just left.

No phone, neither, I realized, so the question of whether or not calling the local police would be appropriate was irrelevant.

Always have a camera.

SICP Support in PLT Scheme

 [partial screenshot of DrScheme Choose Language dialog] My work-in-progress on polished SICP support in PLT Scheme is now available.

If you'd like to work through SICP using DrScheme, please give this a try and let me know anything that can be made more smooth for students.

Hunt for Golden Shoes in Cambridge

 [photo of Golden Shoe and tag outdoors] Alert any kids you know in Cambridge (Mass., USA) that May is Hunt for Golden Shoes month.

Golden Shoes is an outreach project of the City of Cambridge to encourage people to get out, walk around, and be active. It's somewhat like a month-long Easter egg hunt, in which shoes painted gold are hidden throughout Cambridge in places where people might find them when out walking. Anyone who finds a shoe can redeem it for a prize. Additional shoes are hidden throughout the month, so there is incentive to go for a walk around every day.

Note: Photo is of shoe before being hidden elsewhere, in an undisclosed location.

Disclosure: I helped recruit sponsors and hide shoes this year.

Want to Work through SICP in DrScheme?

 [screenshot of DrScheme showing use of SICP Language] We're trying to make DrScheme a polished platform for students working through SICP.

If you want to help polish this by working through SICP using it, please see today's post to the plt-scheme list.

Alvin Ailey in Boston Now

 [photo of two Alvin Ailey dancers] If you're in Boston, and do not yet have tickets for this visit of Alvin Ailey American Dance Theatre, tickets are still available.

(Photo: Alvin Ailey American Dance Theatre)

Earlier to... 2009-04

© Copyright Neil Van Dyke      Contact