HTTP 410: Gone – Geocities

I just ran a link checker for one of the websites I’m running, and got the first ever http error code 410: Gone that I’ve seen, for something that was a Geocities page.  This seems to be in the correct spirit of 410 as embodied by Mark’s blog post on it.

For those that have no idea what I’m talking about, don’t worry, it’s geekery about the specifics of how the web works under the covers.

Ebook pricing

Dear Publishers,

I really do expect that your ebook pricing is going to be at least 50% lower than you list price for your print book.  O’Reilly’s 20% lower model just doesn’t do it for me, and the fact that I can buy the dead tree copy of almost any of ora’s books at Amazon for less than the ebook directly from the publisher, makes no sense.

Why is it that I demand this price differential?  Because the book is not lendable.  I’ll be a good citizen and not hand around your PDF to friends, at least not if I keep a copy, because I do get that that violates the spirit of the sale.  I’m actually ok with that, because I like your content and I want you to keep making it, and am happy to tell others they should buy a copy of the PDF as well.  But that limitation limits the value of the book substantially.

I’m also not buying anything with DRM, period.  There is no way I’m buying something that’s tied to a device that is going to go out of fashion some day.  And, if I buy something electronically from you I expect that you’ll keep a copy of it for me forever.  Pragmatic Programmers does quite a good job on most of these fronts.

Otherwise, I’m going to keep going to the library, like I’ve been doing.  It has many of the advantages of ebooks, i.e. not taking up space in my house, and it’s 100% discounted.  Plus, the Librarians are one of the few groups that are trying to ensure we have a sane copyright policy in this country.

Automating mailman with ruby mechanize

One of the things I’ve found is that people forget events quite often, so I try to make it easy for people to know when and what the next MHVLUG meeting is.  One of the ways I’ve been doing this by setting the footer on our mailing list to list the next couple of meetings.  This has worked out well, except for when I forget to go and update it.

Mailman doesn’t have an API, but you can get past that by using ruby’s excellent mechanize package, which lets you nicely script complex interactions with websites.  With an hour of time I pulled together this script which now runs every night and automatically syncs from our icalendar feed and updates the mailing list footer appropriately.

#!/usr/bin/ruby

require "pp"
require "rubygems"
require "mechanize"
require "tzinfo"
require "icalendar"
require "open-uri"

@@upcoming =<<END
Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium
END

def next_meetings()
    open("http://mhvlug.org/calendar/ical") do |file|
        cal = Icalendar.parse(file)
        # ruby collections are sometimes quite compact, so here is the
        # short hand:
        #   Icalendar returns an array, so get the first element
        #   then get the events array
        #   then filter that by only events in the future, and Wed at 6pm
        #   then only get the first 3 ([0..2] is an array slice)
        events = cal.first.events.
            select { |a|
                (a.dtend > Date.today) and
                (a.dtstart.wday == 3) and
                (a.dtstart.hour == 18)
            }[0..2]

        events.each do |e|
            str = e.dtstart.strftime("%b %e - ") + e.summary
            str.gsub!(/  /, " ")
            @@upcoming += "  " + str + "n"
        end
    end
end

def update_mailman
    a = WWW::Mechanize.new

    # this is the page we want to go, but we aren't logged in yet, so it will give
    # us a login form
    login_page = a.get("http://mhvlug.org/cgi-bin/mailman/admin/mhvlug/nondigest")

    # find the form that gets us back to where we want to go, and set the adminpw field
    nondigest_page = login_page.form_with(
                         :action => "/cgi-bin/mailman/admin/mhvlug/nondigest"
                     ) do |f|
        # set your password here
        f.adminpw = "XXXXXXX"
    end.submit

    # we only care about updating 1 field, name=msg_footer, so find the right form
    # update the field, and submit
    p = nondigest_page.form_with(:action => "../../admin/mhvlug/nondigest") do |f|
        footer = f.msg_footer
        footer = footer.split("MHVLS Auditorium")[0]
        footer.gsub!(/Upcoming Meetings.*/, @@upcoming)
        puts footer
        f.msg_footer = footer
    end.submit
end

# pull from ical
next_meetings

# push to mailman
update_mailman

And now, one more manual task is being done by agents automatically for me.

The Onion on the Science Channel

Via The Onion:

SILVER SPRING, MD—Frustrated by continued demands from viewers for more
awesome and extreme programming, Science Channel president Clark
Bunting told reporters Tuesday that his cable network was “completely
incapable” of watering down science any further than it already had.

“Look, we’ve tried, we really have, but it’s simply not possible to set
the bar any lower,” said a visibly exhausted Bunting, adding that he
“could not in good conscience” make science any more mindless or
insultingly juvenile. “We already have a show called Really Big Things, which is just ridiculous if you think about it, and one called Heavy Metal Taskforce, which I guess deals with science on some distant level, though I don’t know what it is. Plus, there’s Punkin Chunkin.”

Punkin Chunkin, for Christ’s sake,” added Bunting,
referring to the popular program in which contestants launch oversized
pumpkins into the air using catapults. “What more do you people want?”

The entire article is hilarious, go read it.  Seriously, this is how I typically feel when I see stuff coming through on any of the Discovery properties.  The History channel isn’t doing much better of late either.

Being more entertaining than a cell phone

Tuesday night was the first night of the Mid Hudson Astronomy Association in their new digs, the Coykendall Auditorium at SUNY, New Paltz.  I really like the venue.  The lighting and environment is much better than the library.  With 34 people in attendance last night, we had a quite good turn out.

The lecture itself was given by Cathy Law about teaching Astronomy to middle and high school kids.  In an hour we got about 5 weeks worth of material thrown at us (some of it was skipped over), but all of it was quite good.  I especially appreciated the use of Monty Python and the Universe song to end us off.  Cathy was an incredibly compelling speaker, and her students are definitely lucky to have her.

The thing that made me think the most was her comment that one of her biggest challenges in class is being more entertaining than a cell phone, though, ironically, I was on my cellphone at the time verifying the statement I’d just made on the modal lock of Mercury.