Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I was not able to reproduce the anomalies,

Okay.

  1. First problem: Your version of the generator is not -- for the same setting of srand-- producing the same randomly generated tree.

    At first, I assumed this must be because you were using a different rand to me. I guessed you might be running on some flavour of *nix -- but then I noticed your use of notepad above -- which squashed that idea.

    Then I thought you might be running some other flavour of windows perl -- perhaps Strawberry. So, I thought I'd re-generate the failing test cases using my version of the generator and supply you with the generated trees.

  2. Second problem: my version of the generator is no longer producing the same trees for a given value of -S=nnn!

    Did I change the generator between posting and now? I don't remember, but I can only assume that something in the original code I used, that used rand has changed.

    Never mind: I'll reverse engineer the output I posted back to a raw tree structure and give you that.

  3. Third problem: Reverse engineering this pretty form of output is extremely painstaking, laborious and painful!

    But I did it!

    Which fed to your dumper produces the same (malformed) dump that I originally posted:

    C:\test>anonBinTreeDumper.pl _____________________________/\___________________________________ +___________________________________________________ _/\___________________ + ___________________________________/\ /\ _________/\_______ _________________ +______________/\_______________________________ Z a b _____/\_______ _____/\ ____/\________________ +_____ _______________/\_ _/\___ _____/\ /\_ q ___/\ _______________ +____/\_______ _____/\_ /\ /\ _/\ /\_ l m /\_ _/\_ _/ /\___ + ___/\ _______/\___ /\_________ X Y c d /\ g h /\_ n /\ _____/\ //\ 1 _/\___ + _/\_ G /\_____ _/\ P _/\_ e f i /\ o p /\___ v wyxz /\ _/\______ +_ /\ /\ H ___/\ /\ O ___/\ /\ j k r _/\ 2 3 /\ _____ +/\_ C D E F /\_ L M N _/\_ U V W /\ u 4 5 /\_ + /\ I /\ /\ /\ s t 6 /\_ + A B J K Q R S T 7 /\ 8 9

    But that raises another problem...

  4. Fourth problem: if you look at the raw tree above, you'll see it is malformed: [['y','z'],]; the x,y node is paired with a null node.

    And that raises the final problem.

  5. Fifth problem: Given that the raw tree is reproduced from the pretty-printer output, there is no way to determine if the tree my generator fed your dumper was malformed; or if the malformation is a result of occlusion in the dumper output?

    I don't think that it is possible for the generator to produce bad trees -- but I haven't proven that.

    Looking at the spacing between the 'z' and the '1' nodes, the gap is too big, which makes me think it is a artifact of the dumper.

At that point, I manually made the simplest correction to the raw tree that (I thought) would make it valid:

and re-ran the dumper. As you can see, it still produces the identical, malformed dump:

C:\test>anonBinTreeDumper.pl _____________________________/\___________________________________ +___________________________________________________ _/\___________________ + ___________________________________/\ /\ _________/\_______ _________________ +______________/\_______________________________ Z a b _____/\_______ _____/\ ____/\________________ +_____ _______________/\_ _/\___ _____/\ /\_ q ___/\ _______________ +____/\_______ _____/\_ /\ /\ _/\ /\_ l m /\_ _/\_ _/ /\___ + ___/\ _______/\___ /\_________ X Y c d /\ g h /\_ n /\ _____/\ //\ 1 _/\___ + _/\_ G /\_____ _/\ P _/\_ e f i /\ o p /\___ v wyxz /\ _/\______ +_ /\ /\ H ___/\ /\ O ___/\ /\ j k r _/\ 2 3 /\ _____ +/\_ C D E F /\_ L M N _/\_ U V W /\ u 4 5 /\_ + /\ I /\ /\ /\ s t 6 /\_ + A B J K Q R S T 7 /\ 8 9

So then I fed that corrected tree to my dumper:

C:\test>perl \perl64\site\lib\Tree\Dump.pm ____________________________________________________ +_________________________________ _____________/ + \___________________ _/ \_________ __________ +_________________________________/ \ / \ _____/ \_____ _______/ + \_______________ Z a b ___/ \_____ _/ \ _____/ \__________ +___________ ___/ \_ _/ \_ _/ \ / \_ q _/ \ ___/ + \___ _______/ \_________ / \ / \ _/ \ / \_ l m / \_ ___/ \_ _/ / \___ + _/ \ ___/ \_ / \_ X Y c d / \ g h / \_ n / \ ___/ \ / \ / \ 1 _/ \___ + _/ \_ G / \___ _/ \ P ___/ \_ e f i / \ o p / \_ v w x y z / \ _/ \__ +___ / \ / \ H _/ \ / \ O _/ \ / \ j k r _/ \ 2 3 / \ _/ + \_ C D E F / \_ L M N _/ \_ U V W / \ u 4 5 / \_ + / \ I / \ / \ / \ s t 6 / \ +_ A B J K Q R S T 7 / + \ 8 + 9

At this point, I'm kicking the ball into your court to decide if it is worth pursuing further?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


In reply to Re^4: Challenge: Dumping trees. by BrowserUk
in thread Challenge: Dumping trees. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (11)
    As of 2014-12-25 05:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (159 votes), past polls