OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Beauty is in the eye of the beholder (was: Are we ready...

[ Lists Home | Date Index | Thread Index ]

> 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...  <:-(





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS