Friday, August 25. 2006
Earlier in the month I asked for feedback on the super-alpha MARC package for PHP. Most of the responses I received were along the lines of "Sounds great!" but there hasn't been much in the way of real suggestions for improvement. In the mean time, I've figured out (with Lukas and Pierre's assistance, merci beaucoup) how to make use of PEAR::ErrorStack for error handling. I've also decided to split my linked-list-in-PHP implementation into a separate package; first, because it might be useful for someone else; second, because as a separate package the PHP gurus that care deeply about things like returning references can go over it with a fine-toothed comb without having to worry about all of the MARC stuff.
So, once again I'm interested in your comments -- but this time I'm looking for comments on two different packages:
Next steps are to build real PEAR packages for these beasties and put together PEAR proposals for consideration of the community... but don't feel that you have to wait until the proposal to offer any suggestions!
I will put up .phps versions of the examples for each package, but for some reason I'm having problems getting my host to accept my .htaccess file... look for an update on the respective pages after I contact my hosting support team.
Tuesday, August 22. 2006
Amber watched her first film in a real theatre(1) this morning. She had slept straight through You, Me, and Dupree two weeks ago, but insisted on paying attention to today's showing of Talladega Nights: The Legend of Ricky Bobby. Maybe it was the NASCAR action, maybe it was the redneck hollering; maybe it was the unrelenting onslaught of product placements, or maybe it was simply Wil Ferrell's kind, gentle, and let's not kid ourselves, downright handsome face blown up to twenty-foot dimensions, but she was riveted to that screen.
I'm glad we're taking the time to expose her to these cultural influences early; so many people waste their children's crucial first formative months with mindless noise like Beethoven. When my darling baby girl grows up, she's going to be able to say with pride "My daddy done taken me to that there picture show when I was nothing but a squirt in a diaper -- soooo-EEEEE!".
- A local cinema offers a bi-weekly screening of a popular film in a baby-friendly environment. They turn down the volume, leave the lights on dim, provide changing tables and diapers, and nobody minds if the babies cry or if moms are breastfeeding during the flick. It's pretty cool. If the gods are kind, maybe Beerfest will be up for viewing in a month or two...
Although my fingers are pretty sore after writing this entry.
Over the weekend, our household participated in the Orillia Triathlon, Duathlon and Try-a-Tri. A couple of weeks ago, Lynn decided that she was ready to jump back into the triathlon waters with a Try-a-Tri (350m swim, 10k bike, 2.5k run). The Orillia event also happened to be the provincial athletic championships where triathlon clubs could compete for an infusion of cash based on their participation rate, and given that this was the Nickel City Triathlon Team's first year of existence Lynn wanted to support our team and ensure that Sudbury would be known for more than mining. Aside: our team actually came in third for participation points at the event, so we won $300 for the club -- yay team!
Lost in the wake of her enthusiasm, I decided a few days before the event to join her: partially because I wanted to support the team in more than just a "I paid my membership fee and got a Web site going" way; partially because I wanted to cheer Lynn on; and partially because I totally screwed up the date that our friends were hosting a going-away barbecue and I suddenly found myself with a free day. So, because someone was going to have to look after Amber during Lynn's race, I was going to have to choose either the sprint triathlon or duathlon for my own event. Not having put much time into swimming practice over the summer (and by "not much time" I meant three swims of over 250m), and knowing that I would have to breast stroke the swim portion and face the ridicule of my fellow athletes, I opted for the duathlon instead.
Continue reading "I'm not as sore as I thought I would be"
Monday, August 14. 2006
Okay, I've been working on this project (let's call it PEAR_MARC, although it's not an official PEAR project yet) in my spare moments over the past month or two. It's a new PHP package for working with MARC records. The package tries to follow the PEAR project standards (coding, documentation, error handlers, etc) in the hopes that, when I put a proposal forward, it will be accepted as a true PEAR package. For now, I'm most interested in getting feedback from coders for libraries on the usability of the API that I've designed -- is it easy enough to use and does it offer the functionality that you require for your day-to-day work?
The core MARC decoding routine was taken from the php-marc package that Christoffer Landtman coded for the Emilda open source library management system. The decoding routine was based on the algorithm contained in Perl's MARC::Record package. Christoffer generously relicensed php-marc under an LGPL license so that I could use it as the basis of a (hopefully, eventually) official PEAR package. PEAR_MARC itself will therefore be licensed under LGPL.
Some of the major differences that users will see between php-marc and PEAR_MARC are:
- System requirements: php-marc requires PHP 4 or 5, while PEAR_MARC requires PHP 5 due to my desire to offer a relatively clean OO structure.
- API: php-marc was based closely on Perl's MARC::Record API, while with PEAR_MARC I've created a new API from the ground up that is hopefully cleaner, more intuitive where possible, and more transparent where necessary
- Class hierarchy: php-marc offers one major class that contained all of the methods, with different subclasses used as constructors for different MARC sources (files, strings, YAZ). PEAR_MARC is designed with different classes representing subfields, data fields, control fields, and entire records, with just one class representing all MARC sources.
- Functionality: php-marc fields and subfields are based on arrays, which results in some interesting limitations (for example, when you add a subfield in php-marc it is always added to the end of the existing subfields). PEAR_MARC is based on a linked list structure, which enables the user to add fields and subfields at any point in the list.
- Error handling: php-marc implemented warn() and croak() methods as a clone of Perl's API. PEAR::MARC relies on PEAR_ErrorStack as a standard that conforms to the PEAR project requirements.
- Performance: php-marc offers a class, MARC_Index, that claims to be incredibly fast but which can only be used for read-only operations. I haven't benchmarked PEAR_MARC yet, but I have to assume that it will appear sluggish for read-only operations and would probably lag php-marc in performance for operations that add, modify, or delete subfields. It might be possible to create a class similar to MARC_Index that offers read-only operations with the same API as PEAR_MARC and simply make it an option passed in to the constructor. At this point... not a priority.
- Tests: PEAR_MARC includes a number of unit tests that have already been helpful in ensuring that the classes operate correctly. php-marc currently offers no unit test suite; however, it is used in production by emilda so it is arguably well-tested in practice

You can find the latest version of the PEAR_MARC package posted at http://marc.coffeecode.net. Please append any comments as replies to this post, or email me at dan@coffeecode.net.
Friday, August 4. 2006
diaryland.com is a hosting service for people interested in blogging without worrying too much about the technical side of things. It still exists because it predated blogger / blogspot's free services and managed to attract a community consisting of some really great writers, like my friend cloudy.
The problem is that I have become a convert to reading via RSS feed aggregators, and for the longest time I was perplexed that diaryland didn't appear to offer an RSS feed. However, I recently discovered that they do offer RSS; they just don't make it visible in any useful way. So, the solution:
If you are a diaryland blogger and you want to expose your RSS feed (not as naughty as that might sound), add the following chunk of code to your HTML template between the <head> ... </head> tags:
<link rel="alternate" type="application/rss+xml" title="RSS feed"
href="http://blogname.diaryland.com/index.rss" />
If you just want to add the RSS feed for a diaryland blog to your own RSS feed aggregator, the URL is: http://blogname.diaryland.com/index.rss
Posted because diaryland doesn't appear to have published this info anywhere on their own site, and man is it annoying to track something like this down.
Update: Strict XHTML alert -- added the missing / in the <link> tag.
Thursday, August 3. 2006
Just wanted to post a couple of pics we took during the past few weeks.
About a half an hour south of Sudbury on highway 69 is the French River information centre. The centre is brand new and boasts an impressive display on the origins of the area and its importance as one of the early routes for the fur trade in the 17th century before the Northwest Trading Company asserted itself and redirected almost all trade through Hudson's Bay instead (which pretty much relegated the French River community to a well-regarded tourist area). Okay, so if history isn't your thing then you simply have to be impressed with the view of the French River itself. Well worth a twenty minute stop.
Bell Park plays host to Sudbury's annual dragon boat racing competition. We took Amber for a stroll on an intensely hot day along the boardwalk that borders Lake Ramsey's western edge all the way from Science North to Bell Park and, along with thousands of other souls seeking the comfort of the beach, watched the colourful dragon boats vie for fame and glory. Those poor paddlers must have been roasting in the sun. Parts of Bell Park turned into a campground for the contestants, so at least they had some respite under the tents when they weren't getting ready for their next race. In the background, you can see some of the Laurentian University campus buildings. I was / still am on parental leave, and I must admit that on that beatiful day I didn't think about work once.
We have a few different kinds of frogs that visit our backyard; this leopard frog is just one magnificent specimen. All of the shots of the grey tree frogs that like to hang out on our deck have turned out fuzzy so far, and I have only heard the spring peepers -- but I'm down with anything that eats bugs. Particularly black flies and mosquitos. Hmm, any chance that amphibians getting a taste of human blood second-hand will suddenly develop an unslakable thirst for my crimson vitality? As Mr. Bush said, bring'em on!
Dear Amber:
Little girl, you have a lot of people interested in seeing you; there is no doubt that you are well-loved by friends and family.
Your great grandpa travelled all the way from St. Catharines to see just how poorly you're being treated here. You two had a lovely time together, and you saved one of your best morning moods to curl up in his arms in this photo.
Then there's Auntie Jama (on the left there, with you and Lynn): she drove up from Barrie one morning just to visit with you for a couple of hours, then drove all the way back that afternoon! That's love (well, love, and a hectic schedule with work and buying a new home where you are absolutely going to be thrilled to visit in a couple of years--I can already predict the tears that will flow every time we have to leave Jama and Terry's place out in the country).
Oh, and how about your Uncle Jason and Aunt Kelly? They were willing to leave their beloved puppy Hanna behind for a weekend to spend some quality time with you. Kelly pushed you in the stroller all the way to Nepahwin beach and back, and we all did a lot of sight-seeing in the Sudbury area (including the obligatory shot of the Big Nickel).
So how about just a simple shot of you to appease those who haven't been able to make the trip (or who have, but haven't made it up for a while?) The papparazzi are swarming, you might as well give in to the pressure. Let's see if we can find some good killer cuteness shots... Thank you, Colleen, for sending the killer cool environmentally friendly fair trade Peppa Sloppy our way. Amber loves to have it tucked under her arm as she naps, and she naps a lot.
At almost three months, she's also impressively strong. Amber has been able to lift her head since day one, and is constantly threatening to do damage to our lips, chin, nose, or other soft squishy parts of our body when she throws it around. In this shot, she's demonstrating her ability to lie on her belly and check out the world around her. Tummy time is no longer an automatic descent into frustration and tears. On the whole strength thing: she has massive thighs, and can support a good chunk of her weight on her legs. This leads us to the fear that she may learn to walk before she can crawl, resulting in a mad dash to baby-proof our house.
Speaking of which, I rushed to install a baby gate at the top of our stairs this weekend because Ian and Christine were visiting with Emma (their 4 year old) and Maria (their 2 year old). Mental note for my future self: even if it's late at night, you're tired, and there is no good light in the area that you are working, use the level to ensure that the latch side of the gate is level. And do it twice. Fortunately (well, relatively fortunately), this installation was a temporary measure anyways as the top of the stairs only has drywall on the wall side. So I'm going to have to cut out the drywall to expose the studs, install some two-by-fours between the studs as braces, and run another two-by-four vertically between those horizontal braces to have a nice solid place to mount the baby gate.
But I have to wonder: the previous owners had a couple of daughters. Were securely mounted gates at the top of stairs optional accessories in the eighties? I wonder if they also had one of those crazy walkers-on-wheels that were banned after the drug haze of the seventies cleared up and people realized that those devices were a spectacularly bad idea...
|