Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
3452 is lesser than 23453 > > > Dec 21, 2023, 15:19 by henryhr...@gmail.com: > >> I don't understand the problem statement. >> >> Henry Rich >> >> On 12/21/2023 10:17 AM, 'Viktor Grigorov' via Programming wrote: >> >>> Maybe

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
enry Rich > > On 12/21/2023 10:17 AM, 'Viktor Grigorov' via Programming wrote: > >> Maybe a table, summation and a sort using that: >> >>    (/: ([:+/(>/]))) _10 1 10 20 _30 15 25 30 0 >> Can't imagine that being efficient, but it's better

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
> Not quite though. Had I 5 hands, that'd be !4 booleans. > > > Dec 21, 2023, 14:11 by programm...@jsoftware.com: > >> >> 1 0 0 1 0 /:~ i.5 >> >> 1 2 4 0 3 >> >> >> On Thursday, December 21, 2023 at 09:03:34 a.m. EST, 'Viktor Grigor

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
Not quite though. Had I 5 hands, that'd be !4 booleans. Dec 21, 2023, 14:11 by programm...@jsoftware.com: > > 1 0 0 1 0 /:~ i.5 > > 1 2 4 0 3 > > > On Thursday, December 21, 2023 at 09:03:34 a.m. EST, 'Viktor Grigorov' via > Programming wrote: > &

[Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
Hey, Is there an easy way to sort an array with verb returning either 0 or 1, like the comparison primitives? The verb that I'd in mind relates to the 2023's advent of code's day 7: given two equal length hands, which one has the first high card. Which one can write as:    'K2345' ( 2 | 0 {

Re: [Jprogramming] Get all indexes of a boolean array

2023-12-11 Thread 'Viktor Grigorov' via Programming
> condition? > > You might note that Henry Rich proposed the same solution to LdBeth's enquiry. > He (HR) might understand what you're driving at! > > Cheers, > > Mike > > On 11/12/2023 17:09, 'Viktor Grigorov' via Programming wrote: > >>

Re: [Jprogramming] Get all indexes of a boolean array

2023-12-11 Thread 'Viktor Grigorov' via Programming
A fully tacit solution would encapsulate the predicate too, here parenthesized for emphasis:    ($ #: [: I. [: (5&=) ,)  (>:i.8)* 8 8 $ 1j2 # 1 4 1 4 4 4 7 Dec 11, 2023, 17:01 by programm...@jsoftware.com: > I see Pablo has just replied, but here's a similar/same approach, as a tacit > expr

[Jprogramming] i.y for big y

2023-12-01 Thread 'Viktor Grigorov' via Programming
Hey, Excuse the possibly inappropriate title. Many projecteuler.net past the first, say, 80 problems are or seem to be hard to brute force, at least the way I want to write J code. For .https://projecteuler.net/problem=413 for example, the below verb does the job, but 1e19 is a bit too big an i

Re: [Jprogramming] Report of the J wiki group meeting of November 2, 2023

2023-11-13 Thread 'Viktor Grigorov' via Programming
Good point. Some here use version 601. The page diffs, as provided by the wiki, are nice, but require too many clicks and parsing to be a quick reference. A clickable version table in the top right of the page, opposite the ToC, say, that uses links from the page's Wiki history would be suitable

Re: [Jprogramming] (no subject)

2023-10-17 Thread 'Viktor Grigorov' via Programming
changes the context of > $: which means that it also changes the definition used for evaluating > $: -- so you'll need to do something about that. There's several > possibilities, and using a name for the $: phrase is one of those. > > I hope this helps, > > -- > Raul

Re: [Jprogramming] (no subject)

2023-10-17 Thread 'Viktor Grigorov' via Programming
Additionally, it's not exactly that variables are the issue, since inline verb assignment gives the 5 2 2-shaped result as well    ( (q=:...) @ (w=:...) ) 50 25 33 22 293 The definitions are 'correct' though, when used otherwise    (q@w) ... --

[Jprogramming] (no subject)

2023-10-17 Thread 'Viktor Grigorov' via Programming
Hey, I have a bit of code I want to include into something large, but I'm hitting a wall.    ({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1(|:@,:1:))50 25 33 22 293 1 2 1 1 3 Okay. Slap on some parens, and it fails? Valence error for {:..? Both resolve to 3, a verb, according to 4!:0. Beca

[Jprogramming] Issue with dual/under

2023-10-13 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, While working on something, I came upon the following: Why does (|. &. ,) i.3 3 result in a domain error (likewise with &.:), while ($ $ (|. @ ,) ) i.3 3 doesn't? The obverse of ravel hasn't changed, and the shape while unraveled hasn't either. -

Re: [Jprogramming] J build fail

2023-08-21 Thread &#x27;Viktor Grigorov&#x27; via Programming
support and test for a limited number of platforms, "musl" is not > one of them. > You can narrow down by removing the support of libgmp. J still works but > without extended integer support. > > On Tue, 22 Aug 2023 at 12:53 PM 'Viktor Grigorov' via Programming

Re: [Jprogramming] J build fail

2023-08-21 Thread &#x27;Viktor Grigorov&#x27; via Programming
it, the extra performance, or rather, the default one. I don't know enough about standard library variants, nor low-level programming to tell whether this is it. If any of you can tell at a glace I'd be mighty thankful. Aug 22, 2023, 04:23 by bbill....@gmail.com: > Make files

[Jprogramming] J build fail

2023-08-21 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, I cloned the jsource repository. Checked out 9.5.0-beta5 Executed build_all.sh script in make2/ to successfully compile. Executing the executable jconsole I get return code 134 with JE has crashed, likely due to an internal bug.  Please report the code which caused the crash, as well as the

Re: [Jprogramming] Syntax Highlighting: Special Combinations

2023-07-30 Thread &#x27;Viktor Grigorov&#x27; via Programming
My twopence: Worth confirming: did you mean syntax highlighting on wiki pages or for the various text editors? Can't speak for jQt IDE.The answer for both is 'yes', certainly for the simpler ones. Easier for the former, I reckon. Consider also: should special combinations receive one color, that

Re: [Jprogramming] Advent of Code 2022 in J, as a tutorial

2023-06-02 Thread &#x27;Viktor Grigorov&#x27; via Programming
I'd agree that examples are great, e.g., Rosetta Code is a great compendium of programming language equiproblem solution comparisons. A comma-delimited listing of would be too much, as there aren't that many J active users, at least judging from the names I've seen past 2 years on the general an

[Jprogramming] bug?

2023-05-31 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hello, I'm getting 'length error, executing monad (i.x)&|' for    ((i.3) & |."(0 _) ]) i.3 but not for     (i.3) ([ |."(0 _) ]) i.3 Why is that? Other primitive dyads work in rotate's place. Current nuvoc page on rotate has nothing relevant. I well may be be missing something obvious. -

Re: [Jprogramming] J - bootstrapped

2023-05-13 Thread &#x27;Viktor Grigorov&#x27; via Programming
I'd written a zsh script for querying   https://www.jsoftware.com/cgi-bin/forumsearch.cgi I could send it, if you'd like. May 13, 2023, 18:24 by earthspo...@gmail.com: > Okay, found what I was thinking of by searching for my own name in > Pipermail from the beginning. > BTW - what's the best wa

Re: [Jprogramming] j9.4.1 release is available

2023-03-02 Thread &#x27;Viktor Grigorov&#x27; via Programming
Minor quip: the shell script in the general linux zip 'bin/install-usr.sh' should include this line near the top cd "$(dirname "$(readlink -f "$0")")" || exit; or one to the same same, I'm not familiar with posix sh word splitting so I overdo the quotes, hopefully not the opposite effect. This

Re: [Jprogramming] type-independent histogram/occurence count/frequency?

2022-09-11 Thread &#x27;Viktor Grigorov&#x27; via Programming
ment of the nub; no extra mapping required. > > -E > > On Mon, 12 Sep 2022, 'Viktor Grigorov' via Programming wrote: > >> Hey, >> >> Whilst getting back to a Markov text generator in J, I quickly came to the >> issue of all top-result verbs for histogr

Re: [Jprogramming] type-independent histogram/occurence count/frequency?

2022-09-11 Thread &#x27;Viktor Grigorov&#x27; via Programming
Deleted too much: "One'd have to reshapre items appropriate, adding a dimension, to deal with lists." is what I meant to write. Sep 12, 2022, 07:50 by programm...@jsoftware.com: > Hey, > > Whilst getting back to a Markov text generator in J, I quickly came to the > issue of all top-result verbs

[Jprogramming] type-independent histogram/occurence count/frequency?

2022-09-11 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, Whilst getting back to a Markov text generator in J, I quickly came to the issue of all top-result verbs for histograms, found querying the wiki and the mailing lists, to be dealing with numeric types only. One'd have to reshape the items appropriately to a new dimension. But if one has n-

[Jprogramming] J904 refsheet release

2022-08-15 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, I am happy to announce the completion of the final draft, that is, the release of the J904 reference sheet.  I don't want to repeat myself, I wrote about it somewhat in the link belowhttps://code.jsoftware.com/wiki/User:Viktor_Grigorov/j90xrefsheet I would hope that enough people have ide

Re: [Jprogramming] J90X refcard

2022-08-14 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, Thank you for the hearty feedback. I'll reply inline, for ease of reading. Aug 15, 2022, 03:12 by artan...@comcast.net: > > > Comments on draft J90X refcard (Version b.c1.pdf, with footnotes in each > section). > (JPJ refers to related comments of Jan Pietr-Jacobs on 12 Aug.) > > Format:

Re: [Jprogramming] Poll questions: new refcard

2022-08-10 Thread &#x27;Viktor Grigorov&#x27; via Programming
For those using xclip (xsel, and the like) # 1. 1--100 LF sep'd; 2. something to ".  seq -w 100 | xclip   printf %s\\n '-1 -2 -3' '11 22 33' | xclip  ". ;._1 LF,shell'xclip -o' there are two other clipboards, would also ease selection, and forgo multiline line in the console Aug 10, 2022, 16:20

Re: [Jprogramming] Draft reference card for J9.04

2022-08-09 Thread &#x27;Viktor Grigorov&#x27; via Programming
Possibly Germany, if you look at older STEM articles from mid 20. century they used Gothic Blackletter script for sine and the rest trigonometric funs. \Re and \Im are defined in article class and memoir, so they may well be old. Aug 10, 2022, 00:28 by elro...@elronnd.net: > > I am curious whe

Re: [Jprogramming] Poll questions: new refcard

2022-08-06 Thread &#x27;Viktor Grigorov&#x27; via Programming
I initially wanted to do a plaintext version with ANSI C escape codes; and HTML one; and the TeX one. The first proved very annoying after two tables; the second very annoying given special/reserved HTML characters that should be escaped, and the third almost likewise. An internal and official o

Re: [Jprogramming] Wiki update video and revised promo video

2022-07-29 Thread &#x27;Viktor Grigorov&#x27; via Programming
Butting in---why not 'code search', if that is what it explicitly facilitates? And if not, then I'd say I've been misled. Jul 29, 2022, 03:42 by programm...@jsoftware.com: > Hi Ian, > > Thanks for the feedback and the topic list for future videos. Were you > thinking of a documentary style form

Re: [Jprogramming] strange request

2022-07-26 Thread &#x27;Viktor Grigorov&#x27; via Programming
I have if.1=#e=.,(])`((is&(,@;))/)@.(1<#)([:(a:&~:#])<"1@(w(-.@([e.])#[)w((-.@((i.@#@])e.(([(=i.1:)])"0 1)))#])])@;@((1<#@>)#])@:,"2@((F=.<"1 frc q){]))y do. I think this could still be valid if one uses an extra dimension without boxing. The agenda's y is a list of boxes. After the empty ones a

Re: [Jprogramming] scatter amend of boxed y

2022-07-22 Thread &#x27;Viktor Grigorov&#x27; via Programming
I was on the right track going with 27, but it was indeed three times. From the wiki: 3. Argument x must have the shape of a cell of  m{y The so the shape is 3 3, it seems which     9 9 $, (<"0 (3 3$__) ) ((1;1;Q;Q);(Q;Q;1;1);,(<1;Q;1;Q)) } <"0 i.4#3 Jul 23, 2022, 00:50 by programm...@jsoftware

[Jprogramming] scatter amend of boxed y

2022-07-22 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, I just got to using scatter amend. I cannot figure out in what form it wants x when everything is boxed. It whines about length. My case is: y is boxed array of shape 3 3 3 3 m is a boxed array of shape 3, ultimately selecting 21 cells, a face, row, and column (if you "9 9$," the y) For x

Re: [Jprogramming] local scope or more structured x and y?

2022-07-21 Thread &#x27;Viktor Grigorov&#x27; via Programming
Typos can make this unreadable, I apologize. Here it is corrected: Looking through the code for my sudoku solver, I think I found the (or a) reason why it wasn't working. I keep track of all unsolved cells' possble values. If a cell gets solved, the cells of its face, row, column get updated by

[Jprogramming] local scope or more structured x and y?

2022-07-21 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, all, Looking through the code for my sudoku solver, I think I found the (or a) reason why it wasn't working. I keep tracking of all unsolved cells' possble values. If a cell gets solves, the cells of its face, row, column get updated by just removing the value just solved for using "e.". Ea

Re: [Jprogramming] LaTeX question: J-boxed display

2022-07-18 Thread &#x27;Viktor Grigorov&#x27; via Programming
Thanks for the responses. Hauke Rehr, I do enjoy exploration of approaches to a problem. Ewart Shaw, your J-to-TeX is very impressive, although parameters for boxes require some tweaking mysides at least. Keeping files separate requires thinking about names and disallows quick edits, but keeps t

Re: [Jprogramming] LaTeX question: J-boxed display

2022-07-16 Thread &#x27;Viktor Grigorov&#x27; via Programming
Thanks. I should have responded earlier with the solution we went with provided from a tex stackexchange bloke: \usepackage{listofitems} \newlength\maxht \newlength\maxdp \newcommand\cbox[1]{%   \readlist*\mylist{#1}%   \maxht=0pt%   \maxdp=0pt%   \foreachitem\z\in\mylist[]{%     \setbox0=\hbox{\

Re: [Jprogramming] LaTeX question: J-boxed display

2022-07-13 Thread &#x27;Viktor Grigorov&#x27; via Programming
In the attached image, which I hope actually get sent, you'll see 1. \fbox, then a tabular with a 1 in the first cell and a tabular with a single 2 in the second cell (more or less, the tex se q), a verbatim of the output of the of <(<1),<<2 from jconsole, a tcolorbox failure and some other fail

[Jprogramming] Questionable cut and circle part of sentence?

2022-07-13 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, Should the circle function o. not be internally defined as an adverb similarly to b.? Both do use their left argument only to define the action of the verb. Should a similar argument be made about the conjuction cut ;. and its n, which has only 8 possible values? What are the good reasons

Re: [Jprogramming] comparison

2022-05-17 Thread &#x27;Viktor Grigorov&#x27; via Programming
I get domain errors for most of the values above 1e_11 May 17, 2022, 18:59 by rauldmil...@gmail.com: > On Tue, May 17, 2022 at 10:22 AM 'Viktor Grigorov' via Programming > wrote: > >> 9!:19 0.1 >> 9!:19 1.8e_5 >> ({.e.}.)"1 w

Re: [Jprogramming] comparison

2022-05-17 Thread &#x27;Viktor Grigorov&#x27; via Programming
Then, I guess, this is a suboptimal way of solving the problem. Keeping track of the digits in a seperate variable in a recursive tacit function seems like a pain compared to being removing limitations on comparisons. 4--5 decimal places is more than enough for this case. May 17, 2022, 17:54 b

Re: [Jprogramming] comparison

2022-05-17 Thread &#x27;Viktor Grigorov&#x27; via Programming
for tolerance, a 1 is not to be expected >>> so what do you want to achieve, what do you expect and why? >>> >>> >>> Am 17.05.22 um 16:22 schrieb 'Viktor Grigorov' via Programming: >>> >>>> Hey, >>>> >>>>

Re: [Jprogramming] comparison

2022-05-17 Thread &#x27;Viktor Grigorov&#x27; via Programming
Here's my solution, working with remainders only, with the recursion happening only on members past the first (which would correspond to the first digit in the brackets in the notation used in the problem),  ({{($:`(<:@#))@.({.e.}.)y=.((1&|@%@{.),])y}}@(1&|)@:%:) Given I'm not using extended pre

[Jprogramming] comparison

2022-05-17 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, I'm working on project euler 80, and I'm getting stack errors. Tracing the values, step by step, everything is in order, other than the comparison. I have the following:    ]w=:{{  ((1&|@%@{.),])y }}^:(>:i.5) @(1&|)@%: 23 0.256547 0.795832    0    0    0    0 0.897916 0.256

Re: [Jprogramming] jreference addon request for comments

2022-05-17 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hey, Swell idea and implementation. I want to make a new or myown j90x reference sheet, and have on using TeX in the works. But I also wanted to do a html version, an ascii version, an ANSI C escape codes version, and possibly and md version. I also wanted to do a J verb that would spit out eit

Re: [Jprogramming] sudoku solver

2022-02-26 Thread &#x27;Viktor Grigorov&#x27; via Programming
Thank you, Raul, you gave me a few ideas with this. The first was to do the properly renew all could-be numbers after each amend. Getting only the the indices of the cells with could-be numbers of the face, row, column of a particular cell would be a hassle, so it just looks for cells with >1 el

[Jprogramming] sudoku solver

2022-02-26 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hello, I would like to share my progress with the sudoku solver I started awhiles back. I combed and tested every line, I discovered a major mistake, namely indices of a wrong face of the 3 3 3 3 mat, one not corresponding to one of the 9 big squares (when shaped as 9 9). I'm still disappointed

Re: [Jprogramming] HMAC and PBKDF2

2022-02-02 Thread &#x27;Viktor Grigorov&#x27; via Programming
Thank you for that, I see the issues in my attempt. Two comments perhaps more pertinent to the people attempting to revitalize the wiki: how is one to know: - that arbitrary(?) base numberal to decimal exist, matching the regex '\d+b_?\w+'? - how is one to know of the existence of hdf/dfh?---I d

Re: [Jprogramming] HMAC and PBKDF2

2022-02-02 Thread &#x27;Viktor Grigorov&#x27; via Programming
end. > x{.y,x#{.a. > }} > > FYI, > > -- > Raul > > On Wed, Feb 2, 2022 at 6:51 AM Raul Miller wrote: > >> >> On Wed, Feb 2, 2022 at 4:41 AM 'Viktor Grigorov' via Programming >> wrote: >> > I wanted to see if J could be faster

[Jprogramming] HMAC and PBKDF2

2022-02-02 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hello, I wanted to see if J could be faster than bespoke C programs (specifically aircrack-ng, ~10k/s on my machine). From the wiki pages for SHA1 (turns outs there exists a foreign so I dropped it), HMAC, and PBKDF2I assembled: sha1=:1&(128!:6) bs=:512%8 NB. block size in bytes for md5, sha1, sh

[Jprogramming] sudoku solver

2021-10-13 Thread &#x27;Viktor Grigorov&#x27; via Programming
Hello, Recently I saw an article in lobste.rs (https://www.hillelwayne.com/post/sudoku/) about sudoku solving, and though t, "it'd be nice to try it J". (Didn't even bother reading it, but later glancing at it found the author had used J in the end. :D) I reshape a list of integers of length 8

[Jprogramming] >2-dimensional matrix multiplication

2021-06-28 Thread &#x27;Viktor Grigorov&#x27; via Programming
Nabble-fora are in a sickly state, refusing full perusal, so excuse me if this's been answered.. I wanted an x-dimensional y-rank identity matrix. With an auxilliary verb to get a main diagonal from an arbitrarily-dimensional square array verb: md=: (|:~(<@i.@#@$)) I assured the following verb