August 2003 - Posts

More XQuery

 As Christoph Schittko and myself have pointed out XQuery is on its way here.  And I believe to stay.


I’d like to state that XQuery will be the next big thing in Data Mining and your local file system.  We will start to see quasi multi-dimensional XML in the form of aggregated XML documents.  Think tuples.  Already MDX constructs map very nicely to XML and there is already namespace support within XML.  If you look at Members, Tuple (an intersection of 2 or more members) and Sets (A group of tuples or members) it’s pretty easy to see XPath expressions and namespaces. 


E.g.  Member - Employee.JohnDoe = <Employee:JohnDoe/>
E.g. Tuple - Customers.USA.Georgia = /Customers/USA[State=’Georgia’]


With XQuery and XPathNavigators querying Yukon and other objects (think file system) this is going to be very strong stuff.  With Office 2003 and XML hiding behind the curtains you’ll be able to query not only Yukon (The Longhorn filestore?), XML documents and all of your files and spreadsheets.  Put this together with some great new XML driven UI in Longhorn and there are going to be some very compelling Business Intelligence products from the folks at Redmond.

Sean


The Social Life of Paper

 http://www.gladwell.com/2002/2002_03_25_a_paper.htm


A great article about how people use paper that I picked up from John Udell's Weblog.  I noticed the similarities between how air traffic controls use paper and how the movie business uses paper. 


I think may be a very handy way to design XML schema's, create your elements on small strips of paper and then by moving the paper around you can quickly create or change schema's during the design phase.  You could also create multiple schema's for comparison that could be pinned to a walk or laid out on a table or a white-board.

Why do this?  Have you ever opened a complex schema, especially a database diagram, on a laptop?  Until we have virtual display spaces of about 60 inches, think Minority Report, this could be a very handy way to design.

 

Sean

Blackout 2003

I’ve posted some photos in my “Blackout 2003” gallery.

 

I know that this is not .NET related, however I do think that people would be interested in what happened.  At about 4:20 on Thursday the power went out.  Completely.  No flicker, no nothing, just a failure notice on my attempt at saving a file to Visual Source Safe.  This, of course, prompted a curse of VSS.  But lo and behold it was not Visual Source Safe. 

 

We start looking our windows and we see people milling about below (We’re located by Wall Street in New York).  So we start looking around for a battery powered radio to find out what was going on and some flashlights to get downstairs. I do carry a flashlight in my briefcase and had been razed just two days prior for doing so.  I can’t emphasize how handy they are.  Especially if you have to walk down nineteen flights of stairs in the dark with loose gravel on the steps and a few missing handrails. 

 

I walked downstairs to go get batteries for the radio, so we could see if anything strange was going on.  But by the time I got to the street level all the stores where closing and not letting anyone inside.  Mission incomplete which meant back upstairs.

 

I stopped in our office building lobby to listen to the radio and ran into a guy waiting in the lobby for a 5 o'clock interview with our company.  I started to take him upstairs and we met with the rest of the crew coming down the stairs on the sixteenth floor.  He definitely got bonus points for showing up in a blackout.

 

After we got everyone out of the building we went to a beer and burger joint for some cool beverages and some strategy sessions on what to do next.  The Atlanta crew (which I am part of) went to the Millenium Hilton to see if we had power and if we could even stay there.  The hotel was only letting guests inside and they had minimal power to only run the lights in common areas and the elevator.  They are probably one of the few hotels that had a plan for this.  I might also add that this hotel is across the street from Ground Zero, so they where ready. 

 

They would take you up to your floor; however the caveat was that you had to walk down.  I was on the fiftieth floor.  Doh!  Great view, great room, but long walk down.  At least it was all downhill.  After a change into shorts we went back to collect the rest of the NY crew.  The Millenium Hilton was nice enough to put some of our guys up for the night because they had no way of getting home.  Considering that other hotels made there guests sleep on the street, we where very lucky.  In addition to that, we were able to get all of our crew upstairs to the restaurant for dinner.  The Hilton had opened there refrigerators and created an ad-hoc super buffet.  There was everything from tuna salad to chocolate mousse.  No one left hungry.

 

Around eight that night I was able to contact my wife and let her know that we where ok.  She found out from our 3 year old going "New York, that's where my daddy is!", when the news broke on TV.

 

After a hardy meal we where feeling a little spirited and decided to go check out a local watering hole that was open on 9-11.  If any place was open it would be the Dakota Roadhouse.  A short walk and we found ourselves at the only open bar in Manhattan for a couple of beers and a pool game.  About half of us stayed until around 10 after that decided to go back and pack and get ready for Friday. 

 

After a hot, but protected evening in the hotel, I arose at daybreak.  I went to take a cold shower, but no water!  We didn’t have enough water pressure to make it to the 50th floor.  I decided that there would be plenty of people running around the streets with rooster hair and razor stubble and that people wouldn’t notice one more guy.  Everyone from our company was milling about the lobby looking for coffee.  We located a little shop that was serving coffee and day old pastries.  When there’s nothing else around day old pastries taste pretty damn good.  After breakfast we decided to get out of New York and back home to our loved ones.

 

We had a driver booked for 11 to get us to La Guardia and we loaded up seven of us in a mini-van that the driver was able to get and we where off to the airport.  After we got to the airport and found the departure onramp closed we took that as a bad sign.  I ran inside to see what was going on and found a dark airport and about 2000 people in line to try and fly out.  That was at 12 and we had a 1pm flight.  So we high tailed it back to Manhattan and dropped our gear at the Hilton and went to the office to see if we could contact Delta to get out of the city.  Which was imperative for me because my wife was ill and at the doctor.  Being out of town with a sick wife and two small kids will definitely light a fire under you to get home.  Luckily we got a hold of Delta and booked a 3:10 flight out of Newark.  After a 2+ hour delay at Newark we finally boarded and where on our way home.  After three continuous weeks of being in New York I was never happier to be home. 

 

 

Lessons learned:

  1. Always have some cash on you.

  2. Have a flashlight on you, even if it’s just a little LED light.

  3. Network with people when you are traveling.  Relationships with hotel staff, drivers and restaurant staff make all the difference in a tough time.

  4. Carry baby wipes in your luggage.

  5. The Millenium Hilton rocks.

Namespace Madness

Lately there has been a lot of talk about XML namespace.  Let’s boil it down to a very simplified example.  Namespaces can be distilled down to grouping or categorization.  We do this everyday.  We add namespaces to everything.  It helps us prevent “namespace collisions“.

My house = my:house

My car = my:car

My kid = my:kid

Neighborhood dog = neighborhood:dog

My yard = my:yard

And so on…

 

And context has everything to do with it.  As Tim Bray points out.  How the XML is consumed or transformed is up the application. Your parsing application has context.  A RSS reader will handle a RSS XML file differently than a SVG rendering engine would handle it.  The SVG rendering engine has no context of the RSS XML namespace.  The context it is defined by a set of people or entity (think W3) or the application.

 

This may be an over simplification and if it is, just call me simple!

 

Below is a very simple XSL that will give you a list of namespaces within your XML document along with an example.

 

<?xml version="1.0" encoding="UTF-8"?>

<location xmlns:me="http://dotnetjunkies.com/webLog/metablog/"  xmlns:bug="http://www.ralphtheroach.com">

   <me:house>

      <me:me me:action="squash bug">Sean Gerety

         <bug:roach bug:action="looking for dinner">Ralph</bug:roach>

      </me:me>

   </me:house>

</location>

 

If you transform the above xml using the following xsl.

 

<?xml version="1.0" encoding="UTF-8"?>

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

   <xsl:template match="*">

      <xsl:element name="namespaceList">

      <xsl:element name="namespace">default or empty</xsl:element>

         <xsl:for-each select="namespace::*">

           <xsl:element name="namespace">

              <xsl:value-of select="."/>

           </xsl:element>

         </xsl:for-each>

      </xsl:element>

   </xsl:template>

</xsl:stylesheet>

You get.

 

<?xml version="1.0" encoding="UTF-16"?>

<