Filed under Boston, Code, Free Software, Life, Photos, Tips by adam | November 11, 2007 | 1 comment
I’ve been playing around with Gallery and wpg2. I’m still a bit puzzled attempting to integrate Gallery and Wordpress. I’ve resolved most issues; the main remaining issue is to display images in the Ajaxian theme without running over the borders in the Ajax/slideshow views. Also, the embedded image apparently doesn’t render in the RSS feed. Update: I’ve given up on the G2 tinymce plugin and the WPG2 tag for now and just hardcoded the image and album URL. Update 2: now the embedded image is working again for no good reason. Suggestions on the entire configuration are welcome.
In any case, I took some pretty photos today in our back yard (use left and right arrow keys to scroll through images after clicking on the one below — I still can’t get the navigation icons to appear):
Before: Proof of Spring 2007.
Technorati Tags: Autumn, Foliage, Trees, Wordpress, WPG2, Gallery
Share This
Filed under Code, Free Software, Patent Law by adam | June 25, 2007 | 0 comments
The Search Keys extension for Firefox is perhaps my favorite plugin. I tweaked it so it will work with Google Patent Search as well. The only additional code needed is in the searchkeys.js file:
{
name: "Google Patents",
test: function (uri) { return uri.host.indexOf("google") != -1 && uri.path.substr(0,9) == "/patents?"; },
testLink: function (linkNode) { return (linkNode.className == "big"); }
},
I added a new minor version number and posted it here for download. Hopefully the patch will be adopted upstream.
Share This
Filed under Code, Free Software by adam | June 11, 2007 | 2 comments
In case this blog hasn’t been meeting its geekiness quota, I present the following. Ken (who deserves to be better known in the blogosphere and elsewhere) wrote a Haskell program to solve Sodoku with a single SQL query:
SELECT * FROM values AS aaaa, values AS aaab, values AS aaba, values AS aabb, values AS aabc, values AS aaca, values AS abab, values AS abba, values AS abbb, values AS abbc, values AS abcb, values AS abcc, values AS acba, values AS acbc, values AS acca, values AS accc, values AS baaa, values AS baac, values AS babb, values AS babc, values AS bacb, values AS bacc, values AS bbba, values AS bbbc, values AS bcaa, values AS bcab, values AS bcba, values AS bcbb, values AS bcca, values AS bccc, values AS caaa, values AS caac, values AS caba, values AS cabc, values AS cbaa, values AS cbab, values AS cbba, values AS cbbb, values AS cbbc, values AS cbcb, values AS ccac, values AS ccba, values AS ccbb, values AS ccbc, values AS cccb, values AS cccc WHERE aaaa.v <> 3 AND aaaa.v <> 9 AND aaaa.v <> baaa.v AND aaaa.v <> 4 AND aaaa.v <> bcaa.v AND aaaa.v <> caaa.v AND aaaa.v <> cbaa.v AND aaaa.v <> 8 AND 3 <> 9 AND 3 <> baaa.v AND 3 <> 4 AND 3 <> bcaa.v AND 3 …
(edited for brevity)
Share This
Filed under Code, Free Software, This Weblog, Weblogs by adam | May 28, 2007 | 4 comments
Just upgraded to WordPress 2.2. That took all of 18 seconds.
Share This
Filed under Code, Culture, Music, Technology, The Law by adam | May 14, 2007 | 2 comments
Not to be missed: well-known enfant terrible James Grimmelmann is guest-blogging on PrawfsBlawg. His opening commentary on the relationship between law practice and computer science:
Practicing lawyers, like practicing programmers, are professional pragmatists. Both must make their cases (and case mods) out of the materials they have available; both starve or eat steak depending on whether their creations work. The day-to-day practice of law is unlikely ever to require much high theory. We can mourn that fact because it means that they look at us with suspicion, or celebrate it because it frees us to chase Truth and Beauty—and it will remain a fact either way.
Aside from the fact that I don’t eat steak, I think this is correct.
Via a commenter on James’ entry, I learned that the 7th Circuit Court of Appeals is implementing a wiki (the entry page could surely use some more content). Surprisingly, it was not Posner but Easterbrook who spearheaded the effort. This is a very interesting development, but I expect it will be quite a while before any other circuit takes up the idea.
Finally, I have been meaning to write about this New York Times story describing Jonathan Coulton’s success as a musician breaking with the traditional distribution /promotional channels (via 43 folders, a productivity blog that is still on my “probation” list). Unfortunately, slashdot beat me to it. I first re-discovered Jonathan Coulton during his guest episode of the Show with Ze Frank. In any event, the article is well worth reading:
More than 3,000 people, on average, were visiting his site every day, and his most popular songs were being downloaded as many as 500,000 times; he was making what he described as “a reasonable middle-class living” — between $3,000 and $5,000 a month — by selling CDs and digital downloads of his work on iTunes and on his own site…
Coulton realized he could simply poll his existing online audience members, find out where they lived and stage a tactical strike on any town with more than 100 fans, the point at which he’d be likely to make $1,000 for a concert. It is a flash-mob approach to touring: he parachutes into out-of-the-way towns like Ardmore, Pa., where he recently played to a sold-out club of 140….
In total, 41 percent of Coulton’s income is from digital-music sales, three-quarters of which are sold directly off his own Web site. Another 29 percent of his income is from CD sales; 18 percent is from ticket sales for his live shows. The final 11 percent comes from T-shirts, often bought online…
Share This
Filed under Code by adam | October 15, 2006 | 2 comments
Today I released version 0.60 of randomplay, my command-line shuffle-recall-swiss-army-knife music player. It will never make Winamp users happy, but it’s a good substitution for complex combinations of find/grep/xargs/sort that people sometimes use to pick tracks to play. If you can’t see why you’d use it, you probably don’t need it.
The latest version adds two new command-line options, —older-than and —newer-than. These can be used to limit the songs included in the shuffle on the basis of the file modification date. The syntax is fairly flexible, and resembles that used by rdiff-backup for restoration commands. For example:
Randomly play music under the ~/music directory that were added in the past week:
randomplay --newer-than 1W ~/music
Play in order music that is from before this year:
randomplay --norandom --older-than '1/1/2006'
Give a list of filenames of music that were added in the past 6 months, but haven’t been played in the last three months:
randomplay --names-only --newer-than 6M --days 3M
Play, but don’t record in the playing history, music added in the first three months of 2004:
randomplay --noremember --newer-than '1/1/2004' --older-than '4/1/2004'
Unfortunately, this new feature is pretty slow, because it stats each file individually on the initial spidering of the directories to be played. In fact, the startup is always fairly slow if you are searching a large directory hierarchy, since randomplay does not preserve any file index but checks anew on each execution. If you are searching tens of thousands of tracks over NFS (as I do), this can take a minute or so. Suggestions for improving the perfomance of the file modification time detection or of the whole startup are welcome. At some point, I will probably implement an indexing feature, but I like the simplicity of it now where it works basically like the shell find command.
Version 0.60 should show up in Debian unstable shortly.
Share This
Filed under Code by adam | May 29, 2006 | 6 comments
My server’s mailman (or postfix) installation is mysteriously rejecting mail from one Yahoo! mail user. I don’t get it:
Hi. This is the qmail-send program at yahoo.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. : 72.1.169.10 does not like recipient. Remote host said: 550 : Recipient address rejected: undeliverable address: unknown user: "[list name]” Giving up on 72.1.169.10.
72.1.169.10 is, in fact, the IP address of my server. [list name] is (in the real version) the real live name of the list. The list seems to work for everyone else. And it’s certainly not true that I, or my server, doesn’t like this recipient (or sender).
Aside from this anomalous behavior, it’s also funny that Yahoo! provides plain old unfiltered qmail bounce messages to its users. Wouldn’t you think a fully matured webmail service like Yahoo! would, by this point, have somewhat customized their mail error reporting messages? In fact, wouldn’t you think they would want to hide the fact that the use qmail at all, if only for security purposes? Couldn’t they hire an intern to write a few replacement error messages? Maybe I’m missing something.
A propos, I discovered this nice piece from McSweeney’s, entitled YAHOO’S MAILER-DAEMON AUTOMATED REPLY FOR FAILED E-MAIL DELIVERY IS GETTING A LITTLE TOO INTIMATE.
Update 5/30/06: Figured it out. Oddly, Yahoo! was looking up the CNAME DNS record for the domain name and replacing that in the mail header. While the original email went to e.g., listname@lists.mydomain.com, the message as delivered was addressed to listname@servername.mydomain.com. Because only lists.mydomain.com processed email for lists, the message bounced. The solution was to change lists.mydomain.com from being a CNAME entry to its own A entry with the IP address specified directly. That fixed the problem. I’ve never seen any other mail service work this way — gmail certainly doesn’t.
Share This
Filed under Code by adam | March 19, 2006 | 0 comments
It’s been a while since I announced a release of randomplay, my command-line ‘itch a scratch’ music player. It is most useful for maintaining a random shuffle over many sessions—for example, I use it to make sure I don’t ever hear the same song in any three month period.
This new version features the much sought ‘back a song’ keybinding. It also announces the “random weight” preference of the current song as it plays.
Share This
Filed under Code by adam | January 4, 2006 | 4 comments
A couple of weeks, I blogged about trying to create some babysitting coop software and “doing it right.” Despite knowing that I’d benefit from the discipline imposed by Python, I ended up coding it in perl and staying in my comfort zone. Still, it’s a lot less screwy than past things I’ve done.
It’s definitely not ready for prime time—barely tested at all; probably buggy; not feature complete; and not nearly secure enough. But I thought I’d announce it so it can start entering search engine indices. The past blog entry is already a #2 google result for babysitting coop software. (Apparently there is very little competition in this niche).
So. Announcing BabyOp: Software for Babysitting Coops.
Share This
Filed under Code by adam | December 21, 2005 | 9 comments
I’m coding a new CGI application, tentatively entitled BabyOp. It is software to run a babysitting coop; I suppose it is a species of “social software.” The idea is to be able to track hours credits, schedule babysitting times, centralize contact information and other details about babysitting requirements.
I considered using something like Zope or Drupal for the application, but I’ve never liked developing exclusively through a web-interface and found myself having to do a fair bit of “actual” coding to get the results I wanted. I realize there is a command-line interface for Zope, but it’s really pretty limited. I had some plans a couple of years ago when I designed my wedding site in Zope to extend it to be more useful, but sadly never got around to it.
So I’m back in my comfort zone, perl. I’ve written a fair amount of unmanageable perl code, however, CoopOrder probably being a shining example (it was also my first perl program). I’ve certainly improved since then, and the fact that I’ve received several patches from others for randomplay suggests that my coding style is getting to a half-decent point.
I’d really like to get it right this time, though. One thing I’ve learned over the years is always to look for a module to do what you want before setting out to do it yourself, since chances are the module writer is a better coder than you (or at least, than me!). To that end, I’m using CGI::Application, HTML::Template, and DBIx::Abstract, among others. I’m also trying to keep things really granular and avoiding long subroutines. Certainly taking the HTML out of the perl code helps with that. I’m amazed at how often my code now just “works” on the first try, similar to esr’s story about his first look at Python (“Brace yourself: this code only took me about ninety minutes to write—and it worked correctly the first time I ran it.”)
I’m trying to figure out if it would be sensible to make this application more fully object oriented. Growing up in the ’70s and ’80s and having done a lot of database programming, I’ve always been unfortunately pathologically declarative. (My first major package was in Clipper—I was 13 years old). I find it a lot easier to modify a pre-existing object oriented package than to design my own.
But then again, does it really make sense to attempt an object-oriented design where there is really only one important “object” — in this case, the babysitting unit?
Share This