Monthly Archives: November 2010

It's cooooold out there today

It's our second day of winter wonderland here in Redmond, WA.  As you can see, it's nice and clear, but it is very cold outside.

  DSC01955

DSC01951

Amber is now walking to the bus stop to try to get to her lab in Seattle and  I am working from home again today.  I plan to talk to her management at their holiday party about the remote robot worker plan I mentioned yesterday.  I really think it could work.

We almost got enough snow that you can't tell I should have mowed the lawn at least one more time before winter got here.  Almost.

DSC01962

DSC01961

DSC01953

The most surprising news so far today is that my new phone is still scheduled for delivery.  I hope UPS isn't just taunting me:

image

Snow pictures

While taking a break for lunch, I snapped a few quick pictures of the snow around the house today.

It's still snowing, but the street outside is still pretty clear:

DSC01948

I tried to get a picture of the way the snowflakes pile up on the branches:

DSC01947

The deck is starting to get pretty well covered:

DSC01940

Thought this close-up of our maple tree was pretty:

DSC01942

I'm going to put some salt on the driveway, then back to work.

White fluffy cold death?

I like snow, especially when looking at it from inside a warm house, but Like many native Western Washingtonians, I have a somewhat irrational fear of snow.  Or at least driving in it.  Here's the problem:

  1. People here (myself included) don't really know how to drive in snow
  2. The topology of the region makes it hard to drive in snow - I don't care how good a snow driver you are, if you live at the top of Education Hill it's tricky to get up there when the road is covered in packed snow and ice
  3. There isn't the support infrastructure here to keep the roads clear when we get snow

So long story short, when it snows, I tend to stay home.  Fortunately, I have a job where I can work from home and still be productive.  At least reasonably productive.  Unfortunately, Amber is not so lucky.  When you do lab work, it turns out it is hard to do that remotely.  Personally, I think her company should invest in robots that can be controlled remotely, but they are probably concerned about a Matrix/Skynet scenario.  Who can blame them?  Ultimately we can only hope our robot overlords will be benevolent, but why should they be when we've given them all the crap jobs to do?

Anyway, while I was able to stay home this morning, Amber had to brave the elements and the traffic snarls to get to work.  She made it safely, but it was an awful commute.  Turns out that snow days aren't any fun when your Sweetie doesn't get to join in.

Be safe on the roads, everyone.

Looks like Tuesday

imageMy phone is on it's way.  According to the tracking, it should be here Tuesday.  Must have patience…

Made it to the weekend

I'm glad it is Friday.  Successfully made it to the weekend again.  Still don't have my new phone though.

On another note, I fixed another couple of issues on the blog.  Basically applied the suggested fixes on the blog 4 Umbraco issues list.  So now posts are correctly ordered on the page (most recent first) and they have the correct post time instead of midnight.  Maybe I'll try to fix a couple more issues this weekend.

But I want it now…

This may be one of those posts that invite the trolls to come out.  My new Samsung Focus, instead of being in my hands right now, is sitting in a warehouse somewhere.  But I'm getting ahead of myself.

I've been using my T-Mobile Wing for a very long time.  A very long time.  So many times I've been tempted to switch to the iPhone, but I've resisted.  I just knew that Microsoft would be shipping a great phone anytime now, and I wanted to be loyal.  So I've waited. 

Yesterday was to be the day my patience would pay off.  Unfortunately I was naïve.  So many other folks wanted that phone that the AT&T stores around here ran out of stock before I could get mine.  So instead of a shinny new phone, I have this to look at.

Waiting is the hardest part

So my new phone is supposed to arrive on Monday (maybe this weekend if I am really lucky).  Not a bad turnaround time, all things considered.

On a related note, I'm looking for a good blogging app for Windows Phone 7.  A cursory search of the app store revealed this app, which, while the price was right, didn't exactly get stellar reviews.

image

Maybe I should keep searching.  Or maybe my first Windows Phone 7 app project should be a blogging app.

Windy, laddery fun

When I got home tonight I was treated to the crashing of thunder outside.  Actually, it wasn't thunder, it was a couple of pieces of sheet metal flashing along the edge of my roof taking advantage of the somewhat high wind to try to make their escape.

I decided that they would probably be fine and that I didn't want to climb around on a tall ladder in the wind and dark, but a couple hours later, I heard a loud crash outside and decided to go back out to investigate.  The flashing had made significant progress, but hadn't come totally loose and I don't really think it is what made the loud crash.  This may of course mean that despite peering into the darkness with the flashlight that there is another surprise waiting for me somewhere on the homestead.

In any case, my next-door neighbors were outside (they had heard the crash too) and they helped me drag my ladder out and tack the flashing temporarily back in place.  Definitely needs more thorough repair sometime soon when a) it is daylight and b) there is a competent professional around to climb on the ladder.

Thanks neighbors!

Latest comments navigation issue resolved

Fixed another issue on PardonMyReach this morning.  The latest comments navigation on the right was showing an unexpected order for the comments and wasn't getting the latest ones.  It turns out that the XSLT that generates this content had a sort bug in it.  Here's the original code:

image

If you click on it to make it actually visible, you might spot the bug.  The key for the sort, @created, is actually a datetime, but the sort is treating it as a string and sorting it alphabetically.  Here's my fixed XSLT:

image

It turns out that each comment also has a sequential id, so I used that for my sort key, marked it as a number, and it works.

Some other possible solutions:

  • Parse the string into substrings (year, month, day, hour, minutes…)and sort appropriately.  I didn't do this because it looks like the string that represents the datetime created is not using fixed-width fields ("9/5/2010 11:35:23 PM" and "10/26/2010 10:08:09 PM" were demonstrate this), so it looked more challenging to do this.
  • Use XSLT 2.0 and specify these values as dates.  I didn't do this because I wasn't able to easily confirm Umbraco support for XSLT 2.0.  (A quick search on the forum indicated that it supports 1.0, but this may have changed.)

Tag issue resolution

imageAs I mentioned back in Tag filtering, anyone? I have solved the issue I found on my blog with posts not being included when using the tag filtered navigation.  Tags were being correctly counted on the navigation (shown right), but if you clicked on one of these links, only some of the appropriate posts would show up.

I should start with a little more background in case you haven't been following PardonMyReach.  I'm using Umbraco 4.5.2 and the blog4Umbraco package.  I had a really easy time getting Umbraco setup and the blog4Umbraco package installed, but there were a number of minor issues that I discovered with my new blog as I started using it, the aforementioned tag filtering issue being one of them.  Most of the time, I use Live Writer to create my posts.  I noticed that the blog posts that I was posting using Live Writer weren't included when I used the tag filtering navigation.

So one workaround (which I later found mentioned on some of the forums) would be to open each post in the Umbraco back office website for my blog and save it, which seemed to correct the issue, or simply to use the back office to create my posts in the first place.  Neither of these options was particularly appealing, so I kept looking into it.

imageIn examining the database where my content is stored, I found a table suspiciously named cmsContentXML.  Each row has two fields, intuitively named nodeId and XML.  In looking at the XML, I noticed a difference in the XML between posts.  Shown right are two such examples.  (Yes, I am lazy and just did a little image capture - someday I'll get around to writing a style for displaying code clearly in the blog.)  You'll notice that the <tags> element is actually empty (at least for all intents and purposes) on the second post.  Sure enough, when I filtered based on the appropriate tag, the second post was omitted.  Ah ha!

So for some reason, the tags weren't getting saved in the content xml in the DB when I posted using Live Writer, but the count of posts by tag were actually correctly displayed.  I also noticed in the DB that there are two other tables, cmsTags and cmsTagRelationship.  cmsTags is a mapping of tag ids to tags.  cmsTagRelationship is a mapping of content nodes to tags.  And this table was correct.  Just to see if this issue was likely an issue with the blog package or Umbraco, I created a new document type with a tag property and tried creating some content with the back office and with Live Writer and found the same result.  So I concluded the issue is actually in Umbraco and not the blog4Umbraco package.  I spent a little time looking through the Umbraco source, but the issue wasn't obvious to me and I wasn't really all that excited about patching the CMS, so I turned my attention to trying to work around the issue in the blog4Umbraco code.  (It's also possible that this is deprecated functionality and the tag relationship should be determined from the tags library instead of the content node, but this seems a little inconsistent with the other properties).

After looking at the code, I decided the easiest thing to do would be to fix up the content node.  So I looked at creating an event handler.  In blog4Umbraco, there are already several defined, so I opened up BlogDateFolder.cs and added an event handler of my own:

image

(Sorry again about the formatting on this - I guess I'll have to look into displaying code more clearly.  Actually, I tried to post this as code wrapped in a <pre> tag, but it caused an error.  More issues to look at…)

As you can see, I found that the umbraco.editorControls.tags.library.GetTagsFromNodeAsITags() method correctly returns the tags associated with a node.  So I created a BeforePublish event handler and wired it up in the constructor of BlogDateFolder.  The method Document_BeforePublish_Tag does the real work.  In this method, I simply get a list of tags using GetTagsFromNodeAsITags(), create a comma delimited string of tags from this list, and reset the empty tagProperty.Value to the string I create. 

I liked the idea of making this a BeforePublish event handler since it both fixes new posts from here on forward and also allows me to fix the existing posts simply by republishing my content tree.

I could probably clean this up quite a bit.  Firstly, I should probably use a string builder for better performance.  And I could also check to see if the tags need fixing in the first place.  I could also pull this out of blog4Umbraco and create a separate package that would allow a user to configure which ContentTypes to fix (in case they have more than just BlogPost that they care about).

Pictures from SeaWorld

While Amber and I were down in California last month, she took me to SeaWorld.  We saw a bunch of shows, including Shamu: Believe.  I think this was my best picture from the show.

DSC01805

The weather was consistent with the rest of the weekend - gray and cool - so we didn't go on any of the water rides.  But we did check out all the sights.

DSC01753

DSC01832

These guys were the stinkiest.

DSC01781

DSC01786DSC01773

As you can tell, it was a very happy time with my Sweetie.  :)

You can check out the rest of the photos in my flickr set SeaWorld.

In case you were confused, just the flamingos were stinky, not us.