Friday, May 15, 2009

My Starting Place

I know a lot of people in my generation that moved around a lot while growing up. There were a rare few that, especially as time went by, still lived in the same house they grew up in, in the same town, surrounded by the same people. I was one of those people.

I lived in the same house from day 1 until I graduated from college at 21. My parents were never apart. I went to three schools in pre-college days: Ottawa Hills Elementary from K-5th, Blandford Nature Center in 6th, and City High/Middle from 7-12th. Suffice to say, change came more from within than it did in my day to day routine. It was a good life, a stable life, built on good foundation. But those three schools no longer exist.


With the demolition of my elementary school this week, I have realized that the final real, concrete brick connection I had to my hometown was now a pile of rubble.

My elementary school, where my brother attended 5 years before me, is no more. My special 6th grade environmental program at Blandford Nature Center, where my brother attended 5 years before me, packed up many years after I left and relocated. My middle/high school, where my brother attended 5 years before me, was demolished the summer after I graduated to make room for parking and classrooms for the local community college. Our beloved house on the hill in the Ottawa Hills neighborhood of Grand Rapids was sold in 2002 after 30 years in our family when my parents moved to southern California. It is as though my formative years, the good years, lost all connections to home before I was really ready to see them go.

I was a latchkey kid. I walked to elementary school every day with my neighbor, Kevin Vance, as my parents left for work at their schools across town. Kevin and I played together after school at the house, on the school's playgrounds and fields, and on the streets and sidewalks in between. I remember being a good student with Mr Griffin in Kindergarten, Ms Freeman in 1st, Mrs Meyers in 2nd, Mrs Bookman in 3rd, Mrs Wilcox in 4th and 5th... all at the school that took me in as a scrawny 5 year old and opened its doors to let out a budding 5th grader.

Ottawa Elementary was a school with a strong, brick exterior that made me feel safe, even on the big kid's playground, even in the harshest of Michigan winters. It was a school that allowed me the pleasure and awe of being in 5th grade, walking down to the 1st floor, kneeling, and watching the incoming kiddos stretching to the same height I now was. It was where I learned tornado drills and cursive. It was where I touched a computer for the first time. It was where I learned about crayons and erasers, the pleasure of peanut butter sandwiches and fruit roll ups, about dodge ball and frisbee. It was about friendship that through many twists of fate and inventions of technology, still exist at some level some 30 years later.

I had come to terms with my middle/high school being demolished many years ago. Those years, as I sit today, were more painful than they should have been. They were hard years. I dont feel the same about them as my prior schooling years, though the few friendships I had were close and extremely important at the time, as they are now. But high school is more about the preparation of moving on to college, life on your own. It didn't conjure up the same nostalgia as watching my elementary school take its final bow.

I always wondered what it would be like to go back to the old neighborhood. To show my wife where I lived, where I walked to school, where I played baseball every day, every summer, until the sweat stained my baseball cap that unique shade of dirt that kids love. To make that walk from the house to school one more time, maybe with kids of our own. But I hesitate. The house isn't mine anymore. The school doesnt exist anymore. I am a stranger to my hometown now. Something soon will be built in its place. I pause to take a breath, realizing the newborn kids in the neighborhood will have their own starting place soon.

Friday, May 8, 2009

How to alphabetize xml elements using XSLT

I dont blog about my day job much, but I had a problem to solve and wanted to post the solution I came up with to possibly help someone else looking to do the same thing.

Problem: I have a pretty flat XML block that I need to store in a table with an xml datatype column. That xml column has a schema that requires my root elements to be in a specific order (alphabetized). The structure of the XML blocks are variable -- some fields are present in some blocks, other fields are present in other blocks. So how do I alphabetize my xml elements when I don't know exactly what the elements are?

Solution: I came up with an XSLT transformation to do the job.


Original XML:
<doc>
  <c mycattr="c attrib">c text</c>
  <e>
  <g>my g text</g>
  <a expanded="a expanded">a text</a>
  <b id="b id"><d>inner d</d></b>
</doc>

XSL to transform the XML:
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  <xsl:template match="*">
   <xsl:copy>
    <xsl:copy-of select="@*|text()"/>
    <xsl:apply-templates select="*">
     <xsl:sort select="name()"/>
    </xsl:apply-templates>
   </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Resulting XML:
<doc>
  <a expanded="a expanded">a text</a>
  <b id="b id"><d>inner d</d></b>
  <c mycattr="c attrib">c text</c>
  <e>
  <g>my g text</g>
</doc>


I knew I needed to use xsl:sort and knew I needed to reference the name() of the element, but couldn't pull it together until I looked into xsl:copy and xsl:copy-of. I needed to include the "|text()" in my copy-of or else the text of the nodes would not be copied, just the attributes.

This may not be a perfect solution for your needs, but for mine it solves the problem. I plan to call this inside SQL using a c# UDF to update several hundred thousand records for a new schema applied to the column.

Thursday, May 7, 2009

Overdue update on Marc Labate / Allied Construction

This update is long overdue.

The path to justice is well underway. You may know that the contractor we hired to remodel our bakery left us in the cold a while back, something he has done to dozens of other victims in Austin. He has been sued (and lost) in court cases and now, arrested and charged with fraud and theft!

Austin's FOX affiliate ran a story on Marc Labate's scamming ways which you can find on YouTube or on MyFOXAustin.com.

Marc Labate is scheduled in court for his first appearance on June 3, 2009. Will let you know what happens.

And yes, I know about the false reports Marc had been making about me and my bakery on a certain complaint website that shows up in your Google searches. As of now, the site refuses to take down the reports.