j=: 13 :' ;x <@((,"1}.)"1#~(=&{:|.)"1)"1 _ y' j [: ; <@((,"1 }.)"1 #~ (=&{: |.)"1)"1 _ f=: 13 :';x ([:<(,"1}.)"1#~(=&{:|.)"1)"1 _ y' f [: ; ([: < (,"1 }.)"1 #~ (=&{: |.)"1)"1 _ ff=: 13 :';x ([:<(,"1}.)"1#~C=:(=&{:|.)"1)"1 _ y' (A j B)-:A f B 1 (A j B)-:A ff B 1 C (=&{: |.)"1 C B 1 1 1 1 1 D=:=&{: E=:[:={: F=: 13 :'([:={:) y' (D B)-:E B 1 (E B)-:F B 1 5!:2 <'D' --T-T--┐ │=│&│{:│ L-+-+--- 5!:2 <'E' ---T-T--┐ │[:│=│{:│ L--+-+--- 5!:2 <'F' ---T-T--┐ │[:│=│{:│ L--+-+--- 5!:4 <'D' -- = -- & -+- {: 5!:4 <'E' -- [: --+- = L- {: 5!:4 <'F' -- [: --+- = L- {: G=: 13 :'((=&{:)|.)"1 y' G (=&{: |.)"1 H=: 13 :'(([:={:)|.)"1 y' H (([: = {:) |.)"1 5!:2 <'G' --------------T-T-┐ │---------T--┐│"│1│ ││--T-T--┐│|.││ │ │ │││=│&│{:││ ││ │ │ ││L-+-+---│ ││ │ │ │L--------+---│ │ │ L-------------+-+-- 5!:2 <'H' ---------------T-T-┐ │----------T--┐│"│1│ ││---T-T--┐│|.││ │ │ │││[:│=│{:││ ││ │ │ ││L--+-+---│ ││ │ │ │L---------+---│ │ │ L--------------+-+-- 5!:4 <'G' -- = -- & -+- {: ----+- |. -- " -+- 1 5!:4 <'H' -- [: -----+- = ----+ L- {: -- " -+ L- |. L- 1 G B 1 1 1 1 1 H B ran with error: |domain error: H | H B |[-30] c:\users\owner\j701-user\temp\37.ijs G WORKS! H DOESN'T!
How can I write the function H without & and get 1 1 1 1 ? Linda NB. (d,e,f,g,h would be better than the capitals) -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord Sent: Friday, October 19, 2012 3:50 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] stitching matrices Here is an ijis script that is puzzling me. In the next e-mail that follows I show what happens: ]'A B'=:3|L:0(([:<i.)"1)3 5,:5 4 j=: 13 :' ;x <@((,"1}.)"1#~(=&{:|.)"1)"1 _ y' j f=: 13 :';x ([:<(,"1}.)"1#~(=&{:|.)"1)"1 _ y' f ff=: 13 :';x ([:<(,"1}.)"1#~C=:(=&{:|.)"1)"1 _ y' (A j B)-:A f B (A j B)-:A ff B C C B D=:=&{: E=:[:={: F=: 13 :'([:={:) y' (D B)-:E B (E B)-:F B 5!:2 <'D' 5!:2 <'E' 5!:2 <'F' 5!:4 <'D' 5!:4 <'E' 5!:4 <'F' G=: 13 :'((=&{:)|.)"1 y' G H=: 13 :'(([:={:)|.)"1 y' H 5!:2 <'G' 5!:2 <'H' 5!:4 <'G' 5!:4 <'H' G B H B]'A B'=:3|L:0(([:<i.)"1)3 5,:5 4 j=: 13 :' ;x <@((,"1}.)"1#~(=&{:|.)"1)"1 _ y' j f=: 13 :';x ([:<(,"1}.)"1#~(=&{:|.)"1)"1 _ y' f ff=: 13 :';x ([:<(,"1}.)"1#~C=:(=&{:|.)"1)"1 _ y' (A j B)-:A f B (A j B)-:A ff B C C B D=:=&{: E=:[:={: F=: 13 :'([:={:) y' (D B)-:E B (E B)-:F B 5!:2 <'D' 5!:2 <'E' 5!:2 <'F' 5!:4 <'D' 5!:4 <'E' 5!:4 <'F' G=: 13 :'((=&{:)|.)"1 y' G H=: 13 :'(([:={:)|.)"1 y' H 5!:2 <'G' 5!:2 <'H' 5!:4 <'G' 5!:4 <'H' G B H B Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord Sent: Wednesday, October 17, 2012 6:40 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] stitching matrices The C and D are the cause of the 4 : I inserted them to better understand June's solution. When I forgot to remove them it caused the 4 : (which was also explained to indicate that the definition applies two arguments.) Sorry to bother everyone by my carelessness. Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Aai Sent: Wednesday, October 17, 2012 7:59 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] stitching matrices Sorry, I can't figure out where D and C come from. Are these typos? About 4 : dictionary says 4 : n dyad only verb On 17-10-12 13:44, Linda Alvord wrote: > Both A j B and A f B have the same result: > > j=: 13 :' ;x<@((D=:,"1}.)"1#~(C=:=&{:|.)"1)"1 _ y' > f=: 13 :';x ([:<(,"1}.)"1#~(=&{:|.)"1)"1 _ y' > > Both are verbs: > > type 'j' > -----┐ > │verb│ > L----- > type 'f' > -----┐ > │verb│ > L----- > > So, what is the meaning of 4 : in the definition of j ? > j > 4 : ' ;x<@((D=:,"1}.)"1#~(C=:=&{:|.)"1)"1 _ y' > f > [: ; ([: < (,"1 }.)"1 #~ (=&{: |.)"1)"1 _ > > Linda > > > -----Original Message----- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Aai > Sent: Wednesday, October 17, 2012 3:37 AM > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] stitching matrices > > Most of the time I'm too slow to come up with a complete and > readysolution, so I showed this: > > ;A <@((,"1}.)"1#~(=&{: |.)"1)"1 _ B > > If I had given myself some more time I would have come up with the > more complete and obvious solution R.E. Boss came up with: > > A ;@:(<@((,"1}.)"1#~(=&{: |.)"1)"1 _) B > > In my opinion not very important, but after I posted my solution I > modified my phrase to what Raul Miller showed by 'moving' the < to the > other possible position ('connected' with #). I practice this because > I'm curious to this kind of variations of a solution. > > Finally answering your question: No I don't like your alternative more > because I don't like the use of caps. But ok, that's a kind of > nonsense preference (as is my drive to use as much as possible the > natural rank of primitives/verbs). It happens several times I'm not > smart enough to avoid the use caps. Also the alternative could cause > the use of lots of parenthesis. Not elegant according to R.E.Boss's > definition with which I do agree. > > > On 17-10-12 08:14, Linda Alvord wrote: >> Would you like this more? I just modified your sentence a little. >> >> j=: 13 :' ;x <@((D=:,"1}.)"1#~(C=:=&{:|.)"1)"1 _ y' >> j >> 4 : ' ;x <@((D=:,"1}.)"1#~(C=:=&{:|.)"1)"1 _ y' >> >> f=: 13 :';x ([:<(,"1}.)"1#~(=&{:|.)"1)"1 _ y' >> f >> [: ; ([: < (,"1 }.)"1 #~ (=&{: |.)"1)"1 _ >> >> A j B >> 0 1 2 0 1 2 0 1 >> 0 1 2 0 1 2 0 1 >> 2 0 1 2 0 1 2 0 >> 2 0 1 2 0 1 2 0 >> 1 2 0 1 2 0 1 2 >> A f B >> 0 1 2 0 1 2 0 1 >> 0 1 2 0 1 2 0 1 >> 2 0 1 2 0 1 2 0 >> 2 0 1 2 0 1 2 0 >> 1 2 0 1 2 0 1 2 >> >> Linda >> >> >> -----Original Message----- >> From: programming-boun...@forums.jsoftware.com >> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Aai >> Sent: Monday, October 15, 2012 12:50 PM >> To: programm...@jsoftware.com >> Subject: Re: [Jprogramming] stitching matrices >> >> Sorry, by far from elegant: >> >> ;A <@((,"1}.)"1#~(=&{: |.)"1)"1 _ B >> 0 1 2 0 1 2 0 1 >> 0 1 2 0 1 2 0 1 >> 2 0 1 2 0 1 2 0 >> 2 0 1 2 0 1 2 0 >> 1 2 0 1 2 0 1 2 >> >> On 15-10-12 16:59, R.E. Boss wrote: >>> Given >>> >>> ['A B' =. 3|L:0<@i."(1)3 5,: 5 4 >>> +---------+-------+ >>> |0 1 2 0 1|0 1 2 0| >>> |2 0 1 2 0|1 2 0 1| >>> |1 2 0 1 2|2 0 1 2| >>> | |0 1 2 0| >>> | |1 2 0 1| >>> +---------+-------+ >>> >>> I want to stitch every row from A with all rows from B where ({:"1 >>> A) >> equals {."1 B and one of these columns is deleted. >>> This will give me >>> >>> A foo B >>> 0 1 2 0 1 2 0 1 >>> 0 1 2 0 1 2 0 1 >>> 2 0 1 2 0 1 2 0 >>> 2 0 1 2 0 1 2 0 >>> 1 2 0 1 2 0 1 2 >>> >>> Any elegant solutions? >>> >>> >>> R.E. Boss >>> >>> -------------------------------------------------------------------- >>> - >>> - 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 > ---------------------------------------------------------------------- > 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 ---------------------------------------------------------------------- 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