erlsmug — an Erlang client for the SmugMug API

2008-04-30

Like many others, I’m intrigued by the promise of Erlang but my development efforts to date have been limited to small script-like examples and the odd server from the Programming Erlang book. I wanted to develop something much richer on my own and perhaps even something of value. Since I’m already the author of a high-performance SmugMug client for Python I figured writing a similar library would be a proper way to compare and contrast the two languages and approaches to concurrency.

So, without further ado, I present erlsmug, an Erlang client for the SmugMug API. The project is a whopping day old but I can already log in and query my albums and images. I’m excited to see some benchmarks between my Python and Erlang clients — the Python client makes use of PycURL which is concurrent, rockstar fast and easy to use.

Some issues I’ve already encountered:

  • The inets application seems to hang if I try an https url.
  • Copying examples of OTP applications is harder than one would think because each is just a little different.
  • How come the .app doesn’t automatically start the applications declared as dependencies? It looks like most of the examples I looked at code.google had a start/0 helper function which started the appropriate applications. Is this best practice?
  • I’m still a little confused about the State maintained for the server. I’m using it to keep the session id after logging into SmugMug but what if multiple credential could be used simultaneously? I’m sure there’s something I’m just not getting.

That’s it for now. I’m going to have to talk to Martin to clear up some questions and learn more about Erlware.

Categories : development
Tags :     

MacBook Pro 1.5.1 firmware update.

2008-04-27

Update of the update (2008-05-01): Well shit, the upgrade isn’t perfect. Today I came back from lunch to a laptop that didn’t wake, but the delay did seem shorter. I wish this was fixed already.

Update (2008-04-27): Well I went ahead and did the upgrade and as of yet, no wake-from-sleep issues, so maybe, just maybe, this is the fix I’ve been wanting.

I see Apple has a released a firmware update for the MacBook Pro but the notes don’t say what it fixes. According to some articles it includes a fix to the 1.5.0 version (which I never even saw) that introduced some “blank screen” problems. I’ve been having the won’t-wake-from-sleep issues numerous others have reported but the “blank screen” issue sounds even worse so I’m waiting on this update.

Categories : general
Tags :

Submitting expenses.

2008-04-24

I travel for work and so I have to submit expenses and I usually try to coax the tiny little receipts through my HP AIO scanner. I save the scans as PDF but since I don’t run any OCR software they’re basically just photos saved in the PDF document. This step of the expense report process takes a long time.

It dawned on me today to just take a photo of the receipts since it amounts to about the same thing, it’s much faster and it’s easier to add metadata to images than PDFs.

Categories : general

The algorithms behind java.util.concurrent.

2008-04-24

From Doug Lea on the concurrency-interest mailing list, the new book The Art of Multiprocessor Programming is finally available:

This is by far the best source for explaining the ideas and algorithms underlying java.util.concurrent — the vast majority of them, plus some others, including a few that may someday appear. It also uses Java/java.util.concurrent to illustrate most concepts. I strongly recommended it.

While it’s a bit pricey, as a heavy user of the java.util.concurrent package I’m interested in reading it. We’ve greatly increased the stability and performance of our code by using both the 1.5+ and backport versions and understanding the underlying concepts a bit better might yield even better improvements.

I remember at my first job out of school, programming in Objective-C on NEXTSTEP, I wanted to use threads and I was told no by our tech lead who said we’d eventually screw it up — he was probably right — and generations of Java developers have been screwing it up ever since. Most were led to believe threads in Java were easy if synchronized markers [were] employed like pixie dust until the problem seems to go away.

It’s too bad it’s taken so long for the higher level abstractions to materialize in Java because so much old code now needs replacing (not to mention countless hours debugging wasted) but it’s worth it. In one recent example I removed 6 synchronized statements by replacing them with a java.util.concurrent.BlockingQueue and Erlang-style message passing.

Skagit County Tulip Festival

2008-04-22
Geotag Icon View on map.

On Monday, we ventured off-island to see the tulips in bloom at the Skagit County Tulip Festival. We took the “whoa-boat” (daughter speak for ferry) to Seattle and drove up to Mt Vernon where we met my uncle. We drove together to the RoozenGaarde display garden skeptical about the weather since reports were calling for storms starting mid-morning.

The garden reminded me of the rose garden in Portland but the tulips felt much more approachable than the roses.

There were quite a few tripod carrying photographers about and the planners of the garden do a pretty good job of providing interesting photographic scenes beyond just rows of flowers. My wife decided she likes the Ile de France the most while I leaned towards the deepest purples.

As we left I took a photo of the daffodil field next to the parking lot.

From the display garden we made our way to a field active with workers cutting flowers. The storms promised by the weather service finally started to materialize and some rain did begin to fall.

In an attempt to get out of the rain we drove to Tulip Town and the display fields since some of the exhibit is indoors. The storm passed quite quickly and we went out to walk the fields of gold (ugh, I hate that song).

The clouds were amazing and really helped add to the drama of the tulips’ colors.

The fields of tulips are really something to behold, your eyes actually have a hard time adjusting back to a landscape not entirely awash in color. My yard, which is primarily forest green save some rhodys just blooming, looks oddly monochromatic today. I do of course have a houseful of cut tulips though.

(More photos available here)

Categories : photography   travel