Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Re^4: Tripwire tests and future-proofing

by zby (Vicar)
on May 25, 2004 at 10:03 UTC ( #356154=note: print w/replies, xml ) Need Help??

in reply to Re^4: Tripwire tests and future-proofing
in thread Tripwire tests and future-proofing

Thanks. And what with the other question?
  • Comment on Re: Re^4: Tripwire tests and future-proofing

Replies are listed 'Best First'.
Re^6: Tripwire tests and future-proofing
by adrianh (Chancellor) on May 25, 2004 at 10:41 UTC

    Two questions:

    • How many items are in the hash in the example you gave?
    • Does keys actually returns a list in a scalar context?


Re: Re: Re^4: Tripwire tests and future-proofing
by BUU (Prior) on May 25, 2004 at 21:37 UTC
    keys in scalar context returns the number of elements in the resulting list. Whether this is magic in the keys function, or it's returning an "array" instead of a "list", I have no idea.

    >perl -e"%x=qw/foo bar 1 2 3 4 baz bar/; print scalar keys %x" 4

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://356154]
[Eily]: the demonstration itself is fairly easy. The number of paths on a node is the sum of the numbers of paths to the two nodes above (or one node above on the edges of the triangle)
[Eily]: since the value of a node is also the sum from the two nodes above, you just have to demonstrate that the equality is true at the top of the triangle
[Discipulus]: yes Eily, thanks oiskuu but i dont get it.. ;=( maybe I'll ask a SOPW
[LanX]: all combinations with same amount of left and right?
[Eily]: if you want to store in a structure with the coordinates as key, arrays might do, since the keys are going to be 0..n
[LanX]: (Pascale path)
[Eily]: paths like that
[Discipulus]: yes Eily++ (very keen) I want to integrate my project with a 17th experiments. I want to colorize in sequence all paths
[oiskuu]: Yeah, modifry the recursive func combinations() to return not the number, but the paths themselves.
[Eily]: Discipulus I'd do that by starting from the bottom node I think. That way it can inherit the paths from the two nodes above (and so on, recursively)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2018-03-19 11:18 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.