Powershell and Google Desktop
When I can find the time I try to dabble with Windows Powershell. I recently ran into a problem where I had to search for a bunch of serial numbers in a collection of log files. I wanted to determine what log records (if any) I could find for the hundred or so serial numbers I had. I was inspired by Scott Hanselman's post describing how to query the local google desktop server using powershell. He stopped short of coding an actual cmdlet to make it really easy. Well, I decided that is exactly what I needed here, so I coded it myself. Feel free to grab my powershell cmdlet for querying Google Desktop Search:
zip file - GDSCmdlet.zip
source - GDSCmdlet/
Right now this supports restricting the number of results, and whether you want files, emails, or the 'other' type of result. I don't let GDS index my chats or on-line content so I don't know the appropriate codes to use to support those. It'd be easy enough if someone wanted to modify my code to do so.
All the results are presented as XmlNode objects so you can pipe them into something else with full reflection support. I also add a new element called <query> so you can know what the original query was for any given result. This is handy when doing what I originally wanted...iterate over a bunch of numbers and dump any search matches into the pipeline. That way I can tie any resulting match back to what was used to find it. By default GDS doesn't include this in the search result.
To install jump to steps 5 & 6 from this post on the B# .NET Blog. It's really pretty easy once you get over the initial hurdle.
Once you're all set, just run something like:
get-gds "needle" -num 100 -type files | select query, url
...at a powershell prompt and search away!
Thanks to this article at The Code Project for a great example for me to build on.
Damn Canon
So I'm close to purchasing a new Canon Rebel XTi camera in about a month or so. I've been closely watching for Canon's biannual rebate program to see if I'd get a break by waiting, but no. They're not including the XTi in their program this fall.
...bummer.
2 New Prints
I'm realizing more and more that this site is not suiting my current needs. Until I get an idea of what I want I'm having to work within it's bounds. That said, until I find a better way to present new photos, I'll have to do them like this. I created an uploaded a new "print" from an older photo I took. I also went for a walk near my house this afternoon and created a nice panorama capturing the fall colors. Here's a small sample:

I grabbed some other pictures too, but I don't know if they're worth uploading yet.
Prints Gallery
I'm not really sure where this is headed (if anywhere?) but I've started a small gallery of photos I really liked. I'm not saying they're any good, but I think these will showcase what I think are some more interesting photos. Check out the link below to see them:
Jay Cook
Shannon and I headed up to Duluth to go camping at Jay Cook state park this past weekend. It was pretty cold (~40 degrees at night) but it was a lot of fun. Shannon and I took some pics with our point-n-shoot, and I have a roll of 400 speed film that's yet to be developed. For now though, here's a link to the pics that turned out:
Rename pics with PowerShell
I usually take pictures with our DSC-W5, by dumping them to a computer, formatting the camera, then repeating. This is a problem whem I want to keep two batches in the same folder, but the camera has restarted numbering the pictures. So I would have two files named DSC00001.JPG for example, even though the second instance is really another photo taken after formatting the camera.
I decided to work out how to rename a bunch of pictures using Windows PowerShell. Just to document this (albeit simple) operation here's the command I used:
ls *.JPG | foreach { mv $_.Name $_.Name.Replace("DSC00", "DSC01"); }
So what this will do is take a bunch of files named like:
DSC00001.JPG
DSC00002.JPG
DSC00003.JPG
...and convert them to:
DSC01001.JPG
DSC01002.JPG
DSC01003.JPG
For each batch of pictures I just increment the 01 to 02, or 03 and so on. Considering the size of the memory stick we use it's rare that I would have more than 999 pictures, so I don't need to worry overflowing the 3 digits I'm using to number the image. After I do this for each batch of photos I can safely copy them all to the same folder with no fear of colliding file names.
Now this is pretty specific to how the DSC-W5 names its files, but the process would be similar for other cameras. Of course you could make this as crazy as you wanted, but I was impressed by how simple things can become (in terms of what I need to code) when the .NET library is available like this.
WooHoo!
Just wanted to say that Shannon landed her first teaching job on thursday! She interviewed in the morning, and was offered the position 6 hours later :)
So starting this fall she'll be teaching first grade at Chanhassen Elementary. It's less than a mile from where I work too, so we'll even get to carpool. I'm so proud of her!
The Washington Mall
I'm out in Maryland for some training so I decided to hop a train to the capitol and take some pics. Click the pic below to see more:

