Re: [Jprogramming] scripts.ijs

2014-02-15 Thread bill lam
I would rather think the wiki page needs revision because that is
applicable to j602 only.

Сб, 15 фев 2014, William Szuch писал(а):
 Need to add stdlib to the list of scripts in scripts.ijs for open 'stdlib'
 to work as in Wiki. 
 
  
 
 Regards
 
  
 
 Bill Szuch
 
  
 
  
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread linda
I speak only J.  Once Raul translated awk I could understand what it was
doing.  Here is how I would think of the problem as a native speaker of J.

]A=:11;13;15
---T--T--┐
│11│13│15│
L--+--+---
   
   A
11 13 15
   
   
   2{.A
11 13
   
   +/2{.A
24
   
   ]B=: :+/2{.A
24
   
   B;' WEEKS'
---T--┐
│24│ WEEKS│
L--+---
   
   B,' WEEKS'
24 WEEKS
   
   f=: 13 :':+/2{.y'
   
   f A
24
   
   f
[: : [: +/ 2 {. 

  (f A),' WEEKS'
24 WEEKS 

 Linda  
   
  
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
Sent: Friday, February 14, 2014 11:40 PM
To: Programming forum
Subject: Re: [Jprogramming] awk-like J sentences?

One thing to be careful about - awk is designed for a unix command line.
When using J, you should assume a J command line. With a little work, you
can use a J program at the unix command line, but I am not really
comfortable with the way that works, yet.

Meanwhile, at the unix command line you can work with stdin, hereris
scripts, or with files. Similarly, with J, you can work with function
arguments (vaguely like stdin, but right to left, instead of left to
right), with scripts, and with files.

In all cases, the natural unit of computation, for this problem - just like
in awk - would be a single line. I've seen some other code here, but this
is pretty simple:

BEGIN {FS=;}

becomes

';'.
or
,':'

Where in AWK you are giving the program a directive, here you are
physically incorporating the semicolon character in the line.

Also, when coding J, it's good to give your code some test data, so you can
verify that it's working the way you like. So, here's a first attempt:

   : +/ 2 {. 0.;._2 ,';' '11;13;17'

24


I went with the ,';' approach. if I had used ';', I would replace ;. _2
with :. _1 in that expression. (This is the modifier which chops up the
line in fields.


I went with 0. to convert string representations of numbers to character
representation. This mimics a feature which is implicit in awk.


I did not directly mention the field numbers in my example. I probably
should have. To fix that replace 2 {. with 0 1 { (J has 0 for the first
element where AWK uses 1). Finally, +/ inserts + between the two values and
: converts back to text. Quite likely converting back to text is an
unnecessary step, but that's what AWK is doing so I included it here. If
you want this as a named verb, you could go like this:


   addtwo=:verb def ': +/0 1 { 0.;._1 '';'', y'

   addtwo '11;13;17'

24


That's probably not completely intuitive, but I remember taking quite some
time before I was really comfortable working with awk. Everything takes
time to learn, and it's really easy to forget that after you know it well.


Once you have this, here's using it with an inline script (J's variation on
hereis documents):


   addtwo;._2(0 :0)

1;2;3;4;5

6;7;8;9

10;11;

)


Executing this gave me the result:

3

13

21


If you want to run against a file, replace (0 :0) with fread filename.


I hope this helps,


-- 

Raul









On Fri, Feb 14, 2014 at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:

 Hey there,

 As new user to J (but several years experience with C and Java), I
 find it very, very interesting. The power of its one liners and
 mathematical heritage really have me hooked.  I was wondering though
 if it has similar capabilities as awk. What's the equivalent to this
 awk script in J?:

 BEGIN { FS=; }
 { print $1+$2 }

 This script sets a FieldSeparator to ;, and then for every row, add
 the first and second column and prints it. I would like to replace awk
 with J!

 Thank you,

 Lee

 P.S. Excuse me if I've misidentified J sentences. (Sentences -
 statements?)
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Linda Alvord
What I can't understand is how to match what he is starting with which is
not  11;13;17

Linda

-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of linda
Sent: Saturday, February 15, 2014 5:13 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] awk-like J sentences?

I speak only J.  Once Raul translated awk I could understand what it was
doing.  Here is how I would think of the problem as a native speaker of J.

]A=:11;13;15
---T--T--┐
│11│13│15│
L--+--+---
   
   A
11 13 15
   
   
   2{.A
11 13
   
   +/2{.A
24
   
   ]B=: :+/2{.A
24
   
   B;' WEEKS'
---T--┐
│24│ WEEKS│
L--+---
   
   B,' WEEKS'
24 WEEKS
   
   f=: 13 :':+/2{.y'
   
   f A
24
   
   f
[: : [: +/ 2 {. 

  (f A),' WEEKS'
24 WEEKS 

 Linda  
   
  
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
Sent: Friday, February 14, 2014 11:40 PM
To: Programming forum
Subject: Re: [Jprogramming] awk-like J sentences?

One thing to be careful about - awk is designed for a unix command line.
When using J, you should assume a J command line. With a little work, you
can use a J program at the unix command line, but I am not really
comfortable with the way that works, yet.

Meanwhile, at the unix command line you can work with stdin, hereris
scripts, or with files. Similarly, with J, you can work with function
arguments (vaguely like stdin, but right to left, instead of left to
right), with scripts, and with files.

In all cases, the natural unit of computation, for this problem - just like
in awk - would be a single line. I've seen some other code here, but this
is pretty simple:

BEGIN {FS=;}

becomes

';'.
or
,':'

Where in AWK you are giving the program a directive, here you are
physically incorporating the semicolon character in the line.

Also, when coding J, it's good to give your code some test data, so you can
verify that it's working the way you like. So, here's a first attempt:

   : +/ 2 {. 0.;._2 ,';' '11;13;17'

24


I went with the ,';' approach. if I had used ';', I would replace ;. _2
with :. _1 in that expression. (This is the modifier which chops up the
line in fields.


I went with 0. to convert string representations of numbers to character
representation. This mimics a feature which is implicit in awk.


I did not directly mention the field numbers in my example. I probably
should have. To fix that replace 2 {. with 0 1 { (J has 0 for the first
element where AWK uses 1). Finally, +/ inserts + between the two values and
: converts back to text. Quite likely converting back to text is an
unnecessary step, but that's what AWK is doing so I included it here. If
you want this as a named verb, you could go like this:


   addtwo=:verb def ': +/0 1 { 0.;._1 '';'', y'

   addtwo '11;13;17'

24


That's probably not completely intuitive, but I remember taking quite some
time before I was really comfortable working with awk. Everything takes
time to learn, and it's really easy to forget that after you know it well.


Once you have this, here's using it with an inline script (J's variation on
hereis documents):


   addtwo;._2(0 :0)

1;2;3;4;5

6;7;8;9

10;11;

)


Executing this gave me the result:

3

13

21


If you want to run against a file, replace (0 :0) with fread filename.


I hope this helps,


-- 

Raul









On Fri, Feb 14, 2014 at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:

 Hey there,

 As new user to J (but several years experience with C and Java), I
 find it very, very interesting. The power of its one liners and
 mathematical heritage really have me hooked.  I was wondering though
 if it has similar capabilities as awk. What's the equivalent to this
 awk script in J?:

 BEGIN { FS=; }
 { print $1+$2 }

 This script sets a FieldSeparator to ;, and then for every row, add
 the first and second column and prints it. I would like to replace awk
 with J!

 Thank you,

 Lee

 P.S. Excuse me if I've misidentified J sentences. (Sentences -
 statements?)
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Raul Miller
I'm not actually sure what he is starting with. (And I am not sure I would
want to replace awk - it works fine for what it does.)

It might be fun, though, to design and write some J words and phrases to
represent traditional unix concepts, and then wrap J in something (a shell
script initially and a compiled executable later) that lets us use J
efficiently in #! scripts.

Thanks,

-- 
Raul




On Sat, Feb 15, 2014 at 6:21 AM, Linda Alvord lindaalv...@verizon.netwrote:

 What I can't understand is how to match what he is starting with which is
 not  11;13;17

 Linda

 -Original Message-
 From: programming-boun...@forums.jsoftware.com
 [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of linda
 Sent: Saturday, February 15, 2014 5:13 AM
 To: programm...@jsoftware.com
 Subject: Re: [Jprogramming] awk-like J sentences?

 I speak only J.  Once Raul translated awk I could understand what it was
 doing.  Here is how I would think of the problem as a native speaker of
 J.

 ]A=:11;13;15
 ---T--T--┐
 │11│13│15│
 L--+--+---

A
 11 13 15


2{.A
 11 13

+/2{.A
 24

]B=: :+/2{.A
 24

B;' WEEKS'
 ---T--┐
 │24│ WEEKS│
 L--+---

B,' WEEKS'
 24 WEEKS

f=: 13 :':+/2{.y'

f A
 24

f
 [: : [: +/ 2 {. 

   (f A),' WEEKS'
 24 WEEKS

  Linda


 -Original Message-
 From: programming-boun...@forums.jsoftware.com
 [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
 Sent: Friday, February 14, 2014 11:40 PM
 To: Programming forum
 Subject: Re: [Jprogramming] awk-like J sentences?

 One thing to be careful about - awk is designed for a unix command line.
 When using J, you should assume a J command line. With a little work, you
 can use a J program at the unix command line, but I am not really
 comfortable with the way that works, yet.

 Meanwhile, at the unix command line you can work with stdin, hereris
 scripts, or with files. Similarly, with J, you can work with function
 arguments (vaguely like stdin, but right to left, instead of left to
 right), with scripts, and with files.

 In all cases, the natural unit of computation, for this problem - just like
 in awk - would be a single line. I've seen some other code here, but this
 is pretty simple:

 BEGIN {FS=;}

 becomes

 ';'.
 or
 ,':'

 Where in AWK you are giving the program a directive, here you are
 physically incorporating the semicolon character in the line.

 Also, when coding J, it's good to give your code some test data, so you can
 verify that it's working the way you like. So, here's a first attempt:

: +/ 2 {. 0.;._2 ,';' '11;13;17'

 24


 I went with the ,';' approach. if I had used ';', I would replace ;. _2
 with :. _1 in that expression. (This is the modifier which chops up the
 line in fields.


 I went with 0. to convert string representations of numbers to character
 representation. This mimics a feature which is implicit in awk.


 I did not directly mention the field numbers in my example. I probably
 should have. To fix that replace 2 {. with 0 1 { (J has 0 for the first
 element where AWK uses 1). Finally, +/ inserts + between the two values and
 : converts back to text. Quite likely converting back to text is an
 unnecessary step, but that's what AWK is doing so I included it here. If
 you want this as a named verb, you could go like this:


addtwo=:verb def ': +/0 1 { 0.;._1 '';'', y'

addtwo '11;13;17'

 24


 That's probably not completely intuitive, but I remember taking quite some
 time before I was really comfortable working with awk. Everything takes
 time to learn, and it's really easy to forget that after you know it well.


 Once you have this, here's using it with an inline script (J's variation on
 hereis documents):


addtwo;._2(0 :0)

 1;2;3;4;5

 6;7;8;9

 10;11;

 )


 Executing this gave me the result:

 3

 13

 21


 If you want to run against a file, replace (0 :0) with fread filename.


 I hope this helps,


 --

 Raul









 On Fri, Feb 14, 2014 at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:

  Hey there,
 
  As new user to J (but several years experience with C and Java), I
  find it very, very interesting. The power of its one liners and
  mathematical heritage really have me hooked.  I was wondering though
  if it has similar capabilities as awk. What's the equivalent to this
  awk script in J?:
 
  BEGIN { FS=; }
  { print $1+$2 }
 
  This script sets a FieldSeparator to ;, and then for every row, add
  the first and second column and prints it. I would like to replace awk
  with J!
 
  Thank you,
 
  Lee
 
  P.S. Excuse me if I've misidentified J sentences. (Sentences -
  statements?)
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Joe Bogner
This is how I would do it:

lines =: 0 : 0
1;3
2;5
)

FS=:';'

_1[\ +/1  . each  FS cut each LF cut lines

outputs
4
7

lines can also be replaced with:

lines=: freads 'c:/temp/t.txt'

compare to:

gawk BEGIN{FS=;}{print $1+$2} t.txt
4
7

c:\tempcat t.txt
1;3
2;5





On Sat, Feb 15, 2014 at 6:21 AM, Linda Alvord lindaalv...@verizon.netwrote:

 What I can't understand is how to match what he is starting with which is
 not  11;13;17

 Linda

 -Original Message-
 From: programming-boun...@forums.jsoftware.com
 [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of linda
 Sent: Saturday, February 15, 2014 5:13 AM
 To: programm...@jsoftware.com
 Subject: Re: [Jprogramming] awk-like J sentences?

 I speak only J.  Once Raul translated awk I could understand what it was
 doing.  Here is how I would think of the problem as a native speaker of
 J.

 ]A=:11;13;15
 ---T--T--┐
 │11│13│15│
 L--+--+---

A
 11 13 15


2{.A
 11 13

+/2{.A
 24

]B=: :+/2{.A
 24

B;' WEEKS'
 ---T--┐
 │24│ WEEKS│
 L--+---

B,' WEEKS'
 24 WEEKS

f=: 13 :':+/2{.y'

f A
 24

f
 [: : [: +/ 2 {. 

   (f A),' WEEKS'
 24 WEEKS

  Linda


 -Original Message-
 From: programming-boun...@forums.jsoftware.com
 [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
 Sent: Friday, February 14, 2014 11:40 PM
 To: Programming forum
 Subject: Re: [Jprogramming] awk-like J sentences?

 One thing to be careful about - awk is designed for a unix command line.
 When using J, you should assume a J command line. With a little work, you
 can use a J program at the unix command line, but I am not really
 comfortable with the way that works, yet.

 Meanwhile, at the unix command line you can work with stdin, hereris
 scripts, or with files. Similarly, with J, you can work with function
 arguments (vaguely like stdin, but right to left, instead of left to
 right), with scripts, and with files.

 In all cases, the natural unit of computation, for this problem - just like
 in awk - would be a single line. I've seen some other code here, but this
 is pretty simple:

 BEGIN {FS=;}

 becomes

 ';'.
 or
 ,':'

 Where in AWK you are giving the program a directive, here you are
 physically incorporating the semicolon character in the line.

 Also, when coding J, it's good to give your code some test data, so you can
 verify that it's working the way you like. So, here's a first attempt:

: +/ 2 {. 0.;._2 ,';' '11;13;17'

 24


 I went with the ,';' approach. if I had used ';', I would replace ;. _2
 with :. _1 in that expression. (This is the modifier which chops up the
 line in fields.


 I went with 0. to convert string representations of numbers to character
 representation. This mimics a feature which is implicit in awk.


 I did not directly mention the field numbers in my example. I probably
 should have. To fix that replace 2 {. with 0 1 { (J has 0 for the first
 element where AWK uses 1). Finally, +/ inserts + between the two values and
 : converts back to text. Quite likely converting back to text is an
 unnecessary step, but that's what AWK is doing so I included it here. If
 you want this as a named verb, you could go like this:


addtwo=:verb def ': +/0 1 { 0.;._1 '';'', y'

addtwo '11;13;17'

 24


 That's probably not completely intuitive, but I remember taking quite some
 time before I was really comfortable working with awk. Everything takes
 time to learn, and it's really easy to forget that after you know it well.


 Once you have this, here's using it with an inline script (J's variation on
 hereis documents):


addtwo;._2(0 :0)

 1;2;3;4;5

 6;7;8;9

 10;11;

 )


 Executing this gave me the result:

 3

 13

 21


 If you want to run against a file, replace (0 :0) with fread filename.


 I hope this helps,


 --

 Raul









 On Fri, Feb 14, 2014 at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:

  Hey there,
 
  As new user to J (but several years experience with C and Java), I
  find it very, very interesting. The power of its one liners and
  mathematical heritage really have me hooked.  I was wondering though
  if it has similar capabilities as awk. What's the equivalent to this
  awk script in J?:
 
  BEGIN { FS=; }
  { print $1+$2 }
 
  This script sets a FieldSeparator to ;, and then for every row, add
  the first and second column and prints it. I would like to replace awk
  with J!
 
  Thank you,
 
  Lee
 
  P.S. Excuse me if I've misidentified J sentences. (Sentences -
  statements?)
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

 

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Joe Bogner
I think the ultimate 5 minute experience is a combination of:

1. Video

- Here is Kona's intro: http://www.youtube.com/watch?v=bmiq47E5N-w and
- Here is a Kona's wow factor:
http://www.youtube.com/watch?v=WBXsCeW9qfc(we could do the same with
the latest websockets implementation fairly
easily I think)

2. REPL

- http://tryclj.com/
- http://www.tryfsharp.org/

3. Some simple examples:

- http://coffeescript.org/
- http://www.jsoftware.com/jwiki/Studio/SimpleExamples
- http://www.jsoftware.com/jwiki/Studio/TasteofJPart1

4. Cheat sheet  / quick reference

- http://learnxinyminutes.com/docs/julia/ or
http://learnxinyminutes.com/docs/javascript/
-
http://www.jsoftware.com/jwiki/HenryRich?action=AttachFiledo=viewtarget=J602_RefCard_color_letter_current.pdf
- http://www.jsoftware.com/books/pdf/brief.pdf


A new person wants to likely see it, try it, and expand on it in a few
minutes to get a feel for the language and power.




On Sat, Feb 15, 2014 at 12:05 AM, robert therriault
bobtherria...@mac.comwrote:

 Thanks Murray for providing the links.

 I agree Don, but I wonder if the goal of J in 5 minutes is not to teach
 someone J, but to make them want to learn J.

 Not unlike a movie trailer, which has the job of making you want to go see
 the movie, without giving away the story.

 Cheers bob

 On Feb 14, 2014, at 7:02 PM, Don Guinn dongu...@gmail.com wrote:

  Just viewed the videos by Cliff Hastings for Wolfram. Surprised to see
 that
  there looked like an error in the second video on making a first order
 fit
  showing the line going above the origin when x=0. Later it showed it
  correctly. Sent him a note about that.
 
  But what really bothers me about demos like this is that they look so
 easy
  when they do it, but if I were to try to do it I wouldn't know where to
  start. He implied that one could do it without knowing much of anything
 of
  their system. I really get tired of videos like this where they type
 really
  fast and it looks so easy if one just knew their system well, but I
 usually
  don't. If I was presented that screen and wanted to do what he did I
  wouldn't have a clue what to do.
 
  We need to present similar videos on J, but somehow we need to make it
  obvious and logical as to what to do. His video was neat, but could I do
 it
  as quickly and easily as he did it without putting in hours, possibly
 days
  learning their system? I doubt it.
 
 
  On Fri, Feb 14, 2014 at 7:17 PM, Murray Eisenberg mur...@math.umass.edu
 wrote:
 
  If you'd like to see what a good quick demo looks like, done by one guy
  with no fancy production values -- and of a language/system having a
  state-of-the-art user interface, take a look at either of the following:
 
 
 
 http://www.wolfram.com/broadcast/search.php?Search=app%20minutex=-879y=-139video=728
 
   http://www.wolfram.com/broadcast/video.php?channel=86video=869
 
  On 14 Feb 2014 19:00:45 -0500, Henry Rich henryhr...@nc.rr.com wrote:
 
  As Ian [Clark] observed, a newcomer's first 5 minutes with J will be
  decisive in
  establishing their attitude towards the language.  As things stand, it
  takes a serious geek to take a shine to J in 5 minutes.  Just between
 us
  geeks, I wish there were more of us, but that's not the way to bet.
 
  No, we need a snappy demo: an application that everyone can relate to,
  showing how we can code something meaningful and get a pretty display
 in
  under 5 minutes.  Ideally it should be a YouTube video, with an
  accompanying Lab so the interested user can reproduce the results.
 
  
  Murray Eisenbergmur...@math.umass.edu
  Mathematics  Statistics Dept.
  Lederle Graduate Research Tower  phone 240 246-7240 (H)
  University of Massachusetts
  710 North Pleasant Street
  Amherst, MA 01003-9305
 
 
 
 
 
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm

 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] Problem installing jqt on new laptop

2014-02-15 Thread Linda Alvord
In order to create a shortcut to  start jqt I had to move  QtGui4.dll  from
folder  jqt  to folder  j801

 

Once I did that using windows vista i got:

 

JVERSION

Engine: j701/2011-01-10/11:25

Library: 8.01.020

Qt IDE: 1.0.23/4.8.5

Platform: Win 32

Installer: j801 install

InstallPath: c:/users/owner/j801

 

 

Does that look right?

 

Linda

 

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Jim Russell
I love AWK; it (and perl) have saved my bacon many times. If your problem 
involves processing fields within lines of an I/O stream in a *nix environment, 
of course you or I should use AWK. Particularly me, since I'd never be given a 
processing task involving more math than a gozinta or takeaway, much less 
anything involving polynomials, natural logs, verb inverses, factorials, ranks 
above 3, and a whole bunch of stuff that J would do for me if only I understood 
what it was. 

(I would also pick AWK if I had only 5 minutes to learn a new language.)

But had AWK never been invented (shudder), and I needed to write it, would I 
use J? Well, not me, but I know some folks here that might knock it out using J 
in an afternoon or two. 

 On Feb 14, 2014, at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:
 
 Hey there,
 
 As new user to J (but several years experience with C and Java), I
 find it very, very interesting. The power of its one liners and
 mathematical heritage really have me hooked.  I was wondering though
 if it has similar capabilities as awk. What's the equivalent to this
 awk script in J?:
 
 BEGIN { FS=; }
 { print $1+$2 }
 
 This script sets a FieldSeparator to ;, and then for every row, add
 the first and second column and prints it. I would like to replace awk
 with J!
 
 Thank you,
 
 Lee
 
 P.S. Excuse me if I've misidentified J sentences. (Sentences - statements?)
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Lee Fallat
Thank you all for your kind replies! And to those saying how I should
really use awk for this job- I know, I was just curious! I am very
impressed by the variance in answers, and how different J really is
compared to other languages.

Thanks again,

Lee

P.S. As for the input, just numbers was fine. I'm curious though what
J does when it encounters strings (and numbers!). I figured reading
through the books offered on the wiki will explain this. (+/ hello
world 100 = what? :)

On Sat, Feb 15, 2014 at 10:20 AM, Jim Russell jimsruss...@yahoo.com wrote:
 I love AWK; it (and perl) have saved my bacon many times. If your problem 
 involves processing fields within lines of an I/O stream in a *nix 
 environment, of course you or I should use AWK. Particularly me, since I'd 
 never be given a processing task involving more math than a gozinta or 
 takeaway, much less anything involving polynomials, natural logs, verb 
 inverses, factorials, ranks above 3, and a whole bunch of stuff that J would 
 do for me if only I understood what it was.

 (I would also pick AWK if I had only 5 minutes to learn a new language.)

 But had AWK never been invented (shudder), and I needed to write it, would I 
 use J? Well, not me, but I know some folks here that might knock it out using 
 J in an afternoon or two.

 On Feb 14, 2014, at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:

 Hey there,

 As new user to J (but several years experience with C and Java), I
 find it very, very interesting. The power of its one liners and
 mathematical heritage really have me hooked.  I was wondering though
 if it has similar capabilities as awk. What's the equivalent to this
 awk script in J?:

 BEGIN { FS=; }
 { print $1+$2 }

 This script sets a FieldSeparator to ;, and then for every row, add
 the first and second column and prints it. I would like to replace awk
 with J!

 Thank you,

 Lee

 P.S. Excuse me if I've misidentified J sentences. (Sentences - statements?)
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Problem installing jqt on new laptop

2014-02-15 Thread bill lam
No you should create shortcut of the jqt.cmd instead.

Alternatively, you can first unstaill/remove the j801 folder.
and then download and install the windows AIO (All-in-one)
installer from the same j801 download webpage. It will do 
everything for you.

Сб, 15 фев 2014, Linda Alvord писал(а):
 In order to create a shortcut to  start jqt I had to move  QtGui4.dll  from
 folder  jqt  to folder  j801
 
  
 
 Once I did that using windows vista i got:
 
  
 
 JVERSION
 
 Engine: j701/2011-01-10/11:25
 
 Library: 8.01.020
 
 Qt IDE: 1.0.23/4.8.5
 
 Platform: Win 32
 
 Installer: j801 install
 
 InstallPath: c:/users/owner/j801
 
  
 
  
 
 Does that look right?
 
  
 
 Linda
 
  
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
--
For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] Public JHS Servers?

2014-02-15 Thread Lee Fallat
Hey,

Is there anyone hosting a public facing JHS server? It would be nice
to have access to J on any computer connected to the Internet! I would
set one up, but my ISP has connectivity issues.

Kind regards,

Lee
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Using JHS801

2014-02-15 Thread Brian Schott
Patrick,

I am wondering if your comments are indirectly related to my 
experience/confusion with the Mac launching JHS801? Are you suggesting that the 
version 8 is getting confused with the existing version 7 at launch?

---
(B=)

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Raul Miller
Conceptually speaking, J has three atomic data types:

Numeric
Literal
Boxed

Numeric types support arithmetic: 1+1
Literal types are what might be called character types in other languages.
(ascii or unicode)
Boxed types are what might be called reference types in other languages.

J tries to treat numeric types as mathematical arithmetic entities. It's
not perfect, and involves tradeoffs but it does a pretty good job at being
useful and educational while still offering decent performance with a
relatively compact implementation. Also, J booleans are numeric and I
vastly prefer this approach (which fits my understanding of the history of
booleans) over the convention of enshrining arbitrary implementation
limitations.

You cannot perform arithmetic directly on literals but you can, for
example, compare an ascii 'A' with a unicode 'A' and get a literally
correct answer. (However, unicode also includes an open ended set of rules
and extensions and if you want those you will probably need to implement
them yourself. To avoid open-ended arguments about these issues its perhaps
better to refer to this type of data as 'literal' rather than 'character'.)

Boxes take an arbitrary array and puts it in a box - you get a single
thing which can be treated something like a literal or a number.

You cannot mix these three types in the same array, but if you put
something in a box you can put the box in an array of boxes.

Anyways...

For some contexts you might use a list of characters (excuse me: I mean
literals) to represent a string. For other contexts you might want to put
that list of characters in a box. If you arrange your strings as a two
dimensional array they will all be padded (with spaces) to match the length
of the longest one.

Actually, in some contexts you might want to use a list of numbers to
represent a string. Sometimes arithmetic is handy.

Put differently, J does not actually have a string data type. But you can
represent them using arrays.

Examples:

   'hello'
hello
   'hello';'there'
┌─┬─┐
│hello│there│
└─┴─┘
   'hi',:'there'
hi
there
   'hi',:.(-(a.i.'*')).(a.i.)'there'
hi***
there

In that last example, I made the padding character by '*' rather than ' '.
I did this by combining the two strings as numbers rather than literals.
The padding value for numbers is zero. But if I had stopped  there I would
have gotten ascii nulls for my padding. So I also combined them under
subtracting by the numeric value for '*'.

Under performs the reverse transform for the result (of the transform that
it performed from the arguments),
http://www.jsoftware.com/jwiki/Essays/Under

I hope this makes sense.

Thanks,

-- 
Raul

On Sat, Feb 15, 2014 at 10:31 AM, Lee Fallat ircsurfe...@gmail.com wrote:

 Thank you all for your kind replies! And to those saying how I should
 really use awk for this job- I know, I was just curious! I am very
 impressed by the variance in answers, and how different J really is
 compared to other languages.

 Thanks again,

 Lee

 P.S. As for the input, just numbers was fine. I'm curious though what
 J does when it encounters strings (and numbers!). I figured reading
 through the books offered on the wiki will explain this. (+/ hello
 world 100 = what? :)

 On Sat, Feb 15, 2014 at 10:20 AM, Jim Russell jimsruss...@yahoo.com
 wrote:
  I love AWK; it (and perl) have saved my bacon many times. If your
 problem involves processing fields within lines of an I/O stream in a *nix
 environment, of course you or I should use AWK. Particularly me, since I'd
 never be given a processing task involving more math than a gozinta or
 takeaway, much less anything involving polynomials, natural logs, verb
 inverses, factorials, ranks above 3, and a whole bunch of stuff that J
 would do for me if only I understood what it was.
 
  (I would also pick AWK if I had only 5 minutes to learn a new language.)
 
  But had AWK never been invented (shudder), and I needed to write it,
 would I use J? Well, not me, but I know some folks here that might knock it
 out using J in an afternoon or two.
 
  On Feb 14, 2014, at 9:51 PM, Lee Fallat ircsurfe...@gmail.com wrote:
 
  Hey there,
 
  As new user to J (but several years experience with C and Java), I
  find it very, very interesting. The power of its one liners and
  mathematical heritage really have me hooked.  I was wondering though
  if it has similar capabilities as awk. What's the equivalent to this
  awk script in J?:
 
  BEGIN { FS=; }
  { print $1+$2 }
 
  This script sets a FieldSeparator to ;, and then for every row, add
  the first and second column and prints it. I would like to replace awk
  with J!
 
  Thank you,
 
  Lee
 
  P.S. Excuse me if I've misidentified J sentences. (Sentences -
 statements?)
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
  --
  For 

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Murray Eisenberg
The issue is what, exactly, one wishes to convey by a short, introductory, 
video. One possibility is an advertising blurb that tells who uses the language 
and for what wonderful purposes. Another starts out with some fundamental 
notions of the language (you form an array like this, assign it to a name like 
this, transpose it like that using a one-argument function, etc. And yet 
another -- the kind in the videos I cited, just gives a feel for what using the 
language is like by actually coding some simple yet moderately useful example.

Yes, a demo like Cliff Hastings makes things seem deceptively easy. But: (1) 
the help system for this particular programming system is so incredibly rich 
that one could discover how to do all this oneself; and (2) this demo is 
actually part 8 of an 8-part series of videos. (I just couldn't lay my hands on 
the free-standing, self-contained, similar demo that Hastings had posted 
elsewhere.)

[Note. There is NO error in the first plot of the fitted line: the origin is 
not at (0,0) or (1,0) but at (5,0) -- because that's what the system selected 
as best showing the line's plot. In the second plot, of the original, 
quadratic, data together with the linear fit, the system again selects a 
suitable origin, in this case (0,0). And if you don't want to let this 
sophisticated system make such choices for you, you can always override its 
choices, in this instance by specifying an option AxesOrigin - {0, 0} .]

On 14 Feb 2014 20:02:42 -0700, Don Guinn dongu...@gmail.com wrote:

 Just viewed the videos by Cliff Hastings for Wolfram. Surprised to see that
 there looked like an error in the second video on making a first order fit
 showing the line going above the origin when x=0. Later it showed it
 correctly. Sent him a note about that.
 
 But what really bothers me about demos like this is that they look so easy
 when they do it, but if I were to try to do it I wouldn't know where to
 start. He implied that one could do it without knowing much of anything of
 their system. I really get tired of videos like this where they type really
 fast and it looks so easy if one just knew their system well, but I usually
 don't. If I was presented that screen and wanted to do what he did I
 wouldn't have a clue what to do.
 
 We need to present similar videos on J, but somehow we need to make it
 obvious and logical as to what to do. His video was neat, but could I do it
 as quickly and easily as he did it without putting in hours, possibly days
 learning their system? I doubt it.
 
 
 On Fri, Feb 14, 2014 at 7:17 PM, Murray Eisenberg 
 mur...@math.umass.eduwrote:
 
 If you'd like to see what a good quick demo looks like, done by one guy
 with no fancy production values -- and of a language/system having a
 state-of-the-art user interface, take a look at either of the following:
 
 
 http://www.wolfram.com/broadcast/search.php?Search=app%20minutex=-879y=-139video=728
 
  http://www.wolfram.com/broadcast/video.php?channel=86video=869
 
 On 14 Feb 2014 19:00:45 -0500, Henry Rich henryhr...@nc.rr.com wrote:
 
 As Ian [Clark] observed, a newcomer's first 5 minutes with J will be
 decisive in
 establishing their attitude towards the language.  As things stand, it
 takes a serious geek to take a shine to J in 5 minutes.  Just between us
 geeks, I wish there were more of us, but that's not the way to bet.
 
 No, we need a snappy demo: an application that everyone can relate to,
 showing how we can code something meaningful and get a pretty display in
 under 5 minutes.  Ideally it should be a YouTube video, with an
 accompanying Lab so the interested user can reproduce the results

——
Murray Eisenbergmur...@math.umass.edu
Mathematics  Statistics Dept.   
Lederle Graduate Research Tower  phone 240 246-7240 (H)
University of Massachusetts
710 North Pleasant Street 
Amherst, MA 01003-9305






--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Public JHS Servers?

2014-02-15 Thread Raul Miller
It might be fun to run something like this on a disposable ec2 box (or
maybe one of the alternatives, like hostgator or liquidweb, or whatever),
ideally in a readonly chroot partition (partition to work around some ..
issues).

Thanks,

-- 
Raul

On Sat, Feb 15, 2014 at 11:00 AM, Lee Fallat ircsurfe...@gmail.com wrote:

 Oh jeez, didn't know that.

 Nevermind then...heh...

 Thanks Bill!

 On Sat, Feb 15, 2014 at 10:56 AM, bill lam bbill@gmail.com wrote:
  There was one. However I don't suggest doing it without knowing
  its implication becasue J can excute system commands such as
  rm -rf ~/
 
  Сб, 15 фев 2014, Lee Fallat писал(а):
  Hey,
 
  Is there anyone hosting a public facing JHS server? It would be nice
  to have access to J on any computer connected to the Internet! I would
  set one up, but my ISP has connectivity issues.
 
  Kind regards,
 
  Lee
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  regards,
  
  GPG key 1024D/4434BAB3 2008-08-24
  gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
  gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Jim Russell
Love it! Think I'm gonna get a lot from Linda's and Norman's paper. Now I 
wonder if I missed it or forgot it. 

 On Feb 14, 2014, at 7:00 PM, Henry Rich henryhr...@nc.rr.com wrote:
 
 Ian Clark's NuVoc project is a great start at making J easier for newcomers.  
 As part of that effort, the FrontPage of the Wiki now has a section aimed at 
 newcomers.
 
 As Ian observed, a newcomer's first 5 minutes with J will be decisive in 
 establishing their attitude towards the language.  As things stand, it takes 
 a serious geek to take a shine to J in 5 minutes.  Just between us geeks, I 
 wish there were more of us, but that's not the way to bet.
 
 No, we need a snappy demo: an application that everyone can relate to, 
 showing how we can code something meaningful and get a pretty display in 
 under 5 minutes.  Ideally it should be a YouTube video, with an accompanying 
 Lab so the interested user can reproduce the results.
 
 I call for somebody, or a small group, to produce /J in 5 Minutes/, the demo 
 that really makes the case for the language.  The job requires creative and 
 production skills that I lack, but I will be willing to write code to further 
 the project.
 
 Henry Rich
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Henry Rich
What I am thinking we want is 5 minutes that leaves the user thinking, 
Wow.  That was cool.  They did all that and it was so fast and short. 
I want to learn how they did that.  The demo should make extensive use 
of libraries and packages to get a job done.  It needs to be a job that 
takes some coding - something that would take pages of C - but one where 
the J program is short.  You don't have to write the J program in 5 
minutes!  We can have the program already written, but you should be 
able to type it, run it, and see flashy results in that time.


Henry Rich

On 2/15/2014 11:44 AM, Murray Eisenberg wrote:

The issue is what, exactly, one wishes to convey by a short, introductory, video. 
One possibility is an advertising blurb that tells who uses the language and for 
what wonderful purposes. Another starts out with some fundamental notions of the 
language (you form an array like this, assign it to a name like this, 
transpose it like that using a one-argument function, etc. And yet another -- the 
kind in the videos I cited, just gives a feel for what using the language is like by 
actually coding some simple yet moderately useful example.

Yes, a demo like Cliff Hastings makes things seem deceptively easy. But: (1) 
the help system for this particular programming system is so incredibly rich 
that one could discover how to do all this oneself; and (2) this demo is 
actually part 8 of an 8-part series of videos. (I just couldn't lay my hands on 
the free-standing, self-contained, similar demo that Hastings had posted 
elsewhere.)

[Note. There is NO error in the first plot of the fitted line: the origin is not 
at (0,0) or (1,0) but at (5,0) -- because that's what the system selected as best 
showing the line's plot. In the second plot, of the original, quadratic, data 
together with the linear fit, the system again selects a suitable origin, in this 
case (0,0). And if you don't want to let this sophisticated system make such 
choices for you, you can always override its choices, in this instance by 
specifying an option AxesOrigin - {0, 0} .]

On 14 Feb 2014 20:02:42 -0700, Don Guinn dongu...@gmail.com wrote:


Just viewed the videos by Cliff Hastings for Wolfram. Surprised to see that
there looked like an error in the second video on making a first order fit
showing the line going above the origin when x=0. Later it showed it
correctly. Sent him a note about that.

But what really bothers me about demos like this is that they look so easy
when they do it, but if I were to try to do it I wouldn't know where to
start. He implied that one could do it without knowing much of anything of
their system. I really get tired of videos like this where they type really
fast and it looks so easy if one just knew their system well, but I usually
don't. If I was presented that screen and wanted to do what he did I
wouldn't have a clue what to do.

We need to present similar videos on J, but somehow we need to make it
obvious and logical as to what to do. His video was neat, but could I do it
as quickly and easily as he did it without putting in hours, possibly days
learning their system? I doubt it.


On Fri, Feb 14, 2014 at 7:17 PM, Murray Eisenberg mur...@math.umass.eduwrote:


If you'd like to see what a good quick demo looks like, done by one guy
with no fancy production values -- and of a language/system having a
state-of-the-art user interface, take a look at either of the following:


http://www.wolfram.com/broadcast/search.php?Search=app%20minutex=-879y=-139video=728

  http://www.wolfram.com/broadcast/video.php?channel=86video=869

On 14 Feb 2014 19:00:45 -0500, Henry Rich henryhr...@nc.rr.com wrote:


As Ian [Clark] observed, a newcomer's first 5 minutes with J will be

decisive in

establishing their attitude towards the language.  As things stand, it
takes a serious geek to take a shine to J in 5 minutes.  Just between us
geeks, I wish there were more of us, but that's not the way to bet.

No, we need a snappy demo: an application that everyone can relate to,
showing how we can code something meaningful and get a pretty display in
under 5 minutes.  Ideally it should be a YouTube video, with an
accompanying Lab so the interested user can reproduce the results


——
Murray Eisenbergmur...@math.umass.edu
Mathematics  Statistics Dept.
Lederle Graduate Research Tower  phone 240 246-7240 (H)
University of Massachusetts
710 North Pleasant Street
Amherst, MA 01003-9305






--
For information about J forums see http://www.jsoftware.com/forums.htm


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Public JHS Servers?

2014-02-15 Thread Joe Bogner
Raul, I was thinking the same thing earlier on. Personally, with J
available on iOS and Android it handles most cases I would need while away
from the computer.

A web hosted J  with a persistent session or locale per user would be neat.

I recall there is a bot on the irc channel on freenode. I assume it
accounts for the abuse concern somehow
On Feb 15, 2014 11:47 AM, Raul Miller rauldmil...@gmail.com wrote:

 It might be fun to run something like this on a disposable ec2 box (or
 maybe one of the alternatives, like hostgator or liquidweb, or whatever),
 ideally in a readonly chroot partition (partition to work around some ..
 issues).

 Thanks,

 --
 Raul

 On Sat, Feb 15, 2014 at 11:00 AM, Lee Fallat ircsurfe...@gmail.com
 wrote:

  Oh jeez, didn't know that.
 
  Nevermind then...heh...
 
  Thanks Bill!
 
  On Sat, Feb 15, 2014 at 10:56 AM, bill lam bbill@gmail.com wrote:
   There was one. However I don't suggest doing it without knowing
   its implication becasue J can excute system commands such as
   rm -rf ~/
  
   Сб, 15 фев 2014, Lee Fallat писал(а):
   Hey,
  
   Is there anyone hosting a public facing JHS server? It would be nice
   to have access to J on any computer connected to the Internet! I would
   set one up, but my ISP has connectivity issues.
  
   Kind regards,
  
   Lee
   --
   For information about J forums see
 http://www.jsoftware.com/forums.htm
  
   --
   regards,
   
   GPG key 1024D/4434BAB3 2008-08-24
   gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
   gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
   --
   For information about J forums see http://www.jsoftware.com/forums.htm
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] fifth heart curve

2014-02-15 Thread Aai

Just append

7744881


On 15-02-14 17:16, Jim Russell wrote:

Can't get there, from here at least...
Google reports 404 error.


On Feb 15, 2014, at 2:54 AM, R.E. Boss r.e.b...@planet.nl wrote:

What about this one
https://plus.google.com/u/0/photos/101244335910217616226/albums/598024084706
7744881 ?


R.E. Boss

(Add your info to http://www.jsoftware.com/jwiki/Community/Demographics )



-Original Message-
From: programming-boun...@forums.jsoftware.com [mailto:programming-
boun...@forums.jsoftware.com] On Behalf Of Devon McCormick
Sent: vrijdag 14 februari 2014 20:12
To: J-programming forum
Subject: Re: [Jprogramming] fifth heart curve

I'll let the rest of you waste more time on this than I already have:

   pd 'color red;pensize 8;output cairo 1000 1000'
   pd (X j. Y0) 1j1#i: 3.15j1000
   pd 'color blue;pensize 15'
   pd nn=. 3j2-~2%~(_16}.5+i:5j99)^~/1j1*1+99%~i:5j999
   pd (1.5*2-~0{tt)j.1 (1{tt)+1 (8%~1-~i.5)+/|.400%~i.1000 [ tt=.
|:+._1{nn
   pd 'show'


--
For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


--
Met vriendelijke groet,
@@i = Arie Groeneveld

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Roger Hui
​ ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4

In J:
   ((i. 10) + 2.91) % 0.4
or
   (2.91 + i. 10) % 0.4
or
   0.4 %~ 2.91 + i. 10




On Sat, Feb 15, 2014 at 9:04 AM, Lee Fallat ircsurfe...@gmail.com wrote:

 Thanks for the explanation Raul.

 I think I understand now that string manipulation in J is
 non-trivial...I was following right up until the very last J sentence
 ( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
 know a few verbs. I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language. There are so
 many things that would seem straight forward in traditional languages
 than J, but I will have to see!

 Some examples of what I'm thinking of would be difficult or different in J:
 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
 ​​
 ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4
 One other thing is interacting with the operating system...How do I
 check to see if files, or even directories exist? Can you create
 directories, or change permissions of files with J? The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?

 Anyways, I apologize for being off-topic, but just some things I've
 been thinking about. Like I said I still have to get through some more
 learning material.

 Regards,

 Lee



 On Sat, Feb 15, 2014 at 11:37 AM, Raul Miller rauldmil...@gmail.com
 wrote:
  Conceptually speaking, J has three atomic data types:
 
  Numeric
  Literal
  Boxed
 
  Numeric types support arithmetic: 1+1
  Literal types are what might be called character types in other
 languages.
  (ascii or unicode)
  Boxed types are what might be called reference types in other languages.
 
  J tries to treat numeric types as mathematical arithmetic entities. It's
  not perfect, and involves tradeoffs but it does a pretty good job at
 being
  useful and educational while still offering decent performance with a
  relatively compact implementation. Also, J booleans are numeric and I
  vastly prefer this approach (which fits my understanding of the history
 of
  booleans) over the convention of enshrining arbitrary implementation
  limitations.
 
  You cannot perform arithmetic directly on literals but you can, for
  example, compare an ascii 'A' with a unicode 'A' and get a literally
  correct answer. (However, unicode also includes an open ended set of
 rules
  and extensions and if you want those you will probably need to implement
  them yourself. To avoid open-ended arguments about these issues its
 perhaps
  better to refer to this type of data as 'literal' rather than
 'character'.)
 
  Boxes take an arbitrary array and puts it in a box - you get a single
  thing which can be treated something like a literal or a number.
 
  You cannot mix these three types in the same array, but if you put
  something in a box you can put the box in an array of boxes.
 
  Anyways...
 
  For some contexts you might use a list of characters (excuse me: I mean
  literals) to represent a string. For other contexts you might want to put
  that list of characters in a box. If you arrange your strings as a two
  dimensional array they will all be padded (with spaces) to match the
 length
  of the longest one.
 
  Actually, in some contexts you might want to use a list of numbers to
  represent a string. Sometimes arithmetic is handy.
 
  Put differently, J does not actually have a string data type. But you
 can
  represent them using arrays.
 
  Examples:
 
 'hello'
  hello
 'hello';'there'
  ┌─┬─┐
  │hello│there│
  └─┴─┘
 'hi',:'there'
  hi
  there
 'hi',:.(-(a.i.'*')).(a.i.)'there'
  hi***
  there
 
  In that last example, I made the padding character by '*' rather than '
 '.
  I did this by combining the two strings as numbers rather than literals.
  The padding value for numbers is zero. But if I had stopped  there I
 would
  have gotten ascii nulls for my padding. So I also combined them under
  subtracting by the numeric value for '*'.
 
  Under performs the reverse transform for the result (of the transform
 that
  it performed from the arguments),
  http://www.jsoftware.com/jwiki/Essays/Under
 
  I hope this makes sense.
 
  Thanks,
 
  --
  Raul
 
  On Sat, Feb 15, 2014 at 10:31 AM, Lee Fallat ircsurfe...@gmail.com
 wrote:
 
  Thank you all for your kind 

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Pascal Jasmin
string manipulation in J is non-trivial...

The scary code from Raul was trying to replace a default space as a fill 
character.

'hi' ,: 'there'

produces a list of 2 5 long strings
'hi   '
'there'

Passing 3 or more parameters to a verb

an explicit verb can have its first line be:

'a b c' =. y

which puts each of the 3 paramters in y into their own variable.

   0.4 %~ 2.91 + i.10
7.275 9.775 12.275 14.775 17.275 19.775 22.275 24.775 27.275 29.775

.How do I
check to see if files, or even directories exist? Can you create
directories, or change permissions of files with J?


capabilities are there with standard library verbs, and there are raw file 
operations described here: http://www.jsoftware.com/help/dictionary/dx001.htm

- Original Message -
From: Lee Fallat ircsurfe...@gmail.com
To: programm...@jsoftware.com
Cc: 
Sent: Saturday, February 15, 2014 12:04:13 PM
Subject: Re: [Jprogramming] awk-like J sentences?

Thanks for the explanation Raul.

I think I understand now that string manipulation in J is
non-trivial...I was following right up until the very last J sentence
( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
know a few verbs. I am starting to think J is either not for me, or my
way of thinking really needs to change for this language. There are so
many things that would seem straight forward in traditional languages
than J, but I will have to see!

Some examples of what I'm thinking of would be difficult or different in J:
Passing 3 or more parameters to a verb
Turning a vector into a list of arguments
...loops? From what I've seen loops are built into some verbs (+/ -/
etc), but what if you wanted to do say: add every number in the
vector, but for every number add 2.91, then divide that by 0.4?
In python:
range() generates a list of numbers from 0 to 9.
for x in range(0,10)
    y += (x + 2.91) / 0.4
One other thing is interacting with the operating system...How do I
check to see if files, or even directories exist? Can you create
directories, or change permissions of files with J? The scope of J
seems to be very constrained to mathematics. It would be nice to use J
as a system programming language! Are there any examples of people
doing these things?

Anyways, I apologize for being off-topic, but just some things I've
been thinking about. Like I said I still have to get through some more
learning material.

Regards,

Lee



On Sat, Feb 15, 2014 at 11:37 AM, Raul Miller rauldmil...@gmail.com wrote:
 Conceptually speaking, J has three atomic data types:

 Numeric
 Literal
 Boxed

 Numeric types support arithmetic: 1+1
 Literal types are what might be called character types in other languages.
 (ascii or unicode)
 Boxed types are what might be called reference types in other languages.

 J tries to treat numeric types as mathematical arithmetic entities. It's
 not perfect, and involves tradeoffs but it does a pretty good job at being
 useful and educational while still offering decent performance with a
 relatively compact implementation. Also, J booleans are numeric and I
 vastly prefer this approach (which fits my understanding of the history of
 booleans) over the convention of enshrining arbitrary implementation
 limitations.

 You cannot perform arithmetic directly on literals but you can, for
 example, compare an ascii 'A' with a unicode 'A' and get a literally
 correct answer. (However, unicode also includes an open ended set of rules
 and extensions and if you want those you will probably need to implement
 them yourself. To avoid open-ended arguments about these issues its perhaps
 better to refer to this type of data as 'literal' rather than 'character'.)

 Boxes take an arbitrary array and puts it in a box - you get a single
 thing which can be treated something like a literal or a number.

 You cannot mix these three types in the same array, but if you put
 something in a box you can put the box in an array of boxes.

 Anyways...

 For some contexts you might use a list of characters (excuse me: I mean
 literals) to represent a string. For other contexts you might want to put
 that list of characters in a box. If you arrange your strings as a two
 dimensional array they will all be padded (with spaces) to match the length
 of the longest one.

 Actually, in some contexts you might want to use a list of numbers to
 represent a string. Sometimes arithmetic is handy.

 Put differently, J does not actually have a string data type. But you can
 represent them using arrays.

 Examples:

    'hello'
 hello
    'hello';'there'
 ┌─┬─┐
 │hello│there│
 └─┴─┘
    'hi',:'there'
 hi
 there
    'hi',:.(-(a.i.'*')).(a.i.)'there'
 hi***
 there

 In that last example, I made the padding character by '*' rather than ' '.
 I did this by combining the two strings as numbers rather than literals.
 The padding value for numbers is zero. But if I had stopped  there I would
 have gotten ascii nulls for my padding. So I also combined them under
 subtracting by 

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Murray Eisenberg
The first of those two is nicely done.

However -- and here I play a Devil's advocate -- is the example all that 
impressive? Yes, the function leap he defines is fairly terse. But even 
terser, in a certain language I also use, is the pre-defined function:

  LeapYearQ

Moreover, while that Kona demo clearly builds on the methods used to define a 
factorial function so as to build the leap function, isn't it a bit off-putting 
for many programmers so have to worry about defining a factorial function. I 
don't know whether Kona has such a function built in, but J certainly does. The 
issue here is what level programming one is trying to do, of course.
 
On 15 Feb 2014 08:13:10 -0500, Joe Bogner joebog...@gmail.com wrote:

 I think the ultimate 5 minute experience is a combination of:
 
 1. Video
 
 - Here is Kona's intro: http://www.youtube.com/watch?v=bmiq47E5N-w and
 - Here is a Kona's wow factor:
 http://www.youtube.com/watch?v=WBXsCeW9qfc(we could do the same with
 the latest websockets implementation fairly
 easily I think) . . . 

——
Murray Eisenberg mur...@math.umass.edu
Mathematics  Statistics Dept.   
Lederle Graduate Research Tower  phone 240 246-7240 (H)
University of Massachusetts
710 North Pleasant Street 
Amherst, MA 01003-9305






--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Roger Hui
In other words, not only are loops built into some verbs (+/ -/) but they
are built into all verbs.  But we don't really think of them as having
loops.  Ken Iverson told the following anecdote:  In J we say, move the
army from Boston to New York; in a scalar language you'd say for i in
range (0,n) move soldier i from Boston to New York.  Do you think of move
as having a loop built in?




On Sat, Feb 15, 2014 at 9:15 AM, Roger Hui rogerhui.can...@gmail.comwrote:

 ​ ...loops? From what I've seen loops are built into some verbs (+/ -/
  etc), but what if you wanted to do say: add every number in the
  vector, but for every number add 2.91, then divide that by 0.4?
  In python:
  range() generates a list of numbers from 0 to 9.
  for x in range(0,10)
  y += (x + 2.91) / 0.4

 In J:
((i. 10) + 2.91) % 0.4
 or
(2.91 + i. 10) % 0.4
 or
0.4 %~ 2.91 + i. 10




 On Sat, Feb 15, 2014 at 9:04 AM, Lee Fallat ircsurfe...@gmail.com wrote:

 Thanks for the explanation Raul.

 I think I understand now that string manipulation in J is
 non-trivial...I was following right up until the very last J sentence
 ( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
 know a few verbs. I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language. There are so
 many things that would seem straight forward in traditional languages
 than J, but I will have to see!

 Some examples of what I'm thinking of would be difficult or different in
 J:
 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
 ​​
 ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4
 One other thing is interacting with the operating system...How do I
 check to see if files, or even directories exist? Can you create
 directories, or change permissions of files with J? The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?

 Anyways, I apologize for being off-topic, but just some things I've
 been thinking about. Like I said I still have to get through some more
 learning material.

 Regards,

 Lee



 On Sat, Feb 15, 2014 at 11:37 AM, Raul Miller rauldmil...@gmail.com
 wrote:
  Conceptually speaking, J has three atomic data types:
 
  Numeric
  Literal
  Boxed
 
  Numeric types support arithmetic: 1+1
  Literal types are what might be called character types in other
 languages.
  (ascii or unicode)
  Boxed types are what might be called reference types in other languages.
 
  J tries to treat numeric types as mathematical arithmetic entities. It's
  not perfect, and involves tradeoffs but it does a pretty good job at
 being
  useful and educational while still offering decent performance with a
  relatively compact implementation. Also, J booleans are numeric and I
  vastly prefer this approach (which fits my understanding of the history
 of
  booleans) over the convention of enshrining arbitrary implementation
  limitations.
 
  You cannot perform arithmetic directly on literals but you can, for
  example, compare an ascii 'A' with a unicode 'A' and get a literally
  correct answer. (However, unicode also includes an open ended set of
 rules
  and extensions and if you want those you will probably need to implement
  them yourself. To avoid open-ended arguments about these issues its
 perhaps
  better to refer to this type of data as 'literal' rather than
 'character'.)
 
  Boxes take an arbitrary array and puts it in a box - you get a single
  thing which can be treated something like a literal or a number.
 
  You cannot mix these three types in the same array, but if you put
  something in a box you can put the box in an array of boxes.
 
  Anyways...
 
  For some contexts you might use a list of characters (excuse me: I mean
  literals) to represent a string. For other contexts you might want to
 put
  that list of characters in a box. If you arrange your strings as a two
  dimensional array they will all be padded (with spaces) to match the
 length
  of the longest one.
 
  Actually, in some contexts you might want to use a list of numbers to
  represent a string. Sometimes arithmetic is handy.
 
  Put differently, J does not actually have a string data type. But you
 can
  represent them using arrays.
 
  Examples:
 
 'hello'
  hello
 'hello';'there'
  ┌─┬─┐
  │hello│there│
  └─┴─┘
 'hi',:'there'
  hi
  there
 'hi',:.(-(a.i.'*')).(a.i.)'there'
  hi***
  there
 
  In that last example, I made the padding character by '*' rather than '
 '.
  I did this by combining the two strings as numbers rather than literals.
  The padding value for numbers is 

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Roger Hui
I misread the question and the Python statements.  You need a +/ in front
of each expression.  Thus:

In J:
   +/ ((i. 10) + 2.91) % 0.4
or
   +/ (2.91 + i. 10) % 0.4
or
   +/ 0.4 %~ 2.91 + i. 10

You didn't ask, but the partial sums would be:

   +/\ 0.4 %~ 2.91 + i. 10




On Sat, Feb 15, 2014 at 9:15 AM, Roger Hui rogerhui.can...@gmail.comwrote:

 ​ ...loops? From what I've seen loops are built into some verbs (+/ -/
  etc), but what if you wanted to do say: add every number in the
  vector, but for every number add 2.91, then divide that by 0.4?
  In python:
  range() generates a list of numbers from 0 to 9.
  for x in range(0,10)
  y += (x + 2.91) / 0.4

 In J:
((i. 10) + 2.91) % 0.4
 or
(2.91 + i. 10) % 0.4
 or
0.4 %~ 2.91 + i. 10




 On Sat, Feb 15, 2014 at 9:04 AM, Lee Fallat ircsurfe...@gmail.com wrote:

 Thanks for the explanation Raul.

 I think I understand now that string manipulation in J is
 non-trivial...I was following right up until the very last J sentence
 ( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
 know a few verbs. I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language. There are so
 many things that would seem straight forward in traditional languages
 than J, but I will have to see!

 Some examples of what I'm thinking of would be difficult or different in
 J:
 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
 ​​
 ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4
 One other thing is interacting with the operating system...How do I
 check to see if files, or even directories exist? Can you create
 directories, or change permissions of files with J? The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?

 Anyways, I apologize for being off-topic, but just some things I've
 been thinking about. Like I said I still have to get through some more
 learning material.

 Regards,

 Lee



 On Sat, Feb 15, 2014 at 11:37 AM, Raul Miller rauldmil...@gmail.com
 wrote:
  Conceptually speaking, J has three atomic data types:
 
  Numeric
  Literal
  Boxed
 
  Numeric types support arithmetic: 1+1
  Literal types are what might be called character types in other
 languages.
  (ascii or unicode)
  Boxed types are what might be called reference types in other languages.
 
  J tries to treat numeric types as mathematical arithmetic entities. It's
  not perfect, and involves tradeoffs but it does a pretty good job at
 being
  useful and educational while still offering decent performance with a
  relatively compact implementation. Also, J booleans are numeric and I
  vastly prefer this approach (which fits my understanding of the history
 of
  booleans) over the convention of enshrining arbitrary implementation
  limitations.
 
  You cannot perform arithmetic directly on literals but you can, for
  example, compare an ascii 'A' with a unicode 'A' and get a literally
  correct answer. (However, unicode also includes an open ended set of
 rules
  and extensions and if you want those you will probably need to implement
  them yourself. To avoid open-ended arguments about these issues its
 perhaps
  better to refer to this type of data as 'literal' rather than
 'character'.)
 
  Boxes take an arbitrary array and puts it in a box - you get a single
  thing which can be treated something like a literal or a number.
 
  You cannot mix these three types in the same array, but if you put
  something in a box you can put the box in an array of boxes.
 
  Anyways...
 
  For some contexts you might use a list of characters (excuse me: I mean
  literals) to represent a string. For other contexts you might want to
 put
  that list of characters in a box. If you arrange your strings as a two
  dimensional array they will all be padded (with spaces) to match the
 length
  of the longest one.
 
  Actually, in some contexts you might want to use a list of numbers to
  represent a string. Sometimes arithmetic is handy.
 
  Put differently, J does not actually have a string data type. But you
 can
  represent them using arrays.
 
  Examples:
 
 'hello'
  hello
 'hello';'there'
  ┌─┬─┐
  │hello│there│
  └─┴─┘
 'hi',:'there'
  hi
  there
 'hi',:.(-(a.i.'*')).(a.i.)'there'
  hi***
  there
 
  In that last example, I made the padding character by '*' rather than '
 '.
  I did this by combining the two strings as numbers rather than literals.
  The padding value for numbers is zero. But if I had stopped  there I
 would
  have gotten ascii nulls for my padding. So I also combined them under
  

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Raul Miller
Perhaps it is also worth noting that we are not going to impress everyone,
nor should we want to.

J currently caters to some high powered wallstreet types, high quality
engineering types and so on. But it's hardly the only language in use for
any of those categories.

... anyways we should probably think a bit about qualities of the sort of
people we think we want to attract with this video (or videos, since we
might want to attract different kinds of people).

I'd also be tempted to enlist Cathrine Lathwell's advice on video creation
- she has more than a little relevant experience.

Thanks,

-- 
Raul


On Sat, Feb 15, 2014 at 12:21 PM, Murray Eisenberg mur...@math.umass.eduwrote:

 The first of those two is nicely done.

 However -- and here I play a Devil's advocate -- is the example all that
 impressive? Yes, the function leap he defines is fairly terse. But even
 terser, in a certain language I also use, is the pre-defined function:

   LeapYearQ

 Moreover, while that Kona demo clearly builds on the methods used to
 define a factorial function so as to build the leap function, isn't it a
 bit off-putting for many programmers so have to worry about defining a
 factorial function. I don't know whether Kona has such a function built in,
 but J certainly does. The issue here is what level programming one is
 trying to do, of course.

 On 15 Feb 2014 08:13:10 -0500, Joe Bogner joebog...@gmail.com wrote:

  I think the ultimate 5 minute experience is a combination of:
 
  1. Video
 
  - Here is Kona's intro: http://www.youtube.com/watch?v=bmiq47E5N-w and
  - Here is a Kona's wow factor:
  http://www.youtube.com/watch?v=WBXsCeW9qfc(we could do the same with
  the latest websockets implementation fairly
  easily I think) . . .

 ——
 Murray Eisenberg mur...@math.umass.edu
 Mathematics  Statistics Dept.
 Lederle Graduate Research Tower  phone 240 246-7240 (H)
 University of Massachusetts
 710 North Pleasant Street
 Amherst, MA 01003-9305






 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Henry Rich
My idea about that is, we need to appeal to young programmers.  The more 
experience people have with scalar languages, the less able they are to 
learn J.  The more experience they have with other languages in a class 
with J, the less they need to learn J.


The application needs to be of obvious interest to a non-mathematical, 
non-financial user.  My target would be a scientist/engineer/IT person 
who has a computation to perform and no canned package to do it, so they 
have to write a little code.


Henry Rich

On 2/15/2014 12:30 PM, Raul Miller wrote:

Perhaps it is also worth noting that we are not going to impress everyone,
nor should we want to.

J currently caters to some high powered wallstreet types, high quality
engineering types and so on. But it's hardly the only language in use for
any of those categories.

... anyways we should probably think a bit about qualities of the sort of
people we think we want to attract with this video (or videos, since we
might want to attract different kinds of people).

I'd also be tempted to enlist Cathrine Lathwell's advice on video creation
- she has more than a little relevant experience.

Thanks,


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Joe Bogner
On Sat, Feb 15, 2014 at 12:04 PM, Lee Fallat ircsurfe...@gmail.com wrote:

 Thanks for the explanation Raul.

 I think I understand now that string manipulation in J is
 non-trivial...


Hi Lee, this list of standard string functions may be of help:
http://www.jsoftware.com/docs/help602/user/script_strings.htm or
http://www.jsoftware.com/help/user/library.htm  Between those functions and
the regex support, I haven't felt limited by J's string functions (having
come from a long time programming in other languages (C, C#, java,
javascript, python, R, etc)

 I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language.


I felt similar to you about 9 months ago when I started. Stick with it. The
learning curve is steep but I've found it to be rewarding so far. It's a
bit of a journey, sometimes feeling like geocaching. It gets easier with
time.


 Some examples of what I'm thinking of would be difficult or different in J:
 Passing 3 or more parameters to a verb


Raul addressed it with the suggestion of passing a list. The syntax of
binding variables to a list is slick too and makes it feel seamless to me.

'a b c' =: 1;2;3



 The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?


I felt this way in the beginning too. After 9 moths, I haven't found
something that isn't possible. In terms of examples, rosettacode is a
invaluable resource: http://rosettacode.org/wiki/Category:J
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread robert therriault
Hi Henry and Raul,

I think that the audience being young programmers is a good start towards the 
issues that Raul raises. As an additional challenge, I think that we would want 
to use an example that is user friendly once their interest has been attracted. 
There are some areas of J that have more overhanging learning curves than 
others :)  I don't think we would want to get them interested and then send 
them into the teeth of image processing unless we also provided a good road map.

Cheers, bob

On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:

 My idea about that is, we need to appeal to young programmers.  The more 
 experience people have with scalar languages, the less able they are to learn 
 J.  The more experience they have with other languages in a class with J, the 
 less they need to learn J.
 
 The application needs to be of obvious interest to a non-mathematical, 
 non-financial user.  My target would be a scientist/engineer/IT person who 
 has a computation to perform and no canned package to do it, so they have to 
 write a little code.
 
 Henry Rich
 
 On 2/15/2014 12:30 PM, Raul Miller wrote:
 Perhaps it is also worth noting that we are not going to impress everyone,
 nor should we want to.
 
 J currently caters to some high powered wallstreet types, high quality
 engineering types and so on. But it's hardly the only language in use for
 any of those categories.
 
 ... anyways we should probably think a bit about qualities of the sort of
 people we think we want to attract with this video (or videos, since we
 might want to attract different kinds of people).
 
 I'd also be tempted to enlist Cathrine Lathwell's advice on video creation
 - she has more than a little relevant experience.
 
 Thanks,
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] Beginner - multiline paste

2014-02-15 Thread Asdasd Asdasd



Hi, I'm a novice in J and I was trying to define a noun as a multi-line text 
like this:

txt =: 0 : 0
ab
cd
fg
hi
jk
ij
)

I tried first executing the first line (txt =: 0 : 0) and then pasting (ctrl v) 
my text. The result was only 'ij'.
I tried then to execute the first line and press F8 (run clipboard), getting 
0!:101 inputx_jrx_ as a result.

So, is there a way to assign multiline text to a noun without having to create 
a new ijs and running from there?

Thanks.


  
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Beginner - multiline paste

2014-02-15 Thread Henry Rich
Usually put it into .ijs, but you can copy it into .ijx, then select it 
all in the .ijx, and do Run|Selection.


Henry Rich

On 2/15/2014 1:06 PM, Asdasd Asdasd wrote:




Hi, I'm a novice in J and I was trying to define a noun as a multi-line text 
like this:

txt =: 0 : 0
ab
cd
fg
hi
jk
ij
)

I tried first executing the first line (txt =: 0 : 0) and then pasting (ctrl v) 
my text. The result was only 'ij'.
I tried then to execute the first line and press F8 (run clipboard), getting 
0!:101 inputx_jrx_ as a result.

So, is there a way to assign multiline text to a noun without having to create 
a new ijs and running from there?

Thanks.



--
For information about J forums see http://www.jsoftware.com/forums.htm


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Vijay Lulla
I came across
http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
on HN. And
http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
might be useful to consider how newcomers take to concepts. These pages are
fascinating to me because it shows that even though these people have had
prior experience with other languages they claim that they still don't
understand programming. IMO, the emphasis on concepts and how J/APL can aid
in these explorations is the best approach to teach programming. Actually
Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
Quotations page] is one of the best explanations of a very commonly
occurring programming idiom.


On Sat, Feb 15, 2014 at 12:51 PM, robert therriault
bobtherria...@mac.comwrote:

 Hi Henry and Raul,

 I think that the audience being young programmers is a good start towards
 the issues that Raul raises. As an additional challenge, I think that we
 would want to use an example that is user friendly once their interest has
 been attracted. There are some areas of J that have more overhanging
 learning curves than others :)  I don't think we would want to get them
 interested and then send them into the teeth of image processing unless we
 also provided a good road map.

 Cheers, bob

 On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:

  My idea about that is, we need to appeal to young programmers.  The more
 experience people have with scalar languages, the less able they are to
 learn J.  The more experience they have with other languages in a class
 with J, the less they need to learn J.
 
  The application needs to be of obvious interest to a non-mathematical,
 non-financial user.  My target would be a scientist/engineer/IT person who
 has a computation to perform and no canned package to do it, so they have
 to write a little code.
 
  Henry Rich
 
  On 2/15/2014 12:30 PM, Raul Miller wrote:
  Perhaps it is also worth noting that we are not going to impress
 everyone,
  nor should we want to.
 
  J currently caters to some high powered wallstreet types, high quality
  engineering types and so on. But it's hardly the only language in use
 for
  any of those categories.
 
  ... anyways we should probably think a bit about qualities of the sort
 of
  people we think we want to attract with this video (or videos, since we
  might want to attract different kinds of people).
 
  I'd also be tempted to enlist Cathrine Lathwell's advice on video
 creation
  - she has more than a little relevant experience.
 
  Thanks,
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm

 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] a: is not $0

2014-02-15 Thread Henry Rich
I didn't use any foreigns in my version of the verb.  The only point I'm 
trying to make is that a: and $0 are different.


Henry Rich

On 2/15/2014 1:10 PM, Raul Miller wrote:

Does it have to be a domain error? We had an example bug involving a limit
error just a few days ago. Or are foreigns off limits?

Thanks,


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Roger Hui
 The scope of J seems to be very constrained to mathematics.
 It would be nice to use J as a system programming language!
 Are there any examples of people doing these things?

What are the requirements of a system programming language these days?  In
the old days (and my age is showing :-), it means assembler and/or machine
language manipulations.

The following are a few examples of using J.

   - Sudoku http://www.jsoftware.com/jwiki/Essays/Sudoku
   - N Queens 
Problemhttp://www.jsoftware.com/jwiki/Essays/N%20Queens%20Problem
   - Queens and
Knightshttp://www.jsoftware.com/jwiki/Essays/Queens%20and%20Knights
   - Knight's Tour http://www.jsoftware.com/jwiki/Essays/Knight%27s%20Tour
   - Set Game http://www.jsoftware.com/jwiki/Essays/Set%20Game
   - The Monty Hall
Problemhttp://www.jsoftware.com/jwiki/Essays/The%20Monty%20Hall%20Problem

Whether or not you consider these to be constrained by mathematics, it
would be interesting to compare a solution in another language to the J
solution.



On Sat, Feb 15, 2014 at 9:04 AM, Lee Fallat ircsurfe...@gmail.com wrote:

 Thanks for the explanation Raul.

 I think I understand now that string manipulation in J is
 non-trivial...I was following right up until the very last J sentence
 ( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
 know a few verbs. I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language. There are so
 many things that would seem straight forward in traditional languages
 than J, but I will have to see!

 Some examples of what I'm thinking of would be difficult or different in J:
 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
 ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4
 One other thing is interacting with the operating system...How do I
 check to see if files, or even directories exist? Can you create
 directories, or change permissions of files with J? The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?

 Anyways, I apologize for being off-topic, but just some things I've
 been thinking about. Like I said I still have to get through some more
 learning material.

 Regards,

 Lee



 On Sat, Feb 15, 2014 at 11:37 AM, Raul Miller rauldmil...@gmail.com
 wrote:
  Conceptually speaking, J has three atomic data types:
 
  Numeric
  Literal
  Boxed
 
  Numeric types support arithmetic: 1+1
  Literal types are what might be called character types in other
 languages.
  (ascii or unicode)
  Boxed types are what might be called reference types in other languages.
 
  J tries to treat numeric types as mathematical arithmetic entities. It's
  not perfect, and involves tradeoffs but it does a pretty good job at
 being
  useful and educational while still offering decent performance with a
  relatively compact implementation. Also, J booleans are numeric and I
  vastly prefer this approach (which fits my understanding of the history
 of
  booleans) over the convention of enshrining arbitrary implementation
  limitations.
 
  You cannot perform arithmetic directly on literals but you can, for
  example, compare an ascii 'A' with a unicode 'A' and get a literally
  correct answer. (However, unicode also includes an open ended set of
 rules
  and extensions and if you want those you will probably need to implement
  them yourself. To avoid open-ended arguments about these issues its
 perhaps
  better to refer to this type of data as 'literal' rather than
 'character'.)
 
  Boxes take an arbitrary array and puts it in a box - you get a single
  thing which can be treated something like a literal or a number.
 
  You cannot mix these three types in the same array, but if you put
  something in a box you can put the box in an array of boxes.
 
  Anyways...
 
  For some contexts you might use a list of characters (excuse me: I mean
  literals) to represent a string. For other contexts you might want to put
  that list of characters in a box. If you arrange your strings as a two
  dimensional array they will all be padded (with spaces) to match the
 length
  of the longest one.
 
  Actually, in some contexts you might want to use a list of numbers to
  represent a string. Sometimes arithmetic is handy.
 
  Put differently, J does not actually have a string data type. But you
 can
  represent them using arrays.
 
  Examples:
 
 'hello'
  hello
 'hello';'there'
  ┌─┬─┐
  │hello│there│
  └─┴─┘
 'hi',:'there'
  hi
  there
 'hi',:.(-(a.i.'*')).(a.i.)'there'
  hi***
  there
 
  In that last example, I made the padding character by '*' rather than '

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Raul Miller
Something to keep in mind is that good programs take time to write, and you
do not have to solve or understand everything all at once. Also, you need
to start somewhere and it's going to be frustrating sometimes.

On the other hand, you need to find some fun and joy in the programming,
which requires you be just a bit odd (or, in some cases, a lot odd).

Finally, people often think of computers as labor saving devices but it's
probably better to think of them as tools for doing more work. It's a
peculiar kind of laziness you need, where you are willing to work really
hard to get something done in a way that could have been done more easily
by hand, in the hopes that it will solve problems for other people.

Another aspect of coding is redundancy - every time a problem is solved
with a new set of tools, that makes that aspect of our computing
infrastructure more robust against failure (and also trains the people
involved about some things that matter to other people).

One useful thing to learn, when programming, is don't repeat yourself -
this teaches you to find related things and bring them together. But that's
not the only relevant approach, and often gets misapplied. You also have to
be willing to repeat yourself.

Another useful thing to learn is optimizing - making code more efficient.
But the first rule of optimization is don't. Don't optimize until you
need to, and when you do, don't optimize things which do not need it. You
can even think of don't repeat yourself as an optimization of repeat
yourself. But this kind of philosophizing is kind of useless to someone
who doesn't have enough experience yet. So maybe the best advice is don't
worry about it?

Thanks,

-- 
Raul




On Sat, Feb 15, 2014 at 1:16 PM, Vijay Lulla vijaylu...@gmail.com wrote:

 I came across

 http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
 on HN. And
 http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
 might be useful to consider how newcomers take to concepts. These pages are
 fascinating to me because it shows that even though these people have had
 prior experience with other languages they claim that they still don't
 understand programming. IMO, the emphasis on concepts and how J/APL can aid
 in these explorations is the best approach to teach programming. Actually
 Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
 Quotations page] is one of the best explanations of a very commonly
 occurring programming idiom.


 On Sat, Feb 15, 2014 at 12:51 PM, robert therriault
 bobtherria...@mac.comwrote:

  Hi Henry and Raul,
 
  I think that the audience being young programmers is a good start towards
  the issues that Raul raises. As an additional challenge, I think that we
  would want to use an example that is user friendly once their interest
 has
  been attracted. There are some areas of J that have more overhanging
  learning curves than others :)  I don't think we would want to get them
  interested and then send them into the teeth of image processing unless
 we
  also provided a good road map.
 
  Cheers, bob
 
  On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:
 
   My idea about that is, we need to appeal to young programmers.  The
 more
  experience people have with scalar languages, the less able they are to
  learn J.  The more experience they have with other languages in a class
  with J, the less they need to learn J.
  
   The application needs to be of obvious interest to a non-mathematical,
  non-financial user.  My target would be a scientist/engineer/IT person
 who
  has a computation to perform and no canned package to do it, so they have
  to write a little code.
  
   Henry Rich
  
   On 2/15/2014 12:30 PM, Raul Miller wrote:
   Perhaps it is also worth noting that we are not going to impress
  everyone,
   nor should we want to.
  
   J currently caters to some high powered wallstreet types, high quality
   engineering types and so on. But it's hardly the only language in use
  for
   any of those categories.
  
   ... anyways we should probably think a bit about qualities of the sort
  of
   people we think we want to attract with this video (or videos, since
 we
   might want to attract different kinds of people).
  
   I'd also be tempted to enlist Cathrine Lathwell's advice on video
  creation
   - she has more than a little relevant experience.
  
   Thanks,
  
   --
   For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see 

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Brian Schott
Vijay,

Like another recent post to the forum, yours got mangled, somehow.
The correct link is as follows, if it survives.


http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/

Otoh, the mangled link to which I was sent, provide another intriguing,
though irrelevant blog.

http://waterstreetgm.org/this-american-life/




On Sat, Feb 15, 2014 at 1:16 PM, Vijay Lulla vijaylu...@gmail.com wrote:

 I came across

 http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
 on HN. And
 http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
 might be useful to consider how newcomers take to concepts. These pages are
 fascinating to me because it shows that even though these people have had
 prior experience with other languages they claim that they still don't
 understand programming. IMO, the emphasis on concepts and how J/APL can aid
 in these explorations is the best approach to teach programming. Actually
 Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
 Quotations page] is one of the best explanations of a very commonly
 occurring programming idiom.

 --
(B=)
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] a: is not $0

2014-02-15 Thread Raul Miller
Certainly,

   3!:0  a:  NB. boolean
1
   3!:0  $0   NB. integer
4

But what we are working with here is two representations of the same value
-- most differences which do not involve foreigns should probably be
thought of as errors.

-- 
Raul



On Sat, Feb 15, 2014 at 1:19 PM, Henry Rich henryhr...@nc.rr.com wrote:

 I didn't use any foreigns in my version of the verb.  The only point I'm
 trying to make is that a: and $0 are different.

 Henry Rich


 On 2/15/2014 1:10 PM, Raul Miller wrote:

 Does it have to be a domain error? We had an example bug involving a limit
 error just a few days ago. Or are foreigns off limits?

 Thanks,

  --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Jim Russell
Someone recently linked to Ron Jeffery's blog re throwing in the towel on 
learning J. I developed a respect for Ron back when I hung out on Ward 
Cunningham's original Wiki. Ward once raved about J, even though he thought he 
had fully groked it in a weekend or so.  

 On Feb 15, 2014, at 1:16 PM, Vijay Lulla vijaylu...@gmail.com wrote:
 
 I came across
 http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
 on HN. And
 http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
 might be useful to consider how newcomers take to concepts. These pages are
 fascinating to me because it shows that even though these people have had
 prior experience with other languages they claim that they still don't
 understand programming. IMO, the emphasis on concepts and how J/APL can aid
 in these explorations is the best approach to teach programming. Actually
 Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
 Quotations page] is one of the best explanations of a very commonly
 occurring programming idiom.
 
 
 On Sat, Feb 15, 2014 at 12:51 PM, robert therriault
 bobtherria...@mac.comwrote:
 
 Hi Henry and Raul,
 
 I think that the audience being young programmers is a good start towards
 the issues that Raul raises. As an additional challenge, I think that we
 would want to use an example that is user friendly once their interest has
 been attracted. There are some areas of J that have more overhanging
 learning curves than others :)  I don't think we would want to get them
 interested and then send them into the teeth of image processing unless we
 also provided a good road map.
 
 Cheers, bob
 
 On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:
 
 My idea about that is, we need to appeal to young programmers.  The more
 experience people have with scalar languages, the less able they are to
 learn J.  The more experience they have with other languages in a class
 with J, the less they need to learn J.
 
 The application needs to be of obvious interest to a non-mathematical,
 non-financial user.  My target would be a scientist/engineer/IT person who
 has a computation to perform and no canned package to do it, so they have
 to write a little code.
 
 Henry Rich
 
 On 2/15/2014 12:30 PM, Raul Miller wrote:
 Perhaps it is also worth noting that we are not going to impress
 everyone,
 nor should we want to.
 
 J currently caters to some high powered wallstreet types, high quality
 engineering types and so on. But it's hardly the only language in use
 for
 any of those categories.
 
 ... anyways we should probably think a bit about qualities of the sort
 of
 people we think we want to attract with this video (or videos, since we
 might want to attract different kinds of people).
 
 I'd also be tempted to enlist Cathrine Lathwell's advice on video
 creation
 - she has more than a little relevant experience.
 
 Thanks,
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Jim Russell
I thought the first rule was: Q: When is the best time to optimize? A: Not yet!

 On Feb 15, 2014, at 1:36 PM, Raul Miller rauldmil...@gmail.com wrote:
 
 Something to keep in mind is that good programs take time to write, and you
 do not have to solve or understand everything all at once. Also, you need
 to start somewhere and it's going to be frustrating sometimes.
 
 On the other hand, you need to find some fun and joy in the programming,
 which requires you be just a bit odd (or, in some cases, a lot odd).
 
 Finally, people often think of computers as labor saving devices but it's
 probably better to think of them as tools for doing more work. It's a
 peculiar kind of laziness you need, where you are willing to work really
 hard to get something done in a way that could have been done more easily
 by hand, in the hopes that it will solve problems for other people.
 
 Another aspect of coding is redundancy - every time a problem is solved
 with a new set of tools, that makes that aspect of our computing
 infrastructure more robust against failure (and also trains the people
 involved about some things that matter to other people).
 
 One useful thing to learn, when programming, is don't repeat yourself -
 this teaches you to find related things and bring them together. But that's
 not the only relevant approach, and often gets misapplied. You also have to
 be willing to repeat yourself.
 
 Another useful thing to learn is optimizing - making code more efficient.
 But the first rule of optimization is don't. Don't optimize until you
 need to, and when you do, don't optimize things which do not need it. You
 can even think of don't repeat yourself as an optimization of repeat
 yourself. But this kind of philosophizing is kind of useless to someone
 who doesn't have enough experience yet. So maybe the best advice is don't
 worry about it?
 
 Thanks,
 
 -- 
 Raul
 
 
 
 
 On Sat, Feb 15, 2014 at 1:16 PM, Vijay Lulla vijaylu...@gmail.com wrote:
 
 I came across
 
 http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
 on HN. And
 http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
 might be useful to consider how newcomers take to concepts. These pages are
 fascinating to me because it shows that even though these people have had
 prior experience with other languages they claim that they still don't
 understand programming. IMO, the emphasis on concepts and how J/APL can aid
 in these explorations is the best approach to teach programming. Actually
 Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
 Quotations page] is one of the best explanations of a very commonly
 occurring programming idiom.
 
 
 On Sat, Feb 15, 2014 at 12:51 PM, robert therriault
 bobtherria...@mac.comwrote:
 
 Hi Henry and Raul,
 
 I think that the audience being young programmers is a good start towards
 the issues that Raul raises. As an additional challenge, I think that we
 would want to use an example that is user friendly once their interest
 has
 been attracted. There are some areas of J that have more overhanging
 learning curves than others :)  I don't think we would want to get them
 interested and then send them into the teeth of image processing unless
 we
 also provided a good road map.
 
 Cheers, bob
 
 On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:
 
 My idea about that is, we need to appeal to young programmers.  The
 more
 experience people have with scalar languages, the less able they are to
 learn J.  The more experience they have with other languages in a class
 with J, the less they need to learn J.
 
 The application needs to be of obvious interest to a non-mathematical,
 non-financial user.  My target would be a scientist/engineer/IT person
 who
 has a computation to perform and no canned package to do it, so they have
 to write a little code.
 
 Henry Rich
 
 On 2/15/2014 12:30 PM, Raul Miller wrote:
 Perhaps it is also worth noting that we are not going to impress
 everyone,
 nor should we want to.
 
 J currently caters to some high powered wallstreet types, high quality
 engineering types and so on. But it's hardly the only language in use
 for
 any of those categories.
 
 ... anyways we should probably think a bit about qualities of the sort
 of
 people we think we want to attract with this video (or videos, since
 we
 might want to attract different kinds of people).
 
 I'd also be tempted to enlist Cathrine Lathwell's advice on video
 creation
 - she has more than a little relevant experience.
 
 Thanks,
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see 

Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Raul Miller
That was probably my fault.

I tried to show him how I used J, not realizing that he had a very strong
preference for a different style of coding.

:(

-- 
Raul



On Sat, Feb 15, 2014 at 1:44 PM, Jim Russell jimsruss...@yahoo.com wrote:

 Someone recently linked to Ron Jeffery's blog re throwing in the towel on
 learning J. I developed a respect for Ron back when I hung out on Ward
 Cunningham's original Wiki. Ward once raved about J, even though he thought
 he had fully groked it in a weekend or so.

  On Feb 15, 2014, at 1:16 PM, Vijay Lulla vijaylu...@gmail.com wrote:
 
  I came across
 
 http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
  on HN. And
  http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
  might be useful to consider how newcomers take to concepts. These pages
 are
  fascinating to me because it shows that even though these people have had
  prior experience with other languages they claim that they still don't
  understand programming. IMO, the emphasis on concepts and how J/APL can
 aid
  in these explorations is the best approach to teach programming. Actually
  Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
  Quotations page] is one of the best explanations of a very commonly
  occurring programming idiom.
 
 
  On Sat, Feb 15, 2014 at 12:51 PM, robert therriault
  bobtherria...@mac.comwrote:
 
  Hi Henry and Raul,
 
  I think that the audience being young programmers is a good start
 towards
  the issues that Raul raises. As an additional challenge, I think that we
  would want to use an example that is user friendly once their interest
 has
  been attracted. There are some areas of J that have more overhanging
  learning curves than others :)  I don't think we would want to get them
  interested and then send them into the teeth of image processing unless
 we
  also provided a good road map.
 
  Cheers, bob
 
  On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:
 
  My idea about that is, we need to appeal to young programmers.  The
 more
  experience people have with scalar languages, the less able they are to
  learn J.  The more experience they have with other languages in a class
  with J, the less they need to learn J.
 
  The application needs to be of obvious interest to a non-mathematical,
  non-financial user.  My target would be a scientist/engineer/IT person
 who
  has a computation to perform and no canned package to do it, so they
 have
  to write a little code.
 
  Henry Rich
 
  On 2/15/2014 12:30 PM, Raul Miller wrote:
  Perhaps it is also worth noting that we are not going to impress
  everyone,
  nor should we want to.
 
  J currently caters to some high powered wallstreet types, high quality
  engineering types and so on. But it's hardly the only language in use
  for
  any of those categories.
 
  ... anyways we should probably think a bit about qualities of the sort
  of
  people we think we want to attract with this video (or videos, since
 we
  might want to attract different kinds of people).
 
  I'd also be tempted to enlist Cathrine Lathwell's advice on video
  creation
  - she has more than a little relevant experience.
 
  Thanks,
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Vijay Lulla
Raul, I fully agree with everything you've said.

Brian, Sorry for the link mangling. You have the correct link in your
message.


On Sat, Feb 15, 2014 at 1:49 PM, Raul Miller rauldmil...@gmail.com wrote:

 That was probably my fault.

 I tried to show him how I used J, not realizing that he had a very strong
 preference for a different style of coding.

 :(

 --
 Raul



 On Sat, Feb 15, 2014 at 1:44 PM, Jim Russell jimsruss...@yahoo.com
 wrote:

  Someone recently linked to Ron Jeffery's blog re throwing in the towel on
  learning J. I developed a respect for Ron back when I hung out on Ward
  Cunningham's original Wiki. Ward once raved about J, even though he
 thought
  he had fully groked it in a weekend or so.
 
   On Feb 15, 2014, at 1:16 PM, Vijay Lulla vijaylu...@gmail.com wrote:
  
   I came across
  
 
 http://waterstreetgm.org/throwing-in-the-towel-on-becomming-a-programmer/this
   on HN. And
   http://sdawncasey.wordpress.com/about/ in that page. Maybe these pages
   might be useful to consider how newcomers take to concepts. These pages
  are
   fascinating to me because it shows that even though these people have
 had
   prior experience with other languages they claim that they still don't
   understand programming. IMO, the emphasis on concepts and how J/APL can
  aid
   in these explorations is the best approach to teach programming.
 Actually
   Ken Iverson's explanation of Under (.) [I read this on Ken Iverson's
   Quotations page] is one of the best explanations of a very commonly
   occurring programming idiom.
  
  
   On Sat, Feb 15, 2014 at 12:51 PM, robert therriault
   bobtherria...@mac.comwrote:
  
   Hi Henry and Raul,
  
   I think that the audience being young programmers is a good start
  towards
   the issues that Raul raises. As an additional challenge, I think that
 we
   would want to use an example that is user friendly once their interest
  has
   been attracted. There are some areas of J that have more overhanging
   learning curves than others :)  I don't think we would want to get
 them
   interested and then send them into the teeth of image processing
 unless
  we
   also provided a good road map.
  
   Cheers, bob
  
   On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com
 wrote:
  
   My idea about that is, we need to appeal to young programmers.  The
  more
   experience people have with scalar languages, the less able they are
 to
   learn J.  The more experience they have with other languages in a
 class
   with J, the less they need to learn J.
  
   The application needs to be of obvious interest to a
 non-mathematical,
   non-financial user.  My target would be a scientist/engineer/IT person
  who
   has a computation to perform and no canned package to do it, so they
  have
   to write a little code.
  
   Henry Rich
  
   On 2/15/2014 12:30 PM, Raul Miller wrote:
   Perhaps it is also worth noting that we are not going to impress
   everyone,
   nor should we want to.
  
   J currently caters to some high powered wallstreet types, high
 quality
   engineering types and so on. But it's hardly the only language in
 use
   for
   any of those categories.
  
   ... anyways we should probably think a bit about qualities of the
 sort
   of
   people we think we want to attract with this video (or videos, since
  we
   might want to attract different kinds of people).
  
   I'd also be tempted to enlist Cathrine Lathwell's advice on video
   creation
   - she has more than a little relevant experience.
  
   Thanks,
  
 --
   For information about J forums see
 http://www.jsoftware.com/forums.htm
  
   --
   For information about J forums see
 http://www.jsoftware.com/forums.htm
   --
   For information about J forums see http://www.jsoftware.com/forums.htm
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] a: is not $0

2014-02-15 Thread Henry Rich
You are right, but what verb (without foreigns) would expose that 
difference?


Henry Rich

On 2/15/2014 1:41 PM, Raul Miller wrote:

Certainly,

3!:0  a:  NB. boolean
1
3!:0  $0   NB. integer
4

But what we are working with here is two representations of the same value
-- most differences which do not involve foreigns should probably be
thought of as errors.


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread David Lambert
In an earlier post in the awk-like J sentences I used wrong part of 
speech where adverse conjunction was correct.  Yes, awk gracefully 
handles bad data.  And it's well worth learning if you use files.  On 
DOS system I install mingw or cygwin.  There might be a native version 
of gawk as well.


While not helping demonstrate under, fit works with laminate:

   'hi',:!.'*' 'there'
hi***
there

   ('hi',:!.'*' 'there') -: 'hi',:.(-(a.i.'*')).(a.i.)'there'
1


Date: Sat, 15 Feb 2014 11:37:32 -0500
From: Raul Millerrauldmil...@gmail.com
To: Programming forumprogramm...@jsoftware.com
Subject: Re: [Jprogramming] awk-like J sentences?
Message-ID:
cad2jou8omaebf__cyhng+p1el23gtbscyq6zweautzq4rsz...@mail.gmail.com
Content-Type: text/plain; charset=UTF-8

...

'hi',:'there'
hi
there
'hi',:.(-(a.i.'*')).(a.i.)'there'
hi***
there

In that last example, I made the padding character by '*' rather than ' '.
I did this by combining the two strings as numbers rather than literals.
The padding value for numbers is zero. But if I had stopped  there I would
have gotten ascii nulls for my padding. So I also combined them under
subtracting by the numeric value for '*'.


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?so

2014-02-15 Thread David Lambert

Python isn't quite so bad.
 sum((x + 2.91) / 0.4 for x in range(10)) # python
185.250003


I find the sum function somewhat windows like in that some common 
operations are especially easy.  The reduce function was demoted from 
builtin to a library in python3.  Why work under these repressive 
constraints?


   +/ 0.4 %~ 2.91 + i. 10  NB. j
185.25

Let's remember gawk:

$ gawk 'BEGIN{for(x=0;x10;++x)a+=(x + 2.91) / 0.4;print a;exit}'
185.25

 Date: Sat, 15 Feb 2014 12:04:13 -0500
From: Lee Fallat ircsurfe...@gmail.com
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] awk-like J sentences?

Message-ID:
 cakzhxzhxcyhdzzccvgvgaftzqxxgvmqwzstfholfu0m4g+a...@mail.gmail.com
Content-Type: text/plain; charset=UTF-8

Thanks for the explanation Raul.

I think I understand now that string manipulation in J is
non-trivial...I was following right up until the very last J sentence
( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
know a few verbs. I am starting to think J is either not for me, or my
way of thinking really needs to change for this language. There are so
many things that would seem straight forward in traditional languages
than J, but I will have to see!

Some examples of what I'm thinking of would be difficult or different 
in J:

Passing 3 or more parameters to a verb
Turning a vector into a list of arguments
...loops? From what I've seen loops are built into some verbs (+/ -/
etc), but what if you wanted to do say: add every number in the
vector, but for every number add 2.91, then divide that by 0.4?
In python:
range() generates a list of numbers from 0 to 9.
for x in range(0,10)
y += (x + 2.91) / 0.4
One other thing is interacting with the operating system...How do I
check to see if files, or even directories exist? Can you create
directories, or change permissions of files with J? The scope of J
seems to be very constrained to mathematics. It would be nice to use J
as a system programming language! Are there any examples of people
doing these things?

Anyways, I apologize for being off-topic, but just some things I've
been thinking about. Like I said I still have to get through some more
learning material.

Regards,

Lee


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Beginner - multiline paste

2014-02-15 Thread Jan-Pieter Jacobs
The problem is that pasting multiple lines somehow only results in the last
one being seen in the GUI's. In the console it does work as expected.
This is a point where I think the GUI's are a bit counter intuitive.
The workarounds have been given by others.
Kind regards,

Jan-Pieter


2014-02-15 19:27 GMT+01:00 robert therriault bobtherria...@mac.com:

 You can put the linefeeds in yourself.

a=:'ab',LF,'cd',LF,'ef',LF,'gh',LF,'ij'
a
 ab
 cd
 ef
 gh
 ij
$a
 14
b=: 'ab','cd','ef','gh',:'ij'
b
 ab
 cd
 ef
 gh
 ij
$b
 5 2
c=: 0 : 0
 ab
 cd
 ef
 gh
 ij
 )
c
 ab
 cd
 ef
 gh
 ij
$c
 15

   Note that a is a 14 character string which displays linefeeds and b is a
 5 2 array. c is a 15 character string because of the extra LF you have used
 to moved to the last line ')' in your explicit definition.

 Hope this helps,

 Cheers, bob

 On Feb 15, 2014, at 10:09 AM, Henry Rich henryhr...@nc.rr.com wrote:

  Usually put it into .ijs, but you can copy it into .ijx, then select it
 all in the .ijx, and do Run|Selection.
 
  Henry Rich
 
  On 2/15/2014 1:06 PM, Asdasd Asdasd wrote:
 
 
 
  Hi, I'm a novice in J and I was trying to define a noun as a multi-line
 text like this:
 
  txt =: 0 : 0
  ab
  cd
  fg
  hi
  jk
  ij
  )
 
  I tried first executing the first line (txt =: 0 : 0) and then pasting
 (ctrl v) my text. The result was only 'ij'.
  I tried then to execute the first line and press F8 (run clipboard),
 getting 0!:101 inputx_jrx_ as a result.
 
  So, is there a way to assign multiline text to a noun without having to
 create a new ijs and running from there?
 
  Thanks.
 
 
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm

 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Beginner - multiline paste

2014-02-15 Thread Ric Sherlock
If you are using the J ide,
rather than pasting the clipboard contents in to the terminal, use the menu
command Run | Clipboard. (pasting in to a jconsole session works fine)
On Feb 16, 2014 9:05 AM, Jan-Pieter Jacobs janpieter.jac...@gmail.com
wrote:

 The problem is that pasting multiple lines somehow only results in the last
 one being seen in the GUI's. In the console it does work as expected.
 This is a point where I think the GUI's are a bit counter intuitive.
 The workarounds have been given by others.
 Kind regards,

 Jan-Pieter


 2014-02-15 19:27 GMT+01:00 robert therriault bobtherria...@mac.com:

  You can put the linefeeds in yourself.
 
 a=:'ab',LF,'cd',LF,'ef',LF,'gh',LF,'ij'
 a
  ab
  cd
  ef
  gh
  ij
 $a
  14
 b=: 'ab','cd','ef','gh',:'ij'
 b
  ab
  cd
  ef
  gh
  ij
 $b
  5 2
 c=: 0 : 0
  ab
  cd
  ef
  gh
  ij
  )
 c
  ab
  cd
  ef
  gh
  ij
 $c
  15
 
Note that a is a 14 character string which displays linefeeds and b is
 a
  5 2 array. c is a 15 character string because of the extra LF you have
 used
  to moved to the last line ')' in your explicit definition.
 
  Hope this helps,
 
  Cheers, bob
 
  On Feb 15, 2014, at 10:09 AM, Henry Rich henryhr...@nc.rr.com wrote:
 
   Usually put it into .ijs, but you can copy it into .ijx, then select it
  all in the .ijx, and do Run|Selection.
  
   Henry Rich
  
   On 2/15/2014 1:06 PM, Asdasd Asdasd wrote:
  
  
  
   Hi, I'm a novice in J and I was trying to define a noun as a
 multi-line
  text like this:
  
   txt =: 0 : 0
   ab
   cd
   fg
   hi
   jk
   ij
   )
  
   I tried first executing the first line (txt =: 0 : 0) and then pasting
  (ctrl v) my text. The result was only 'ij'.
   I tried then to execute the first line and press F8 (run clipboard),
  getting 0!:101 inputx_jrx_ as a result.
  
   So, is there a way to assign multiline text to a noun without having
 to
  create a new ijs and running from there?
  
   Thanks.
  
  
  
   --
   For information about J forums see
 http://www.jsoftware.com/forums.htm
  
   --
   For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread robert therriault
Well reducing your audience by a few orders of magnitude is still reducing your 
audience, even it does remain largish. :)

And as a balance to Sturgeon's Law (which is discouragingly true), I present 
this quote from Ira Glass that applies to all those  (even programmers!) that 
dare to make something new.
http://www.goodreads.com/quotes/309485-nobody-tells-this-to-people-who-are-beginners-i-wish

Cheers, bob

On Feb 15, 2014, at 10:20 AM, Raul Miller rauldmil...@gmail.com wrote:

 Young programmers still covers a lot of ground, but I guess we have limited
 our target population to something in the millions (not billions).
 
 Still, we could always make a bunch of them, run them past some people, see
 what they think, and then try again. But beware that
 http://en.wikipedia.org/wiki/Sturgeon's_Law suggests that many of our
 attempts at attracting people will be unappealing to most of them.
 
 Thanks,
 
 -- 
 Raul
 

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread robert therriault
What if we leveraged the 'calculator on steroids' aspect of J?

There are lots of students who would benefit from an experimental approach to 
math that comes with using J.

You show them an IDE, do a few calculations, tease them with the way you can 
combine functions, and point them towards 'getting started' documentation. 

Programming as such could come later, but this might be a quick way into 
wanting to do more.

Cheers, bob

On Feb 15, 2014, at 9:36 AM, Henry Rich henryhr...@nc.rr.com wrote:

 My idea about that is, we need to appeal to young programmers.  The more 
 experience people have with scalar languages, the less able they are to learn 
 J.  The more experience they have with other languages in a class with J, the 
 less they need to learn J.
 
 The application needs to be of obvious interest to a non-mathematical, 
 non-financial user.  My target would be a scientist/engineer/IT person who 
 has a computation to perform and no canned package to do it, so they have to 
 write a little code.
 
 Henry Rich
 
 On 2/15/2014 12:30 PM, Raul Miller wrote:
 Perhaps it is also worth noting that we are not going to impress everyone,
 nor should we want to.
 
 J currently caters to some high powered wallstreet types, high quality
 engineering types and so on. But it's hardly the only language in use for
 any of those categories.
 
 ... anyways we should probably think a bit about qualities of the sort of
 people we think we want to attract with this video (or videos, since we
 might want to attract different kinds of people).
 
 I'd also be tempted to enlist Cathrine Lathwell's advice on video creation
 - she has more than a little relevant experience.
 
 Thanks,
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Beginner - multiline paste

2014-02-15 Thread Fraser Jackson
You can enter multiline text exactly as you listed.  In processing that, J 
interpreted the line
text =: 0 : 0 as the instruction to read the characters input in the 
following lines, including the line feeds until it received a line beginning 
with ).  At that point it assigned the input to the name  text.   if you 
then enter a line with the characters  text  it displays what you entered.


If you copy those lines in the  term  window and paste them into the window 
it does not reexecute the whole set of lines.  Each line now appears as a 
separate line in the window but it does not execute them


If you space back and and re-execute the line

text =: 0 : 0

it begins the process again and expects input to follow which will be 
terminated as before by a right parenthesis.


Within the term window you can think of each line as a J sentence to be 
executed, except in some cases when using explicit definition using the : 
conjunction.


As Henry said, it is simpler to enter such text in a script window  ( 
*.ijs).  If having entered it in a term window you want to copy it to a 
script window you can select the lines and do the usual copy and paste.




- Original Message - 
From: Asdasd Asdasd tr...@outlook.com

To: programm...@jsoftware.com
Sent: Sunday, February 16, 2014 7:06 AM
Subject: [Jprogramming] Beginner - multiline paste






Hi, I'm a novice in J and I was trying to define a noun as a multi-line 
text like this:


txt =: 0 : 0
ab
cd
fg
hi
jk
ij
)

I tried first executing the first line (txt =: 0 : 0) and then pasting 
(ctrl v) my text. The result was only 'ij'.
I tried then to execute the first line and press F8 (run clipboard), 
getting 0!:101 inputx_jrx_ as a result.


So, is there a way to assign multiline text to a noun without having to 
create a new ijs and running from there?


Thanks.



--
For information about J forums see http://www.jsoftware.com/forums.htm 


--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Jim Russell
One teaser ought to be a list of the very many powerful J features that are 
unique to the language. Then a getting started intro to the JSoftware site: 
the existence of, and how to search, the site, the wiki, the forums, and the 
code. Them perhaps a guided tour, with links, of some of the remarkable 
highlights, including a comprehensive glossary for when they (we) get 
hopelessly confused. 

 On Feb 15, 2014, at 8:13 AM, Joe Bogner joebog...@gmail.com wrote:
 
 I think the ultimate 5 minute experience is a combination of:
 
 1. Video
 
 - Here is Kona's intro: http://www.youtube.com/watch?v=bmiq47E5N-w and
 - Here is a Kona's wow factor:
 http://www.youtube.com/watch?v=WBXsCeW9qfc(we could do the same with
 the latest websockets implementation fairly
 easily I think)
 
 2. REPL
 
 - http://tryclj.com/
 - http://www.tryfsharp.org/
 
 3. Some simple examples:
 
 - http://coffeescript.org/
 - http://www.jsoftware.com/jwiki/Studio/SimpleExamples
 - http://www.jsoftware.com/jwiki/Studio/TasteofJPart1
 
 4. Cheat sheet  / quick reference
 
 - http://learnxinyminutes.com/docs/julia/ or
 http://learnxinyminutes.com/docs/javascript/
 -
 http://www.jsoftware.com/jwiki/HenryRich?action=AttachFiledo=viewtarget=J602_RefCard_color_letter_current.pdf
 - http://www.jsoftware.com/books/pdf/brief.pdf
 
 
 A new person wants to likely see it, try it, and expand on it in a few
 minutes to get a feel for the language and power.
 
 
 
 
 On Sat, Feb 15, 2014 at 12:05 AM, robert therriault
 bobtherria...@mac.comwrote:
 
 Thanks Murray for providing the links.
 
 I agree Don, but I wonder if the goal of J in 5 minutes is not to teach
 someone J, but to make them want to learn J.
 
 Not unlike a movie trailer, which has the job of making you want to go see
 the movie, without giving away the story.
 
 Cheers bob
 
 On Feb 14, 2014, at 7:02 PM, Don Guinn dongu...@gmail.com wrote:
 
 Just viewed the videos by Cliff Hastings for Wolfram. Surprised to see
 that
 there looked like an error in the second video on making a first order
 fit
 showing the line going above the origin when x=0. Later it showed it
 correctly. Sent him a note about that.
 
 But what really bothers me about demos like this is that they look so
 easy
 when they do it, but if I were to try to do it I wouldn't know where to
 start. He implied that one could do it without knowing much of anything
 of
 their system. I really get tired of videos like this where they type
 really
 fast and it looks so easy if one just knew their system well, but I
 usually
 don't. If I was presented that screen and wanted to do what he did I
 wouldn't have a clue what to do.
 
 We need to present similar videos on J, but somehow we need to make it
 obvious and logical as to what to do. His video was neat, but could I do
 it
 as quickly and easily as he did it without putting in hours, possibly
 days
 learning their system? I doubt it.
 
 
 On Fri, Feb 14, 2014 at 7:17 PM, Murray Eisenberg mur...@math.umass.edu
 wrote:
 
 If you'd like to see what a good quick demo looks like, done by one guy
 with no fancy production values -- and of a language/system having a
 state-of-the-art user interface, take a look at either of the following:
 http://www.wolfram.com/broadcast/search.php?Search=app%20minutex=-879y=-139video=728
 
 http://www.wolfram.com/broadcast/video.php?channel=86video=869
 
 On 14 Feb 2014 19:00:45 -0500, Henry Rich henryhr...@nc.rr.com wrote:
 
 As Ian [Clark] observed, a newcomer's first 5 minutes with J will be
 decisive in
 establishing their attitude towards the language.  As things stand, it
 takes a serious geek to take a shine to J in 5 minutes.  Just between
 us
 geeks, I wish there were more of us, but that's not the way to bet.
 
 No, we need a snappy demo: an application that everyone can relate to,
 showing how we can code something meaningful and get a pretty display
 in
 under 5 minutes.  Ideally it should be a YouTube video, with an
 accompanying Lab so the interested user can reproduce the results.
 
 
 Murray Eisenbergmur...@math.umass.edu
 Mathematics  Statistics Dept.
 Lederle Graduate Research Tower  phone 240 246-7240 (H)
 University of Massachusetts
 710 North Pleasant Street
 Amherst, MA 01003-9305
 
 
 
 
 
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see 

Re: [Jprogramming] Problem installing jqt on new laptop

2014-02-15 Thread Linda Alvord
Is this better?

   JVERSION
Engine: j701/2011-01-10/11:25
Library: 8.01.020
Qt IDE: 1.0.23/4.8.5
Platform: Win 32
Installer: j801 beta install
InstallPath: c:/users/owner/j801
 
Linda  

-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord
Sent: Saturday, February 15, 2014 9:44 AM
To: programm...@jsoftware.com
Subject: [Jprogramming] Problem installing jqt on new laptop

In order to create a shortcut to  start jqt I had to move  QtGui4.dll  from
folder  jqt  to folder  j801

 

Once I did that using windows vista i got:

 

JVERSION

Engine: j701/2011-01-10/11:25

Library: 8.01.020

Qt IDE: 1.0.23/4.8.5

Platform: Win 32

Installer: j801 install

InstallPath: c:/users/owner/j801

 

 

Does that look right?

 

Linda

 

--
For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J in 5 minutes

2014-02-15 Thread Raul Miller
Excellent point, I need to remember this.

Thanks,

-- 
Raul



On Sat, Feb 15, 2014 at 3:24 PM, robert therriault bobtherria...@mac.comwrote:

 Well reducing your audience by a few orders of magnitude is still reducing
 your audience, even it does remain largish. :)

 And as a balance to Sturgeon's Law (which is discouragingly true), I
 present this quote from Ira Glass that applies to all those  (even
 programmers!) that dare to make something new.

 http://www.goodreads.com/quotes/309485-nobody-tells-this-to-people-who-are-beginners-i-wish

 Cheers, bob

 On Feb 15, 2014, at 10:20 AM, Raul Miller rauldmil...@gmail.com wrote:

  Young programmers still covers a lot of ground, but I guess we have
 limited
  our target population to something in the millions (not billions).
 
  Still, we could always make a bunch of them, run them past some people,
 see
  what they think, and then try again. But beware that
  http://en.wikipedia.org/wiki/Sturgeon's_Law suggests that many of our
  attempts at attracting people will be unappealing to most of them.
 
  Thanks,
 
  --
  Raul
 

 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?so

2014-02-15 Thread Raul Miller
Repression is in the eye of the beholder?

I can point out any number of things about python that trouble me, I am not
sure that that would accomplish anything useful but we can do that in
private (or on the chat forum) if you feel like it.

Meanwhile, reduce works well with the design of J.

Thanks,

-- 
Raul


On Sat, Feb 15, 2014 at 3:02 PM, David Lambert b49p23t...@stny.rr.comwrote:

 Python isn't quite so bad.
  sum((x + 2.91) / 0.4 for x in range(10)) # python
 185.250003
 

 I find the sum function somewhat windows like in that some common
 operations are especially easy.  The reduce function was demoted from
 builtin to a library in python3.  Why work under these repressive
 constraints?

+/ 0.4 %~ 2.91 + i. 10  NB. j
 185.25

 Let's remember gawk:

 $ gawk 'BEGIN{for(x=0;x10;++x)a+=(x + 2.91) / 0.4;print a;exit}'
 185.25

  Date: Sat, 15 Feb 2014 12:04:13 -0500
 From: Lee Fallat ircsurfe...@gmail.com
 To: programm...@jsoftware.com
 Subject: Re: [Jprogramming] awk-like J sentences?
 
 Message-ID:
  cakzhxzhxcyhdzzccvgvgaftzqxxgvmqwzstfholfu0m4g+a...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8
 
 Thanks for the explanation Raul.
 
 I think I understand now that string manipulation in J is
 non-trivial...I was following right up until the very last J sentence
 ( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
 know a few verbs. I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language. There are so
 many things that would seem straight forward in traditional languages
 than J, but I will have to see!
 
 Some examples of what I'm thinking of would be difficult or different in
 J:
 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
 ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4
 One other thing is interacting with the operating system...How do I
 check to see if files, or even directories exist? Can you create
 directories, or change permissions of files with J? The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?
 
 Anyways, I apologize for being off-topic, but just some things I've
 been thinking about. Like I said I still have to get through some more
 learning material.
 
 Regards,
 
 Lee
 

 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] jhs801.app

2014-02-15 Thread Eric Iverson
Brian,

I can verify your reported problems with OSX 891 JHS app launcher.

The jhs801.app has an error such that when it is launched it leaves
the red J icon bouncing in the dock until J is terminated. The server
is running and you can access it from your browser, but the bouncing
icon is very distracting. The problem is that app launches expect to
have the program request input after it initializes, but as a server
it doesn't request keyboard input and instead waits on socket
connections from a browser. Hence the bouncing J icon.

We will probably build a new release that fixes this problem.

In the meantime here is a workaround (basically use the 701 launcher):

Finder:
1. folder j64-701 copy j64-701.app
2. paste this into j64-801 folder
3. in folder j64-801 rename jhs801.app to be jhs801_bad.app
4. in folder j64-801 rename jhs701.app to be jhs801.app
5. remove all red J icons from the dock (to avoid confusion)
6. drag new jhs801.app and drop it on the dock

You can now start jhs801 by a single click on the red J icon in the dock
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] fifth heart curve

2014-02-15 Thread Raul Miller
I see two problems with that.

One is that email line-wrap garbled your url for me. Here's a workaround:
http://tinyurl.com/kkwozwq

The other is that it's not in J.
http://www.jsoftware.com/jwiki/Plot/Optionsreminds me that plot has a
contour option, so it should be doable, but I
really ought to think about getting up in a few hours.

Thanks,

-- 
Raul



On Sat, Feb 15, 2014 at 2:54 AM, R.E. Boss r.e.b...@planet.nl wrote:

 What about this one

 https://plus.google.com/u/0/photos/101244335910217616226/albums/598024084706
 7744881 ?


 R.E. Boss

 (Add your info to http://www.jsoftware.com/jwiki/Community/Demographics )


  -Original Message-
  From: programming-boun...@forums.jsoftware.com [mailto:programming-
  boun...@forums.jsoftware.com] On Behalf Of Devon McCormick
  Sent: vrijdag 14 februari 2014 20:12
  To: J-programming forum
  Subject: Re: [Jprogramming] fifth heart curve
 
  I'll let the rest of you waste more time on this than I already have:
 
 pd 'color red;pensize 8;output cairo 1000 1000'
 pd (X j. Y0) 1j1#i: 3.15j1000
 pd 'color blue;pensize 15'
 pd nn=. 3j2-~2%~(_16}.5+i:5j99)^~/1j1*1+99%~i:5j999
 pd (1.5*2-~0{tt)j.1 (1{tt)+1 (8%~1-~i.5)+/|.400%~i.1000 [ tt=.
  |:+._1{nn
 pd 'show'
 
 


 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] problem matching boxed string

2014-02-15 Thread Pascal Jasmin
Looks great.  good decisions on everything, 

a thought for an alternative for strings would be putting 
'--at start'
'and end    '

this assumes that space is the fill.  a unique colour for text is good for '123'
I'm not completely sure why J doesn't do that already, but if the goal is to 
not have extra ascii characters in the display, and I am guessing clipboard to 
text/log files, so perhaps some graphical bookends to a string would let it be 
copied easily while taking less space?

A simpler style for strings would be to just change the backcolor, so trailing 
spaces would be visible, and no clipboard issues.


- Original Message -
From: robert therriault bobtherria...@mac.com
To: Programming forum programm...@jsoftware.com
Cc: 
Sent: Friday, February 14, 2014 2:36:59 AM
Subject: Re: [Jprogramming] problem matching boxed string

Just to finish the job, here is a link to a video screencast of the display 
style for the skinnier look. http://wp.me/p1rSg-8x

Cheers, bob

On Feb 12, 2014, at 6:04 PM, robert therriault bobtherria...@mac.com wrote:

 Well, I am not sure I would call it a nice example, but I am glad to hear 
 that it does work. 
 
 I also added a second script that has a 'skinnier' look. Haven't had time to 
 finish a video on that one yet.
 
 http://www.jsoftware.com/jwiki/http:/www.jsoftware.com/jwiki/BobTherriault/Visualize?action=AttachFiledo=view⌖=vlitejwiki.ijs
 
 Cheers, bob
 
 On Feb 12, 2014, at 4:44 PM, Joe Bogner joebog...@gmail.com wrote:
 
 bob, thanks again for sharing. It works really well and is also a nice JHS
 example.
 
 
 On Tue, Feb 11, 2014 at 9:08 PM, robert therriault 
 bobtherria...@mac.comwrote:
 
 Thanks Pascal,
 
 Believe it or not I did simplify this quite a bit from where I originally
 was, based on you previous comments. I'll play around some more to see if I
 can slim it down further and still have it intuitive (which is actually one
 of the targets that I am aiming for in addition to the 'different things
 should display differently')
 
 I have attached the script of the simple test page to the wiki at
 
 http://www.jsoftware.com/jwiki/http%3A/www.jsoftware.com/jwiki/BobTherriault/Visualize?action=AttachFile
 
 If you want to play.
 
 Cheers, bob
 
 On Feb 11, 2014, at 9:53 AM, Pascal Jasmin godspiral2...@yahoo.ca wrote:
 
 I like it.
 
 I'll restate my preference for simpler css.  Using colour only if boxes
 aren't completely necessary (datatype).
 
 I understand the desire to deal with leading 0 shapes, but I think
 leading 1 shapes are what byte people/beginers the most.  For instance
 assuming that }. and {: produce identical results with 2 elements.
 
 So, if there was a way to only box-decorate items when there is a
 leading 1 or 0 dimension, I think it would be very helpful without being as
 noisy.
 
 
 - Original Message -
 From: robert therriault bobtherria...@mac.com
 To: Programming forum programm...@jsoftware.com
 Cc:
 Sent: Tuesday, February 11, 2014 12:14:14 PM
 Subject: Re: [Jprogramming] problem matching boxed string
 
 Thanks Raul,
 
 I am currently working on the boxing display and you are right, it does
 present some different challenges. My plan is to have the script on the
 wiki for general amusement later this afternoon. I have put this together
 as a way to see the results of the language in a way that I found more
 useful and it involves a mix of html, css and J, so as far as coding I
 think of myself as a hobbyist rather than a pro.
 
 It should not be hard to change the size of the empty spots and I think
 that is a really good idea. The nice thing about CSS is that you can change
 appearance across classes, although the complexity can avalanche when you
 start to decide how classes will display based on the context of other
 classes.
 
 Anyway, I will post when I have the script up on the jwiki.
 
 Cheers, bob
 
 On Feb 11, 2014, at 8:51 AM, Raul Miller rauldmil...@gmail.com wrote:
 
 This looks promising.
 
 I currently have two quibbles which you might want to reject:
 
 First, the additional markup seems to get in the way for some typical
 cases. I can see the need for leading 1 dimensions and embedded zero
 dimensions. I understand the idea of consistent display of information,
 but
 there's so much going on when arrays have no zeros or ones in their
 shape
 and I can't help but wonder if a reduced complexity presentation might
 be
 nice, at least as a later option?
 
 Second, when there are zeros in the shape, the placeholders are the same
 size and shape (ha ha, get it? shape... eh... maybe you had to be
 there)
 as when data is present. Maybe you could shrink the cell size for empty
 cells?
 
 I should also probably watch it again for how you display boxed data.
 One
 of my worries is that with so much decoration on flat arrays that
 boxing
 will get lost in the noise.
 
 That said, from a user point of view, I can totally imagine wanting to
 be
 able to customize this, and I can also imagine not wanting to 

Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Don Kelly
why not this - even though it uses spaces instead of semicolons for 
separators. while this may not be just what you want, at least the 
result is numerical and can be operated on numerically.

file=:1 2;4 5;6 7

file

1 2

4 5

6 7

+/1 file

3 9 13

 or this

+/|: file

3 9 13


file2=:1 2 3;4 5 6;7 8 9

1 2 3

4 5 6

7 8 9

+/1 file2

6 15 24

+/|: file2

6 15 24


Don Kelly





On 14/02/2014 6:51 PM, Lee Fallat wrote:

Hey there,

As new user to J (but several years experience with C and Java), I
find it very, very interesting. The power of its one liners and
mathematical heritage really have me hooked.  I was wondering though
if it has similar capabilities as awk. What's the equivalent to this
awk script in J?:

BEGIN { FS=; }
{ print $1+$2 }

This script sets a FieldSeparator to ;, and then for every row, add
the first and second column and prints it. I would like to replace awk
with J!

Thank you,

Lee

P.S. Excuse me if I've misidentified J sentences. (Sentences - statements?)
--
For information about J forums see http://www.jsoftware.com/forums.htm



--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Using JHS801

2014-02-15 Thread Don Kelly
I installed alongside J6 and there was no problem. I just moved some of 
my own scripts over and am rolling.

(win 7 64bit)

Don
On 14/02/2014 6:17 AM, km wrote:

I have installed J801 and modified my j701jhs icon so it calls up JHS801.  
Evidence

J Http Server
   i.2
0 1
Updating server catalog...
   JVERSION
Engine: j701/2011-01-10/11:25
Library: 8.01.020
Platform: Win 32
Installer: j801 install
InstallPath: c:/users/kip murray/j801

BUT NOT MANY 'ORDINARY' USERS COULD HAVE DONE THAT.  PLEASE HAVE THE J801 
INSTALL FOR WINDOWS CREATE AND DISPLAY A j801jhs ICON.

--Kip Murray

Sent from my iPad
--
For information about J forums see http://www.jsoftware.com/forums.htm



--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Lee Fallat
Perhaps I would use awk to format the data to J-friendly data :)

On Sat, Feb 15, 2014 at 7:33 PM, Don Kelly d...@shaw.ca wrote:
 why not this - even though it uses spaces instead of semicolons for
 separators. while this may not be just what you want, at least the result is
 numerical and can be operated on numerically.
 file=:1 2;4 5;6 7

 file

 1 2

 4 5

 6 7

 +/1 file

 3 9 13

  or this

 +/|: file

 3 9 13


 file2=:1 2 3;4 5 6;7 8 9


 1 2 3

 4 5 6

 7 8 9

 +/1 file2

 6 15 24

 +/|: file2

 6 15 24


 Don Kelly






 On 14/02/2014 6:51 PM, Lee Fallat wrote:

 Hey there,

 As new user to J (but several years experience with C and Java), I
 find it very, very interesting. The power of its one liners and
 mathematical heritage really have me hooked.  I was wondering though
 if it has similar capabilities as awk. What's the equivalent to this
 awk script in J?:

 BEGIN { FS=; }
 { print $1+$2 }

 This script sets a FieldSeparator to ;, and then for every row, add
 the first and second column and prints it. I would like to replace awk
 with J!

 Thank you,

 Lee

 P.S. Excuse me if I've misidentified J sentences. (Sentences -
 statements?)
 --
 For information about J forums see http://www.jsoftware.com/forums.htm


 --
 For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] J in 5 Minutes

2014-02-15 Thread km
]page1 =: 1 2 , 3 4 ,: 5 6
 1 2
 3 4
 5 6
]page2 =: 2 * page1
  2  4
  6  8
 10 12
]book1 =: page1 ,: page2
  1  2
  3  4
  5  6
 
  2  4
  6  8
 10 12
]book2 =: page2 ,: page2
  2  4
  6  8
 10 12
 
  2  4
  6  8
 10 12
 
]library =: book1 ,: book2
  1  2
  3  4
  5  6
 
  2  4
  6  8
 10 12
 
 
  2  4
  6  8
 10 12
 
  2  4
  6  8
 10 12
,. page1 ; +/ page1
 ++
 |1 2 |
 |3 4 |
 |5 6 |
 ++
 |9 12|
 ++
,. book1 ; +/ book1
 +-+
 | 1  2|
 | 3  4|
 | 5  6|
 | |
 | 2  4|
 | 6  8|
 |10 12|
 +-+
 | 3  6|
 | 9 12|
 |15 18|
 +-+
,. library ; +/ library
 +-+
 | 1  2|
 | 3  4|
 | 5  6|
 | |
 | 2  4|
 | 6  8|
 |10 12|
 | |
 | |
 | 2  4|
 | 6  8|
 |10 12|
 | |
 | 2  4|
 | 6  8|
 |10 12|
 +-+
 | 3  6|
 | 9 12|
 |15 18|
 | |
 | 4  8|
 |12 16|
 |20 24|
 +-+
 
 --Kip Murray

Sent from my iPad
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] awk-like J sentences?

2014-02-15 Thread Marshall Lochbaum
Some other people have said similar things on this topic, but here are
my thoughts:

Your way of thinking does need to change in order to use J. It's not an
unnatural change, or even a hard change, in the sense that the J way of
thinking is just as natural and as easy as the Python (or other
imperative language) way of thinking. However, it is a large shift so
you will need to put some work into divorcing your thoughts about
programming from your knowledge of the imperative style.

The first few things you want to do are not ends, but means--they are
ways of accomplishing tasks in Python but aren't necessarily important
in J. This means you have moved a step forward from your problem
statement to a method of solving that problem. In order to learn J, I
recommend that you prevent yourself from taking that step and consider
what you want to do rather than how you want to do it. For instance:

 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
What you really want to do is to work with multiple pieces of data at
the same time. This is performed easily enough by placing the data in an
array with three or more elements. And why would you want to work with a
list of arguments? It's invariable easier to pass a list. If you want to
assign a name to each element of an array of a fixed length, use
multiple assignment, for example
   'x y z' =: 4 ; 'Hello' ; 1 0 0
   x
4
   y
Hello
   z
1 0 0
.

 ...loops?
J allows for loops (using similar semantics to Python's for ... in ...)
in explicit verbs, but usually general loops are not called for and a
specific case suffices. The transition from using for loops to solve
every problem to using a number of more specific cases with nicer
properties strongly parallels the historic shift from using the general
goto construct to structured loops like for and while. In this case, you
can add 2.91 to each number in the list, divide by 0.4, and then sum:
   +/ 0.4 %~ 2.91 + i.10
185.25
.

As for interacting with the outside world, a class of verbs called
foreigns form J's interface to the outside world:
http://www.jsoftware.com/help/dictionary/xmain.htm
Many of these have aliases or nicer versions (e.g. fread is a wrapper
for 1!:1) in the standard library, but I don't know where all these
verbs are documented.

Marshall

On Sat, Feb 15, 2014 at 12:04:13PM -0500, Lee Fallat wrote:
 Thanks for the explanation Raul.
 
 I think I understand now that string manipulation in J is
 non-trivial...I was following right up until the very last J sentence
 ( 'hi',:.(-(a.i.'*')).(a.i.)'there'), mostly because I still only
 know a few verbs. I am starting to think J is either not for me, or my
 way of thinking really needs to change for this language. There are so
 many things that would seem straight forward in traditional languages
 than J, but I will have to see!
 
 Some examples of what I'm thinking of would be difficult or different in J:
 Passing 3 or more parameters to a verb
 Turning a vector into a list of arguments
 ...loops? From what I've seen loops are built into some verbs (+/ -/
 etc), but what if you wanted to do say: add every number in the
 vector, but for every number add 2.91, then divide that by 0.4?
 In python:
 range() generates a list of numbers from 0 to 9.
 for x in range(0,10)
 y += (x + 2.91) / 0.4
 One other thing is interacting with the operating system...How do I
 check to see if files, or even directories exist? Can you create
 directories, or change permissions of files with J? The scope of J
 seems to be very constrained to mathematics. It would be nice to use J
 as a system programming language! Are there any examples of people
 doing these things?
 
 Anyways, I apologize for being off-topic, but just some things I've
 been thinking about. Like I said I still have to get through some more
 learning material.
 
 Regards,
 
 Lee
 
 
 
 On Sat, Feb 15, 2014 at 11:37 AM, Raul Miller rauldmil...@gmail.com wrote:
  Conceptually speaking, J has three atomic data types:
 
  Numeric
  Literal
  Boxed
 
  Numeric types support arithmetic: 1+1
  Literal types are what might be called character types in other languages.
  (ascii or unicode)
  Boxed types are what might be called reference types in other languages.
 
  J tries to treat numeric types as mathematical arithmetic entities. It's
  not perfect, and involves tradeoffs but it does a pretty good job at being
  useful and educational while still offering decent performance with a
  relatively compact implementation. Also, J booleans are numeric and I
  vastly prefer this approach (which fits my understanding of the history of
  booleans) over the convention of enshrining arbitrary implementation
  limitations.
 
  You cannot perform arithmetic directly on literals but you can, for
  example, compare an ascii 'A' with a unicode 'A' and get a literally
  correct answer. (However, unicode also includes an open ended set of rules
  and extensions and if you want those you will probably 

[Jprogramming] windows jhs shortcut

2014-02-15 Thread bill lam
Windows AIO installers are updated to include a shortcut of
JHS in program group menu.

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
--
For information about J forums see http://www.jsoftware.com/forums.htm