Wednesday, April 26, 2006

May The Schwartz Be With You...

I'm sure you've all heard that Scott McNealy has handed over the reigns as CEO of Sun to Jonathan Schwartz. Jonathan has been President of Sun for a while now, so it's not totally unexpected. McNealy on the other hand, is now going to be Sun's Chief Evangelist and Chairman of the Board, which I'm sure he'll continue providing witty soundbites for the press to eat up! Of course, he needs to figure out how to blog -- it worked really well for Schwartz, and has really impressed me there.

What is not so clear, is how the market will react to Schwartz. He's certainly younger, and arguably a very bright person. Wall Street continues to call for massive cuts in the company, and in an effort to make his opening numbers look good, I'm wondering if he'll go ahead and follow their advice.

McNealy and Schwartz have made statements in the past that they will avoid layoffs at all costs. That said, I know of several stealth layoffs that continue to occur almost quarterly now. I fear for the Software and Services folks. Sun never could figure out how to sell software, and has instead, open-sourced most of it. Much of services have been out-sourced to India or otherwise. At heart, Sun is still a hardware company. But like a McClaren racer, who can really afford one? These days, folks continue to look for a Toyota Prius-like hybrid -- low on cost, good performance, and runs all kinds of software. I think Sun is a little management heavy, too. When they make the cuts, though, they tend to cut into the muscle and not enough of the fat.

For my friends still left at Sun, "May The Schwartz Be With You" -- and not against you...

Categories: ,

Wednesday, April 19, 2006

Playing the Spock Market

The new G4 network has come out with some interesting new shows. Slightly amusing is Bonzai, but the best is Star Trek 2.0!

I found out about it from an ad on MeeVee (who says internet ads don't work?). The show plays uncut classic Trek episodes, but also provides a ticker for the "Spock Market"

Basically, you sign up for a free account where they start you with 100000 Federation credits to "invest". There are a variety of "stocks" you can buy, and based on the episodes that air and other random news events, the value of those stocks change.

For my starting portfolio, here's what I got for my 100000 credits:

  • SPK (Spock): 10
  • MDM (Dr. McCoy): 5
  • SCT (Scotty): 100 - why not? This is Scotty's Engineering Log after all!
  • CKV (Chekov): 25
  • DMI (Dilithium Mining and Mineral): 45 - hey, who figured out how to re-crystalize in ST IV?
  • PHP (Starship Phaser and Photon): 1
  • WRP (Cochrane Warp and Impulse): 5
  • RAC (Robot, Android and Clone): 15
  • RDS (Red Shirt): 2 - because everyone needs a couple of Red Shirts, just in case...
  • TRS (Transporter): 50 - what did Scotty work on besides the engines?
  • PHZ (Hand Phaser and Blade): 25
  • KRS (Klingons, Romulans and More): 25 - I've always liked the Klingons! Qapla'!

I figured this would give me a pretty balanced portfolio. We'll see how this Enterprise works out...

You can give it a try at: http://www.g4tv.com/startrek20/spockmarket.aspx

UPDATE (4/26): My current net worth is 24,293,485 FDR!

  • JTK (Kirk): 1006
  • SPK (Spock): 75
  • MDM (Dr. McCoy): 167
  • SCT (Scotty): 100
  • CKV (Chekov): 10
  • DMI (Dilithium Mining and Mineral): 200
  • PHP (Starship Phaser and Photon): 10
  • COM (Communicator): 1
  • TSP (Tricorder, Sensor and Probe): 10
  • WRP (Cochrane Warp and Impulse): 10
  • LOG (Starship Log and Computer): 2
  • FED (United Federation of Planets): 200
  • RAC (Robot, Android and Clone): 130
  • RDS (Red Shirt): 100
  • TRS (Transporter): 23
  • UPP (Universal Planet and Planetoid): 205
  • PHZ (Hand Phaser and Blade): 10245
  • KRS (Klingons, Romulans and More): 40

Categories: ,

Monday, April 17, 2006

Happy Birthday, Flatirons Solutions!

Today is Flatirons Solutions 5th anniversary/birthday!

During the early years, Flatirons had to deal not only with typical startup pains, but also brutal general economic conditions with virtually no IT spending because of the market crash and 9/11.

Despite these very significant challenges, Flatirons is now a $15M company with 80 employees, and a an impressive list of clients in both the commercial and government sectors!

Flatirons Solutions is a great company to work for, and I'd like to say congratulations to our founders and my colleagues for 5 years of Vision, Experience, and Engineering Excellence.

Categories: ,

Annotating DocBook

Dominik Brettnacher has released Annotate 0.1.6, a free annotation tool for DocBook documents. Based on an extension of the DocBook XSL and a DBMS to store the annotations, it looks to be very useful! There is also an online demo you can try. For more info, check out: http://www.brettnacher.org/annotate/.

Annotation has been added to DocBook v5.0, and is described here: http://docbook.org/tdg5/en/html/annotation.html

Categories:

Thursday, April 13, 2006

You're going to have to get up pretty early...

If you want to hear me play French Horn! I'm playing for the Easter Sunrise service for Rock Creeek Church this Sunday.Selections will be traditional hymns:
"Christ the Lord is Risen Today", "Christ Arose (Up from the Grave He Arose)", and "A Mighty Fortress".

If you are in the Boulder area and are looking for a place to attend Easter services, you are invited to attend!
Directions are located here. We will be holding Good Friday service at 7pm, Easter Sunrise at 6am w/breakfast, and our regular service at 10am at Monarch High School. Hope to see you there!

Categories: , , ,

Wednesday, April 12, 2006

DocBook V5.0b5

Norm Walsh has just released beta 5 of DocBook V5.0!

Please give this version a test drive and report any problems.
The DTD/XSD/RNG can be found here: http://docbook.org/xml/5.0b5/

Categories:

Monday, April 03, 2006

Generating DOCTYPE and ENTITY DECLs in XSLT

I ran into a very interesting challenge lately, and since RoboHelp has been EOL'd, I thought I'd try to benefit the rest of the community that might need to migrate content out of RoboHelp. There is an export handler in RoboHTML that will convert content to DocBook, but unfortunately, it doesn't provide very good or accurate markup, IMO.

Since the default RoboHTML export handler for DocBook wouldn't work for us, we created a new export handler, based on the original. What I wanted, was a book file that contained entity declarations for each topic. The trick was trying to generate the Doctype declaration, with the entity declarations. XSLT provides a way to generate a PUBLIC and SYSTEM identifier in the DOCTYPE declaration for an output document, but does not provide a way to write out the entity declarations as an internal DTD subset in that doctype decl.

Part of the solution is to not use the XML output method, but to use the TEXT method. This was working splendidly, until it came time to write the file entity reference in the content. From what I could tell, the problem is with the msxml parser that RoboHelp uses when exporting content. No matter how I tried to escape the "&", I would get & in the entity reference, which of course would not resolve.

Instead of building it into the export handler, I came up with a stylesheet to process the *_toc.xml file that resulted from the DocBook export.

Here are some snippets from the resulting code. The critical components are generating the DOCTYPE decl, generating the ENTITY decl, and then creating the entity reference.

<xsl:output method="text"  indent="yes"/>

<xsl:template match="/">
  <xsl:text disable-output-escaping="yes"><!DOCTYPE book PUBLIC "-//COMPANY//DTD DocBook-Based Extension v1.0//EN" "extended-docbook.dtd" [
    <!ENTITY glossary SYSTEM "glossary.xml">
  </xsl:text>
  <xsl:for-each select="//tocentry/ulink[normalize-space(@url)!= '']">
    <xsl:call-template name="generate_entity_decl">
      <xsl:with-param name="url" select="@url" />
      <xsl:with-param name="title" select="@title" />
    </xsl:call-template>
  </xsl:for-each>
  <xsl:text disable-output-escaping="yes">]></xsl:text>
  <book>
    <title><xsl:value-of select="title"/></title>
    <bookinfo>
      <xsl:call-template name="generate_publisher_info">
        <xsl:with-param name="rootnode" select="." />
      </xsl:call-template>
    </bookinfo>
<xsl:apply-templates/> 
    <xsl:text disable-output-escaping="yes">&</xsl:text>glossary;
  </book>
</xsl:template>

The above creates the DocType declaration, but relies on generating a valid entity name for the entity declarations:

  <!-- =========== generate_file_url template ============= -->
  <xsl:template name="entityName">  
    <xsl:param name="url"  />
    
    <xsl:choose>
      <xsl:when test="contains($url,'/')">        
        <xsl:value-of select="substring-before($url,'/')"/>
        <xsl:call-template name="entityName">          
          <xsl:with-param name="url" select="substring-after($url, '/')"/>         
        </xsl:call-template>       
      </xsl:when>     
      <xsl:when test="contains($url,'\')">        
        <xsl:value-of select="substring-before($url,'\')"/>
        <xsl:call-template name="entityName">          
          <xsl:with-param name="url" select="substring-after($url, '\')"/>         
        </xsl:call-template>       
      </xsl:when> 
      <xsl:otherwise>       
        <xsl:value-of select="$url"/>       
      </xsl:otherwise>     
    </xsl:choose>
    
  </xsl:template>
  
  <!-- ======== outputs entity references ======== -->
  <xsl:template name="generate_file_url">
    <xsl:param name="url" select="''" />
    <xsl:param name="title" select="''" />
    
    <xsl:variable name="transformedURL">
      <xsl:value-of select="translate(string($url), ' ()','_' )" />
    </xsl:variable>
    
    <xsl:variable name="entity.file.name">
      <xsl:call-template name="entityName">
        <xsl:with-param name="url" select="$transformedURL" />
      </xsl:call-template>
    </xsl:variable>
    
    <xsl:variable name="entity.name">
      <xsl:choose>
        <xsl:when test="contains($entity.file.name, 'htm')">
          <xsl:value-of select="substring-before($entity.file.name, '.htm')" />         
        </xsl:when>
        <xsl:when test="contains($entity.file.name, 'xml')">
          <xsl:value-of select="substring-before($entity.file.name, '.xml')" />         
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$entity.file.name" />
        </xsl:otherwise>
      </xsl:choose> 
    </xsl:variable>
    
    <!-- outputs entity reference -->
    <xsl:text disable-output-escaping="yes">&</xsl:text>
    <xsl:value-of select="$entity.name" />
    <xsl:text disable-output-escaping="yes">; 
    </xsl:text>
    
  </xsl:template>

The above templates create a valid entity name, based on the path to the file. I tried to adjust for both XML, HTML and unknown file names. Following is the template that creates the ENTITY declaration that needs to be a part of the internal subset in the DOCTYPE declaration.

  <!-- This generates an entity declaration: <!ENTITY foo SYSTEM "foo.xml"> -->
  <xsl:template name="generate_entity_decl">
    <xsl:param name="url" select="''" />
    <xsl:param name="title" select="''" />
    
    <xsl:variable name="transformedURL">
      <xsl:value-of select="translate(string($url), ' ()','_' )" />
    </xsl:variable>
    
    <xsl:variable name="entity.file.name">
      <xsl:call-template name="entityName">
        <xsl:with-param name="url" select="$transformedURL" />
      </xsl:call-template>
    </xsl:variable>
    
    <xsl:variable name="entity.name">
      <xsl:choose>
        <xsl:when test="contains($entity.file.name, 'htm')">
          <xsl:value-of select="substring-before($entity.file.name, '.htm')" />         
        </xsl:when>
        <xsl:when test="contains($entity.file.name, 'xml')">
          <xsl:value-of select="substring-before($entity.file.name, '.xml')" />         
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$entity.file.name" />
        </xsl:otherwise>
      </xsl:choose> 
    </xsl:variable>
    
    <!-- outputs entity declaration -->
    <xsl:text disable-output-escaping='yes'><!ENTITY </xsl:text><xsl:value-of select='$entity.name'/><xsl:text> SYSTEM
"</xsl:text><xsl:value-of select='$transformedURL'/><xsl:text>"</xsl:text><xsl:text disable-output-escaping='yes'>>
    </xsl:text> 
  </xsl:template>

As you can see, there are several variables that have been reused, and could probably be declared globally or more efficiently. The remaining task is to create the entity reference in the content. Since the RoboHelp export handler dumped everything as a tocentry/ulink, it's pretty easy to extract and re-write the entity reference we really want:

 
  <xsl:template match="tocpart">
    <chapter>
      <title>
        <xsl:value-of select="tocentry"/>
      </title>
      <xsl:apply-templates />
    </chapter>
  </xsl:template>
  
  <xsl:template match="tocchap">
    <xsl:choose>
      <xsl:when test="tocentry/ulink">
    <xsl:call-template name="generate_file_url">
      <xsl:with-param name="url">
        <xsl:value-of select="tocentry/ulink/@url"/>
      </xsl:with-param>
    </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <section>
          <title>
            <xsl:value-of select="tocentry" />
          </title>
          <xsl:apply-templates select="toclevel1"/>
        </section>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

The finer details will be left as an exercise to the reader, but this was a particularly interesting problem and solution. Hope this helps!

Categories: ,