Flickr Plugin

I decided it’s easier to use flickr for hosting pictures with the new camera. Flickr has a requirement that all photos link back, so it would get ugly pretty quickly if I had to do the link and image tag every time (although I could just cut and paste their code).

Instead, I wrote a Blosxom plugin that takes the url to the picture itself and a description and builds the link. It was all of 20 lines, most of which was blosxom required empty methods. The actual linking consisted of one regex match, a small bit of parsing that and then a replace with the url and image link.

Unfortunately, flickr urls include underscores and the Markdown plugin tried to make those into emphasis. Instead of just renumbering/renaming, I added a Markdown fixer that does a search and replace for <em> tags in the src links and reverts them to underscores.

New Toy

First Shot

Best Feeder Shot

Best Overall Shot

Finally got to take my new toy out and use it a bit. Click around and you can get closer to the original size. Already learning a bit about the advantages of RAW as the first shot was raised 2/3 of a stop in Lightroom. Not sure if I want to use Lightroom or Aperture yet, although it seems like Lightroom is easy to use with multiple disks.

Yard Sharpie

Yard Sharpie with Mourning Dove remains


Unfortunately the dove was just about finished when I got home. Every last bit of meat was plucked off. After the hawk left, we walked over and looked around and could barely find a trace other than the feathers.

Watching the hawk as it finished was quite interesting. Working on the last piece appeared to be difficult. The bird was having trouble holding it down to rip off the meat and kept pulling it up from under its other foot. Eventually, it moved to a branch where it was able to hold it down. After finishing, it spent quite a while wiping its bill on the branches, before shaking off a few times and taking off.

Winter List for Waltham 2006-2007

Stealing an idea from the Canadians, here’s a December-February list for Waltham. Dates and locations are the first sighting. Birds in bold are my first Dec-Feb sighting in Waltham.

  1. Canada Goose (12/1, Leitha)
  2. Mute Swan (12/2, HP from yard)
  3. Wood Duck (12/25, Lyman Pond)
  4. American Wigeon (12/9, HP from yard)
  5. American Black Duck (12/2, Charles)
  6. Mallard (12/2, HP)
  7. Green-winged Teal (1/21, Charles)
  8. Ring-necked Duck (12/8, Charles)
  9. Common Goldeneye (2/1, Charles)
  10. Hooded Merganser (12/1, HP from yard)
  11. Common Merganser (12/1, HP from yard)
  12. Ruddy Duck (12/2, HP)
  13. Great Blue Heron (12/2, HP)
  14. Turkey Vulture (12/17, Gore Estate)
  15. Cooper’s Hawk (12/17, Lexington St)
  16. Red-tailed Hawk (12/2, Prospect Hill)
  17. American Kestrel (12/28, UMass Field Station)
  18. Merlin (12/13, Hardy Pond)
  19. American Coot (12/2, HP)
  20. Ring-billed Gull (12/2, Lexington St)
  21. Herring Gull (12/1, Trapelo at Lexington)
  22. Iceland Gull (1/31, Stanley)
  23. Great Black-backed Gull (12/2, HP)
  24. Rock Pigeon (12/2, Trapelo)
  25. Mourning Dove (12/1, WHS)
  26. Eastern Screech-Owl (12/17, yard)
  27. Great Horned Owl (12/17, WHS)
  28. Belted Kingfisher (12/17, Charles)
  29. Red-bellied Woodpecker (12/20, Paine)
  30. Downy Woodpecker (12/2, yard)
  31. Hairy Woodpecker (12/2, Prospect Hill)
  32. Northern Flicker (12/17, Met State)
  33. Blue Jay (12/1, yard)
  34. American Crow (12/1, Trapelo at Lexington)
  35. Fish Crow (12/16, Charles)
  36. Black-capped Chickadee (12/1, WHS)
  37. Tufted Titmouse (12/1, WHS)
  38. White-breasted Nuthatch (12/1, yard)
  39. Brown Creeper (12/11, Paine)
  40. Carolina Wren (12/17, Lot 1)
  41. Golden-crowned Kinglet (12/2, Prospect Hill)
  42. Eastern Bluebird (12/17, Met State)
  43. Hermit Thrush (1/20, Met State)
  44. American Robin (12/1, WHS)
  45. Northern Mockingbird (12/2, yard)
  46. European Starling (12/2, Smith St.)
  47. Yellow-rumped Warbler (1/4, Charles)
  48. American Tree Sparrow (12/6, Waverly Oaks Marsh)
  49. Song Sparrow (12/2, Charles)
  50. White-throated Sparrow (12/1, Leitha)
  51. Dark-eyed Junco (12/1, Leitha)
  52. Northern Cardinal (12/2, yard)
  53. Red-winged Blackbird (12/17, Charles)
  54. Common Grackle (12/17, Hardy Pond)
  55. House Finch (12/1, yard)
  56. American Goldfinch (12/1, yard)
  57. House Sparrow (12/1, yard)

Dec: 1: 16, 2: 33, 6:34, 8:35, 9:36, 11:37, 13:38, 15: 39, 17: 49, 20: 50, 25: 51, 28: 52

Jan: 4: 53, 20: 54, 21: 55, 31: 56

Feb: 1: 57

So final total 57, which is the same as last year. Overall total is now 74, with the additions of Brown Creeper, Eastern Bluebird, Yellow-rumped Warbler, Hermit Thrush, and Iceland Gull. From my calculations, there were at least 210 on the overall Massachusetts list this year.

Roman Numeral Fun

In my waiting-for-people-to-leave-so-I-can-get-into-classrooms time at work I wrote a roman numeral translator in Factor. It’s a bit different from your normal implementation as Factor’s parser actually does almost all the work:

USING: strings parser kernel words sequences math ;

: NUMERAL: CREATE dup reset-generic dup t "parsing" set-word-prop parse-definition  parsed add define-compound ; parsing

NUMERAL: I 1 ;
NUMERAL: IV 4 ;
NUMERAL: V 5 ;
NUMERAL: IX 9 ;
NUMERAL: X 10 ;
NUMERAL: XL 40 ;
NUMERAL: L 50 ;
NUMERAL: XC 90 ;
NUMERAL: C 100 ;
NUMERAL: CD 400 ;
NUMERAL: D 500 ;
NUMERAL: CM 900 ;
NUMERAL: M 1000 ;

: separate ( str -- str )
    "" swap [ " " append ] [ add ] interleave ;

: join-special ( str str -- str )
    dup >r split1 [ 1 r> remove-nth swap 3append ] [ r> drop ] if* ;

: merge-specials ( str -- str )
    [ "I V" "I X" "X L" "X C" "C D" "C M" ] [ join-special ] each ;

: convert-numerals ( string -- arr )
    separate merge-specials parse ;

: all-numerals? ( str -- ? )
    [ "IVXLCDM" member? ] all? ;

: roman>number ( roman -- number )
    >upper dup all-numerals? [ convert-numerals sum ] [ drop "Not a roman numeral" ] if ;

Instead of grabbing characters and keeping a running tally, I defined a bunch of parsing words using NUMERAL: to hold the values. I then took the string and split it into individual characters (“XIV” becomes “X I V”). The 4’s and 9’s are then rejoined (so we get “X IV”). I then simply parse the string, which gives a list of numbers and sum that up. It’s not perfect as it allows any pattern of numerals (“IVIVIVIV” parsed to 22), but good enough.

Early March

A few pictures from the weekend:

Green-winged Teal

American Coot

Both at the Charles. And at Lyman Pond:

Eastern Screech-Owls!

Those should be the first birds I’ll confirm for the BBA

And today I found my first Killdeer of the spring at the UMass Field Station. Too bad it’s going to be frozen to the ground tonight and the rest of the week. Things should be picking up after that.

Checklist

The code for generating the checklist is written in Factor. Factor is rather outside the mainstream, but it works beautifully for my purposes.

I store the checklist data in a text file that looks like the following:

CHECKLIST:
    FAMILY: Wrens
        SPECIES: Carolina Wren
            STATUS: Fairly common year-round. Can be found almost anywhere. There's too many around to not be breeding, but I have yet to find a nest.
            PB
        END

        SPECIES: House Wren
            STATUS: Regular in spring and summer. Possible almost anywhere. Young at Paine Estate imply breeding.
            CB
        END

        SPECIES: Winter Wren
            STATUS: Probably a rare visitor, possible at all seasons?
            RECORD: M. Emmons, 5/14/1997, ? , 2
            RECORD: R. Haaseth/D. Finch, 2/6/2004, near Prospect Hill, 1
            RECORD: R. Haaseth/D. Finch, 10/2005, ?, 1
            PERSONAL: 11/25/2006, Met State, 1
        END

        SPECIES: Marsh Wren
            STATUS: Likely a regular migrant and possibly a breeder at Waverly Oaks Marsh.
            RECORD: M. Rines, 4/20/2006, Waverly Oaks Marsh, 1
        END
    END

    HYPOTHETICAL: White-winged Crossbill | irruptive species
    HYPOTHETICAL: Hoary Redpoll | irruptive species

    HISTORICAL: Black Vulture | coming soon
    HISTORICAL: Boreal Chickadee | coming soon
    HISTORICAL: Louisiana Waterthrush | coming soon

This is a nice clean structure that is easy to parse. In fact, the code to parse it is "USE: checklistn" swap dup file-length swap <file-reader> stream-read append parse call ; Yep, the checklist is actually code that parses itself.

To do this, I defined a few tuples:

  • TUPLE: checklist confirmed hypotheticals historicals
  • TUPLE: family name species
  • TUPLE: species name status breeding records
  • TUPLE: record observer date place quantity
  • TUPLE: historical name details
  • TUPLE: hypothetical name reason

Each one simply contains the data and stores anything below it in a vector. I then defined a bunch of words that handle the parsing.

  • CHECKLIST: creates a new checklist
  • FAMILY: creates a new family and gives it the name of whatever is on the line
  • SPECIES: does the same for species
  • STATUS: stores the status
  • PB and CB store the breeding
  • RECORD: and PERSONAL: create and store records (PERSONAL: creates a record with observer “me”)
  • END is a generic word that adds the species or family to the family or checklist respectively (I’d like to define it for the checklist as well, but the stack effects don’t match so it doesn’t work)
  • HISTORICAL: and HYPOTHETICAL: do the obvious

For the most part, defining those was straightforward. The trickiest part was dealing with status, as I had to be able to call a word for the next object on the stack after reading the status in. I ended up with the ugly

: STATUS: rest-of-line swap ?push  swap swap ?push  set-species-status V{ } clone [ push ] keep >quotation swap ?push  keep swap ?push ; parsing

mess. I’m sure there’s a better way but that took a couple days to get and I haven’t fiddled with it since.

Getting from the checklist tuple to the output was pretty easy, just doing lots of formatting with make and working down.

Cold Out

It’s been too cold to do much of anything lately and what’s out there hasn’t changed much.

I have been doing some work on the site, see the new Paine Esate page.

I just finished fixing up the code for the checklist and have finally updated the Waltham checklist. If you want to see how it works, I’ve got some details up in the projects section. I do need to figure out how to tweak the formatting a bit, but it’s up and updated.

Townsend's Again

My father decided that he really should see the Townsend’s, so we went back over this morning. Although the sun made the drive over pretty rough, it was well worth it. Before we even rounded the corner, the bird was sitting on the fence at the front of the yard. It alternated between the fence and tree for a while, before dropping to the ground. Eventually, it flew to the big tree on the street and then took off. Not only did we get excellent looks, but we heard it calling this time, a very different buzzy note.

Given that it was on the fence, I got a few pictures, much better than the previous ones.

Townsend's Warbler

Townsend's Warbler

Townsend's Warbler

Townsend's Warbler

#450!

Today I finally caught up with the Townsend’s Warbler that has been hanging around in Cambridgeport for the last few weeks (at least).

After spending almost 5 hours last Sunday (with one person getting a likely sighting) and another 3 hours yesterday (seen 10 minutes before and several times after), today’s effort was almost too easy. We left the house at about 6:50 and were parking by 7:10, which was pretty good for lots of red lights and a detour at Mt. Auburn. We walked over, said hi to Phil Brown and a minute later the bird popped up and proceeded to sit in the open for probably 45 minutes.

Townsend's Warbler

I took several photos, but that’s the only one that’s good enough to show publicly.

So that’s 450 in the US now. Should have gotten to that in New Mexico, but within 3 months isn’t too bad.