Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread David Lambert
Yes, thank you Roger for this explanation of dyadic & which i've recently been thinking about how to incorporate into my j programming. |Date: Sun, 16 Aug 2020 21:00:42 + (UTC) |From: "'Pascal Jasmin' via Programming" |To: "[email protected]" |Subject: Re: [Jprogramming] conditional

Re: [Jprogramming] J902-beta-e available

2020-08-17 Thread 'Michael Day' via Programming
Thanks, Henry.  Back home now, so emailing from my laptop,  where J902 resides, is easier... On startup, I get    allolddefs 1 ++---+ |base|treerep| ++---+ +---++ |jsocket|ccdm| +---++ +-++ |z|bind| +-++ As far as I recall,  these aren't my definitions

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread Henry Rich
On the current implementation it is much preferable to use bitmask operator@]^:["0 operand rather than bitmask 0&(] operator)"0 operand They both execute at low rank, but the second version reinterprets the internal form ( 0&(] operator)^:bitmask ) for each atom. I have yet to find an app

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread Hauke Rehr
dyadic m&f … first I thought I should learn this construct now I think I don’t need to any suggestions? is this considered an idiom that ought to be known and used? Am 17.08.20 um 16:20 schrieb Henry Rich: On the current implementation it is much preferable to use bitmask operator@]^:["0 oper

Re: [Jprogramming] J902-beta-e available

2020-08-17 Thread Henry Rich
You have to clean them up.  Maybe you can beg someone else to do it, but assume nothing.  The last two are easy.  On my system I see    bind_z_ 2 : 'u@(v"_)'    ccdm_jsocket_ 1 : '(''"wsock32" '',u)&(15!:0)' These are OK.  You will find they are different on your system, because you haven't up

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread Raul Miller
I think the primary benefit of that notation is instructional. add=: 1&+ 2 add 3 5 There's more efficient ways of achieving the same end, but efficiency is not always the most important issue. -- Raul On Mon, Aug 17, 2020 at 10:25 AM Hauke Rehr wrote: > > dyadic m&f … > > first I though

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread 'robert therriault' via Programming
Thanks Henry, I woke up this morning realizing that the argument to & could be any value and that cleared up a lot of my fuzziness on what was going on. Thank you to Pascal as well for the explanation and Roger for twisting my brain for a few hours. operand =. 2 2 2 $ 3 2 2 3 2 3 3 2 bitmask =

Re: [Jprogramming] Given a depth vector, pretty print its tree

2020-08-17 Thread 'Michael Day' via Programming
Late to the party - I had a look at the problem after the correspondence closed,  and have only just got home to my own wifi. I developed a few functions, tpxxxmd,  not pretty in themselves, which attempt a number of variations, some using box characters,  19 22 25 26 { a. Unfortunately,  I not

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread Henry Rich
With arguments that small, most of the time is spent in lexing and parsing.  To test the time of execution, you need arguments long enough that the execution dominates.  Or, you can make a tacit verb that has done the parsing in advance. To get serious measurements you need to delay the sampli

Re: [Jprogramming] Given a depth vector, pretty print its tree

2020-08-17 Thread Hauke Rehr
… the last version (meant to be raul’s) doesn’t quite look right … can’t verify right now Am 17.08.20 um 16:49 schrieb 'Michael Day' via Programming: Late to the party - I had a look at the problem after the correspondence closed,  and have only just got home to my own wifi. I developed a few f

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread 'Pascal Jasmin' via Programming
Tetration (I think it is called) is an impressive display of dyadic (m&) You are allowed to keep adding (&m) bindings. As a hybrid depth/breadth first (do depth 10 times in a breadth way), then 10 x&search^:(until)^:_ y lets you make that chunk size a verb parameter.  With that said, there is

Re: [Jprogramming] J902-beta-e available

2020-08-17 Thread 'Michael Day' via Programming
Thanks, Henry. I thought I had run Package Manager on all my addons,  but it seems not.  My excuse is that we were away for a month,  and snatching wifi when fitfully available,  so I might have tried updating them and failed... Anyway,  for others who might be as silly as I,  in case it's

[Jprogramming] 902 beta messages

2020-08-17 Thread chris burke
Dear All Please use the beta forum for any new messages on the 902 beta. Thanks. Just a reminder - the programming forum is used for announcements, and otherwise posts should be directed to the appropriate forum. Eric announced the latest 902 beta to the programming forum, but as his email stat

Re: [Jprogramming] Given a depth vector, pretty print its tree

2020-08-17 Thread 'Michael Day' via Programming
I took this as the definition of "raul" : raul =: 13 : ';"1('' - '',&.>'' o+|''){~(+3*_1 1&E.)"1&.|:(*>./\.@:*)0,~2:`(}.@((i:,.]-1:) ~.))`((1,~]#_1:)"0)}~y' I copied this from his email of 7/Aug/20 timed (here) at 23:21 . There was a line break at *>./\.@: which might have messed up the def

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread Henry Rich
Now that I think of it, x m&v y   is equivalent to    x (m&v @ ] ^: [) y so there is never going to be a case where dyadic m&v is necessary.  The question is how valuable the uses mentioned are.  I know I have lost a lot of time over the years by mistaken execution of dyadic m&v, and a domain e

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread 'robert therriault' via Programming
Thanks Henry, I have increased argument sizes and defined using tacit. I am still not seeing results that suggest the differences in the two approaches. Feel free to ignore if I am just running down a rabbit hole, but if it is useful here are my results. JVERSION Engine: j902/j64avx2/darwi

Re: [Jprogramming] Given a depth vector, pretty print its tree

2020-08-17 Thread Raul Miller
Yes.. I think mine needs a scan added, so that only the first + on a line is retained. This would add maybe a dozen characters to the line. -- Raul On Mon, Aug 17, 2020 at 10:49 AM 'Michael Day' via Programming < [email protected]> wrote: > Late to the party - I had a look at the probl

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread 'Pascal Jasmin' via Programming
with nesting, I'm not sure of the equivalency 3 (2&(+&2@]^:[))^:[ 3 39 3 (2&(+&2)) 3 15 but the actual equivalent is 3 (2&(+&2@]^:[)@:])^:[ 3 15 +&2^:6 ] 3 15 +&2^:(18) ] 3 39 I'm not sure why the first is 39, but I understood why the short expression/last 2 was 15. But a short "verb

Re: [Jprogramming] conditional application defined by bitmask

2020-08-17 Thread Henry Rich
I think you are right.  I see a persistent but small (<5%) difference in my timings.  Much less than I expected.  The m&v version does reinterpret (u^:n) for every atom, but it takes a fast path and does not have to allocate memory. Henry Rich On 8/17/2020 11:56 AM, 'robert therriault' via Pr

[Jprogramming] List of Plot color names (preferably with colors)

2020-08-17 Thread HH PackRat
The J program I'm currently working on uses Plot for showing multiple versions of stock prices simultaneously. Hence, I need to differentiate colors. I'm familiar with some minimal "standard" colors such as red, green, blue, etc., but some of those shades are too light or too dark for my purposes

Re: [Jprogramming] List of Plot color names (preferably with colors)

2020-08-17 Thread chris burke
Plot uses the graphics/color addon. The names are in github.com/jsoftware/graphics_color/blob/master/colortab.ijs . Plot uses uppercase names, like other Plot globals. For example: load'plot' ALICEBLUE_jzplot_ 240 248 255 On Mon, Aug 17, 2020 at 6:02 PM HH PackRat wrote: > > The J program

Re: [Jprogramming] List of Plot color names (preferably with colors)

2020-08-17 Thread HH PackRat
On 8/17/20, chris burke wrote: > Plot uses the graphics/color addon. The names are in > github.com/jsoftware/graphics_color/blob/master/colortab.ijs . Thanks, Chris! That's exactly what I was looking for! Harvey -- For informat