Re: [Jprogramming] 903-beta-d

2021-02-03 Thread 'Michael Day' via Programming
Thanks. I've updated to beta-d. Having had a bit of trouble with crashing on loading errors,  I find that    load'noname'    NB. just after firing up JQt correctly reports 'not found: /noname' on the first attempt, but crashes J903 beta-d on the second attempt. OK in J902. This is in Win

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread 'Michael Day' via Programming
I know you're interested in developing encode and decode for Playfair, but members _might_ like to know that the London Times "Listener" crosswords*, which appear every Saturday,  occasionally employ Playfair codes. FYI,  I've found these pertinent puzzles in my records:    4236  4303  4406  44

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread 'Michael Day' via Programming
Just before I venture into updating to the correct beta d... Raul's is elegant, single-pass and pretty spare.  Here's a verbose, inelegant, multi-pass one,  but it seems to work,  except perhaps for the last example, below. I stuck with _2 which means that with odd length strings an error is

Re: [Jprogramming] 903-beta-d

2021-02-04 Thread 'Michael Day' via Programming
e crash on the second load of rubbish is fixed. Get the latest with: start J903 load'pacman' 'upgrade'jpkg'jengine' *** Check JVERSION or 9!:14'' to verify that your windows j903-beta-d was built on Feb 4 and not on Feb 3. On Wed, Feb 3, 2021 at 6:

Re: [Jprogramming] 903-beta-d

2021-02-04 Thread 'Michael Day' via Programming
   0!:0 y[4!:55<'y' so that's ok! Thanks for the help, Mike On 04/02/2021 16:11, Eric Iverson wrote: Sounds like another J session was in the way. Be sure all J's are closed and then start j903 and try again. On Thu, Feb 4, 2021 at 11:08 AM 'Michael Day'

[Jprogramming] Error in addons/math/misc/fermat.ijs

2021-02-04 Thread &#x27;Michael Day&#x27; via Programming
Having a look at the scripts in ~addons/math/misc,  I've just noticed a slip in fermat.ijs - I doubt if it's used much,  though,  which is probably why it hasn't been reported.  Its fellow script,  pollard.ijs,  has a greatly superior factoring algorithm or two. The optional left argument of t

Re: [Jprogramming] Bug in Calculus

2021-02-07 Thread &#x27;Michael Day&#x27; via Programming
For interest,  I had a look at the changes in the script. I tried both derivatives,  and both failed in different ways: a)  polynomials using p. :    (1 2 3 & p. ) deriv 1   NB. result should be 2 6&p. 0&p.    (0 & p. ) deriv 1  NB. ok! 0&p. b)   f() ^ h()    (*: ^ *:) deriv 1 |domain error: der

Re: [Jprogramming] Error in comment in addons/math/misc/pollard.ijs

2021-02-11 Thread &#x27;Michael Day&#x27; via Programming
Further to my delve in the scripts in ~addons/math/misc,  I've just noticed a misleading comment in pollard.ijs . The script offers implementations of two Pollard factorisation algorhithms. The relevant comments are (with a bit of context): NB. examples: NB. NB.    ]x=. (,*/) x: p: 1e7 30101 NB

Re: [Jprogramming] k-mediods PAM algo, help with canonical form

2021-02-13 Thread &#x27;Michael Day&#x27; via Programming
I was having a look at the wiki description with a view to trying to do my own version and then comparing with Emir U's code.  But I was stuck wondering about the lack of definition of cost,  as well as what the greedy choice of k points is aiming to optimise at the start. The algorithm is rath

Re: [Jprogramming] Strange result when calculating triangular number

2021-02-15 Thread &#x27;Michael Day&#x27; via Programming
Yes,  it does seem to misbehave. I looked at what happens with @ rather than @:    t0=: <.@ -:@ (* >:)    t =: <.@:-:@:(* >:)    (t0,:t1) 5928745 5928745  NB. compare @ with @: 17575011601885 17575011601885 17575011601886 17575011601886 I thought [: might fix it - but no:    tbr0=: [: <. [: -:

Re: [Jprogramming] Strange result when calculating triangular number

2021-02-15 Thread &#x27;Michael Day&#x27; via Programming
Sorry,  slightly careless in drafting - I'll correct the errors inline. Please discard my earlier post. On 15/02/2021 13:16, 'Michael Day' via Programming wrote: Yes, it does seem to misbehave. I looked at what happens with @ rather than @:    t0=: <.

Re: [Jprogramming] Strange result when calculating tringular number

2021-02-15 Thread &#x27;Michael Day&#x27; via Programming
"Fixed for the next beta" suggests you might have overlooked that this problem seems to occur in J9.02 as well. Apologies if I'm wrong. Cheers, Mike On 15/02/2021 17:16, Henry Rich wrote: It comes down to this:     <. 17575011601890. 0  NB. bug! 17575011601891 0     <. 17575011601890. 175750

Re: [Jprogramming] k-mediods PAM algo, help with canonical form (xash)

2021-02-15 Thread &#x27;Michael Day&#x27; via Programming
Have you decided whether your code does implement the PAM algorithm? xash suggested it might be doing the Voronoi method. Thanks, Mike On 15/02/2021 18:16, Emir U wrote: Hey again xash, I've improved the algo some following your example (especially the use of ./). It has reduced the algo (at

[Jprogramming] Apparent Error in NuVoc

2021-02-16 Thread &#x27;Michael Day&#x27; via Programming
In connection with the recent correspondence on the PAM algorithm for k-medoids, I thought it _might_ be worth considering using complex coordinates, eg    cdata =: j./"1 data so that distance between points is just the magnitude of the difference of their complex representations. Forgetting t

Re: [Jprogramming] Apparent Error in NuVoc

2021-02-16 Thread &#x27;Michael Day&#x27; via Programming
essage and hoping someone will pick up on it. There are lots of errors; you will see them even if you don't plan to make a habit of it.  Since you are one of the few who will recognize an error when you see one, have an account ready for the occasion. Henry Rich On 2/16/2021 4:37 AM, &#

Re: [Jprogramming] csvedit

2021-02-18 Thread &#x27;Michael Day&#x27; via Programming
I keep too many old versions of J - it turns out I have csvedit.ijs for J version 6.02. It's accompanied by help.html,  and testX.csv,   where X e. ' ' cut '1 1a 2 3 4 5 6' as well as the manifest and history.  The script and txt files are dated 3/Aug/2007, the csv files 7/Jan/2007  . I've no

Re: [Jprogramming] Interquartile range

2021-02-22 Thread &#x27;Michael Day&#x27; via Programming
Thanks for bringing this to attention. In https://mathworld.wolfram.com/Quantile.html Eric Weisstein lists 9 different quantile implementations. Back in the 90s there was a project to establish a library of stats functions in APL. One result was a useful Maximum Likelihood model workspace,  bu

Re: [Jprogramming] Quora Problem

2021-03-21 Thread &#x27;Michael Day&#x27; via Programming
I see Raul & Bob have replied while I was abed. SO,  before I look at their replies Not brute force,  but quite neat:    <.^(10%3)*^.10 14 For a smaller problem, check with 4^4:     +/(=<.)^&(%3)>:i.4^4 6 <.^(4%3)*^.4 6 QED? Cheers, Mike On 21/03/2021 02:57, Skip Cave wrote:

Re: [Jprogramming] Quora Problem

2021-03-21 Thread &#x27;Michael Day&#x27; via Programming
AH - neat but wrong problem!  Sorry. Now for breakfast M On 21/03/2021 09:16, 'Michael Day' via Programming wrote: I see Raul & Bob have replied while I was abed. SO,  before I look at their replies Not brute force,  but quite neat:    <.^(10%3)*^.10 14 For a smaller prob

Re: [Jprogramming] Quora Problem

2021-03-21 Thread &#x27;Michael Day&#x27; via Programming
Back on the laptop,  running J903 rather than J701 which crashed on the less compendious iPad. Here's a somewhat speedier version of Bob Theriault's approach.  (I wasn't seeking to speed it up, but it wouldn't complete in reasonable time without a tweak or two.) rt =: 3 : 0 N  =. y n  =. >: i.

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread &#x27;Michael Day&#x27; via Programming
Just in case it matters,  are you regarding Hello & Jello as distinct words here,  or is space just another character? If they're separate,  then we need only examine (;: s) or (cut s), brackets only to delimit the J idioms. Thanks, Mike On 09/04/2021 14:48, Emir U wrote: s=: 'Hello Jello'

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread &#x27;Michael Day&#x27; via Programming
Thanks - so in this slightly longer,  repetitive string: <<     s,' ',s Hello Jello Hello Jello >> 'llo Jell' would be a prefix (among several others!) with a count of two? (I see Julian has posted something which is probably useful...) Cheers, Mike On 09/04/2021 15:12, Emir U wrote: Hey Mi

Re: [Jprogramming] [Jgeneral] interpolation (equidistant re-sampling)

2021-05-07 Thread &#x27;Michael Day&#x27; via Programming
I was pretty sure I'd done something with splines years back,  but CTRL-E I "spline" only in my user folder revealed two relevant scripts.  One was my edited crib from ~addons/demos/wdplot/plexam.ijs, the other a copy of what Patrick Harrington posted to the J Forum way back in 2004. The latter

Re: [Jprogramming] Mass amend

2021-05-15 Thread &#x27;Michael Day&#x27; via Programming
Depends what Harvey means by "values",  I suppose. I assumed he meant scalars.    Otherwise my observation is pretty useless! Cheers, Mike On 15/05/2021 19:01, Joey K Tuttle wrote: I'm probably wrong, but when I first saw Harvey's request, I thought by amend he might be visualizing something

Re: [Jprogramming] possibly heretical proposal : .. as sentence separator ?

2021-07-26 Thread &#x27;Michael Day&#x27; via Programming
APL lives/d with the diamond separator,  which works from left to right,  in addition to left tack and right tack (in Dyalog anyway) which are similar to J's [  and  ]  . So this modification might help recruit any APL-ers still averse to or unaware of J. Cheers, Mike On 26/07/2021 14:47,

Re: [Jprogramming] initial version of tangentstorm/j-kvm

2021-07-26 Thread &#x27;Michael Day&#x27; via Programming
Thanks. Your "readme" file says: *    Note:*on windows, you need the stock|jconsole.exe|that comes with J,/and/you need to run it through the"new" Windows terminal . The ' "new" Windows terminal ' is indeed news to me.  I realise you provide a link to "

Re: [Jprogramming] initial version of tangentstorm/j-kvm

2021-07-28 Thread &#x27;Michael Day&#x27; via Programming
xterm on Linux. It also gives you 24 bit color and multiple console tabs on the same window. You can get it for free from the Microsoft store. I believe it requires at least windows 10: https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1#activetab=pivot:overviewtab On Mon,

Re: [Jprogramming] initial version of tangentstorm/j-kvm

2021-07-29 Thread &#x27;Michael Day&#x27; via Programming
fault. You can even set a J icon of your choice. Best Regards, Esa -Original Message- From: Programming On Behalf Of 'Michael Day' via Programming Sent: torstai 29. heinäkuuta 2021 0.54 To: programm...@jsoftware.com Subject: Re: [Jprogramming] initial version of tangentstorm/j

Re: [Jprogramming] initial version of tangentstorm/j-kvm

2021-07-29 Thread &#x27;Michael Day&#x27; via Programming
Raul - Many thanks for the insight;  this gives me an idea what the gurus are talking about! It works. Cheers, Mike On 29/07/2021 22:50, Raul Miller wrote: To make a profile for the current version of windows terminal: (1) Start Windows Terminal (2) In the title bar, to the immediate right of

Re: [Jprogramming] Tacit hook

2021-08-01 Thread &#x27;Michael Day&#x27; via Programming
Thanks,  Bo. This variation on comb works pretty well,  except it doesn't test for the empty case, ie x = 0: NB. these boolean verbs are quicker than multiply and add for this case twice =: 1 & (32 b.) or    =: 23 b. Smpscomb =: 4 : 0  k=. 2^i.>:d=.y-x  z=. <"0 k  for. i.<: x do.    z=. k or &.

Re: [Jprogramming] break from loading a script with 'load'

2021-08-31 Thread &#x27;Michael Day&#x27; via Programming
I sometimes need this too.  If so,  and if you're JQt,  it's easy to select all the unwanted lines and switch on comments with ctrl-/ .  You can later uncomment all those lines with another ctrl-/ on the same selection. However,  that can be a bit awkward,  and thanks to your message I've just

Re: [Jprogramming] Hello, new programmer here!

2021-09-05 Thread &#x27;Michael Day&#x27; via Programming
Hello Joseph, Unfortunately,  >.  is not defined as (greater than or equal to) It's very important to realise that >  >.    and   >:   are three different, albeit related,  primitives. and even more important that (nearly?) all symbols or letters used for J primitives can be monographs,  or

Re: [Jprogramming] cross product

2021-09-23 Thread &#x27;Michael Day&#x27; via Programming
I thought this should perform similarly to Igor's proposal,  but evidently not: NB. input:    $bigmap 3000 4000    (+/%#) ,bigmap 0.030052333    10{.bigm abcabcabca    10{.bign ABCDABCDAB NB. fns:     ts  NB. timestamp 6!:2 , 7!:2@]     acp   NB. IZ 1 : (':'; '; (<"0 x) ,"0 L: 0 m <@#"1

Re: [Jprogramming] cross product

2021-09-23 Thread &#x27;Michael Day&#x27; via Programming
Henry's comment just now explains the difference in performance,   I should think. Bill hasn't yet told us the ones-density or matrix-size. Anyway, Engine: j903/j64avx2/windows Beta-q: commercial/2021-09-14T15:38:42 Library: 9.03.06 Qt IDE: 1.9.3/5.15.2(5.15.2) Platform: Win 64 Installer: J903

Re: [Jprogramming] cross product

2021-09-23 Thread &#x27;Michael Day&#x27; via Programming
1.06e_5 25504 ... so perhaps Ric was right all along! I haven't tried Bill's 20 x 2 though. Cheers, Mike On 23/09/2021 16:22, bill lam wrote: I encountered a case in which $map = 20 2 Density of map is 0.004% map is already sparse otherwise it will run into out-of

Re: [Jprogramming] irregular tillings

2021-09-26 Thread &#x27;Michael Day&#x27; via Programming
Still trying to understand L: - it looks so useful, but meanwhile,  how do you get an even more irregular tiling such as: +---+-+ | 1  2  3  4| 4  5| | 8  9 10 11|11 12| |15 16 17 18|18 19| +---+-+ |29 30 31 32|32 33| +---+-+ |15 16 17 18|18 19| |22 23 24 25|25

Re: [Jprogramming] irregular tillings

2021-09-26 Thread &#x27;Michael Day&#x27; via Programming
R.E. Boss -Original Message- From: Programming On Behalf Of 'Michael Day' via Programming Sent: zondag 26 september 2021 13:04 To: programm...@jsoftware.com Subject: Re: [Jprogramming] irregular tillings Still trying to understand L: - it looks so useful, but meanwhile,  how do

Re: [Jprogramming] j901 (actually 903-beta-k) available from app store for iPhone/iPad

2021-10-20 Thread &#x27;Michael Day&#x27; via Programming
Congratulations to Ian! As he knows,  my iPad is "ancient",  ie 4-5 years old,  and is stuck at around iOS 12.1  He/we tried to get it to work in that OS,  but it just wouldn't fit.  Luckily, like several others,  I was able to try a number of Beta versions on a later iPad,  in my case,  my wif

Re: [Jprogramming] JHS update

2021-11-29 Thread &#x27;Michael Day&#x27; via Programming
Thanks Eric. I've noticed your msg,  just before bedtime,  so, briefly,  here's what happened when I tried firing up tour>overview,  after running Package Manager from Jqt to install all selected updates: overview tour *** event handler error ev_overview_click 0 |assertion failure: spf |

Re: [Jprogramming] JHS update

2021-11-29 Thread &#x27;Michael Day&#x27; via Programming
Devon's note reminds me to mention that I'm using the Avast Secure Browser Mike On 30/11/2021 00:11, 'Michael Day' via Programming wrote: Thanks Eric. I've noticed your msg,  just before bedtime,  so, briefly,  here's what happened when I tried firing up tour>

Re: [Jprogramming] Advent of Code day 2 + comment on day 18

2021-12-22 Thread &#x27;Michael Day&#x27; via Programming
Apologies - more chat than programming,  but: fwiw,  for part 1,  I just defined simple one-liner functions "forward" etc which worked ok.  For part 2, they needed redefining,  and, yes, I used direct defs;  nothing as sophisticated as fold! I've done days 1-17,  mostly straightforward,  some v

Re: [Jprogramming] Advent of Code day 2 + comment on day 18

2021-12-22 Thread &#x27;Michael Day&#x27; via Programming
Thanks, Raul I've checked what "use" does with an example.  I won't study its details,  though,  not wanting to crib.  I will say though that the output is similar to my interim results in processing the data. My mistake appears to have been to keep the verbose format and try to reproduce it, 

Re: [Jprogramming] Advent of Code Day 6

2021-12-27 Thread &#x27;Michael Day&#x27; via Programming
Yes, a nice insight,  I suppose,  but only nice,  and by no means necessary! Many Project Euler problems require this sort of thing in the tool-box! Also,  some sort of counting of cases is often nearly essential for PE. One of my finite arithmetic routines,  written pre-{{ ... }} NB. Matrix x t

Re: [Jprogramming] Advent of Code Day 10

2021-12-31 Thread &#x27;Michael Day&#x27; via Programming
I _think_ I used a somewhat different approach.  I'll only deal with part 1 as part 2 doesn't add much complexity. This approach is simple -  remove adjacent pairs of opening and closing brackets of the same kind until there are none.  The function is called reduce: I've added echo lines only f

Re: [Jprogramming] Advent of Code Day 10

2021-12-31 Thread &#x27;Michael Day&#x27; via Programming
/2021 15:58, 'Michael Day' via Programming wrote: I _think_ I used a somewhat different approach.  I'll only deal with part 1 as part 2 doesn't add much complexity. This approach is simple -  remove adjacent pairs of opening and closing brackets of the same kind until there

Re: [Jprogramming] Advent of Code Day 10

2021-12-31 Thread &#x27;Michael Day&#x27; via Programming
Neater! Cheers, Mike On 31/12/2021 19:19, Raul Miller wrote: That is a different approach. I had avoided even thinking about that approach, because of speed concerns. But, testing a simple implementation on the large aoc "puzzle input", I see that this approach completes in less than 17 milli

Re: [Jprogramming] Advent of Code Day 11

2022-01-01 Thread &#x27;Michael Day&#x27; via Programming
Yes,  the second part was again pretty trivial,  at least when, as in J,  you can use the power operation. I seem to have solved it on my iPad, running iOS 12.5.5,  which is too obsolete to support Ian Clark's new J902 version,  so it's stuck in J701,  so not up to {{ }} and lots more. I can

[Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-05 Thread &#x27;Michael Day&#x27; via Programming
I don't think there are any spoilers here. Well,  I have at last managed to do part 2 of day 22,  one of those "days" when part 2 is considerably harder than part 1.  (I've found day 22 the hardest so far:  day 21 part2's Dirac Die was tricky,  because I'd forgotten every go had 3 throws,  but

Re: [Jprogramming] Advent of Code Day 16

2022-01-06 Thread &#x27;Michael Day&#x27; via Programming
So your parse is akin to my unpack. I was going to say that my "operator" and "literal" were both dyadic too,  but checked, and now find I'm wrong.  But "unpack" itself is indeed dyadic;  irs input is initially 0 _ , holding the required part 1 total,  and the number of sub-packets where relev

Re: [Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-06 Thread &#x27;Michael Day&#x27; via Programming
b22 input' 24.2392 1.15927e9 FYI, -- Raul On Wed, Jan 5, 2022 at 7:08 PM 'Michael Day' via Programming wrote: I don't think there are any spoilers here. Well, I have at last managed to do part 2 of day 22, one of those "days" when part 2 is considerably harder than

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread &#x27;Michael Day&#x27; via Programming
Raul,  would you mind defining cross?  I've tried */ and (+/  .  *) but neither seem to work for me,  and I'm not sure what you mean. As I said a few days ago,  I gave up wondering why I'd found 48 rotations when they asked for 24,  couldn't grasp what the meant by facing" and resorted to matr

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread &#x27;Michael Day&#x27; via Programming
Chat really,  but I think it still belongs here. I've just had another look at the performance stats for day 19. The numbers solving parts 1 & 2 are 15420 and 236, respectively., at the time of typing. Weird - once you've done part 1,  there's hardly anything further to do in part 2 ! Perhaps

Re: [Jprogramming] Advent of Code Day 19

2022-01-10 Thread &#x27;Michael Day&#x27; via Programming
Thanks for this and for the previously undefined "cross" in another post. I now see why I got 48 rotations rather than 24 - I hadn't taken on board that all scanners used the "same" coord system,  which others have interpreted as all using the same parity. You mentioned looking for 67 or 68 of

Re: [Jprogramming] Advent of Code Day 21

2022-01-11 Thread &#x27;Michael Day&#x27; via Programming
I think it's easier to post my code than to try answering your question. I've run successfully this in a new session, so I think it's self-contained. Apologies for the verbose code - it's as I wrote it,  and I haven't attempted to polish it for presentation here.  The function "part2" , not s

Re: [Jprogramming] Parsing {{ }}

2022-01-11 Thread &#x27;Michael Day&#x27; via Programming
Thanks, Bob - yes,  I do know.  Ian gave up hoping to keep J901 compatible with my iOS 11,  later iOS 12. My iPad is too old to support the later versions of iOS which support his J901 app. Liz (my email address's other half!)  does have it on her iPad,  but I don't want to take over her tablet!

Re: [Jprogramming] Advent of Code Day 22

2022-01-12 Thread &#x27;Michael Day&#x27; via Programming
I thought I'd try running this code,  but it failed on parse.  Must have been my data, I thought, so I tried parse sample,  which is defined in the following script.    parse sample |assertion failure |   7=#t-._ __ I'm running J903-a,  same as Raul, I think,  under Windows 11, which is di

Re: [Jprogramming] Advent of Code Day 22

2022-01-12 Thread &#x27;Michael Day&#x27; via Programming
Whoa!  I've just tried    use sample which did work ok. Mea Culpa Mike On 12/01/2022 13:24, 'Michael Day' via Programming wrote: I thought I'd try running this code,  but it failed on parse.  Must have been my data, I thought, so I tried parse sample,  which is defi

Re: [Jprogramming] Advent of Code Day 22

2022-01-12 Thread &#x27;Michael Day&#x27; via Programming
OK, sorry about the alarm just now.  I'd misunderstood how to apply parse. FWIW,  I ran b22 and my "reboota" on "sample" which I'd called "bigexsteps" (big example steps) and on my bespoke data set,  called "data" for some reason. "reboot2a" is a much slimmer version of "reboot2".  reboot2 perf

Re: [Jprogramming] Advent of Code Day 22

2022-01-12 Thread &#x27;Michael Day&#x27; via Programming
   =. PQR <."1 y{~"1 ] -5 3 1 0 3 1 4 2 5{"1 A,.B ) NB. end of script My earlier remarks about the signs of intersections of different levels or generations still apply, but it wasn't necessary to break up a contributing cuboid into 3 sub-cuboids;  we only need to kee

Re: [Jprogramming] Advent of Code Day 22

2022-01-13 Thread &#x27;Michael Day&#x27; via Programming
indices allow the on/off boolean to be present or absent PQR =. x{~ -5 3 1 A   =. pqr >."1 y{~"1 ] -6 4 2 B   =. PQR <."1 y{~"1 ] -5 3 1 0 3 1 4 2 5{"1 A,.B ) NB. end of script My earlier remarks about the signs of intersections of different levels or generations

Re: [Jprogramming] Advent of Code Day 24

2022-01-14 Thread &#x27;Michael Day&#x27; via Programming
We haven't seen part 2 yet,  of course... there could be another sting in the tail, judging by the number of part 2 finishers in the stats! Mike On 14/01/2022 14:01, Raul Miller wrote: On Fri, Jan 14, 2022 at 4:15 AM 'Mike Day' via Programming wrote: My data has, of course, 14 inp ops; to my

Re: [Jprogramming] Advent of Code Day 24

2022-01-14 Thread &#x27;Michael Day&#x27; via Programming
Apologies to Eugene Nonko - I'd overlooked your remarks about the great similarity between the 14 segments.  Plagiarism rules! Mike On 13/01/2022 23:34, Eugene Nonko wrote: I did solve it, but I didn't use J for that one. I wrote a translator in Perl that converted their assembly into C. C, b

Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread &#x27;Michael Day&#x27; via Programming
Yes, that's my guess.  I called them p q & r,  and found that p = 1 or 26 as q is positive or negative. So: having got one machine to run 14 times on different values of p q r and the previous Z, I worked back from Z = 0 output on the 14th machine,  saving which W & Zs gave rise to 0,  then us

Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread &#x27;Michael Day&#x27; via Programming
... and it's one of those "days" that part 2 is ridiculously easy cf part 1 !!! Mike On 15/01/2022 21:15, 'Michael Day' via Programming wrote: Yes, that's my guess.  I called them p q & r,  and found that p = 1 or 26 as q is positive or negative. So: havi

Re: [Jprogramming] Advent of Code Day 24

2022-01-16 Thread &#x27;Michael Day&#x27; via Programming
OK - your approach is far more efficient than mine!  I suspect you did what I had in mind, but couldn't quite get that mind to produce. I see that you (Raul) didn't bother with truncating divide towards zero.  In testing,  I fell foul of this, and used    divt =: {{ s * y <.@%~ | x   [ s =. *

Re: [Jprogramming] Advent of Code Day 25

2022-01-16 Thread &#x27;Michael Day&#x27; via Programming
Also pretty crude,  in one self-contained routine,  "move" . It was fast and slim enough for its purpose!    $data 137 139    ts'move data' 0.0623268 1.69075e6    timer'move data' +-+---+ |0.0669937|412| +-+---+ move =: 3 : 0 NB. long-winded but never mind _ move y  N

Re: [Jprogramming] Advent of Code Day 23

2022-01-23 Thread &#x27;Michael Day&#x27; via Programming
Chat really - sorry! An update on my progress on this so-far elusive problem for me, part2 at least. I _nearly_ got the right answer - tweaking the code resulted in being able to reach a termination of the tree-search - too high! - another tweak - too low! further tweaks - explosion of sear

Re: [Jprogramming] Advent of Code Day 23

2022-02-02 Thread &#x27;Michael Day&#x27; via Programming
Raul Miller's solution,  way below in this post,  and see what I missed. And then back to Project Euler to see if any current problems are approachable! Thanks for your patience, Mike On 23/01/2022 19:02, 'Michael Day' via Programming wrote: Chat really - sorry! An update

[Jprogramming] test

2022-02-15 Thread &#x27;Michael Day&#x27; via Programming
Please ignore -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Advent of Code Day 23

2022-02-15 Thread &#x27;Michael Day&#x27; via Programming
Thanks, Mike On 02/02/2022 14:18, Raul Miller wrote: My solution there was also quite verbose. Golfing an implementation might be a worthwhile exercise. Thanks, On 02/02/2022 14:15, 'Michael Day' via Programming wrote: More chat on this old thread. Finished at last!  50 stars for so

Re: [Jprogramming] polynomial division

2022-02-20 Thread &#x27;Michael Day&#x27; via Programming
Just checked on the laptop running J903: Performance not too bad for largish orders,  even with extended type, albeit only binomial coefficients:    ts'1000 diva&binc 20'  NB. presumably overflow in binc |NaN error: diva |   d=.(ly{.x)    -&}.r*y    ts'1000x diva&binc 20x' 0.2399954 1570560   

Re: [Jprogramming] polynomial division

2022-02-20 Thread &#x27;Michael Day&#x27; via Programming
Bear in mind my later comments about performance on this laptop. Either extended arithmetic or other tricks to deal with high exponents are necessary in some cases.  And, of course, I didn't deal with edge effects.  I've dealt with one such,  introducing assert.  , ie    assert. 2 <: n =. 2 + x -&

Re: [Jprogramming] polynomial division

2022-02-20 Thread &#x27;Michael Day&#x27; via Programming
achine, I get    100 timespacex '1000x binc 500x' 0.101916 957376    100 timespacex '1, */\ 1000x (- % >:@]) i.500x' 0.00247977 680320 Am 20.02.22 um 13:30 schrieb 'Michael Day' via Programming:     ts'1000x div&binc 500

Re: [Jprogramming] polynomial division

2022-02-20 Thread &#x27;Michael Day&#x27; via Programming
Pas grand' chose -  the writer evidently meant to enter    E =. 1 5 10 10 4 7    ]q =. E dbho c 1 3 3 1    ]r =. E - c t q 0 0 0 0 2 3 - or perhaps with capital Q & R rather than q & r - ... but it's clear enough with a bit of insight! Cheers, Mike On 20/02/2022 16:15, Raul Miller wrote: For

Re: [Jprogramming] polynomial division

2022-02-20 Thread &#x27;Michael Day&#x27; via Programming
I suppose dyad |. !0 is better than dyad }.  by keeping the result in place. Anyway,   although I agree that it seems attractive to ignore those zeros, your get-around doesn't seem to apply!!! - unless I'm missing something. I embedded an echo: ...     if. 0={.y do. j=. j-i=. 0 i.~ 0=y echo '0=

Re: [Jprogramming] polynomial division

2022-02-21 Thread &#x27;Michael Day&#x27; via Programming
uot; in earlier postings! Not so cheerily, Mike On 20/02/2022 18:05, 'Michael Day' via Programming wrote: I suppose dyad |. !0 is better than dyad }.  by keeping the result in place. Anyway,   although I agree that it seems attractive to ignore those zeros, your get-around doesn't se

[Jprogramming] Cyclotomic Polynomials and FFT - was Re: polynomial division

2022-03-01 Thread &#x27;Michael Day&#x27; via Programming
Raul Miller's and RE Boss's (revised) entries here refer:    http://rosettacode.org/wiki/Cyclotomic_polynomial#J I think I'm partly responsible for pDiv in this (otherwise!) nicely concise and elegant presentation of J routines to derive these polynomials. Typically, NB. (1+5x+10x^2+10x^3+5x^4+

Re: [Jprogramming] Cyclotomic Polynomials and FFT - was Re: polynomial division

2022-03-01 Thread &#x27;Michael Day&#x27; via Programming
Oops - ct was my memoised version of cyclotomic,  while still using pDiv. I expect the results will be much the same,  but I'll have a look later as I've got to go out now.  I'll have to replace ct by ctfft - perhaps you'd like to try while I'm pub-quizzing! Cheers, Mike On 01/03/2022 19:02

Re: [Jprogramming] Cyclotomic Polynomials and FFT - was Re: polynomial division

2022-03-01 Thread &#x27;Michael Day&#x27; via Programming
┐ │3 58.355003│1 105 385 1365 1785 2805 3135 6545 6545 10465│ └───┴─────────────┘ So not much significant difference in the running times from those in my earlier report. Cheers, Mike On 01/03/2022 19:17, 'Michael Day'

Re: [Jprogramming] Cyclotomic Polynomials and FFT - was Re: polynomial division

2022-03-02 Thread &#x27;Michael Day&#x27; via Programming
Interesting!   I've got some thoughts on this,  but it's getting late here,  so I'll defer a fuller reply. Meanwhile,  a quickie:  since the memoisation does seem to work, might it be better to dispense with cache?  A pity as you put some effort into its use,  but the code is simpler without

Re: [Jprogramming] Power Conjunction

2022-03-06 Thread &#x27;Michael Day&#x27; via Programming
Late to the power party! This is one way to automate the OEIS look-up - I'm not an expert on parsing the result,  but hunting for 'A', a single digit seems a good starter:    OEIS =: 'http://oeis.org/search?q='  NB. fails with https://... !    getoeisseries =:{{ {{(-.{.) ' ',,/ y&{{~.x{~(i.7)

Re: [Jprogramming] Power Conjunction

2022-03-06 Thread &#x27;Michael Day&#x27; via Programming
I don't yet see how to separate the series itself/themselves from cross-refs! M On 06/03/2022 12:18, 'Michael Day' via Programming wrote: Late to the power party! This is one way to automate the OEIS look-up - I'm not an expert on parsing the result,  but hunting for

Re: [Jprogramming] Power Conjunction

2022-03-06 Thread &#x27;Michael Day&#x27; via Programming
=== IF the series is found,  you can go on to examine - even parse?! - the global "RAW" - though I expect it's just as useful to go to the browser.  I don't use JHS enough to know how to integrate this approach in that enviornment. Mike On 06/03/2022 14:06, 'M

Re: [Jprogramming] Power Conjunction

2022-03-06 Thread &#x27;Michael Day&#x27; via Programming
I forgot about regular expressions in J, but not familiar with them anyway! Used to know them in unix, once upon a time. Yr commas much better,  too. M On 06/03/2022 17:02, Raul Miller wrote: Here's a version of getoeisseries which only returns direct hits and not cross references: NB. install

Re: [Jprogramming] Power Conjunction

2022-03-06 Thread &#x27;Michael Day&#x27; via Programming
Oops - please use this line in goeis,  just below,    echo ' results found',~ ": +/ok in place of    echo '3 results found' Mike On 06/03/2022 17:05, 'Michael Day' via Programming wrote: OK - Ian wondered about automating a search in OEIS. With a little i

Re: [Jprogramming] Cyclotomic Polynomials and FFT - was Re: polynomial division

2022-03-08 Thread &#x27;Michael Day&#x27; via Programming
Sorry - a few days have passed Interesting! As I had put up this idea (using fft multiplication and a special case for fft "division"),  I feel I can wonder if this helps the Rosetta Code exposition of the virtues of J!  I like my idea,  of course, and it's of potential interest to the J c

Re: [Jprogramming] Cyclotomic Polynomials and FFT - was Re: polynomial division

2022-03-08 Thread &#x27;Michael Day&#x27; via Programming
ting problem letters. Cheers Mike On 08/03/2022 21:01, Raul Miller wrote: On Tue, Mar 8, 2022 at 2:01 PM 'Michael Day' via Programming wrote: for fft "division"), I feel I can wonder if this helps the Rosetta Code exposition of the virtues of J! I like my idea, of course,

Re: [Jprogramming] {{ }} definitions

2022-03-29 Thread &#x27;Michael Day&#x27; via Programming
Yes: eg NB. in your script,  say foo =: {{    x + y }}"0 1  NB. just as an example! (Not necessarily a sensible use of rank!) NB. displaying it in the terminal session;  direct definition functions NB. are displayed as conventional explicit definitions    foo 4 : '   x + y'"0 1 So t

Re: [Jprogramming] [Jbeta] J904 multithreading

2022-04-11 Thread &#x27;Michael Day&#x27; via Programming
The mechanism here is presumably common knowledge,  but might be worth sharing. Here's what I use to allocate half of the laptop's cores for use by J: NB. Processor Affinity coclass 'affin' require'dll' GetCurrentProcess=: >@{.@('kernel32 GetCurrentProcess i'&(15!:0)) GetProcessAffinityMask=: (

[Jprogramming] jpm niggle - was Re: [Jbeta] Beta users: please enable new diagnostic message

2022-04-11 Thread &#x27;Michael Day&#x27; via Programming
Thanks. BTW,  not a Beta problem,  I realise,  and I don't know how many users are affected,  but I'm still having to make functions monadic if I want showdetail to provide a useful report; dyads still yield zero times for all lines - last time I looked, anyway!  po Mike On 11/04/2022 17:57,

Re: [Jprogramming] jpm niggle - was Re: [Jbeta] Beta users: please enable new diagnostic message

2022-04-12 Thread &#x27;Michael Day&#x27; via Programming
en too busy to deal with this issue for this beta release. Cheers, Mike On 12/04/2022 16:45, Henry Rich wrote: I thought I fixed that a while back & I believe I got good results in JPM.  I'll look again next time I have to profile. Henry Rich On 4/11/2022 1:03 PM, 'Micha

Re: [Jprogramming] Extended precision question

2022-05-01 Thread &#x27;Michael Day&#x27; via Programming
Mainly for Ed Gottsman: Chat really,  but the thread is already here. I've just solved Euler Problem 788 with the assistance of extended precision numbers.  The solution is slow,  taking over 14 minutes,  but at least it's less than the lifetime of the universe,  unlike my (projected) methods

[Jprogramming] JQT not starting properly in Windows 11

2022-05-16 Thread &#x27;Michael Day&#x27; via Programming
Hello.  I tried to wake up my laptop from sleep just now,  as usual - ie I leave it in sleep mode while I'm asleep... But,  as occasionally happens, it must have restarted,  and nothing was open. (I wanted to explore the Babylon Spiral topic,  which I've just woken up to see!) I now find tha

Re: [Jprogramming] JQT not starting properly in Windows 11

2022-05-17 Thread &#x27;Michael Day&#x27; via Programming
Thanks,  but I'm pretty sure it's not off-screen.  At least, Alt+Tab doesn't find it, and I frequently use those keys to swap windows. I forgot to mention earlier that I did think of permissions,  and tried "run as administrator" with the same lack of a terminal screen. And oh yes,  the yell

Re: [Jprogramming] JQT not starting properly in Windows 11

2022-05-17 Thread &#x27;Michael Day&#x27; via Programming
his encouraging sign of survival,  I clicked on J904 beta's icon in the Taskbar and its terminal appeared almost immediately. Weird.  I'll keep it running for a while now. Sorry to cry wolf. Mike On 17/05/2022 17:19, 'Michael Day' via Programming wrote: Thanks, but I

Re: [Jprogramming] JQT not starting properly in Windows 11

2022-05-17 Thread &#x27;Michael Day&#x27; via Programming
Thanks,  Raul.   I've downloaded Process Explorer, as you suggest, as it sounds useful. I think you're right that this laptop offers two (or more?) "desktops",  but I've never deliberately used the feature,   and it doesn't look as though Jqt was hiding elsewhere. Anyway,  as I mentioned in

Re: [Jprogramming] J904-beta-d

2022-05-20 Thread &#x27;Michael Day&#x27; via Programming
Thanks.  The upgrade was easy,  but the result is unfortunate,  at least on this laptop running Windows 11. Attempting to open any of Jqt, JHS, Jconsole does establish a new instance of jqt.exe or jconsole.exe, according to the details display of Task Manager,  but it immediately shows its sta

Re: [Jprogramming] Sudoku16

2022-06-19 Thread &#x27;Michael Day&#x27; via Programming
FWIW,  I've been looking at this,  and my own slower and more space-consuming versions. I tried amending Roger's similar original code,  posted in the forum,  I think, with obvious changes as follows.  Some of his verbs,  including your ac & ar I think differ in the wiki article from the ones I

Re: [Jprogramming] Sudoku16

2022-06-20 Thread &#x27;Michael Day&#x27; via Programming
Purists may object to the number representation in the 16x16 puzzle, in the generalisation I've just posted; numbers 1-16 are encoded as 1-g !  Clearly they could be "better" as 0-f.  I don't know which is preferable! I normally stick to a numeric output,  involving no encoding. NB - I haven't

Re: [Jprogramming] Sudoku16

2022-06-24 Thread &#x27;Michael Day&#x27; via Programming
Sorry for late posting - apparently a problem with my broadband provider's server. Yes, it can be worth doing a limited feasibility check on your input.  Every column, row and small box should have no repeated elements apart from the "missing" indicator,  such as 0 or perhaps one of '.-*0' , 

  1   2   3   >