[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Beauty is in the eye of the beholder (was: Are we ready...


beauty beholder
> this is starting to look like the ip addressing problems ipv4, sorry ran
> out of numbers, now ipv6, our children will probably need ipv8 (whatever
> that might be)

There is that possibility, although there are wayyy more name characters
than there are Arabic numerals.  The danger of running out of unique
character combinations, even short ones, seems remote to me. But I've been
wrong before.

> 
> i'm already avoiding namespaces because it's so bloated. xsl:... or
> xsd:... is about as much as i can handle.

Yeah. Default namespaces are worse, though. ;-)

> i'm reminded of the quote from the front of djikstra's seminal work "a
> discipline of programming"
> 
> "For a long time I have wanted to write a book somewhat along the lines
> of this one: on the one hand I knew that programs could have a
> compelling and deep logical beauty, on the other hand I was forced to
> admit that most programs are presented in a way fit for mechanical
> execution but, even if of any beauty at all, totally unfit for human
> appreciation."

Hmmm. Is the following Dijkstra-ascribed permutation algorithm
(implementation in Java purely my fault) beauteous or just way too clever?:


public class Permuter extends Object
{
   int m_level;
   int[] m_value;
   int m_permCt = 0;

   public Permuter(int size)
   {
      m_level = -1;
      m_value = new int[size];
   }

   public void permute()
   {
      visit(0);
      System.out.println("\nTotal permutations = " + m_permCt);
   }

   public void visit(int k)
   {
      m_level++;
      m_value[k] = m_level;

      if (m_level == m_value.length)
      {
         addPermutation();
      }
      else
      {
         for (int i = 0; i < m_value.length; i++)
         {
            if (m_value[i] == 0)
               visit(i);
         }
      }

      m_level--;
      m_value[k] = 0;
   }

   void addPermutation()
   {
      for (int i = 0; i < m_value.length; i++)
      {
         System.out.print(m_value[i] + " ");
      }

      System.out.println();

      m_permCt++;
   }

}

I have a hard enough time tracing through this in a debugger without getting
lost. Works pretty fast, though, I will admit.

> tried reading a microsoft (eg, but by no means the only offenders)
> spreadsheet xml format lately?
> 
> even worse, tried writing one?

The InkML snippets have already convinced me we're all doomed even without
namespaces. Of course, the relational purists have known that for awhile
now.

> i'm a bit of a fan of occam's razor and so once things start to get this
> complex i start to get uneasy that we're somehow losing the plot....

Sorry, I was only trying to help...  <:-(


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.