Re: [Jprogramming] hello and announcement on implementation of web form server system for adding forms to Jconsole function

2023-12-21 Thread Yuji Suda
To Raul - In the early stage of development, in windows, the install directory is defined as Users home directory.  But it turned out that there can be a space character ' ' in the name of home directory, such as 'c:\Users\yuji suda', this never happens in MacOS and Linux where

Re: [Jprogramming] hello and announcement on implementation of web form server system for adding forms to Jconsole function

2023-12-21 Thread Yuji Suda
To LdBeth - The source scripts are in two zip files.    making_basic_ver_0_1.zip for simple server and client system to test infinite core loop for server socket communication    making_ver_0_1.zip  for web form server system based on server core loop with http protocol

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Elijah Stone
For toposort, though, you'd presumably want a cleverer strategy than just sorting the nodes, doing a full graph traversal on each comparison. Alpha-beta pruning I don't know about. On Thu, 21 Dec 2023, Henry Rich wrote: Topological sorting was a big topic in graphics back in the day. I can i

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Henry Rich
Topological sorting was a big topic in graphics back in the day. I can imagine that during alpha -beta pruning you might run into some ordering requirements that require more than simple keys. Henry Rich On Thu, Dec 21, 2023, 9:56 PM Elijah Stone wrote: > > The problem it has is that if elemen

Re: [Jprogramming] testing for J version or later

2023-12-21 Thread Raul Miller
Hmm... only if we're updating stdlib, supporting versions of J back to 4.0.1. A worthwhile effort, though, if someone was actually tackling those issues. Otherwise, I think an idiom would be about as good as it gets. -- Raul On Thu, Dec 21, 2023 at 9:24 PM Ian Clark wrote: > > For those of us

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Elijah Stone
Oh yeah, unicode collation! That's a fun time. Floats is annoying. You should probably get a choice of invalid operation exception on nan or straight sign-magnitude interpretation (which is consistent with ieee total order). But I do concede that either way you probably want special code fo

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Marshall Lochbaum
> I am curious what applications there are that really need a user-specified > comparison function (rather than just a sort key, like dyadic /: takes). There must some applications out there with some sort of smart string ordering that couldn't be reduced to array ordering. And of course in a lang

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Elijah Stone
On Thu, 21 Dec 2023, Marshall Lochbaum wrote: This is a stable algorithm Yeah--it's the naive in-place version that's unstable. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Elijah Stone
The problem it has is that if elements compare equal but don't match then it'll never get down to an array where ~.y has length 1. Right, of course. Shame on me for being lazy and not bothering to write out *./2 u/\y. Modern quicksort hybrids ... always use one bit at a time. I am curious

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Marshall Lochbaum
This is a stable algorithm because it only ever changes the order of elements if one's less than the pivot and the other isn't. The problem it has is that if elements compare equal but don't match then it'll never get down to an array where ~.y has length 1. You get a stack error on (<&:*qs _1 2 3)

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Marshall Lochbaum
You can get a three-result comparison from a boolean c by using it twice, (c-c~). See https://www.jsoftware.com/papers/50/50_00.htm . If this fails to distinguish elements then they are equivalent under the ordering, so a stable algorithm has to maintain their input order. It's my opinion that sor

[Jprogramming] testing for J version or later

2023-12-21 Thread Ian Clark
For those of us digital archaeologists running back-levels of J, it would be nice to have a robust test for a given version of J or later which tolerates versions down to 4.01, say. What represents best-practice? The best I can come up with is: jversion=: 3 : 0 ". 'j.' -.~ '/' taketo 9!:14''

Re: [Jprogramming] hello and announcement on implementation of web form server system for adding forms to Jconsole function

2023-12-21 Thread Yuji Suda
Comment on testing web form server sample application in j9.5.1 just released - If the web form server system is tested in the latest j9.5.1, the definition file has to be revised to require addons 'bmp' and 'png'  in the sample application of 52_hokusai_komon_image_galary_j9_5

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Pascal Jasmin' via Programming
The same output of your quoted "program" \:~ _10 1 10 20 _30 15 25 30 0 30 25 20 15 10 1 0 _10 _30 I may have misunderstood your original question, based on subject line.  You appear to want to sort card hands. You would want to encode cards as integers, where 2-A maps to 0-13.  It is a good

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Raul Miller
Yeah, I was talking about a stable quicksort, like we see at https://code.jsoftware.com/wiki/Essays/Quicksort I guess if you don't care about search stability you can eliminate the equality test against the pivot value. Thanks, -- Raul On Thu, Dec 21, 2023 at 5:07 PM Elijah Stone wrote: > > T

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Elijah Stone
The quicksort I know does not care whether elements are out of order. Example: qs=. {{ NB.quicksort adverb; u compare, y array if. 1>:#~.y do. y return. end. NB.ignore ~. p=. y{~?#y s=. y u"_1 _ p (u qs s#y) , (u qs (-.s)#y) }} It is unstable, but that is to be expected. And it can be mad

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Raul Miller
It's probably worth noting here that (for example) the quicksort algorithm relies on being able to tell whether items are equal. And a 0 1 result can't distinguish between ordering and equality. Many sorting implementations rely on a _1, 0, 1 result, as a consequence. That said, you could implemen

[Jprogramming] Compile Jqt for macOS

2023-12-21 Thread glam via Programming
I tried to start jqt from the desktop shortcut, after I install J on macOs, but it fail to start.So I tried to recompile jqt for macOs. First I tried to install Qt from source, but fail.Then i use the Qt online installer for macOS, and install the Qt version 6.5.3.Just follow the Guide to compil

Re: [Jprogramming] J9.5.1 release available

2023-12-21 Thread Eric Iverson
Did you use winget or AIO? I think the install is either in your home folder or in the windows system folder for program files. In any case, if you get J running, the following might help: jpath'~install' On Wed, Dec 20, 2023 at 9:24 PM Devon McCormick wrote: > I followed the Windows installa

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Henry Rich
(/: verb-to-put-cards-in-order) table-of-hands For poker, verb-to-put-cards-in-order is vtpcio =. '23456789TJQKA'&i.    (/: vtpcio) _5 ]\ 'A22345323452' 23452 23453 2 A Henry Rich On 12/21/2023 10:29 AM, 'Viktor Grigorov' via Programming wrote: The first example is lesser, m

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
The first example is lesser, my bad! Dec 21, 2023, 15:27 by programm...@jsoftware.com: > I have a list that I would like to sort using a verb that outputs 0 or 1, > depending on the two items compared. Since there are length-1 factorial > possible pairings and hence booleans, I'd thought of th

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
I have a list that I would like to sort using a verb that outputs 0 or 1, depending on the two items compared. Since there are length-1 factorial possible pairings and hence booleans, I'd thought of the table. Here, the items are hands of playing cards. One hand is greater than another, if at a

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread Henry Rich
I don't understand the problem statement. Henry 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 than nothing. The verb I'd

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Viktor Grigorov' via Programming
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 than nothing. The verb I'd defined can't deal with rank 2 nouns anyways. Dec 21, 2023, 14:21 by programm...@jsoftware.com: > Not quite though. Had I

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: > > Hey, > > Is there an easy way to sort an

Re: [Jprogramming] sorting using verb returing a boolean

2023-12-21 Thread 'Pascal Jasmin' via Programming
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: 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'

[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] J9.5.1 release available

2023-12-21 Thread bill lam
android J9.5.1 release available at * http://www.jsoftware.com/download/j9.5/install/ On Thu, Dec 21, 2023 at 3:20 AM Eric Iverson wrote: > J9.5.1 release available > > If you were running the 9.5 beta, do a full install to get everything and > have a clean slate. Do not just do an engine upgrad

Re: [Jprogramming] J9.5.1 release available

2023-12-21 Thread bill lam
Does typing JVERSION help? On Thu, Dec 21, 2023 at 10:24 Devon McCormick wrote: > I followed the Windows installation instructions and I think it worked but > I can't tell and I have to guess where it was installed since there is no > helpful message at the end saying something like "Successfull