Re: [Jprogramming] Fwd: Newbie needs a little help with J under Linux :)

2013-03-14 Thread Jo van Schalkwyk
Brilliant, thank you all. I like the 2!:0 'cat /dev/urandom|od -N4 -An -i' most as I find it easily intelligible, but _everyone_ has been extremely helpful. I'm impressed. True confessions: I likely won't make _major_ use of /dev/random but I wanted to get it working. I will share the knowledge. I

Re: [Jprogramming] J functional programming extensions

2013-03-14 Thread Raul Miller
Have you tried putting a sparse array in a box? I wonder if this kind of stuff will be causing memory leaks or other such thing... (I also wonder how to explain this kind of thing to new people.) -- Raul -- For information abou

Re: [Jprogramming] Stemplot

2013-03-14 Thread Kip Murray
Thanks to Ric and Brian for their references. Here is my verb stemplot, which assumes non-negative integer data, begins by trimming x digits from the data, and assumes there will be at most three digits in the stem. stemplot =: 4 : 0 NB. usage trim stemplot data trimy =: <. y % 10 ^ x NB.

Re: [Jprogramming] J functional programming extensions

2013-03-14 Thread Steven Taylor
Hi Jose, I like Conjunction-adverb and adverb-verb. Nice. Need to dig into that recursive 103!:0 to get a feel for it. Encouraging work though. Thanks for making these changes available to us. -Steven On 14 March 2013 11:41, Raul Miller wrote: > Have you tried putting a sparse array in a

Re: [Jprogramming] Stemplot

2013-03-14 Thread Raul Miller
I am not sure that negative numbers are consistent with stem and leaf plots. That said, you could use an existing mechanism by manipulating the numbers before handing them off. For example: fudge=: ] + 0&> * (_20 * 0 = 10&|) - 10 2&p. -- Raul On Wed, Mar 13, 2013 at 5:16 PM, Brian Schott w

Re: [Jprogramming] Stemplot

2013-03-14 Thread km
Negative numbers in stem and leaf plots are discussed here: http://en.wikipedia.org/wiki/Stem-and-leaf_display --Kip Sent from my iPad On Mar 14, 2013, at 8:00 AM, Raul Miller wrote: > I am not sure that negative numbers are consistent with stem and leaf plots. > > That said, you could use

Re: [Jprogramming] Stemplot

2013-03-14 Thread Raul Miller
I think the current wikipedia discussion of this topic is not self consistent. Earlier on the page, we see that 76 is interpreted as a stem of 7 and a leaf of 6, and 88 is interpreted as a stem of 8 and a leaf of 8. In the treatment of negative numbers, the stem for X is expressed as X/10, with n

Re: [Jprogramming] Stemplot

2013-03-14 Thread Raul Miller
That said, I doubt that SAS's implementation represents the symmetry which is present here: 5*i:5 _25 _20 _15 _10 _5 0 5 10 15 20 25 Perhaps it would be worthwhile documenting the SAS stem and leaf algorithm, though, since it is "prestigious"? Thanks, -- Raul On Thu, Mar 14, 2013 at 9:48 A

Re: [Jprogramming] Stemplot

2013-03-14 Thread km
Classical stem and leaf uses truncation not rounding, to make it easy to look up values in the original data. For the wiki data -23.678758, -12.45, -3.4, 4.43, 5.5, 5.678, 16.87, 24.7, 56.8 you can truncate to the integer part and get (here done by hand) -2 | 3 -1 | 2 -0 | 3 +0 | 4 5 5

Re: [Jprogramming] Stemplot

2013-03-14 Thread Raul Miller
On Thu, Mar 14, 2013 at 3:47 PM, km wrote: > Classical stem and leaf uses truncation not rounding, to make it easy to look > up values in the original data. For the wiki data ... > You cannot show the symmetry in i: 12, which classically would probably > appear as (again done by hand, t f s e a

Re: [Jprogramming] Stemplot

2013-03-14 Thread Brian Schott
Raul, My understanding is that the stems are never rounded, but the leaves may be rounded to so that their displayed leaf is an integer. I mentioned SAS before. SAS allows the use of stems that are either X%10 5 2, I believe. I believe my version also allows such. On Thu, Mar 14, 2013 at 10:40 A

Re: [Jprogramming] Stemplot

2013-03-14 Thread Raul Miller
On Thu, Mar 14, 2013 at 4:23 PM, Brian Schott wrote: > I mentioned SAS before. SAS allows the use of stems that are either > X%10 5 2, I believe. I believe my version also allows such. Some examples would be good, to resolve the questions this raises for me. i:12 and 0.1*i:12 are probably good v

Re: [Jprogramming] Stemplot

2013-03-14 Thread km
For i:12 you can do -1 | 2 1 0 -0 | 9 8 7 6 5 4 3 2 1 +0 | 0 1 2 3 4 5 6 7 8 9 1 | 0 1 2 but variants of the stem and leaf display are available, for example -1 | 2 1 0 * | 9 8 7 6 5 -0 | 4 3 2 1 +0 | 0 1 2 3 4 * | 5 6 7 8 9 1 | 0 1 2 in which final digits 0

Re: [Jprogramming] Stemplot

2013-03-14 Thread Brian Schott
Raul, Here are some examples from my version. I no longer have access to SAS. Granted that 0.1*i:12 takes some preprocessing. pretty SL >.0.1*i:12 _0 | 1110 0 | 01122 pretty 2 SL >.0.1*i:12 _0 | 1110 0 | 011 2 | 22 pretty 5 SL i: 12

Re: [Jprogramming] J functional programming extensions

2013-03-14 Thread Jose Mario Quintana
No, I have not tried putting a sparse array in a box. How to explain this kind of thing to new people? I cannot even explain a few things to myself! Arguably this is not J, or at least it is not the way J was meant to be; yet, I find this temptation irresistible... (by the way, the extension wl

Re: [Jprogramming] Stemplot

2013-03-14 Thread Raul Miller
Given the various definition here, I think I'd implement stem and leaf plots like this: stem=: }:@":&.> leaf=: {:@":&.> stemleaf=:2 :0 y=./:~ y s=. u y (,.>~.s) ; >s <@;/. v y ) Example (using >,./ to avoiding boxes because email clients mishandle boxes): ,./ >stem stemleaf leaf i:12

[Jprogramming] What are 0: 1: and 2: ?

2013-03-14 Thread Alex Giannakopoulos
I saw these operators, 0: and 2: in some code, and I can't quite make out what they do, nor can I find any documentation. Any suggestions? -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] What are 0: 1: and 2: ?

2013-03-14 Thread Peter B. Kessler
http://www.jsoftware.com/help/dictionary/dconsf.htm ... peter On 03/14/13 18:40, Alex Giannakopoulos wrote: I saw these operators, 0: and 2: in some code, and I can't quite make out what they do, nor can I find any documentation. Any suggestions?

Re: [Jprogramming] What are 0: 1: and 2: ?

2013-03-14 Thread Alex Giannakopoulos
Thanks Peter, thought that might be the case, but I couldn't be quite sure. You know, I tried looking in the J dictionary for "constant functions", but there was no entry for them on the first page! On 15 March 2013 01:43, Peter B. Kessler wrote: > http://www.jsoftware.com/help/**dictionary/dco

Re: [Jprogramming] What are 0: 1: and 2: ?

2013-03-14 Thread Greg Borota
In j64-701gtk (under windows at least) typing 2: at the prompt and then doing CTRL-F1 takes you directly to that dictionary page. That's the way you get context sensitive help in J Term. But that's not supported yet in latest jqt.exe (j64-801 beta). On Thu, Mar 14, 2013 at 9:06 PM, Alex Giannako

Re: [Jprogramming] What are 0: 1: and 2: ?

2013-03-14 Thread bill lam
One can print out that page as a cheat sheet. That page was the back cover of the printed DOJ. Чт, 14 мар 2013, Greg Borota писал(а): > In j64-701gtk (under windows at least) typing 2: at the prompt and then > doing CTRL-F1 takes you directly to that dictionary page. That's the way > you get cont

Re: [Jprogramming] What are 0: 1: and 2: ?

2013-03-14 Thread km
At the bottom of the Vocabulary page you can see the entry _9: to 9: Constant functions I always have the Vocabulary page http://www.jsoftware.com/docs/help701/dictionary/vocabul.htm as the first tab on my Chrome browser! You can make any noun a constant function whose only value is the noun b