Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Boyko Bantchev
On 16 February 2013 00:12, Raul Miller wrote: > With this definition, all programming is "functional programming", and > there's no distinction between "imperative programming" and > "functional programming". This 'conclusion' of yours is logically fallacious. > At this point, I think I will ref

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread km
iPad time and space results for Kip's code. Brian Schott tells me correctly that verb open can be replaced by verb Raze ; ones =: ; pairs 1 = ?. 200 200 $ 100 NB. paths with one move # ones 390 5 {. ones NB. each pair represents one move 1 8 1 9 2 41 2 44 2 84 ts ';@:next^:3 one

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread km
OK, I think I've got it, thanks. I was using -- for a bidirectional connection. --Kip Sent from my iPad On Feb 15, 2013, at 7:47 PM, Raul Miller wrote: > On Fri, Feb 15, 2013 at 7:23 PM, km wrote: >> My code is for directed graphs as defined in Graphs in Computer Science: >> >> http://w

Re: [Jprogramming] "plot" legend bounding box bad

2013-02-15 Thread bill lam
I guess it failed to determine the correct length for the text. it uses "glqextent" for this purpose. Please search for that word in plot. Пт, 15 фев 2013, Devon McCormick писал(а): > Hi all - > > I have a nagging problem with "plot" - it does a poor job of drawing the > bounding box around the l

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Raul Miller
On Fri, Feb 15, 2013 at 7:23 PM, km wrote: > My code is for directed graphs as defined in Graphs in Computer Science: > > http://web.cecs.pdx.edu/~sheard/course/Cs163/Doc/Graphs.html This is consistent with my intent when I used the phrase. > However, suppose our undirected graph is > > 0--1--2-

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread km
My code is for directed graphs as defined in Graphs in Computer Science: http://web.cecs.pdx.edu/~sheard/course/Cs163/Doc/Graphs.html However, suppose our undirected graph is 0--1--2--3 (the only edges are those shown). Am I right that every set of two nodes is visitable from node 2? These ar

Re: [Jprogramming] "plot" legend bounding box bad

2013-02-15 Thread Devon McCormick
This is on J console with JVERSION: Engine: j701/2011-01-10/11:25 Library: 7.01.082 Platform: Win 64 Installer: j701a_win64.exe I think this is GTK? On Fri, Feb 15, 2013 at 5:03 PM, chris burke wrote: > I don't see this. What platform are you using? > > On Sat, Feb 16, 2013 at 4:05 AM, Devon M

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Raul Miller
On Fri, Feb 15, 2013 at 5:01 PM, Boyko Bantchev wrote: > On 15 February 2013 21:10, Raul Miller wrote: >> But, since you have never told me what you do mean I am left >> without any useful approach for understanding the concepts you are >> referring to. I would like it if, at some point, yo

Re: [Jprogramming] "plot" legend bounding box bad

2013-02-15 Thread chris burke
I don't see this. What platform are you using? On Sat, Feb 16, 2013 at 4:05 AM, Devon McCormick wrote: > Hi all - > > I have a nagging problem with "plot" - it does a poor job of drawing the > bounding box around the legend: some text often extends past the box. For > example, entering somethin

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Boyko Bantchev
On 15 February 2013 21:10, Raul Miller wrote: > But, since you have never told me what you do mean I am left > without any useful approach for understanding the concepts you are > referring to. I would like it if, at some point, you supplied some > definitions for the meanings of some of the

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Raul Miller
wrapc does look plausible - to avoid memory problems we could break the processing of the problematic line so it chews on smaller chunks of data. And, I am expecting that one step of iteration have a computational cost which is a multiple of the square of the number of distinct nodes reached so fa

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Raul Miller
Yes: for me, since I was just interested in knowing the unique sets of visitable nodes with a population of N, I would treat 1 8 6 and 1 6 8 as equivalent (or, more precisely, in the context of your code: interchangeable), and I would treat a 7 7 path as visiting only a single node. How does your

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread km
Raul, I have carefully ignored your later posts and may be on a different track than you intended. Here is where I am. Path 1 8 6 means there is a directed edge from 1 to 8 and a directed edge from 8 to 6 and is different from path 1 6 8 if such a path exists. You can even have a one edge

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Raul Miller
Note also that there are related (linguistic) issues associated with concepts like "number" and "equality" - english (like all "natural languages") is contextual and we deal with this issue so often that we usually do not pay any attention to it. That said, we do have informal ways of referring to

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Roger Hui
More useful to assign a special meaning to "function", I think. Then you can include things like ?, file reads, comparisons (which depend on tolerance), etc. On Fri, Feb 15, 2013 at 12:08 PM, Devon McCormick wrote: > One functional language definition of "function" that I've seen is along > the

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Devon McCormick
One functional language definition of "function" that I've seen is along the lines of "a function always returns the same result for the same input" which apparently excludes anything like "?" in J unless we assign a special meaning to "same". On Fri, Feb 15, 2013 at 2:10 PM, Raul Miller wrote:

[Jprogramming] "plot" legend bounding box bad

2013-02-15 Thread Devon McCormick
Hi all - I have a nagging problem with "plot" - it does a poor job of drawing the bounding box around the legend: some text often extends past the box. For example, entering something as simple as 'title Demonstrate Legend Defect;key Before After' plot 2 100?@$0 gives a legend box in which t

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Mike Day
Yes, "tree" is not the best word, though it does hint at the existence of branches - however its structure doesn't reveal the links. Each row is a sorted list, I suppose. Whatever we call it, I think you've got a big problem in finding all such "things" each with 100 unique members, in a 2

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Raul Miller
Thank you, again. I have not yet had time to read through wrapb, but a quick glance suggests that the "too many paths (or 'trees', maybe )" issue could probably be resolved by sorting each "path" before determining uniqueness. That said, I am more uncomfortable labelling these "visitable sets" wi

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Raul Miller
On Fri, Feb 15, 2013 at 12:29 PM, Boyko Bantchev wrote: > On 15 February 2013 18:01, Raul Miller wrote: >> It seems we differ on the definition of a mathematical "function". > > I wonder how you came to this conclusion, since 'mathematical > functions' were not discussed. It came about because I

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Mike Day
Thanks. I think my verb "wrapb" _is_ doing what you want, even though it doesn't get your answer of 5945 tree-paths for 10 graph2 wrap 0 I've just seen your later posting. Sorry about 1 1$y - I agree, but had thought you only wanted a single starting node. You then say " But this is a prob

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Boyko Bantchev
On 15 February 2013 18:01, Raul Miller wrote: > It seems we differ on the definition of a mathematical "function". I wonder how you came to this conclusion, since 'mathematical functions' were not discussed. Apart from that, your statement: > Here, you have introduced a definition of "function"

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Raul Miller
After reading this code, I see two issues. First, this line: p=. 1 1 $ y should be p=. ,. y The original supported multiple start nodes, and I do not yet see any simplicity advantages to considering only a single starting node. We already need to deal with multiple paths, so why not allow

Re: [Jprogramming] sax addon problem

2013-02-15 Thread bill lam
I looked at the commit log, apparently I add that patch with that comment some years ago when mirgrating to j701. If you examine the callback, you will find it is plausible but can fail in all OS because there is no gaurantee that a positve number inside a certain range cannot be a memory pointer

Re: [Jprogramming] sax addon problem

2013-02-15 Thread Thomas Costigliola
David, I see what you mean. But IF64 is also true in windows, which is what I am using, so it seems like a bug. It is working after changing that line to: SetCharacterDataHandler^:(-.IF64*.'Linux'-:UNAME) PARSER;cdcb 3 NB. crash in linux64 Thanks. On Fri, Feb 15, 2013 at 11:09 AM, David Ward

Re: [Jprogramming] sax addon problem

2013-02-15 Thread David Ward Lambert
You're using a 64 bit linux system. character is disabled because it core dumps. sax.ijs: ... create=: 3 : 0 PARSER=: ParserCreate <<0 IGNOREWS=: 0 seterr'' SetElementHandler PARSER;(cdcb 3);(cdcb 2) SetCharacterDataHandler^:(-.IF64) PARSER;cdcb 3 NB. crash in linux64 ) > Date: Fri,

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Raul Miller
On Fri, Feb 15, 2013 at 9:40 AM, Boyko Bantchev wrote: > On 15 February 2013 15:27, Raul Miller wrote: >> Here, you have introduced a definition of "function" which conflicts >> with the usual meaning of the word when people talk about functional >> programming. >> .. > > Surely not. And the

Re: [Jprogramming] sax addon problem

2013-02-15 Thread bill lam
I know very little about this addons nor did I use it. Did you mean it worked previously in J6 but failed in J7? FYI this addons will not work in J7 GTK, try test on j7 jconsole instead if that matters. Пт, 15 фев 2013, Thomas Costigliola писал(а): > I am having a problem with the sax addon in J

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Boyko Bantchev
On 15 February 2013 15:27, Raul Miller wrote: > Here, you have introduced a definition of "function" which conflicts > with the usual meaning of the word when people talk about functional > programming. > .. Surely not. And the appropriateness of the linguistic effort in the above post evade

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Raul Miller
On Fri, Feb 15, 2013 at 4:40 AM, Boyko Bantchev wrote: > The 'Lexical Closure' essay > (http://www.jsoftware.com/jwiki/Guides/Lexical%20Closure) > mentioned in this thread declares lexical closures to be > 'incompatible with the functional programming model'. > Such a statement is incorrect. > > I

Re: [Jprogramming] puzzle: paths in cyclic graphs

2013-02-15 Thread Raul Miller
I'll have to take some time to read your code (there's a lot of it). But perhaps this can illustrate why I initially called them "paths" (though they can branch): Here's a numeric representation of the connection graph. First column is index, second column represents what that node connects to:

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-15 Thread Boyko Bantchev
The 'Lexical Closure' essay (http://www.jsoftware.com/jwiki/Guides/Lexical%20Closure) mentioned in this thread declares lexical closures to be 'incompatible with the functional programming model'. Such a statement is incorrect. If a function returns different values for the same arguments, it is n