Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread 'Skip Cave' via Programming
Wow! brilliant solutions! It will take me a couple of days to parse through these diverse approaches to solving the Digits problem. One of the aspects of J that I appreciate the most is the wide range of creative approaches that seem to materialize when multiple people use J to solve the same probl

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Jimmy Gauvin
Variant on the cheat: zz=.,10#.>{4#<>:i.6 4{.zz 1112 1113 1114 On Tue, Oct 3, 2017 at 11:24 PM, Roger Hui wrote: > V. nice. > > As they say, if you're not cheating you are not trying hard enough. :-) > > > On Tue, Oct 3, 2017 at 8:21 PM, Cliff Reiter > wrote: > > > A cheat (?) that

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Roger Hui
V. nice. As they say, if you're not cheating you are not trying hard enough. :-) On Tue, Oct 3, 2017 at 8:21 PM, Cliff Reiter wrote: > A cheat (?) that builds instead of "removing" > >z=.,".>{4#<'123456' >$z > 1296 >10{.z > 1112 1113 1114 1115 1116 1121 1122 1123 1124 > > > On

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Cliff Reiter
A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114 1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip Cave wrote: Another interesting Quora problem: Given the integers from 1000 to , remove all integers that contain a 7, 8, 9

Re: [Jprogramming] jcs/zmq addons updated

2017-10-03 Thread bill lam
Let's take out the memory constraint factor first, say qrun with sentence 1e3. I am not sure running in different jqt instances is a good idea since the range of 100 ports used by jcs is hardcoded and are the same for each jqt. On Oct 4, 2017 10:41 AM, "'Pascal Jasmin' via Programming" < programm.

Re: [Jprogramming] jcs/zmq addons updated

2017-10-03 Thread 'Pascal Jasmin' via Programming
in a 4th jqt session, yes it hung on first run, though pretty far in. I started getting memory errors (without hanging), at 80 80, and 22 22. I have 4 hung jqt sessions now, but any new one lets the others progress. Task manager reports very low memory use. 99 11 finishes just fine. It seems

Re: [Jprogramming] jcs/zmq addons updated

2017-10-03 Thread bill lam
Did qrun 99 99 hang in the first run? On Oct 4, 2017 9:16 AM, "'Pascal Jasmin' via Programming" < programm...@jsoftware.com> wrote: > qrun still hangs for me. Never on the first run though. In 5 of 6 tries, > it hangs on the 3rd run. On other it hanged on 2nd run. 3rd parameter > always 6. > >

Re: [Jprogramming] jcs/zmq addons updated

2017-10-03 Thread 'Pascal Jasmin' via Programming
qrun still hangs for me. Never on the first run though. In 5 of 6 tries, it hangs on the 3rd run. On other it hanged on 2nd run. 3rd parameter always 6. I don't think I ever breeched memory/swap issues in these or previous tests. I found a way to unhang it though. start 2nd jqt session, and

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Raul Miller
Carelessness on my part. Thanks, -- Raul On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui wrote: > Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense. > > > On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote: > >> Something like this? >> >>(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999 >

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Don Guinn
10#.>:6 6 6 6#:i.6^4 On Tue, Oct 3, 2017 at 3:00 PM, Jimmy Gauvin wrote: >ff=: 3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y' > >$ff 1000+i.9000 > > 1296 > >$ff 1000+i.5667 > > 1296 > > On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui > wrote: > > > Why 1000+i.8999? 1000+i.6000 or 1000+

[Jprogramming] jcs/zmq addons updated

2017-10-03 Thread Eric Iverson
A few cosmetic changes and perhaps fixes for qrun and related task problems. Note: qrun now defined in jcs/qrun.ijs The main problem was that a task ending could have a delayed close of the associated socket port and this could, depending on timing, prevent the proper start of the next task tryin

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Marshall Lochbaum
I doubt you'll find a much faster J solution than: ,(+/~10&*)/ 4#,:>:i.6 or the uglier but slightly quicker ,+// (10<.@^i._4)*/>:i.6 Marshall On Tue, Oct 03, 2017 at 03:16:41PM -0500, Skip Cave wrote: > Another interesting Quora problem: > > Given the integers from 1000 to , remove all in

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Jimmy Gauvin
ff=: 3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y' $ff 1000+i.9000 1296 $ff 1000+i.5667 1296 On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui wrote: > Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense. > > > On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote: > > > Somethi

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Roger Hui
Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense. On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote: > Something like this? > >(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999 > > Thanks, > > -- > Raul > > > On Tue, Oct 3, 2017 at 4:16 PM, Skip Cave wrote: > > Another interesting Q

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Raul Miller
Something like this? (#~ 1- +./@e.&'7890'@":"0) 1000+i.8999 Thanks, -- Raul On Tue, Oct 3, 2017 at 4:16 PM, Skip Cave wrote: > Another interesting Quora problem: > > Given the integers from 1000 to , remove all integers that contain a 7, > 8, 9, or zero, and list the remaining integer

[Jprogramming] Quora Digits Problem

2017-10-03 Thread Skip Cave
Another interesting Quora problem: Given the integers from 1000 to , remove all integers that contain a 7, 8, 9, or zero, and list the remaining integers. Skip -- For information about J forums see http://www.jsoftware.com/fo

Re: [Jprogramming] (no subject)

2017-10-03 Thread Louis de Forcrand
Here is another approach using __&q: to generate only unique factors due to their unique prime factorisations: factors=: (*/ . ^ [: |:@:>@,@{ <@i.@>:)/@(__&q:) Cheers, Louis > On 3 Oct 2017, at 12:23, Erling Hellenäs wrote: > > Hi all! > > a=: 2 5 7 > f=: 1 :'/:~ (#: }. i.2^#y) u@# y

Re: [Jprogramming] factors

2017-10-03 Thread David Lambert
Fine approach.  I've before taken this route:    factors =: [: */&> [: { [: <@powers"1 [: |: 2&p:    powers =: {. ^ i.@:>:@:{:    2 p: 360  NB. prime ,: count 2 3 5 3 2 1    (powers L:_1) 2 3 ; 3 2 ; 5 1   [   boxdraw_j_ 1 +---+-+---+ |1 2 4 8|1 3 9|1 5| +---+-+---+    factor

Re: [Jprogramming] (no subject)

2017-10-03 Thread Erling Hellenäs
Hi all!     a=: 2 5 7     f=: 1 :'/:~ (#: }. i.2^#y) u@# y'    +/f a 2 5 7 7 9 12 14    */f a 2 5 7 10 14 35 70    Hi all !    a=: 2 5 7    f=: 1 : '/:~(#: }. i. 2 ^ # y) ([: u/ #) /"1 y'    + f a 2 5 7 7 9 12 14    * f a 2 5 7 10 14 35 70 Cheers, Erling On 2017-10-02 19:45, Erling Hellenäs w