Friday, October 31, 2008

Happy Halloween!

Happy Halloween

Monday, October 27, 2008

10K "Fun Run"

Kel and I spent the Labour Day weekend in Whakatane.

While we were there I needed to do my last long(ish) run before the Auckland Marathon next Sunday. So I thought I'd head over to Ohope beach on Sunday morning and do the Ohope Beach Walk 2 Health Challenge. The entry fee goes to a good cause (Bay Hospice), it was a nice day, Ohope is a beautiful beach, and they'd measured out a nice series of courses (3k, 5k, and 10k).

The only drawback was something my marathon training plan had warned me about: wasting the extra energy that builds up from the decreasing training mileage to go and run too fast on a useless workout.

But that won't happen to me I thought as I listened to the pre-event briefing, where they too said "this isn't a race, there are no prizes for coming in first, go out and have fun".

But sure enough, once the run started, I gradually accelerated and ended up running a PR in the 10K by nearly 2 minutes (if the course is accurate)! My time was 44:08 over a previous best of 46:02. So the course would need to be off by over half a K for that not to be some kind of PR.

Oops . . . Oh well, doesn't seem to have impaired me too much. I feel quite good today, so I suppose we'll see how a medium long, slow recovery run goes tomorrow.

By the way, here's Ohope beach . . . notice the miles and miles of beautiful sand and surf without a person in sight! You'll see a few more people in the summer, but it never gets near anything you'd call crowded.



Ohope Beach

Ohope Beach Looking Towards the East Cape

Wednesday, October 22, 2008

Minnesota Absentee Ballot




I think I've now completed the process to submit my absentee ballot.

Minnesota made it quite easy . . . I was able to complete my request and overseas registration (FPCA) by scanning and emailing the documents to the Hennepin County election officials.

They acknowledged that when it was received, then sent me the ballot paperwork as PDFs via email.

Those then had to be printed, and snail-mailed back, but overall turnaround was about a week.

Now all that's left is watching the election coverage. I normally get all my U.S. news from The Daily Show and The Onion, but I'll be curious to see what TVNZ do for election night (afternoon for us).

https://www.overseasvotefoundation.org/

https://minnesota.overseasvotefoundation.org/

Thursday, October 16, 2008

Stolen Bike

N-Duro 2006Our shed was broken into the other night and my mountain bike stolen. Fortunately, Kel's bike was in my car at the time, so they only got one of two bikes out of the shed, but I'm still pretty annoyed about the whole thing. The police have been very helpful, they came out to fingerprint and everything, much better service than you'd get in the states for this kind of thing. But I'm not holding my breath.

I think we'll be moving all the toys down to Whakatane this weekend.

Damn this pisses me off! I liked that bike. :-(

By the way, if any readers are in the North Shore area and come across a dodgy bike sale, let me know if you see a black Giant XTC 3. It's got a couple of very distinctive features that I could identify straight away if I (or the police) can get a close enough look at it.

Thursday, October 02, 2008

Darjit Bird Sculptures

KelhiCreative.co.nz
I've made a couple of updates to Kel's site.
Last weekend we drove over to Katikati to drop off a couple of darjit sculptures she's just finished for the Katikati Open Air Arts festival.


Hanging BirdThe Hanging Bird has been in it's tree all week, but unfortunately, the Standing Bird was knocked over and damaged by volunteers as they were moving them out to the park for display in the morning. (Unbeknownst to us, they were moving all the sculptures from the park to a fenced in yard every evening, all but the Hanging Bird and some of the bigger ones anyway).

Unfortunately, that was the first day it would have been on display, and the day before the judging. Needless to say, Kel's not too happy about the damage, and definitely not happy that the Hanging Bird is out in the park all night by itself.

Hopefully, the damage is repairable, but it'll take time, and it may be a while before we have any pictures of it outside looking the way it should.


Hanging BirdStanding Bird

Monday, September 22, 2008

The Legend

The race this weekend went great. I finished in 1:46.21. As far as I can remember, that's my fastest half marathon, though I suppose that's not too difficult, as the next fastest that I know of was the halfway split in my first marathon (1:49:40). I haven't run a lot of on-road halves.

Anyway, the day was fantastic, sunny and pleasant. The course was hilly, but nowhere near as tough as the website made it sound. Our weekend long run course on Whangaparoa road is quite a lot tougher. That said, there were a lot of rolling hills and nice smooth downhills.

Here are the splits (markers were every 2km)
2k - 10:07 (5:03s)
4k - 19:47 (4:50s)
6k - 30:30 (5:21s)
8k - 40:27 (4:59s)
10k - 51:55 (5:44s)
12k - 1:04:04 (6:04s) - big uphills.
14k - 1:14:20 (5:08s)
16k - (4:34s)
18k - (4:34s)
20k - (4:34s) 8:27? (4:13s)
21k - 1:46:21


My watch data is a little bit muddled from 16-20km. I think I got some of the full marathon distance markers mixed up with the half markers. But whatever happened, I was definitely averaging 4:34s from 15km to the finish! I would love to have the splits from the last 2km. 18-20 is 8:27 in my watch, but I'm not certain that's right.

Thursday, September 18, 2008

Marathons Past

This last weekend I did a 34k training run. That may be the furthest I've ever run outside of an actual marathon. It was definitely almost as tough as running a marathon itself.

It got me thinking about past races and times. It occurred to me that I'd lost track of how many marathon's I've run. I had the feeling it was somewhere around 10, but I couldn't be sure.

After a bit of searching around the websites of the races I've run, it turns out that this upcoming Auckland marathon will be my 9th. For future reference, here are the races and times:

EventTimeComments
Grandma's Marathon 20023:48:11First Marathon with Craig, Pete, and Scott
Twin Cities Marathon 20033:59:54Ran by myself, beautiful weather. Breaking 4:00 in this race is what made me think I could just keep running without training.
Grandma's Marathon 20044:00:20Ran with Peter Akimoto. Stayed in the Clown House. I probably would have wimped out on this one if Peter hadn't been keen on driving up to Duluth on Friday night.
Twin Cities Marathon 20055:18:06Ran this one with some first timers from work. For the record, running slower is more painful that just running as fast as you can (To a point at least, the very first marathon, I was at the best fitness level, but in the worst shape at the starting line, and in the most pain afterwards.)
Auckland Marathon 20064:28:16First New Zealand Marathon. This one made me decide that I'd better get training again after all.
Rotorua Marathon 20074:51:10This one was brutal. Pouring rain at the start line, cold wind later. This is the only marathon where I thought for a while that I might not finish.
Auckland Marathon 20074:08:20I was in overall good shape for this one, but not the greatest running shape. I held the end together quite well, but just didn't have the leg muscles to finish under 4:00
Rotorua Marathon 20084:07:03Much better than the last Rotorua, in fact the day was nearly perfect. Same story as Auckland 2007, good run, just couldn't pull in under 4:00




The last few months I've put in more running than any year since 2002. We'll see how that works out.

This weekend I'm running a half Marathon. "The Legend" named for Arthur Lydiard's training route in the Waitakere's. Looking at Arthur's training methods, they're nearly identical to what my old high school cross country coach used to use. I may have to study up on that again, I wouldn't mind seeing how close I can get to my 5k PR (18:03) one of these days in between marathons.

Anyway, here's The Legend, I'll post a race report afterwards:

Wednesday, September 10, 2008

Compile Error in ASP.Net (error CS0103: The name 'X' does not exist in the current context)

Note: I would have liked to title this post "Microsoft Voodoo make Hulk MAD!!" but for reasons outlined in the rant below, I went with the title above.



The Problem


In an ASP.Net web project you may see one of these two compile error messages referring to a control in a page:

In the Visual Studio 2005 Output window:

"error CS0103: The name 'X' does not exist in the current context"
"error CS0117: 'XPage' does not contain a definition for 'X'"

and
In the VS.Net 2005 Compile Error List

"The name 'X' does not exist in the current context."


Where 'X' is your control variable name (like TextBox1). If you're seeing these, then you may have the same problem I did.

My problem more specifically was that I was copying files from one (working) VS.Net solution which contained one sort of web project, to another stand-alone project. I needed the new project to have a .CSProj file so our build guys could compile the site with whatever they're using. As soon as I copied the first non-static content into the new Project, the errors above started.

My Solution


The technical root cause of the problem was that there was no variable referring to the control(s) in the page object model.

More details


When I added a new page from scratch, a WebForm1.aspx.designer.CS file appeared, with the following code in it:

protected global::System.Web.UI.WebControls.TextBox TextBox1;


Hmmm . . . why did the other page not have a designer.cs file? In fact the original project I was copying from has no Designer.cs files at all.

I went back to the other (working) project and right clicked on the object referece to my control. In response to "Go to Definition" I got a message box stating:

"The definition of the object is hidden."


WTF?!?

Hidden where exactly? Visual Studio's little "Show All Files" option is greyed out. A look at the file system revealed no mystery files. This was starting to sound familiar from my long ago reading about new partial class features.
After Googling "The definition of the object is hidden" I had my answer (see references for details, specifically [1]).

It turns out that I'd stumbled into a gap between "Web Site Project" and "Web Application Project"[2]. I was attempting to manually copy files from a "Web Site" into a "Web Application". In a "Web Site Project", the compiler does some code generation for you, and hides it away in a temporary assembly stored in the location specified by HTTPRuntime.CodeGenDir.

"Web Application Projects" were rolled into VS.Net 2005 with Service Pack 1.

So anyway, throwing the textBox variable declaration into the code-behind file allowed a successful compile with a cut down version of the page. That was definitely it.

Now that I knew what I was looking for, I searched on "Converting a Web Site Project to a Web Application Project". Sure enough, that turned up [4] Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio 2005

Great . . . not only does this guide contain an exact description of the specifics of the problem, but it's a detailed guide to the solution. I still need to read a bit more of this tomorrow, but this has certainly cleared the biggest roadblock. To rub salt in the wounds, if you do the file copy from IDE window to IDE window it all happens magically, I never would have seen this problem at all:

"Visual Studio includes an option to convert pages and classes within Web application projects to use partial class declarations. Partial classes are used to separate designer-generated code from code-behind code. These designer-generated classes are stored in a separate file from the code-behind file. This conversion process causes Visual Studio 2005 to recursively examine every page, user-control, and master-page in the project, and to automatically generate a .designer.cs file for each. Visual Studio also changes the .aspx or .ascx files to use the codeBehind attribute instead of the codeFile attribute."


<BonusRant read="optional">
I get incredibly annoyed with some of these 'easy' problems. I want to be able to just look up the error message in a search engine, but it seems I always run across the same pattern of search results:

1. Often the top couple of hits are totally irrelevant sites that happened to be experiencing the same error at the time that the crawler bot visited.

2. The next hit or two are even more annoying. Typically, it's somebody who has innocently(naively) cut and pasted their error message into some forum site or support board. Their post is at the top, then there follow the useless trolls and know-it-alls who bitch about posting off topic or demand more irrelevant data. Then the whole thing either trails off, or the person solves their own problem, but doesn't post the solution. Better forums at least they put a little mark on the solution (if one has emerged).
3. After the first page or so of search results, you just get forum sites that scrape other forum sites, or tons of cross posts of the original problem to ghost-town forums.

So anyway, the moral of this story is: here's my contribution back to the internet: The error message and a solution in one troll-free page. ;-) I've seen quite a number of search hits for other technical posts here, so hopefully this helps somebody.

</BonusRant>

References


[1]The Definition of the Object is Hidden
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115127

[2]Visual Studio.Net 2005 Web Application Projects
http://msdn.microsoft.com/en-us/asp.net/aa336618.aspx

[3]ASP.Net 2.0 Hidden Files and Assemblies
http://blogs.msdn.com/daviddu/archive/2006/06/03/616324.aspx

[4]Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio 2005
http://msdn.microsoft.com/en-us/library/aa983476(VS.80).aspx

Monday, September 01, 2008

Tech Ed NZ 2008

Tech Ed New Zealand is on at the moment. It's day two.



I was excited about it over the weekend and yesterday morning, but I've had enough now.

This is one of those in between years when everything is pretty much where it was last year. Visual Studio 2008 and .Net Framework 3.5. I didn't even see anything shiny or fun in the Silverlight or WPF department. Most annoying of all, in between sessions when I went down to play in the hands on labs, all the lab virtual machines had expired beta versions of Expression Blend, rendering them unusable for WPF and Silverlight labs.

Ah well, maybe it will be more fun next year. I really only learn from what I work with every day anyway. At the moment, that's WCF via VS.Net 2005, most of my work doesn't even have GUIs other than my own test harnesses.

Speaking of testing, one of my co-workers: Rob Fonesca-Ensor gave a presentation on Dependency Injection, Inversion of Control and Unit Testing during the New Zealand .Net Users Group Code Camp on Sunday. Very good presentation. There's some stuff I'll actually use soon, I need to do some follow-up on the Ninject framework.

Two other good things out of Tech Ed: Scott Hanselman is coming over here to talk to our developers in our lunchroom for a couple hours. Scott's ASP.Net MVC presentation was the high point of day one. Then OpShop is playing at TechFest tonight.

Wednesday, August 27, 2008

Waikato Tough Guy and Gal

Tires

The photos are finally available from the race.

It was a 6 (1 lap) or 12 (2) kilometer race through a mud track and army-style obstacle course.

Kel ran her 6K in 1:20:23

I did the 12K in 1:35:33

My lap 1 was 43:06
Lap 2 was 52:26.

It felt like lap 2 was slower mostly due to congestion on the course and obstacles.

Weather was good, rain overnight (good for mud), but mostly sunny and just slightly chilly during the race. We had just a bit of a shower about halfway through.

Overall a lot of fun, definitely have to do this one again next year. Hopefully we can get a team together next time!


FenceMud

Wednesday, August 13, 2008

Waikato Draught Tough Guy and Gal

Kel and I are doing this race in Rotorua this weekend:
http://www.toughguyandgal.co.nz/

Waikato Tough Guy and Gal

Tuesday, July 22, 2008

Updates to Kel's Site

Kel did another Darjit Sculpture workshop this last weekend.

This time she made a couple of bird sculptures. One for an upcoming competition.

Darjit BirdWireframe Bird

http://www.kelhicreative.com/DarjitGallery.htm

Sunday, June 15, 2008

Snowplanet



It's winter here in New Zealand, and the ski slopes are starting to open. I heard the other day that this is the earliest opening for some since 1992.

Later this season we'll get down to the south island to hit Cadrona or Treble Cone. But in the meantime, Staton and I went up to check out Snowplanet.

In Minnesota, there'd be no need for a place like this. But down here, even in the depths of winter, you'd have to drive 3 or 4 hours from Auckland to find snow. Even then it's hit or miss. We went skiing at Whakapapa last year towards the end of the season, and the snow was pretty poor.

Snowplanet's like a bunny hill in a box. Like a Minnesota hill, you spend more time on the lift and in the queue than on the downhill, but it's nice for knocking a little rust off before heading for the mountains.


Staton at Snowplanet
Snowplanet

Saturday, May 10, 2008

New Zealand Music Month

In honour of NZ Music month, I thought I'd link some of my favorite Kiwi Music.

In no particular order or organisation:

Evermore: Running


Minuit: Fuji


Atlas: Crawl



Scribe: F.R.E.S.H.


Scribe: Say it Again


Solaa: Sylphlike


Tiki Taane: Tangaroa (God of the Sea)


Have a look at Amplifier.co.nz as well.

Rotorua Marathon 2008


Rotorua Marathon 2008
I completed the Rotorua Marathon last weekend (May 3rd).

I ran 4:07:03, which is my fastest New Zealand marathon, and way better than Rotorua last year. However it's a ways off my best marathon time (3:48), and probably not quite fast enough to keep me ahead of Craig when he runs the Marine Corp marathon in October. Fortunately, the Auckland Marathon is just a few days later (2 Nov), so I've got something definite to shoot for if Craig does beat me. ;-)

Anyway, conditions were just about perfect for Rotorua this year. Sunny, slightly cold, dry, and partly cloudy. It was an all around fantastic day for running. The only possible compliant is a little bit of a headwind along the open stretches around kilometers 25 to 35 or so.

My splits are surprisingly even. I can't come up with any issues with this race: Weather was perfect, the course is fast, and my nutrition/hydration felt great this time. I just need to do some training and run faster next time. I think that 8:01 for K35 is a misplaced marker. I did take a food break around there, but not that long, the 5:30 before that makes it doubly suspicious. I think that 5:30 probably ought to be about 6:30, with one minute off the 8:00 and about 30-40 seconds of the remaining 7:00 going to slacking off at the water stop. That would make the last kilometer my slowest at 7:06 (pretty much to be expected), and my fastest that 4:57 on the big downhill on the back side of the lake (also no surprise).




Km Elapsed Split
1 6:06 6:06
2 11:56 5:50
3 17:17 5:20
4 22:54 5:36
5 28:15 5:21
6 33:35 5:19
7 38:38 5:02
8 44:11 5:33
9 49:31 5:19
10 55:04 5:32
11 1:00:36 5:32
12 1:05:56 5:19
13 1:11:09 5:13
14 1:16:35 5:25
15 1:21:57 5:22
16 1:27:54 5:57
17 1:33:59 6:04
18 1:38:56 4:57
19 1:44:30 5:33
20 1:50:20 5:50
21 1:56:33 6:13
22 2:02:05 5:31
23 2:07:27 5:21
24 2:13:27 6:00
25 2:19:29 6:01
26 2:25:04 5:34
27 2:31:01 5:57
28 2:36:28 5:26
29 2:42:19 5:50
30 2:48:06 5:47
31 2:54:06 5:59
32 3:00:30 6:24
33 3:07:27 6:56
34 3:13:01 5:33
35 3:21:02 8:01
36 3:27:28 6:25
37 3:33:55 6:26
38 3:40:24 6:28
39 3:47:06 6:42
40 3:53:36 6:29
41 3:59:58 6:22
42 4:07:03 7:06

Sunday, May 04, 2008

Photo Catchup Part II

Still more catching up to do . .



As a Christmas present, I enrolled Kel in a Darjit Garden Sculpture workshop over in Tauranga. She created a planter for her mum's garden.

I took some photos, then headed off to climb Mt. Maunganui, and do some surf kayaking at the beach.


Mt. Maunganui



Filling in the Wireframe
Filling in the Wireframe

Filling in the Wireframe

Finished, Still Wet

Finished, In Place, and Planted


Wireframe

Kel and Throne

Finished and Dry

Nightglow

Nightglow



She liked that class so much, she enrolled for another one before leaving at the end of the second day. In that one she's been making a big garden throne. That's still in progress, she's going to cover it with mosaic.

A couple of weekends ago I drove down to Tauranga to pick it up (it takes a week to dry, and Kel was on call that next weekend). On the way back, I stopped in Hamilton to catch the Nightglow part of the Balloons Over Waikato festivities.

Over the last few weeks, we've been photographing all of Kel's paintings and Sculptures, and posting them to a web site we've set up. http://www.kelhicreative.co.nz/. I'll post more of the Darjit Garden Sculpture photos there as they progress.




Photo Catchup

Alright, It's been way too long since I've posted to do much in the way of catchup. I'll have to settle for a barrage of photos. Here goes:


Trip to Minnesota, late December early January


Highlights:

  • Seeing family again

  • Kel's first white Xmas

  • Staying up North at Grand View Lodge with the gang

  • Dogsledding

  • Cross Country Skiing with Craig and Jeff

  • Catching up with friends in town

  • Seeing all the Xmas Lights

  • Catching a Wild game in St. Paul




Kel, Mom and Trinity
Grand View Lodge
Kel, Claire and Joel from Suomi Hills Kennels
Kel and the Dogs
Nordic skiing at Grand View Lodge.
Kel's First Snowmobile Ride.
Wild vs Oilers



Cindy - Before
Cindy - After
Kel and Cindy at Port Ohope
Kel and Cindy at Port Ohope


Second Christmas in Whakatane


After getting back to New Zealand, we had a second holiday celebration down in Whakatane, Kel's hometown in the Bay of Plenty. For those of you who've met Kel's mother's dog Cindy, we saw her for the first time after her summer haircut, it was hilarious! Definitely much nicer to have the shorter coat for swimming over at Ohope.

 



Miscellaneous News from back in NZ



  • In mid January, I did the Wild Turkey Off-Road Half Marathon. That was a blast, after about 7 km along the beach, it had a whole long canyoneering section in the middle. I spent more time taking photos than running, but it was all great fun. My friend Staton spent most of the race trying to keep his iPod dry. :-)

  • For my birthday this year, Kel bought me a kayak! That's been out several times now, around Whakatane and Mt Maunganui.

  • We went to see Bon Jovi in Christchurch




Kayak on the Swift
7Km Along the Beach
Staten and I
Waterfall Climb from the Top
Bon Jovi at Jade Stadium


Ok, this post is getting long. To be continued. . .

Thursday, February 21, 2008

Google Calendar, RSS, ATOM, XML, XSL, XPATH, Namespaces and Firefox Bugs

I'm not quite sure how such a simple request spiralled out of control, plunging into buckets of alphabet soup . . . but I need to write something down. By Monday morning I'll have completely forgotten what the hell I was doing today. :-)

It all started simply enough: Updating a rusty old business process.

The old process:
1. Business user creates/updates a timetable spreadsheet.
2. Business user emails spreadsheet to web team.
3. Web team converts spreadsheet to HTML cuts/pastes/styles and generally beautifies content.
4. Web page is updated with new Timetable HTML.

This of course is a very 90's way of running a website, so we were discussing alternate ways of updating and automating this process.

We settled on the idea of creating a Google Calendar for the Timetable. The interface is simple for the business users, not much different than their Outlook calendar. The owners can set up their recurring appointments, and when they need to reschedule something around an event or shift a time, it's instantly live.

On the web team side, we just needed to pull down the RSS XML from the public address of the calendar, style it with XSL, and output the same HTML table view that the users know and love.

New Process
1. Business users maintain Google Calendar
2. RSS, XSLT and CSS magically produce an HTML Timetable for the site.

And so it began . . .
I set up a public Google Calendar, entered a few test events, and downloaded the Atom feed Xml.
I posted the Atom XML on my local web server.
I opened the XML in my browsers . . Firefox shows me the feed subscription page, IE6 shows me raw XML . . . so far so good.
I created a rudimentary XSLT and inject it into the top of the XML file.


<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="wtf.xsl"?>


This displayed my "Hello XSLT" in IE6, but Firefox still shows me the default subscription page. I figure I did something dumb, or not quite standards compliant, and set off happily developing and testing in IE6 (back to this later).

Now I started putting some XPath pattern matching into my XSLT. This didn't go so well.

An RSS/Atom doc is pretty simple, it's really just a 'Channel' or 'Feed' element filled with either 'Item' or 'Entry' elements.

So I was surprised when none of my XPath worked. No combination of

/ //Entry /Entry Feed/Entry /Feed or //Feed

selected any content.
Annoyingly,
<xsl:for-each

did work, and when I did
<xsl:value-of select='name(.)'

on the current node, I got back "Entry" and "Feed".
Grrr . . .

Eventually, I decided that it had something to do with namespaces, particularly the default namespace.


<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gCal='http://schemas.google.com/gCal/2005'
xmlns:gd='http://schemas.google.com/g/2005'>


Google turned up all sorts of noise around how to pull out namespaces using XSLT. I was distracted for a while trying to pull out the default namespace programatically, and tack it on to my XPath patterns. In the end, it turned out to be quite simple. I just needed to declare a prefix for the default namespace in my XSLT file:


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom">


This page pretty much solved it for me:
XPath and Default Namespace Handling;

Embarassingly, this article from back in 2001 would also have shown me the light:
http://www.xml.com/pub/a/2001/05/02/trxml.html;

Of course this all would probably would have been easier if I used a tool other than Notepad as my XML/XSLT/XPath IDE. :-)

In any case, a very simple little XSL pulls all the Entry Node contents out of an ATOM Feed:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom">
<xsl:template match="/">
<html>
<head><title>Google Calendar Test 2</title></head>
<body>
<xsl:apply-templates select="//atom:entry"/>
</body>
</html>
</xsl:template>
<xsl:template match="atom:entry" >
<h2><xsl:value-of select="name(.)"/></h2>
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>


This gave me a ugly but accurate display of the timetable info we were after . . . at least in IE.

I popped over to Firefox to take a look at it, and discovered that Firefox still displayed the same old default subscription page. I fiddled with pathing and file names for just a bit before deciding that it was something stranger than me fat-fingering a path.

It turns out that Firefox does indeed ignore your stylesheet if the phrase "RSS" or "Feed" appears in the first 512 bytes of your XML file!

Firefox 2.0 breaks client-side XSL for RSS and Atom feeds

BugzillaBug 338621 – Feed View overrides XSLT stylesheet defined in XML document

*sigh*

Ah well, I did get a good laugh out of one of the workarounds in the comments:


"The emerging workaround for this problem (which isn't new to us, since we're
using the same heuristic that IE7 betas have been using for months) is to put
in a comment ranting about the evils of sniffing web content and overriding the
desires of web developers which is long enough to move "<rss" or "<feed" out of
the first 512 bytes, since that's all we sniff.



Then, just to kick some more sand in my face, I caught this out of the corner of my eye as I was closing up my browser windows for the day:


"The Firefox pitfall

All would be good in the land of RSS and Atom if Firefox had support for the disable-output-escaping feature in XSLT but it does not.

disable-output-escaping is an obscure feature in XSLT that serves only one purpose: it processes tags that appear in other tags, such as CDATA sections. And, RSS and Atom make heavy use of CDATA sections to embed HTML code.

With disable-output-escaping, you should be able to lift the HTML tags from the feed and insert them right into the HTML page...but for Firefox. Firefox essentially ignores the instruction so it ends up displaying the raw HTML code.

There's been some debate in the Firefox community as to whether this behavior was standard compliant or not. Nevertheless it is a problem and one for which you need a solution."

Working XML: Serve friendlier RSS and Atom feeds


Then, to top it all off, I realized that there was no way we would have been able to inject that initial stylesheet declaration into Google's Atom XML anyway. We've no choice but to use either some server side script or some string parsing to help with the transformation. So we don't really need to worry about XML Namespaces or XML element names for that matter. Hmmm . . .

Ah well, I'm sure I'll be pissed about all this on Monday, but for now I've had enough. Hopefully I'll get around to posting some catchup stuff by Monday!
Have a good weekend!

File Under: Technology,

Tuesday, February 12, 2008

Posts To Do

Ugh, I can't believe it's been over a month since I've posted anything. After finally getting around to the long overdue blogger layout upgrade, I figured it'd be much easier to get back into posting regularly. Unfortunately, with the summer weather down here, it's been pretty tough to set aside computer time.

Anyway, here we go now. Since my last non-technical post:

  • We've been back to Minnesota for Christmas and New Years

  • Down to Whakatane for a 2nd Christmas with Kel's family

  • Down to Christchurch to see Bon Jovi

  • Kel gave me a Kayak for my birthday!

  • We attended a Twenty20 Cricket match: NZ (Black Caps) vs England.

  • We've been down to Whakatane for Kel's cousin Jeremy's wedding

  • We've been over to Tauranga where Kel attended a sculpture workshop I'd booked for her as an anniversary present (meanwhile I paddled Tauranga harour)


  • Individual posts and piles of photos to follow . .

    Wednesday, January 09, 2008

    Upgraded Blogger Template to New Layout System.

    I've just finished something that I've been putting off for a long time: upgrading my blog template to Blogger's new Layout system.

    At first, it appeared to go quite smoothly. The same basic theme/template was still available, and all my widgets and hacks worked as HTML/Script blocks with no problems.

    I ran into the first issue when I wanted to increase the width of the main post window. This little comment in the HTML of the template says it all:


    /* Page Structure
    ----------------------------------------------------------- */
    /* The images which help create rounded corners depend on the
    following widths and measurements. If you want to change
    these measurements, the images will also need to change.
    */


    Happily, the HTML of the new template was nearly identical to the old one, so I just reused my wide rounded corner images from the old template.

    Anyway, glad that's done. Now I can get back to posting without being annoyed by the old layout code every time I look at things.

    For those of you who subscribe via feed readers and never hit the blogger pages, here's what's changed.


    • Switched the header image from the St. Croix river to Mt. Nguaruhoe.

    • Got rid of the "Days in New Zealand" counter. It'll be two years in April. That counter originally started as a countdown to keep me motivated in my moving preparations. It's not so interesting anymore.

    • Added a feed for my shared items from Google Reader.

    • Added a feed for my code snippets on Snipplr.

    • Added a "What I'm Reading" badge from my Anobii bookshelf.

    • Added a quilt of my iTunes album covers from LastFM.

    • Added a blogroll of shared feeds I read from Google Reader

    • Added a tagroll of my bookmark tags from Del.icio.us. (Although I mostly use Google Bookmarks and Google Notebook now. Unfortunately, Google bookmarks is still missing a few cool features from Del.icio.us. It's main advantage, and my reason for switching, is that it doesn't get blocked by most Surfwatch Big Brother programs)