Re: [Jprogramming] J v Python

2012-12-07 Thread John-Philip BUTLER
Graham,   My experience is very similar to yours: J is excellent for solving engineering problems on time, but then comes a request to repackage the tool into something that non-J users can use more easily (Python if you are lucky, Excel if you are not so fortunate, Shell if you are allowed to

Re: [Jprogramming] J v Python

2012-12-07 Thread Linda Alvord
Why not teach J in the math classes in the schools. Prepare all students for the skills they might need in science, technology,engineering, sand mathematics. STEM is the big push here in Florida. I would recommend MSET. Then they have used J in math, science and engineering classes and get to

Re: [Jprogramming] @: and capped fork (and puzzles)

2012-12-07 Thread Linda Alvord
What is the advantage of defining Ca and p when the first statement has no added parentheses? 2.5 (>. % [: <. + * -) 4 _0.4 2.5 (>. % Ca <.p + * -) 4 _0.4 2.5 (>. % [ <.@] + * -) 4 _0.4 Linda Original Message-n From: programming-boun...@forums.jsoftware.com [mailto:programm

Re: [Jprogramming] Bug/annoyances in plot

2012-12-07 Thread Linda Alvord
When I was first using plot I saved this little script so I would remember how to get dots. Mayboe it will help you. pd 'reset' pd 'itemcolor red' pd 'type marker' pd 'markersize 1.4' pd 'markers circle' NB.pd (i.15);15?30 pd (0{"1 p);1{"1 p pd 'itemcolor blue' NB.pd (5

Re: [Jprogramming] J v Python

2012-12-07 Thread Bo Jacoby
Graham and Philip. When an engineering problem is solved on time comes a request to destroy the solution. Don't do it. Refuse! It is bad economy. Do some explaining and commenting, and make simplifications and improvements on the code, but don't translate it into an inferior language. Two versio

Re: [Jprogramming] J v Python

2012-12-07 Thread Linda Alvord
A chapter from my fantasy world. Kindergarten First Semester $ Imagine C, D, E... as little symbols like a cat, a dog, an elephant... ]C=:42 { a. * ]D=:35 { a. # 4 $ C 12 $ D 2 4 $ C ** 2 4 $ C 3 4 2 $ D ## ## ## ## ## ## ## ## ## ## ## ##

Re: [Jprogramming] J v Python

2012-12-07 Thread Raul Miller
Of course a real python solution involving an existing implementation should be a few lines of python that call into the existing implementation... Anyways, if I were in your situation, I would explain that I expected that my python development costs would be about 5x my J development costs, and t

Re: [Jprogramming] J v Python

2012-12-07 Thread Neil Murphy
Sounds dishonest to me. Sent from my iPhone On 7 Dec 2012, at 12:29, Raul Miller wrote: > Of course a real python solution involving an existing implementation > should be a few lines of python that call into the existing > implementation... > > Anyways, if I were in your situation, I would e

Re: [Jprogramming] J v Python

2012-12-07 Thread Raul Miller
Why dishonest? Granted, I approximated, but there are a variety of costs here having to do with making sure the result is reliable and works properly. Mind you, with that kind of price, I might lose the customer, but think about it, this price has to include things like: * Training costs for mys

Re: [Jprogramming] J v Python

2012-12-07 Thread Raul Miller
p.s. by "construction work", here, I meant something like building houses -- something I am not currently doing. -- Raul On Fri, Dec 7, 2012 at 9:15 AM, Raul Miller wrote: > Why dishonest? > > Granted, I approximated, but there are a variety of costs here having > to do with making sure the res

Re: [Jprogramming] count iterations

2012-12-07 Thread Aai
(([ ,~ -.~) 1 i.@+ >./) 1 2 4 0 3 1 2 4 or with an interesting application of under and cycle : ]&.C. 1 2 4 0 3 1 2 4 Note that if all these missing values are smaller in value than anything in the argument list they will have I have problems understanding this.Sorry if it is my b

Re: [Jprogramming] J v Python

2012-12-07 Thread David Ward Lambert
Teaching J for math class in school is a great idea. The same notation works for English class and for social studies too. The cost of entry is steep with algebraic notation so deeply entrenched. Can the US convert to Metric system? That's an easier task. > Linda Alvord > Sent: Friday, Decembe

Re: [Jprogramming] count iterations

2012-12-07 Thread Raul Miller
Here's an example argument list which specifies a permutation: 9 7 8 Here's the complete permutation: (([ ,~ -.~) 1 i.@+ >./) 9 7 8 0 1 2 3 4 5 6 9 7 8 Here's the relevance of each member of the permutation: ({. +/ .> }.)\. (([ ,~ -.~) 1 i.@+ >./) 9 7 8 0 0 0 0 0 0 0 2 0 0 Notice that e

Re: [Jprogramming] count iterations

2012-12-07 Thread Aai
On 07-12-12 16:58, Raul Miller wrote: Here's an example argument list which specifies a permutation: 9 7 8 Here's the complete permutation: (([ ,~ -.~) 1 i.@+ >./) 9 7 8 0 1 2 3 4 5 6 9 7 8 Here's the relevance of each member of the permutation: ({. +/ .> }.)\. (([ ,~ -.~) 1 i.@+ >

Re: [Jprogramming] count iterations

2012-12-07 Thread Raul Miller
I do not understand your question -- which quoted sentence were you asking about? Thanks, -- Raul On Fri, Dec 7, 2012 at 11:12 AM, Aai wrote: > > On 07-12-12 16:58, Raul Miller wrote: >> >> Here's an example argument list which specifies a permutation: >> 9 7 8 >> Here's the complete perm

Re: [Jprogramming] count iterations

2012-12-07 Thread Aai
In other words, it prefixes the argument list with any missing values. Note that if all these missing values are smaller in value than anything in the argument list they will have just missing a period or Anyways, once the On 07-12-12 18:12, Raul Miller wrote: I do not underst

Re: [Jprogramming] J v Python

2012-12-07 Thread Boyko Bantchev
On 7 December 2012 17:38, David Ward Lambert wrote: > Teaching J for math class in school is a great idea. The same notation > works for English class and for social studies too. The cost of entry > is steep with algebraic notation so deeply entrenched. Can the US > convert to Metric system? T

[Jprogramming] indirect assignment and rank question

2012-12-07 Thread Brian Schott
I am working with photographic images which use RGB color. The array d is a single image and the array D is now 2 images but I want D to contain any number of images. And I want split out the R,G, and B part which I can do for d, but I am having difficulty with the analogous r, g, and b for D.

Re: [Jprogramming] indirect assignment and rank question

2012-12-07 Thread Marshall Lochbaum
0 1 2&|: will do the job. I recommend reading the dictionary definition of |: through a few times. In particular, note that 0 1&|: on a rank three array is the same as 2 0 1&|: , and 0 1 2&|: turns into 3 0 1 2&|: on a rank four array. Marshall On Fri, Dec 07, 2012 at 03:02:49PM -0500, Brian Sch

Re: [Jprogramming] indirect assignment and rank question

2012-12-07 Thread Brian Schott
Perfect. Something was blocking me. On Fri, Dec 7, 2012 at 3:28 PM, Marshall Lochbaum wrote: > 0 1 2&|: will do the job. > > I recommend reading the dictionary definition of |: through a few times. > In particular, note that 0 1&|: on a rank three array is the same as > 2 0 1&|: , and 0 1 2&|: tu

Re: [Jprogramming] J v Python

2012-12-07 Thread Don & Cathy Kelly
What I find with the Python version is that with very little modification this could have been written in Fortran or Basic back in the early '70s with essentially the same statements- a "for" and an" if." . Whoopee! You could also do this with J using control structures and could show it to yo

Re: [Jprogramming] @: and capped fork (and puzzles)

2012-12-07 Thread Dan Bron
I haven't read the spoilers yet, so I'd like to ask a couple of clarifying questions: - re (Ca f p g) vs ([: f g) : must a difference be identified in the /output/ of these two verbs when applied to identical arguments, or are solutions allowed which show differences in products derived fr

Re: [Jprogramming] indirect assignment and rank question

2012-12-07 Thread Dan Bron
Something I never wrapped my head around with |: is what exactly the DoJ means when it says axes are "run together" when the LHA is boxed. -Dan On Dec 7, 2012, at 3:28 PM, Marshall Lochbaum wrote: > 0 1 2&|: will do the job. > > I recommend reading the dictionary definition of |: through a f

Re: [Jprogramming] J v Python

2012-12-07 Thread Graham Parkhouse
Thank you for all your responses! My thoughts are: 1. Give up engineering and teach J in math classes in schools. This is not an opportunity open to me, I'm afraid Linda, for several reasons. I think I will serve everybody best by focusing on my particular problem and helping my colleagues to unde

Re: [Jprogramming] indirect assignment and rank question

2012-12-07 Thread Linda Alvord
Why is it necessary to include & in each of these example? (0 1&|:A)-:0 1|:A=:?3 2 4$5 1 (2 0 1|:A)-:0 1|:A 1 (0 1 2|:B)-:3 0 1 2|:B=:?3 2 5 4$5 1 (0 1 2&|:B)-:3 0 1 2&|:B=:?3 2 5 4$5 1 Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:p

Re: [Jprogramming] indirect assignment and rank question

2012-12-07 Thread bob therriault
Good question Linda, My preference, if you did not need to assign variables, would be to just use the N V V train and so the verb test becomes t=:((2 0 1|:])-:(0 1|:]))@:? and you could apply it to any noun you would like. t 3 2 4$5 1 The right inner brackets are not necessary, but I th

Re: [Jprogramming] @: and capped fork (and puzzles)

2012-12-07 Thread Linda Alvord
If you replace each expression with @: with one without it: 2.5 (>. % <. @: + * -) 4 _0.44 2.5 (>. % <. @ + * -) 4 _0.44 2.5 (>. % <. @ (+ * -)) 4 _0.4 2.5 (>. % <. @ (+ * -)) 4 _0.4 Now you can see the difference in the removal of parentheses better. 2.5 (>. % [:

Re: [Jprogramming] @: and capped fork (and puzzles)

2012-12-07 Thread Dan Bron
Pepe, The specification for the first puzzle is still a bit ambiguous, because: > the equivalence fails because the execution of > sentences involving (Ca f p g) break down when > applied to (meaningful) identical arguments Can apply equally to the cases I was trying to distinguish: (1)

Re: [Jprogramming] J v Python

2012-12-07 Thread Don & Cathy Kelly
Hey - I am approaching this as an engineer (and ex educator) rather than as a professional programmer. I have in the past used a variety of languages- first was MAD (1961 at U of Michigan-credit to the Ford Foundation which provided generous support) which was a superior Fortran at the time, t

Re: [Jprogramming] Bug/annoyances in plot

2012-12-07 Thread Joey K Tuttle
My problem is not how to draw dots, but the following bug in jzplot.ijs load 'plot' pd 'type point' pd 2;3 pd 'show' |length error: pdf_circle | 'x y r'=.y Clearly there is something going wrong somewhere in the script. I've looked (a little) at trying to find where the diffe