I’m in Love with LibraryThing

30 07 2007

I discovered LibraryThing over the weekend, and I’m in love.

Anyone who knows me or has visited my house knows I love books. Since 1994, I’ve tried to keep a list of the books I’ve read. I started this habit because I found I was forgetting what I’d read. I’d be in a bookstore and be unsure if I’d read something before. (This was particularly true of all of the sci-fi & fantasy books I read in junior high & high school.) The simple act of writing down the titles what I’d read helped me remember the content of the books.

If you want to read more about my history trying to keep track of what I’ve read, why I love LibraryThing, and the tools I wrote to make it easier to move over to LibraryThing, then keep reading this post.

Read the rest of this entry »





Overexposed, but Still Kind of Cool

30 07 2007

I brought my camera with me when I took Alex to the playground this evening. Most of the shots I took are the typical look-my-son-is-at-the-playground pictures. But there was one batch of pictures I took when I forgot I’d left the camera on manual exposure, and they came out extremely overexposed. I tried to recover the pictures on the computer, and the resulting effect is pretty cool. Here’s a link to the best shots. (You get to see some of them in both color and black-and-white.)

http://www.flickr.com/gp/9052666@N05/3U3628

20070730_Overexposed-4





Technology: Todo.txt, PowerShell, and OneNote

26 07 2007

So this is pretty geeky of me. I read the description of people who keep their list of things to do in just a plain text file, and then use computer scripts to process it. You can read more here: http://todotxt.com/. To quote the website:

Plain text is software and operating system agnostic. It’s searchable, portable, lightweight and easily manipulated. It’s unstructured. It works when someone else’s web server is down or your Outlook .PST file is corrupt. Since it’s been around since the dawn of computing, it’s safe to say it’s completely future-proof. There’s no exporting and importing, no databases or tags or flags or stars or prioritizing or [Insert company name here]-induced rules on what you can and can’t do with it.

Todo.txt is a flat text file that contains one task per line, each optionally associated with a context, project and priority for slicing, dicing and sorting.

The website then refers readers to a shell script that manipulates the contents of todo.txt (you know, when you just can’t fire up emacs). Well, I figured, why should the Unix users have all of the fun? So for us Windows users, I wrote a series of PowerShell scripts that can be used to manipulate a todo.txt file. You can find the scripts here: TodoTxtPowerShell.zip. These scripts are provided under the Microsoft Community License. In the package, the file about_TodoTxt.help.txt gives more information about the scripts.

While these scripts are certainly useful, if you’re going to keep all your todo items in a text file, I don’t think the scripts make things any easier than just editing the file in Notepad. These scripts are probably more useful as an example of how to use PowerShell for text processing. The scripts are pretty straightforward and make reasonable sample code for PowerShell. When I have more time, I might dissect the scripts in this blog.

One bonus of moving to a PowerShell world for scripting is that I’m not confined to storing these lines of text in a text file. Thanks to the OneNote PowerShell Provider, my PowerShell scripts can manipulate text on OneNote pages as well as in text files. So if you live out of OneNote and want to bring the simplicity of a todo.txt-style todo list to the place you keep the rest of your notes, well, now you have a set of scripts that can help you manipulate those todo items.

As an aside, the OneNote integration came (mostly) for free, and I think it really shows off the long-term potential that PowerShell’s provider model brings. It becomes quite easy to stitch data together from multiple sources.





The Spice Rack Again

26 07 2007

Alex still loves playing with the spices in the spice rack. Now, however, he tends to park himself in the corner and sit down. He can stay happy there for minutes, which is pretty long for him.

Hanging out behind the spice rack  Getting out from behind the spice rack





Thinking about Harry Potter and the Deathly Hallows

25 07 2007

For the past couple of months, I would walk past Barnes & Noble after dropping Alex off at daycare, on my way to pick up coffee at Starbucks. Each time I walked by the store, I’d think, “Harry Potter is coming soon!” I’d remember being at the midnight release party for Harry Potter and the Half-Blood Prince two years earlier, at that same Barnes & Noble, and I’d get excited imagining the scene at the upcoming release party.

I did spend a couple of hours at Barnes & Noble on July 20th, securing my spot in line, checking out the decorations, and admiring the crowds and the costumes. I found the experience heartwarming and exciting. I’ve grown up with books and always known they were important. The mobs of witches and wizards and three-headed dogs at Barnes & Noble on a drizzly midnight showed how many other people think books are important, too.

Fluffy  Beauxbatons

The crowds gather

By 12:10 AM on the 21st, I had my copy of the book, and I finished reading it by 10:00 PM. That was 22 hours after buying the book, and almost nine years after first reading Harry Potter and the Sorcerer’s Stone. Once I finished the book — which I loved — and its spell started wearing off, I had a hard time explaining why Harry Potter made me so excited. It’s not my favorite book. (I’d have a hard time picking between To Kill a Mockingbird, The Name of the Rose, Love in the Time of Cholera, King Lear, or Atonement for the “favorite book” title.) It’s not the most detailed alternate universe I’ve encountered. That’s clearly The Lord of the Rings. It’s not even my favorite children’s fantasy series. I think Lloyd Alexander’s The Chronicles of Prydain (now almost 40 years old!) are still the best.

So what is it?

First, I think the Harry Potter phenomenon shows how powerfully stories affect our emotions. Judging from the comments I’ve read on the internet, hundreds of thousands of people around the world were crying this past weekend because of the deaths in The Deathly Hallows. It doesn’t matter that, in fact, there were no deaths — because, in fact, these aren’t real people we’re talking about. Stories seem real to us. We want them to be real. And our emotions respond to a good story the same way they respond to reality. The emotional response lasts past the end of the novels, spilling over to color how readers respond to language itself. For example, anybody who’s made it through all seven books can’t read the word Hogwarts without getting that warm, comforting feeling associated with home; can’t read the word Voldemort without a feeling of dread; can’t read the nonsense phrase Expecto Patronum without feeling a sense of protection.

(Tim O’Brien makes this point better than I ever could in “How to Tell a True War Story” in The Things They Carried. Every lover of fiction should read that story — but be warned it’s not for the faint-hearted.)

While readers will bond with any good story, I think that bond has been particularly strong with Harry Potter because it has developed over such a long stretch of time. As I look around my bookshelf, I don’t see any other fictional universe that has rolled around in my head, off and on, for anywhere close to the nine years I’ve been visiting Hogwarts. I’ve spent over a quarter of my life waiting for the next Harry Potter book to come out. For the younger readers, the connection must be even stronger because they have grown up as Harry has grown up.

I wager that for bookworms like me, the books read during childhood and adolescence are more important than anything except family and close friends in shaping the kind of person you grow up to be. When I look back on my childhood, I can see how books like To Kill a Mockingbird and The Chronicles of Prydain influenced my sense of right and wrong — those stories are deeply etched on my adult personality. What must it be like to grow up with Harry Potter? As with To Kill a Mockingbird, children who grow up reading Harry Potter will see that someone’s worth doesn’t depend on heritage or race. Children who grow up reading Harry Potter will see the power of love, of sacrifice, and of friendship. They will see how the fear of death corrupts, or threatens to corrupt, everybody from Voldemort to Dumbledore. Many of these are timeless themes that are as old as literature. But unlike the books I grew up with, this series straddles the pre-9/11 and post-9/11 worlds. The post-9/11 Harry Potter books show what it is like to deal with people who are pure evil and who deftly use terror to gain power. The books warn against both pretending that the problem doesn’t exist (Cornelius Fudge), and also against using torture and other inhumane ways of trying to combat your enemies (Dolores Umbridge). So this is J.K. Rowling’s greatest achievement — she’s created a modern series that’s worth growing up with. I can’t wait for my son to be old enough to read these books and let them influence him the way books influenced me when I was young.

The Youngest Fan?

Say "Every Flavour Bean!"





Christmas in July?

19 07 2007

It feels a lot like I’m six years old and it’s Christmas Eve. Tomorrow night I’ll have the last Harry Potter book in my hands. Way more exciting than an iPhone.

Molly & I read the first Harry Potter in the winter of 1998 on the advice of her mother. We ordered the second and third books from amazon.co.uk because they were available in the UK months before the US release. We’ve picked up every other US copy the day of release. (I remember buying Book 4 at the airport in Portland, Maine. I was visiting family, and Molly wasn’t with me. I knew a book was waiting for me back in Seattle, but I didn’t want to wait. I donated that copy to the library in Rangeley, Maine. I also didn’t immediately tell Molly about it, because we were supposed to read the book together. Well, we’ve now given up that pretense. As the faster reader, and the one who tends to stay up late, I’ll get the first crack at it.)

What’s strange to realize is I’ve spent over a quarter of my life waiting for the next Harry Potter book to come out, and all of that waiting ends in about 28 hours.





Completely pointless iPhone observation

19 07 2007

The iPhone is polluting how I interact with other technology. I was just reading through a Word document on my laptop and I was confused for several seconds because the document wasn’t scrolling properly. Then I realized it was because I was flicking the laptop touchpad like an iPhone screen, which of course works in exactly the opposite way.

No wonder most people get confused by technology.





I Bought an iPhone

18 07 2007

My wife tells me this is because I have no ability to resist buying gadgets. Looking at the smartphones I’ve owned in the past two years, there might be something to it.

Parade of Smartphones

And if I still had my non-phone PDAs, the collection of personal gadgets would be even longer. (Palm III in 1998, HP Jornada 540, Compaq iPaq 3630, HP Jornada 567, iPaq 2200 series.)

So in spite of changing my PDA on average once a year, there are a few things about this purchase that did make me a little queasy. First, it’s the first time since my Palm III that I’ve used a device that doesn’t run a Microsoft operating system. Second, I had the device that immediately preceeded my iPhone (the Treo 750 in the picture) for less than two months. I had the device before it (the Cingular 3125 flip phone) for about eight months. Why have I been compelled to fly through devices so fast recently? Finally, I’ve had to put down more money for the iPhone than I have for any PDA. (I can’t recall the details, but the HP Jornada 540 might have been close in price.)

So what made me do it? Why did I go from flip phone to keyboard phone to iPhone in less than a year? Why have I abandoned Microsoft in my pocket?

There are two main reasons. The first is the simply stunning form factor of the iPhone. It’s half the thickness of the Treo, and the screen is amazing. I haven’t seen another portable screen like it. Browsing through photos on the iPhone is a great experience. I can show off baby pictures on this phone, and it will be as good or better as carrying a stack of 4×6 prints.

Second, the iPhone gives a great experience browsing the web. Much better than I’ve been able to do with any other portable device.

This last point highlights the interesting tradeoff I’ve made as a Microsoft employee. The Treo is the pinnacle of the business phone. It’s just as pleasant to hold as the iPhone (actually, I think the Treo feels better in my hand, while the thinner iPhone feels better in my pocket). The Treo plugged in seamlessly and effortlessly into our corporate Exchange servers. With it and its keyboard, I was mind-melded with the corporate information grid. But the Treo’s connection to the rest of the web is weak.

The iPhone is the opposite. With the iPhone, my connection to the Corporate Grid is tenuous (email on the iPhone is unpleasant, and my calendar is no longer always-up-to-date). But my connection to the rest of the Internet — to Google, to Facebook, to Flickr, to YouTube, to Amazon, etc., etc.  — is incredible.

That’s the about-face I decided to make. After nine years of buying devices that brought me increasingly in touch with the corporate world, I decided I’d rather have something in my pocket that would better connect me to the rest of the world.

Now that I have this fancy phone, though, I guess I better use it to call people!

PC and Mac





OneNote PowerShell Provider

18 07 2007

Worlds collide — up until now, I’ve been writing about my personal life. But I also have some things to share about work and technology. I thought about creating a separate website to publish that information, but finally decided that because I’m a combination of geekiness, and proud fatherhood, and other odd interests stuck together, then it’s OK to have this site be a combination of odd things stuck together. So, if you’re here for the baby pictures, then you should just skip the technology posts. And if you’re here for technology, then you should skip the baby pictures.

This is a technology post.

There are two pieces of Microsoft technology that I’ve been using recently and I love. The first is OneNote, which is the first program that I think can replace my cherished paper notebooks. Not only is OneNote a great place to write down all of those thoughts I don’t want to forget, it’s also turning into a wonderful tool for collaboration. Starting in OneNote 2007, OneNote has incredible “shared notebook” functionality. With OneNote 2007, you can have a team of people all contributing information to a single notebook. It’s a great way to build a common repository of knowledge.

The second piece of Microsoft technology I love is PowerShell. This is the ultimate geek-chic tool. It’s a powerful command line / scripting environment.

I now use these programs all the time. And like a Reese’s Peanut Butter Cup, I wondered if these two great technologies would be even better if brought together? So I’ve tried to bring them together in the form of a OneNote PowerShell provider. This is a PowerShell extension that lets you create and manipulate OneNote notebooks, sections, and pages from PowerShell. You can use provider to do some interesting automation using OneNote.

Here’s an example: One thing I wanted was a tool that sends email when pages in a shared OneNote notebook change. This turned out to be pretty easy to do in PowerShell. With the OneNote PowerShell provider, the following lines of script get all of the pages that have changed after a particular time — I use this line in the script to find all pages that have changed since the last time I ran the script.

$changedPages = dir $Notebook -recurse | 
    where-object { ([datetime]$_.lastModifiedTime -gt $targetDate) -and (!$_.PSIsContainer) }

The dir -recurse command gets me a listing of all of the pages, sections, and section groups in the notebook. The where-object clause is then used to whittle the list down to only pages (that’s the !$_.PSIsContainer bit) and only pages that have changed after $targetDate.

Then, I can use the following pipeline to export the changed OneNote pages to MHT format and remember the resulting filenames.

$exportedFileNames = $changedPages | 
    export-onenote -output $outputDirectory -format mht | get-propertyvalue ExportedFile

Finally, I use the Send-SMTPMail cmdlet from the PowerShell Community Extensions to send the email containing all of the changed pages.

While the core of the script is just those three pipelines, there’s a lot more to the script (217 lines more, to be exact) to do things like parameter validation, formatting, etc. But still, writing and maintaining 220 lines of script was a lot easier than maintaining the couple of thousands of lines of code it would otherwise take to accomplish the same task.

If you want to play with the OneNote PowerShell extension, I’m making it publicly available under the Microsoft Community License. You can find the binary files here: OneNotePowershell.msi. The source files are here: OnPsProvider-1158.zip.

If you install the provider, it will install several sample scripts as well, including the script I’ve been discussing here (Get-OneNoteDigest.ps1).

If you just want to read the documentation that comes with the provider and the scripts, it exists in OneNote format: OneNote PowerShell Documentation.

If you want to use PowerShell with OneNote to build useful tools, let me know. I’ll be curious to see how you use it.





Final Five pictures from our vacation

16 07 2007

I went through the remaining pictures from our vacation, and there were only five that really stood out. I’ve uploaded them to Flickr. To save you the effort of going to another site, here they are:

Alex and Molly

Alex, Elsa, and Adrian

Giant Family

Jack

Alex Before Bedtime