tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/2790-network-not-giving-the-results-that-i-expecedNodeBox: Discussion 2013-12-03T09:59:06Ztag:support.nodebox.net,2012-11-01:Comment/302666852013-12-02T10:15:33Z2013-12-02T10:15:33ZNetwork not giving the results (that I) expeced<div><p>Hey Gustaf,</p>
<p>I've looked at your network and it seems to do what is intended;
that is, there is no bug in NodeBox.</p>
<p>The question is: what do you want to do? It looks like you're
trying to sum all the numbers or something?</p>
<p>About the issue of the rendered node in the subnetwork: we're
aware of that, it is indeed irritating and we're thinking of a
fix.</p></div>Frederik De Blesertag:support.nodebox.net,2012-11-01:Comment/302666852013-12-02T10:30:29Z2013-12-02T10:30:29ZNetwork not giving the results (that I) expeced<div><p>hmm. What I am trying to do is just get the first value of a
list. The "add" node doesnt do anything and is only there because,
well, thats how i ran in to this problem.</p>
<p>If you look at the result of the two nodes on the left
(add+first) you see a single value as the result (0.0), right?</p>
<p>If you look inside the group on the right hand side you see that
it has the same two nodes (add+first) inside of it, but it doesnt
produce the same result. Instead of returning a single value (0.0),
it returns the full range of 10 values.</p>
<p>Is this what you see as well? If it is, please explain why the
group on the right shouldnt produce the same result as the two
nodes on the left.</p>
<p>thanks</p></div>gustaftag:support.nodebox.net,2012-11-01:Comment/302666852013-12-02T10:53:40Z2013-12-02T10:53:40ZNetwork not giving the results (that I) expeced<div><p>Okay, I see your problem. This is related to how NodeBox does
list matching.<br>
Basically, it treats the network as a function, and will call it
with each element of the list. In your case, that means it will
take the first element of the list, add zero to it, then take the
first element (but there's already only one element) and return
that. Then it will do the same for the second element, and append
that to the bigger list. If you're familiar with functional
operation, it basically performs a <code>map</code> operation over
all the elements.</p>
<p>This is the default behavior but you can change it. In the
metadata for the network, select the published port and set the
"range" to "list". This means that NodeBox will work on the entire
list at once, not one-by-one. Then you see that the network works
as the nodes in the root.</p>
<p>For more information, you can read <a href=
"http://nodebox.net/node/documentation/concepts/concepts.html">How
NodeBox Works</a>, specifically the part on list matching.</p>
<p>Hope this helps!</p>
<p>F</p></div>Frederik De Blesertag:support.nodebox.net,2012-11-01:Comment/302666852013-12-02T10:54:23Z2013-12-02T10:54:23ZNetwork not giving the results (that I) expeced<div><p>Here's a screenshot showing the metadata setting:</p></div>Frederik De Blesertag:support.nodebox.net,2012-11-01:Comment/302666852013-12-02T21:19:39Z2013-12-02T21:19:39ZNetwork not giving the results (that I) expeced<div><p>aaaaaaaaaah <em>slaps forhead</em></p>
<p>May I give a suggestion for the subnetwork output? Having
special "input" and "output" nodes that you put inside the network
that creates a virtual bridge to the parent nodes in and out points
seems to work very well in other programs.</p>
<p>Could also avoid any backwards compatibility issues with some
kind of "if (no output nodes exist) then output the render-flagged
node" ?</p></div>gustaftag:support.nodebox.net,2012-11-01:Comment/302666852013-12-03T09:59:04Z2013-12-03T09:59:04ZNetwork not giving the results (that I) expeced<div><p>Yes – having "inlets" and an "outlet" is something we're
considering, since the issue you mention causes lots of confusion.
This requires a conversion from published ports to
inlets/outlets.</p>
<p>I've added an issue that tracks this: <a href=
"https://github.com/nodebox/nodebox/issues/368">https://github.com/nodebox/nodebox/issues/368</a></p></div>Frederik De Bleser