Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Hauke Rehr
should have read the first entry in row x … where x is the index of the number in list rows, and n is that number Am 27.01.22 um 01:25 schrieb Hauke Rehr: rows says: the first entry in col x is the n-th entry in values -- -- mail written using NEO neo-layout.org --

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Hauke Rehr
rows says: the first entry in col x is the n-th entry in values row 0 0th (if any) row 1 2nd (if any) (so in row 0 we had 2 values) row 2 3rd (if any) (so in row 1 we had 1 value) row 3 5th (if any) (so in row 2 we had 2 values) row 4 5th (if any) (so in row 3 we had 0 values) etc. Am 26.01.22 u

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Jan-Pieter Jacobs
Hi, I tried out the add-on, it looks very promising! After managing to install ArrayFire (apparently the logical "apt install" didn't work), I tried the basic tutorial and found the following line causes J to segfault when using the opencl backend: display_jaf_ afaiNB. get AF text display

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread 'Mike Day' via Programming
Unfortunately, Pawel wants 2 f d to be 3 11. However, I find that 3 f d IS 3 11. Other results are a bit strange, too: 4 f d 2 12 8 f d |index error: f | y({~,])x i.~+/\(i.@#~:i.~)y I wasn’t going to post my effort, but it might interest Pawel. This version works on the slightl

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Raul Miller
Execution error sounds possibly overbearing. But I guess if it's limited to scripts, and lines which would produce a display result of a non-noun (the sort of thing influenced by 9!:3) if the line were executed outside of a script, that that would be ok. That said... I also kind of like the idea t

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Henry Rich
No, it's an execution error.  But colorizing would be a good idea. Henry Rich On 1/26/2022 5:13 PM, Raul Miller wrote: Colorized? That would be nice. Thanks, -- This email has been checked for viruses by AVG. https://www.avg.com

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Raul Miller
Colorized? That would be nice. Thanks, -- Raul On Wed, Jan 26, 2022 at 5:09 PM Henry Rich wrote: > > Help is on the way in the next beta, sequences that don't produce a > noun will be flagged. > > Henry Rich > > On 1/26/2022 5:07 PM, Raul Miller wrote: > > And.. a problem was that gllines

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Henry Rich
Help is on the way in the next beta, sequences that don't produce a noun will be flagged. Henry Rich On 1/26/2022 5:07 PM, Raul Miller wrote: And.. a problem was that gllines was not executing. (gllines <.@(1 2 3 4) forms a verb, but does not execute gllines.) Also, there's an issue where

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Raul Miller
And.. a problem was that gllines was not executing. (gllines <.@(1 2 3 4) forms a verb, but does not execute gllines.) Also, there's an issue where the isidraw does not update when the jqt session window has focus,. FYI, -- Raul On Wed, Jan 26, 2022 at 2:55 PM Raul Miller wrote: > > Ok, so it

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Eric Iverson
I did not have any problem installing on win10. It seems win11 is tightening the rules. You will need to take some extra step to override the security check. On Wed, Jan 26, 2022 at 3:35 PM 'Mike Day' via Programming < programm...@jsoftware.com> wrote: > Just about downloading ArrayFire for Windo

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread xash
-.@~: gets a mask of duplicates, I. then their indices. With them you can get a list of (index, value) pairs: ((],.{~) I.@:-.@~:) a 5 2 8 3 11 3 12 2 With 0 ({ (],.{~) I.@:-.@~:)) a you can 0-index into this list. If you are only interested into the first duplicate of a value, you could filter d

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Hauke Rehr
As Henry pointed out, do take a look at [1] for how to approach this in J If you want to understand my solution, just try it step by step. I repeat it here, with a bit of litter removed: f =: {{ (,~ {&y) {. I. (>: x) e."1 +/\ =/~ y }} NB. where does each number occur? =/~ d 1 0 0 0 0 0 0

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Raul Miller
Here's a variation that works: d=: 1 _1 2 3 4 2 5 6 3 8 10 3 2 f=: {{y ({~,]) x i.~ +/\(i.@#~:i.~)y }} 1 f d 2 5 2 f d 3 8 The phrase (i.@# ~: i.~) finds the locations of duplicates (i.@#~:i.~) 1 _1 2 3 4 2 5 6 3 8 10 3 2 0 0 0 0 0 1 0 0 1 0 0 1 1 And, +/\ computes a running sum

[Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Pawel Jakubas
It should be of course 1 f d 2 5 Would be great if you could decompose your solution and the idea behind the solution. Many thanks. Cheers, Pawel -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread 'Mike Day' via Programming
Just about downloading ArrayFire for Windows 11... I tried downloading the two exe files, one for W11, which failed, and then W10, also a failure. The failures both reported inability to verify. My son has just commented that it’s a common M/S feature... Anyone else seen this behaviour?

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Raul Miller
Ok, so it's not that gllines on isidraw completely fails on my machine. That's good to know. Thanks, -- Raul On Wed, Jan 26, 2022 at 2:25 PM Henry Rich wrote: > > Dissect uses isidraw and gllines on Jqt. > > Henry Rich > > On 1/26/2022 11:58 AM, Raul Miller wrote: > > http://www.rosettacode.o

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread 'Pascal Jasmin' via Programming
The signature for af_add: af_add (af_array *out, const af_array lhs, const af_array rhs, const bool batch) with lhs and rhs as parameter names, I don't think J users would get lost if they called the "cover function" dyadically the same way they call + I'm not suggesting altering any existing c

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Henry Rich
Use the ideas in https://code.jsoftware.com/wiki/Essays/Progressive_Index-Of . Henry Rich On 1/26/2022 1:37 PM, Pawel Jakubas wrote: Dear J enthusiasts, I wonder how to elegantly implement dyad f that takes as x=1,2,3... and y vector and returns nth duplicate value with index of that occurenc

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Henry Rich
Dissect uses isidraw and gllines on Jqt. Henry Rich On 1/26/2022 11:58 AM, Raul Miller wrote: http://www.rosettacode.org/wiki/Fractal_tree#J I had updated the fractal tree implementation to work with j903. (The previous code did not work with any implementation of J which I have installed on m

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Hauke Rehr
Maybe this is what you want (but it’s not elegant) f =: {{ (,~ {&y) {. I. ( (>: x)&e."1) +/\ =/~ y }} 1 f d 2 5 2 f d 3 11 just a quick and dirty working solution (if 2 5 is the correct answer to 1 f d) Am 26.01.22 um 19:37 schrieb Pawel Jakubas: Dear J enthusiasts, I wonder how to e

Re: [Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Hauke Rehr
I don’t understand why it’s index 2 (first occurrence of 2) but 11 (third occurrence of 3) Am 26.01.22 um 19:37 schrieb Pawel Jakubas: Dear J enthusiasts, I wonder how to elegantly implement dyad f that takes as x=1,2,3... and y vector and returns nth duplicate value with index of that occurenc

[Jprogramming] Find nth duplicate in vector

2022-01-26 Thread Pawel Jakubas
Dear J enthusiasts, I wonder how to elegantly implement dyad f that takes as x=1,2,3... and y vector and returns nth duplicate value with index of that occurence: d=: 1 _1 2 3 4 2 5 6 3 8 10 3 2 NB. the earliest first duplicate is for 2 and index 2 1 f d 2 2 NB. the earliest second dupl

Re: [Jprogramming] isidraw...?

2022-01-26 Thread Raul Miller
Sadly, glpaint_jgl2_'' does not change anything. Does it work for you? (In other words, is this a problem specific to my machine, or my type of machine?) Thanks, -- Raul On Wed, Jan 26, 2022 at 12:04 PM bill lam wrote: > > Try put an glpaint'' after the last gllines... > > Untested > > On T

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Eric Iverson
Pascal, Interesting ideas on arrayfire args. I will probably resist the idea of making dop verbs dyadic. I think it better to stick closer to the arrayfire syntax. But it makes sense to avoid unnecessary boxing. af_add_jaf_ afad;afbd NB. works af_add_jaf_ afad,afbd NB. fails, but probably s

Re: [Jprogramming] isidraw...?

2022-01-26 Thread bill lam
Try put an glpaint'' after the last gllines... Untested On Thu, 27 Jan 2022 at 12:59 AM Raul Miller wrote: > http://www.rosettacode.org/wiki/Fractal_tree#J > > I had updated the fractal tree implementation to work with j903. (The > previous code did not work with any implementation of J which

[Jprogramming] isidraw...?

2022-01-26 Thread Raul Miller
http://www.rosettacode.org/wiki/Fractal_tree#J I had updated the fractal tree implementation to work with j903. (The previous code did not work with any implementation of J which I have installed on my mac -- apparently Apple's changes mean that j504 and j602 no longer function on this machine.)

[Jprogramming] ArrayFire addon

2022-01-26 Thread Eric Iverson
Apologies for the rough start. The development was done in linux with arrayfire installed and not enough attention was paid to other platforms or new users. The addon has been updated. Raul: You were on macOS, which had not been tested at all. It should work now if arrayfire is installed in folder

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread 'Pascal Jasmin' via Programming
An interface suggestion would be to transform all verbs that currently take 2 boxed arguments into unboxed dyad arguments. this can be done by adding the adverb (@:;) for the dop class verbs.  and (@:;~) for the reduce class verbs such that the operating axis is the x term.  The reduce class co

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-26 Thread sblank
Hi Bob, Thanks! Will do... lots to learn in this fascinating language! Kind regards, Stan On 2022-01-25 21:34, 'robert therriault' via Programming wrote: Hi Stan, If you have looked at the shader demo in Jqt Help | Studio | Qt demos... there is a source button that will show the sourc