[Jprogramming] From J 9.03r maximum rank of nouns and verbs is now 63

2021-11-23 Thread 'Sergey Kamenev' via Programming
Health to all! I am using the stable version J with level 80 rank in sparse arrays. A large rank can be useful for some purposes (only in sparse arrays, of course). Henry, can you lift the rank restriction in the stable release J 9.03? Nice day! Sergey Kamenev

Re: [Jprogramming] Roger Hui - 1953 - 2021

2021-10-17 Thread 'Sergey Kamenev' via Programming
My condolences. I only knew Roger by chat and articles. It is a pity that he is gone. I experienced acute negative emotions when I read this news. Sergey Kamenev 17.10.2021 19:14, Eric Iverson пишет: Roger Hui passed away peacefully on Saturday afternoon, October 16, 2021. He had a several

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
settle on “we agree to disagree” – I don’t think further back and forth will lead us somewhere. (and maybe I need to get some rest ere I write more rubbish here) Hauke Am 25.02.21 um 17:19 schrieb 'Sergey Kamenev' via Programming: I think Henry Rich is most likely a genius programmer. By the way, I

Re: [Jprogramming] Request for optimized v/\

2021-02-25 Thread 'Sergey Kamenev' via Programming
25.02.2021 18:38, Henry Rich: For other associative verbs you have to use u/\.&.|. Thank you for hint. Sergey. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Request for optimized v/\

2021-02-25 Thread 'Sergey Kamenev' via Programming
25.02.2021 19:05, Hauke Rehr: sorry, wrong: that’s commutativity didn’t get the order of thought and speech right, again associativity right_associative =: v (b v c) You meant? right_associative =: a v (b v c) -- For

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
I think Henry Rich is most likely a genius programmer. By the way, I am a supporter of meritocracy, when the weight of a person's voice depends on his merits. But a programming language is written for the community. And so the voice of the community when discussing new features should carry a

Re: [Jprogramming] Request for optimized v/\

2021-02-25 Thread 'Sergey Kamenev' via Programming
by Fold computing. By the way, what are associative verbs? Sergey. 25.02.2021 18:38, Henry Rich: This is already done for associative atomic primitives.  For other associative verbs you have to use u/\.&.|. . Henry Rich On 2/25/2021 10:10 AM, 'Sergey Kamenev' via Programming wrote: +/\ 1 2 3

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
About consensus. Sergey Kamenev thinks that the order of the arguments of V should be changed. Hauke Rehr believes the definition of Fold can be improved. Вrian Schott "I think I am in favor of Sergey's suggestion." Raul Miller gave an example with 'control-like' and 'data-like' that confused

[Jprogramming] Request for optimized v/\

2021-02-25 Thread 'Sergey Kamenev' via Programming
+/\ 1 2 3 4 5 By computing partial sum every time is recomputed partial fold. It's time and CPU expensive. 1 1+2 1+2+3 - Sum 1+2 don't need to recalculated 1+2+3+4 - Sum 1+2+3 don't need to recalculated 1+2+3+4+5 - Sum 1+2+3+4 don't need to recalculated This optimization can be done for

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
25.02.2021 16:17, Hauke Rehr: Wrong again, the data will be the result of an operation, the control array will be fixed on many occasions. Control array to the left, data (whatever shape) to the right. You can, of course, invent examples when the array for folding will be filled with control

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
24.02.2021 12:05, Hauke Rehr: I still think, from the 'control' vs 'data' point of view, the array of controls should go left, the initial data right. It looks logical and intuitive. However, the essence of the J lies in the fact that the data travels from right to left along the road being

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
I will be like the boy from Andersen's fairy tale "The Naked King". Actually, the initial value and the array for Fold is data. There is no 'control-like' argument at all. Only there is more data in the data array to Fold. Therefore, it must be recognized as an 'data-like' argument. It's just

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-25 Thread 'Sergey Kamenev' via Programming
This is exactly the counterintuitiveness that I am talking about. 24.02.2021 12:34, Raul Miller: I was having second thoughts, was I remembering wrong? So I implemented a little test: VERB=:{{ echo 'control value ',":;x echo 'data value ',":;y }} 'CONTROL' ]F..VERB <'DATA' control

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-23 Thread 'Sergey Kamenev' via Programming
Inside verb v we have two local variables: x and y. x - left verb argument, y - right verb argument. Array for Fold located in right part of expression: 7 ] F:. see_arg 1 2 3 4 I see more intuitiveness if numbers from right array 1 2 3 4 would be passed as right argument of verb 'see_arg'.

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-23 Thread 'Sergey Kamenev' via Programming
-like vs data-like. Am 22.02.21 um 13:31 schrieb 'Sergey Kamenev' via Programming: I'm talking about the order of the arguments within a verb 'see_arg'. Inside the verb 'see_arg', the initial value must be passed as the left argument, and then (on next iteration) the result of the fold. And as t

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-23 Thread 'Sergey Kamenev' via Programming
side V, you could do that like this: V=: {{y+x [ echo y,x}} Thanks, -- Raul On Tue, Feb 23, 2021 at 2:50 AM 'Sergey Kamenev' via Programming wrote: Not. I talked about swapping the arguments x and y inside the verb v. In 'see_arg' in my example 23.02.2021 0:27, Raul Miller пишет: I thou

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-23 Thread 'Sergey Kamenev' via Programming
Yes you are right. This formulation is more correct. Sergey. 23.02.2021 15:47, Hauke Rehr: We’re saying it isn’t. But presently, the order*is* swapped. So we’re arguing we should reverse that swapping of arguments. As you said, it’s counterintuitive. So we all agree it had better been defined

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-23 Thread 'Sergey Kamenev' via Programming
22.02.2021 16:34, Henry Rich: I don't agree about the inuitiveness of the order of v.  I don't see a decisive argument either way, & I am content with leaving it as is. Get a petition with 100 signatures & we can revisit the matter. I don't think there are in all 100 users of J in the world

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-22 Thread 'Sergey Kamenev' via Programming
Not. I talked about swapping the arguments x and y inside the verb v. In 'see_arg' in my example 23.02.2021 0:27, Raul Miller пишет: I thought you were talking about using that verb in a fold operation which proceeds from left to right?

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-22 Thread 'Sergey Kamenev' via Programming
The Fold array, in my opinion, looks more like 'data-like' argument and elements from him need to passed as right arguments to right verb (to 'see_arg' in my example). But they passed as left argument to verb. The verb actually has an initial meaning (in left part) and an array to process

Re: [Jprogramming] Contrintuitive argument order in Fold right verb

2021-02-22 Thread 'Sergey Kamenev' via Programming
I'm talking about the order of the arguments within a verb 'see_arg'. Inside the verb 'see_arg', the initial value must be passed as the left argument, and then (on next iteration) the result of the fold. And as the right value, the values from the collapsing array must be passed. The

Re: [Jprogramming] Bug in new vocabulary &: page

2020-03-28 Thread 'Sergey Kamenev' via Programming
t y into cells so that it can be applied to v.   Every verb operates on cells whose rank is no higher than the rank of the verb. In other words, the splitting is not part of u@:v - it is part of executing v itself. Henry Rich On 3/28/2020 2:58 PM, 'Sergey Kamenev' via Programming wrote: My comme

Re: [Jprogramming] Bug in new vocabulary &: page

2020-03-28 Thread 'Sergey Kamenev' via Programming
collect the results before applying them to u . Henry Rich On 3/28/2020 2:36 PM, 'Sergey Kamenev' via Programming wrote: Health to all! Page: https://code.jsoftware.com/wiki/Vocabulary/ampco Written at the top of the page: Applies verb v to each argument in its entirety, and then applie

[Jprogramming] Bug in new vocabulary &: page

2020-03-28 Thread 'Sergey Kamenev' via Programming
Health to all! Page: https://code.jsoftware.com/wiki/Vocabulary/ampco Written at the top of the page: Applies verb v to each argument in its entirety, and then applies verb u to the result(s) of v The diagram says about &: (bottom to top): * split y into cell * apply v to each cell Nice

Re: [Jprogramming] Android: whis is lowest version supported?

2020-02-04 Thread 'Sergey Kamenev' via Programming
Now working! Thank you 04.02.2020 11:49, bill lam пишет: I can reproduce the crash on Android 5. It was some illegal instruction when running armv7 and api 21/22. An update has been uploaded, please download and try again. Tue, 04 Feb 2020, jprogramming написал(а): 1. Qualcomm Snapdragon 800

Re: [Jprogramming] Android: whis is lowest version supported?

2020-02-04 Thread 'Sergey Kamenev' via Programming
1. Qualcomm Snapdragon 800 2.27 Ghz 2. Android version 5.0 3. Api level 21 4. Kernel architecture: armv7l 04.02.2020 10:25, bill lam пишет: Can you run CPU-Z or similar to check the following, cpu model Android version API level kernel architecture Tue, 04 Feb 2020, Arnab Chakraborty

[Jprogramming] How are boolean arrays stored in memory?

2020-01-30 Thread 'Sergey Kamenev' via Programming
Hi! I read https://code.jsoftware.com/wiki/System/ReleaseNotes/J901. It says about improving the performance of Boolean arrays. Is it due to the fact that it is stored in memory as bits, or as bytes, or still as integers? Sergey.

Re: [Jprogramming] What is the best stack for Linux J programming?

2020-01-30 Thread 'Sergey Kamenev' via Programming
30.01.2020 20:31, Raul Miller: "Best" requires context. I probably use the jqt environment the most, but there are some tasks where jhs is just a better interface. But, also, if I'm targeting a unix command line environment, I might be using vi+jconsole I have never used Kate+konsole for j

[Jprogramming] What is the best stack for Linux J programming?

2020-01-30 Thread 'Sergey Kamenev' via Programming
Hi! 1) JQt 2) Kate + konsole 3) your option Sergey. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Strange behavior write 1!:2 verb

2020-01-26 Thread 'Sergey Kamenev' via Programming
27.01.2020 5:00, Julian Fondren: #! /usr/bin/env ijconsole dot =: 3 : '''.'' 1!:3 <''/proc/self/fd/1''' hardwork =: 3 : 0 n =. 0 for_i. i.100 do. dot'' n =. n + 2 | !!8x end. n ) echo hardwork'' exit 0 Great! Thank you! I slightly

Re: [Jprogramming] Strange behavior write 1!:2 verb

2020-01-26 Thread 'Sergey Kamenev' via Programming
26.01.2020 19:15, Brian Schott пишет: 'aaa' empty@(1!:2) 4 Thank you, Brian! '.' empty@(1!:2) 4 Really no new line after this verb in session mode! But I found another problem. Output of this verb is cached in some buffer and displayed only after invoking 'echo' verb. I see this in

[Jprogramming] Strange behavior write 1!:2 verb

2020-01-26 Thread 'Sergey Kamenev' via Programming
Hi! 'aaa' (1!:2) 2 aaa aaa 'aaa' (1!:2) 4 aa Why echoed text is duplicated? Why I see different types of duplication? I need verb like 'echo' but without printing carriage return. Which standart way for this? Sergey.

[Jprogramming] One more reason for changing argument order in Fold

2020-01-25 Thread 'Sergey Kamenev' via Programming
Hi! Fold verb is very useful for work with concatinating verbs. Current I using this sentense: sOutStr =. '' (] , getStrFromTransOut@[) F.. ] aVOut One symbol longer: sOutStr =. '' (getStrFromTransOut@[ ,~ ]) F.. ] aVOut Ideal option (solution) with another argument order: sOutStr =. '' ([

[Jprogramming] Best version of appleintree verb

2020-01-25 Thread 'Sergey Kamenev' via Programming
Hi! applyintree =: 2 : 0 i =. >^:((1=#)@>) {. n (u`(u applyintree (}.n))@.(1<#n)&.:> i{y) i} y : i =. >^:((1=#)@>) {. n ((x)`(x&(u applyintree (}.n)))@.(1<#n)&.:> i{y) i} y ) This version support all previous features (except double boxing indices) and working with unsupported

[Jprogramming] Why appleintree verb don't working?

2020-01-24 Thread 'Sergey Kamenev' via Programming
Hi! ] y =: ((<1) ,<2) ,: (<<'abc'), <'bb' ┌─┬──┐ │1│2 │ ├─┼──┤ │┌───┐│bb│ ││abc││ │ │└───┘│ │ └─┴──┘ (6 [ ]) applyintree(<1 1) y ┌─┬─┐ │1│2│ ├─┼─┤ │┌───┐│6│ ││abc││ │ │└───┘│ │ └─┴─┘ (6 [ ]) applyintree(1 0; 0) y |length error | ((u

Re: [Jprogramming] Possible error in Fold F..

2020-01-21 Thread 'Sergey Kamenev' via Programming
Sorry. I found my error. 21.01.2020 19:36, Henry Rich пишет: Sorry, I don't understand. Please give a sequence that fails. Henry Rich On 1/21/2020 11:13 AM, 'Sergey Kamenev' via Programming wrote: Sorry. I make error in verb getJsonNode: Forget this: path =. '/' splitstring x 21.01.2020

Re: [Jprogramming] Possible error in Fold F..

2020-01-21 Thread 'Sergey Kamenev' via Programming
Sorry. I make error in verb getJsonNode: Forget this: path =. '/' splitstring x 21.01.2020 18:43, 'Sergey Kamenev' via Programming пишет: sJson =. fread 'btc_block_100.txt' NB. left - boxed elem, right - boxed decoded json getJsonEl =: dyad : 0   string =. >x   fl =. {. y   > 

[Jprogramming] Possible error in Fold F..

2020-01-21 Thread 'Sergey Kamenev' via Programming
Hi! sJson =. fread 'btc_block_100.txt' NB. left - boxed elem, right - boxed decoded json getJsonEl =: dyad : 0 string =. >x fl =. {. y > (1 { y) {~ 1 i.~ string&-:@> fl ) NB. Parsing json path like 'store/book/title' NB. left - path, right - boxed getJsonNode =: dyad : 0 y

[Jprogramming] Maybe someone has a code that forms a bitcoin block?

2020-01-20 Thread 'Sergey Kamenev' via Programming
Hi! I need J code which form transaction(s) and block (including block header) of them? Best if the code will support SegWit feature. Nice day! Sergey -- For information about J forums see

Re: [Jprogramming] How to get array with indices of not-empty elements in sparse array?

2020-01-20 Thread 'Sergey Kamenev' via Programming
20.01.2020 11:39, 'Mike Day' via Programming пишет: 1 2 (1 1;0 2) } 1$.3 4;0 1;0. On j901 also. The question is that Amend should work without indices boxing. -- For information about J forums see

Re: [Jprogramming] How to get array with indices of not-empty elements in sparse array?

2020-01-20 Thread 'Sergey Kamenev' via Programming
20.01.2020 9:10, Ben Gorte: v i } 1$.3 4;0 1;0 NB. amend an 'empty' sparse matrix |index error | v i}1$.3 4;0 1;0 Amend working for 1-dimensional sparse arrays y =. 0 0 0 5 0 0 0 9 ] u =. $. y u 3 │ 5 7 │ 9 5 (1)} u 1 │ 5 3 │ 5 7 │ 9 For two dimensional is possible amend

Re: [Jprogramming] How to get array with indices of not-empty elements in sparse array?

2020-01-19 Thread 'Sergey Kamenev' via Programming
20.01.2020 7:57, Ben Gorte: Do you mean 4$.s ? Thanks. That's what I need. Sergey -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] How to get array with indices of not-empty elements in sparse array?

2020-01-19 Thread 'Sergey Kamenev' via Programming
Hi! ] d=: (?. 3 4$2) * ?. 3 4$100 0 55 79 0 0 39 0 57 0 0 0 0 ] s=: $. d convert d to sparse and assign to s 0 1 | 55 0 2 | 79 the display of s gives the indices of the 1 1 | 39 “non-zero” cells and the corresponding values

Re: [Jprogramming] How to write this code without loop?

2020-01-16 Thread 'Sergey Kamenev' via Programming
The bugs are yours. Thank you! In your second bug, you are not executing 1: .  You should have @: not &: . Does &: not work because of this? https://code.jsoftware.com/wiki/Vocabulary/ampco The monadic use of &: is deprecated. Use @: instead. Some compounds of the form f&:g are not

Re: [Jprogramming] How to write this code without loop?

2020-01-16 Thread 'Sergey Kamenev' via Programming
I believe that i. stops at the first match. So this should work. ({.~0 i.~])4 3 2 8 0 9 1 4 3 2 8 Yes. But in my case I finding result of function. And your decision requires to apply function to all elements source array. Sergey

Re: [Jprogramming] How to write this code without loop?

2020-01-16 Thread 'Sergey Kamenev' via Programming
─┐ │3│0│ └─┴─┘ 0 0 0 For my more clear order: x - ini (previsious) value y - value from array ┌─┬─┐ │0│1│ └─┴─┘ ┌─┬─┐ │0│2│ └─┴─┘ ┌─┬─┐ │0│3│ └─┴─┘ 0 0 0 Thank you! Sergey Henry Rich On 1/15/2020 2:58 PM, 'Sergey Kamenev' via Programming wrote: Hi! I need test function f on array x1 x2

[Jprogramming] How to write this code without loop?

2020-01-15 Thread 'Sergey Kamenev' via Programming
Hi! I need test function f on array x1 x2 ... xn If f(x) = 0 then no need test another member of array. I don't understand how write this code loopless. Main thing: I would avoid of waste computation of f(x) if f(x) = C found. I think about Fold but I see only ugly decision with using global

Re: [Jprogramming] Question about strange verb

2020-01-15 Thread 'Sergey Kamenev' via Programming
r a better and more thorough explanation. Cheers, bob On Jan 15, 2020, at 06:34, 'Sergey Kamenev' via Programming wrote: I thought the fork is an isolated sequence of verbs, like (> ]) Why sentense with noun 100 100 > ] is fork? 15.01.2020 17:21, 'Pascal Jasmin' via Program

Re: [Jprogramming] Question about strange verb

2020-01-15 Thread 'Sergey Kamenev' via Programming
/help/dictionary/dictf.htm 15.01.2020 17:21, 'Pascal Jasmin' via Programming пишет: (100 > ]) is a verb.  (it is a fork equivalent to (100&>)@:] ) On Wednesday, January 15, 2020, 09:15:05 a.m. EST, 'Sergey Kamenev' via Programming wrote: Hi! Power verb has 3 variant of

Re: [Jprogramming] Question about strange verb

2020-01-15 Thread 'Sergey Kamenev' via Programming
9:15:05 a.m. EST, 'Sergey Kamenev' via Programming wrote: Hi! Power verb has 3 variant of w: u^:w y noun, verb, gerund. In example on https://code.jsoftware.com/wiki/Vocabulary/hatco#DoWhile I see sentense: 3&*^:(100 > ])^:_ (5) 100 > ] is not noun, verb or gerund. (100&am

[Jprogramming] Question about strange verb

2020-01-15 Thread 'Sergey Kamenev' via Programming
Hi! Power verb has 3 variant of w: u^:w y noun, verb, gerund. In example on https://code.jsoftware.com/wiki/Vocabulary/hatco#DoWhile I see sentense: 3&*^:(100 > ])^:_ (5) 100 > ] is not noun, verb or gerund. (100&>)@] is verb Why she's (100 > ]) working in power verb? Nice day! Sergey