most useful fork I know personally: inl =: (cocurrent@] ".@] [)"1 0
'code to run in locales' inl loc1;loc2;loc3 the neat parts about it: the left verb is sideeffects only. the pivot verb is monadically applied to right verb result the locale list is usually a list of numeric object instances. ________________________________ From: Devon McCormick <devon...@gmail.com> To: J-programming forum <programm...@jsoftware.com> Sent: Monday, January 20, 2014 12:48:59 PM Subject: Re: [Jprogramming] more fork examples I won't use this as an example for this talk. If I do elaborate on matrix multiplication, I usually like to emphasize how this is a specific instance of a more general concept. The problem I'm having now is that I'd like to use the power conjunction as my example but I'm placing it in a hierarchy like this: J Parts of Speech: a Functional Hierarchy Name Argument Type Example? Conjunction Verbs Adverb Verbs and nouns Verb Nouns Noun - but I have not been able to come up with a good, simple example of the power conjunction using a couple of verbs. The best I have so far is from Roger's essay: "Do While" using power conjunction: http://www.jsoftware.com/jwiki/Essays/Do%20While . He uses this example - which is pretty good for my purposes: (1+3*])^:(1e5&>)^:_]3 but does not resonate as some kind of well-known problem. I wanted to do something like this (to find the first Fibonacci number greater than 4e6): fib^:(4e6&>)^:_]1 but I end up writing it like this: (([: >: {.) , [: (fib) {.)^:(4000000 > {:)^:_]1 35 5702887 (so the 34th term is the one I'm looking for) but this involves too many symbols I have not yet introduced or are otherwise unfamiliar. Anyway, I have to finish this up in the next few hours so I can start practicing it. On Mon, Jan 20, 2014 at 12:51 AM, Henry Rich <henryhr...@nc.rr.com> wrote: > If you use this as an example, be sure you can explain how +/ . *, which > is usually matrix multiplication, applies to these operands which are not > matrices. Mathematically it would be an error to matrix-multiply two > vectors of the same shape. > > Henry Rich > > > On 1/20/2014 12:14 AM, Devon McCormick wrote: > >> NB. Weighted mean: >> >> 1 10 1 ((+/ . *) % ([:+/[)) 10 2 30 >> >> 5 >> >> >> On Thu, Jan 16, 2014 at 8:09 PM, Roger Hui <rogerhui.can...@gmail.com> >> wrote: >> >> The put down was for not so much that our system was not capable of >>> sensitivity analysis, or perhaps that we did not even know what >>> sensitivity >>> analysis was, but that we were unwilling to admit it. >>> >>> ----------- >>> >>> The braggart claims to have Superman's powers. >>> >>> "Can you crush things like Superman?" >>> >>> The braggart took a walnut in each hand, absolutely crushed them to a >>> pulp, >>> and said, "Yes, I can." >>> >>> "Can you see far away like Superman?" >>> >>> The braggart flipped down a pair of binocular glasses he was wearing and >>> read out the words on the sign at the end of the block, and said, "Yes I >>> can." >>> >>> "Can you fly like Superman?" >>> >>> The braggart walked up to the roof of a 3-floor building, and jumped off >>> with a flying leap! Splat! With great struggle and lots of moaning, he >>> raised himself up on his elbows, and said, "Yessssh, yesh, ... yesh I >>> can." >>> >>> >>> >>> >>> On Thu, Jan 16, 2014 at 2:16 PM, Dan Bron <j...@bron.us> wrote: >>> >>> I don't get the put-down (or joke). Can you explain it to me? >>>> >>>> -Dan >>>> >>>> >>>> ----- Original Message --------------- >>>> >>>> Subject: Re: [Jprogramming] more fork examples >>>> From: Roger Hui <rogerhui.can...@gmail.com> >>>> Date: Thu, 16 Jan 2014 13:14:12 -0800 >>>> To: Programming forum <programm...@jsoftware.com> >>>> >>>> Thanks for the compliment but what I really need are for y'all to send >>>> me >>>> quotes/anecdotes not yet in the list. For example: >>>> >>>> Once, in the early 1980s, Ken Iverson visited us in Calgary. Fred >>>> Appleyard and I proudly showed off our system implemented in direct >>>> definition. Ken asked a question which is essentially, "Can you do >>>> sensitivity analysis?" We start mumbling something. Ken says, "Can you >>>> touch your shoulder?", and proceeded to reach behind his neck to touch >>>> >>> the >>> >>>> opposite shoulder. I have yet to recover from this put-down :-). >>>> >>>> BTW, among the APL crowd, accusing somebody of "mumbling something" is >>>> >>> done >>> >>>> by putting your hand in front of your mouth and muttering, "but ah eh >>>> >>> blah >>> >>>> blah ...". >>>> >>>> ---------------------------------------------------------------------- >>> For information about J forums see http://www.jsoftware.com/forums.htm >>> >>> >> >> >> ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm