Re: [Jprogramming] Bug in sorting?

2023-12-28 Thread bill lam
I got a similar result. I believe this bug is related to the boolean
argument.
coercing the array to integer can work correctly.

p =. 00 + 8 2 $ 0 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0

On Thu, Dec 28, 2023 at 6:02 PM Marcin Żołek <
marcin.zo...@students.mimuw.edu.pl> wrote:

> Hello,
> I was trying to run my code on j9.4 Linux, j9.4 MacOS, j9.5 MacOS and it
> crashes.
>
> In terminal
> /Applications/j9.5/bin/jconsole bug.ijs < input.txt
> JE has crashed, likely due to an internal bug.  Please report the code
> which caused the crash, as well as the following printout, to the J
> programming forum.
> Could not generate stack trace: no debug info in Mach-O executable (-1)
> ...
>
> -
> 5 3 1 1[1]6692 abort  /Applications/j9.5/bin/jconsole bug.ijs <
> input.txt
>
> bug.ijs:
> ":@((#/.~ +/@, ~.)@/:~)@(".;._2)&.stdin''
>
> input.txt:
> 0 0
> 1 1
> 1 0
> 0 0
> 0 1
> 1 0
> 1 0
> 0 0
> I figured out that the problem is with sorting:
> p =. 8 2 $ 0 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0
> p
> 0 0
> 1 1
> 1 0
> 0 0
> 0 1
> 1 0
> 1 0
> 0 0
> /:~ p NB. returns various and wrong results
> 0 0
> 0 0
> 0 0
> 1 0
> 1 0
> 1 0
> 1 1
> 1 1
>
> or
>
> 0 0
> 0 0
> 0 0
> 1 0
> 1 0
> 1 0
> 0 0
> 0 0
> ~.@:/:~ p NB. crashes jqt
>
> Best regards,
> Marcin
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


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 upgrade.
>
> https://code.jsoftware.com/wiki/System/Installation/J9.5
>
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
>
> The 9.6 beta starts in early 2024.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


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 "Successfully installed at
> location XYZ" or whatever.
>
> On Wed, Dec 20, 2023 at 2:20 PM 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 upgrade.
> >
> > https://code.jsoftware.com/wiki/System/Installation/J9.5
> >
> >  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
> >
> > The 9.6 beta starts in early 2024.
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta9 available

2023-12-14 Thread bill lam
The latest base library is 9.5.5 so yours has been updated.

It uses windows stock curl.exe for http fetch therefore certificates come
from windows. Did you get windows update?

On Fri, Dec 15, 2023 at 03:59 'Michael Day' via Programming <
programm...@jsoftware.com> wrote:

> I'm still getting an error, reported earlier for beta 7 (msg copied
> below), when using upgrade - still can't
> see why.  The laptop has been through many on/off switches,  so it's not
> a transient error.
>
> I think I've updated to beta9 by using the zip file.  Jversion info
> follows my sign-off.  I see the Library
> verson is 9.5.5 .
>
> However,  a similar problem occurs when I try to update addons using
> Package Manager.   A dialog box
> diagnostic shows the same message as below in my earlier msg about beta
> version 7:
> "Connection failed: curl: (35) ... for the certificate"
>
> So I can't keep my addons up-to-date unless I can download them
> "manually" from jsoftware.com,  but
> I don't know/remember their location.
>
> Bill had suggested updating the base libraries - are they in addons?
>
> Thanks for any help,
>
> Mike
>
> JVERSION
>
> Engine: j9.5.0-beta9/j64/windows
>
> Build: commercial/2023-12-06T14:20:54/clang-16-0-6/SLEEF=1
>
> Library: 9.5.5  <<<< is this wrong
>
> Qt IDE: 2.5.1/6.5.3(6.5.3)
>
> OS Ver: Windows 11 Version 22H2 10.0.22621
>
> Platform: Win 64
>
> Installer: j9.5 install
>
> InstallPath: c:/d/j9.5
>
> Contact: www.jsoftware.com
>
>
> On 29/11/2023 18:56, Michael Day wrote:
> > Never mind vn 7 or 8,  I'm getting this error (I've added some
> > line-feeds):
> >
> > <<
> >load'pacman'
> >'upgrade'jpkg'jengine'
> >
> > Connection failed: curl: (35) schannel: next InitializeSecurityContext
> > failed:
> > Unknown error (0x80092012) - The revocation function was unable to
> > check revocation for the certificate.
> >
> > Connection failed:
> >
> > curl: (35) schannel: next InitializeSecurityContext failed: Unknown
> > error (0x80092012) -
> > The revocation function was unable to check revocation for the
> > certificate.
> >
> > upgrade - read jengine folder failed
> > |syntax error in je_update, unexecutable fragment (noun verb)
> > |   log'upgrade - read jengine folder failed'return
> >
> > >>
> >
> > Any ideas?  My set-up or J-side?
> >
> > (I could presumably reinstall from scratch,  but still...)
> >
> > Thanks,
> >
> > Mike
> >
> > On 29/11/2023 18:00, Eric Iverson wrote:
> >> j9.5.0-beta7 available
> >>
> >> If you already run the beta, then upgrade is easy:
> >> load'pacman'
> >> 'upgrade'jpkg'jengine'
> >>
> >> To install 9.5 beta:
> >> https://code.jsoftware.com/wiki/System/Installation/J9.5
> >>
> >> Release notes:
> >> https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
> >>
> >> Questions/bug reports/etc. should go to the beta forum.
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jprogramming] Six cards

2023-12-10 Thread bill lam
https://ibb.co/XLn0bxH

The each of the 6 cards is missing a number that is present in the
remaining 5 cards.
By asking a player a number is present in the card or not, the number can
be deducted. Eg, 55 is missing in the top left card.

The problem is to generate all 6 cards in J.
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta9 available

2023-12-08 Thread bill lam
j9.5.0-beta9 android available.
http://www.jsoftware.com/download/j9.5/install/

On Thu, Dec 7, 2023 at 12:47 AM Eric Iverson 
wrote:

> j9.5.0-beta9 available
>
> With luck this is the final beta and the release will be by year end. Last
> chance to help check things out and ensure the release is stable and meets
> your needs.
>
> If you already run the beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> To install 9.5 beta:
>  https://code.jsoftware.com/wiki/System/Installation/J9.5
>
> Release notes:
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J for android (Pixel 8) & other platforms

2023-12-04 Thread bill lam
Good observation. I am also thinking of moving the user folder to public
location such as download folder so that J scripts will be visible by
default.

On Tue, Dec 5, 2023 at 00:59 J. Patrick Harrington  wrote:

> Quick followup. I realized you don't have to mess with (somewhat
> awkward) AV File Manager to see files in Android/data. I finally looked
> at J documentation at wiki/Plot/Commands/Output commands and saw pdf
> [file w h]! Never knew you could direct the plot to any desired folder.
> So I just changed pd 'pdf' in my code to
>
> pd 'pdf /storage/emulated/0/Documents/my_plot,pdf'
>
> and the plot goes to the *readable* Documents folder.
>
> --Patrick
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta7 available

2023-11-30 Thread bill lam
j9.5.0-beta8 android available.
http://www.jsoftware.com/download/j9.5/install/


On Thu, Nov 30, 2023 at 2:01 AM Eric Iverson 
wrote:

> j9.5.0-beta7 available
>
> If you already run the beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> To install 9.5 beta:
>  https://code.jsoftware.com/wiki/System/Installation/J9.5
>
> Release notes:
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta7 available

2023-11-30 Thread bill lam
Can you try upgrading the base library and restart J to test again?

On Thu, Nov 30, 2023, 2:56 AM 'Michael Day' via Programming <
programm...@jsoftware.com> wrote:

> Never mind vn 7 or 8,  I'm getting this error (I've added some line-feeds):
>
> <<
> load'pacman'
> 'upgrade'jpkg'jengine'
>
> Connection failed: curl: (35) schannel: next InitializeSecurityContext
> failed:
> Unknown error (0x80092012) - The revocation function was unable to check
> revocation for the certificate.
>
> Connection failed:
>
> curl: (35) schannel: next InitializeSecurityContext failed: Unknown
> error (0x80092012) -
> The revocation function was unable to check revocation for the certificate.
>
> upgrade - read jengine folder failed
> |syntax error in je_update, unexecutable fragment (noun verb)
> |   log'upgrade - read jengine folder failed'return
>
>  >>
>
> Any ideas?  My set-up or J-side?
>
> (I could presumably reinstall from scratch,  but still...)
>
> Thanks,
>
> Mike
>
> On 29/11/2023 18:00, Eric Iverson wrote:
> > j9.5.0-beta7 available
> >
> > If you already run the beta, then upgrade is easy:
> > load'pacman'
> > 'upgrade'jpkg'jengine'
> >
> > To install 9.5 beta:
> >   https://code.jsoftware.com/wiki/System/Installation/J9.5
> >
> > Release notes:
> >   https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
> >
> > Questions/bug reports/etc. should go to the beta forum.
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J for android (Pixel 8) & other platforms

2023-11-09 Thread bill lam
Info available in
https://code.jsoftware.com/wiki/Guides/JAndroid

Recapped here

This is the *JKeyboard* from Michael Dykman. Go to *Settings* >> *Language
& Input* to activate *JKeyboard*. We do not collect your data. Finally
scroll up and select *JKeyboard* in the *default* box.



On Fri, 10 Nov 2023 at 12:24 AM James Patrick Harrington 
wrote:

> Bill,
> I just re-installed J on my Pixel - amazing: I had been running an ancient
> version & this has so much more e.g. viewmat, etc. But I cannot find
> anything about the keyboard in settings. I've looked under apps, as well as
> more general headings. Any suggestions?
> Sent from my Pixel 8 Pro,
> Patrick
>
> On Thu, Nov 9, 2023, 4:50 AM bill lam  wrote:
>
> > You need to go to phone settings and then enable j keyboard. And then it
> > will be available for your keyboard selection.
> >
> > On Thu, 9 Nov 2023 at 2:25 PM J. Patrick Harrington 
> wrote:
> >
> > > Thank you Kenneth,
> > >
> > > I just downloaded it to my laptop and transferred to the Pixel 8 via
> USB
> > > cable. It works!
> > >
> > > Now I need to look around for the j keyboard -- special characters are
> a
> > > nuisance on the default. And figure out the correct locations of the
> > > data files and scripts I want to use ...
> > >
> > > Best regards,  Patrick
> > >
> > > On 11/8/23 11:50 AM, 'Kenneth Lettow' via Programming wrote:
> > > > The apk for android is available here:
> > > > https://www.jsoftware.com/download/j9.5/install/ .
> > > >
> > > > On Wed, Nov 8, 2023 at 11:37 AM J. Patrick Harrington 
> > > wrote:
> > > >
> > > >> Hello all,
> > > >>
> > > >> While I've not posted for a while, I've been a J user for many
> > decades.
> > > >> At present I'm running j9.4 and j9.5 on a mac mini and my Dell xps
> 13
> > > >> under Ubuntu 22.04. I generally use jqt. All this is good.
> > > >>
> > > >> What I'm seeking help with is J for android. Back in Jan 2022, I
> > > >> acquired a Pixel 6 Pro phone. I installed J on it and have used it
> > > >> successfully until a few weeks ago, when I upgraded to a Pixel 8 Pro
> > > >> (seduced by the better camera). Now I want to install J on this
> phone,
> > > >> but the problem is, I don't remember how I installed it. I have the
> > > >> impression that it was available in the Play Store, but I can't find
> > it
> > > >> there now. I see that the files are found on github (thank you
> Michael
> > > >> Dykman), but I haven't used github and am unfamiliar with it - I
> can't
> > > >> believe that's how I installed it (and the J keyboard) on my Pixel
> 6.
> > > >> The problem is that there seemed to be no way to copy 3rd party
> *apps*
> > > >> from the Pix 6 to the Pix 8. (I really tried, and failed. Now my
> > Pixel 6
> > > >> is gone, traded in).
> > > >>
> > > >> So I'm asking for help here. Is the J app that I loaded into my Pix
> 6
> > a
> > > >> couple of years ago still out there somewhere, or do I have to
> figure
> > > >> out what to do with all those files on github?
> > > >>
> > > >> For something completely different, I have on order a System 76
> linux
> > > >> laptop. I'm in need of more computing power. Has anyone out there
> > > >> installed J under System 76's Pop!_OS (which is basically just
> > Ubuntu)?
> > > >> I'll let you know how it goes.
> > > >>
> > > >>
> > > >>
> --
> > > >> For information about J forums see
> > http://www.jsoftware.com/forums.htm
> > > >>
> > > >
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta7 available

2023-11-09 Thread bill lam
android j9.5.0-beta7 available
https://www.jsoftware.com/download/j9.5/install/


On Sat, Sep 16, 2023 at 10:34 PM Eric Iverson 
wrote:

> j9.5.0-beta7 available
>
> If you already run the beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> To install 9.5 beta:
>  https://code.jsoftware.com/wiki/System/Installation/J9.5
>
> Release notes:
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J for android (Pixel 8) & other platforms

2023-11-09 Thread bill lam
You need to go to phone settings and then enable j keyboard. And then it
will be available for your keyboard selection.

On Thu, 9 Nov 2023 at 2:25 PM J. Patrick Harrington  wrote:

> Thank you Kenneth,
>
> I just downloaded it to my laptop and transferred to the Pixel 8 via USB
> cable. It works!
>
> Now I need to look around for the j keyboard -- special characters are a
> nuisance on the default. And figure out the correct locations of the
> data files and scripts I want to use ...
>
> Best regards,  Patrick
>
> On 11/8/23 11:50 AM, 'Kenneth Lettow' via Programming wrote:
> > The apk for android is available here:
> > https://www.jsoftware.com/download/j9.5/install/ .
> >
> > On Wed, Nov 8, 2023 at 11:37 AM J. Patrick Harrington 
> wrote:
> >
> >> Hello all,
> >>
> >> While I've not posted for a while, I've been a J user for many decades.
> >> At present I'm running j9.4 and j9.5 on a mac mini and my Dell xps 13
> >> under Ubuntu 22.04. I generally use jqt. All this is good.
> >>
> >> What I'm seeking help with is J for android. Back in Jan 2022, I
> >> acquired a Pixel 6 Pro phone. I installed J on it and have used it
> >> successfully until a few weeks ago, when I upgraded to a Pixel 8 Pro
> >> (seduced by the better camera). Now I want to install J on this phone,
> >> but the problem is, I don't remember how I installed it. I have the
> >> impression that it was available in the Play Store, but I can't find it
> >> there now. I see that the files are found on github (thank you Michael
> >> Dykman), but I haven't used github and am unfamiliar with it - I can't
> >> believe that's how I installed it (and the J keyboard) on my Pixel 6.
> >> The problem is that there seemed to be no way to copy 3rd party *apps*
> >> from the Pix 6 to the Pix 8. (I really tried, and failed. Now my Pixel 6
> >> is gone, traded in).
> >>
> >> So I'm asking for help here. Is the J app that I loaded into my Pix 6 a
> >> couple of years ago still out there somewhere, or do I have to figure
> >> out what to do with all those files on github?
> >>
> >> For something completely different, I have on order a System 76 linux
> >> laptop. I'm in need of more computing power. Has anyone out there
> >> installed J under System 76's Pop!_OS (which is basically just Ubuntu)?
> >> I'll let you know how it goes.
> >>
> >>
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] broken taraxml?

2023-10-03 Thread bill lam
Apparently it requires the msxml.exe for working on windows. Please try
download and install the msxml package from the net.

On Tue, Oct 3, 2023 at 8:54 PM  wrote:

> Hello,
>
>
> I have been reactiving some old code of mine and it seems that taraxml is
> now broken.
>
> load'tables/taraxml'
> load'~addons\tables\taraxml\test\test.ijs'
> readxlxsheets: worksheet not found
> |assertion failure: assert
> | assert x12-:readxlxsheets fnme
> |[-47] c:\program files\j9.4\addons\tables\taraxml\test\taraxmlread.ijs
> load'~addons\tables\taraxml\test\taraxmlread.ijs'
> readxlxsheets: worksheet not found
> |assertion failure: assert
> | assert x12-:readxlxsheets fnme
> |[-47] c:\program files\j9.4\addons\tables\taraxml\test\taraxmlread.ijs
>
>
> I get the same error with j9.4.2 on windows (jqt), j807 on windows (jqt)
> and  j903 on linux (jhs and ijconsole).
>
>
> As a workaround, I can save my excel files as *.xls and use tara instead.
>
>
>
> Philip
>
>
>
>
>
>
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] wd peculiarity

2023-09-21 Thread bill lam
wd'show' is asynchronous. It returns immediately so that the subsequent
commands are possibly executed before the window is realized.

On Thu, 21 Sep 2023 at 12:26 PM Ed Gottsman 
wrote:

> Greetings.  I’m supporting a Windows user (I do not have Windows myself)
> who seems to be running into a difficulty with wd's layout manager.
>
> The code below creates a series of windows.  On my Mac setup, which is:
>
> Engine: j9.5.0-beta7/j64avx2/darwin
> Build: commercial/2023-09-15T21:06:17/clang-14-0-0/SLEEF=1
> Library: 9.5.4
> Qt IDE: 2.5.1/6.5.2(6.5.2)
> OS Ver: macOS Ventura (13.4) 22.5.0
> Platform: Darwin 64
> Installer: j9.5 install
> InstallPath: /applications/j9.5
> Contact: www.jsoftware.com
>
> …the output is:
>
> physical screen dimensions: 1680 1050
> testNoContainer width, height: 1680 931
> testHContainer width, height: 1680 931
> testVContainer width, height: 1680 931
> testVHContainer width, height: 1680 931
> testVVHContainer width, height: 1680 931
>
> That is, the windows are maximized as expected when using wd ‘pshow
> maximized'
>
> On his setup, which is:
>
> Engine: j9.5.0-beta7/j64avx2/windows
> Build: commercial/2023-09-15T21:03:14/clang-16-0-6/SLEEF=1
> Library: 9.5.4
> Qt IDE: 2.5.1/6.5.2(6.5.2)
> OS Ver: Windows 11 Version 22H2 10.0.22621
> Platform: Win 64
> Installer: j9.5 install
> InstallPath: c:/users/bill/j9.5
> Contact: www.jsoftware.com <http://www.jsoftware.com/>
>
> …by contrast, the output is:
>
> physical screen dimensions: 3440 1440
> testNoContainer width, height: 18 18
> testHContainer width, height: 200 100
> testVContainer width, height: 200 100
> testVHContainer width, height: 200 100
> testVVHContainer width, height: 200 100
>
> That is, the windows are not maximized.
>
> There is another problem that I cannot as easily isolate but that may be
> related.  From Windows users, I’m suddenly getting multiple reports of the
> wd application I’m supporting freezing on launch.
>
> I’d very much appreciate any thoughts on what I might be missing here.
>
> Thank you.
>
> Ed
>
>
> testNoContainer =: {{
> wd 'pc form escclose'
> wd 'cc context2 webview'
> wd 'pshow maximized'
> 'w h' =. ". wd 'getp wh'
> wd 'pclose'
> smoutput 'testNoContainer width, height: ' , ": w , h
> }}
>
> testHContainer =: {{
> wd 'pc form escclose'
> wd 'bin h'
> wd   'cc context1 isigraph'
> wd   'cc context2 checkbox'
> wd 'bin z'
> wd 'pshow maximized'
> 'w h' =. ". wd 'getp wh'
> wd 'pclose'
> smoutput 'testHContainer width, height: ' , ": w , h
> }}
>
> testVContainer =: {{
> wd 'pc form escclose'
> wd 'bin v'
> wd   'cc context1 isigraph'
> wd   'cc context2 webview'
> wd 'bin z'
> wd 'pshow maximized'
> 'w h' =. ". wd 'getp wh'
> wd 'pclose'
> smoutput 'testVContainer width, height: ' , ": w , h
> }}
>
> testVHContainer =: {{
> wd 'pc form escclose'
> wd 'bin v'
> wd   'bin h'
> wd 'cc context1 isigraph'
> wd 'cc context2 checkbox'
> wd   'bin z'
> wd   'bin h'
> wd 'cc context3 isigraph'
> wd 'cc context4 checkbox'
> wd   'bin z'
> wd 'bin z'
> wd 'pshow maximized'
> 'w h' =. ". wd 'getp wh'
> wd 'pclose'
> smoutput 'testVHContainer width, height: ' , ": w , h
> }}
>
> testVVHContainer =: {{
> wd 'pc form escclose'
> wd 'bin v'
> wd   'bin h'
> wd 'cc cb1 checkbox'
> wd 'cc cb2 checkbox'
> wd   'bin z'
> wd   'bin v'
> wd 'bin h'
> wd   'cc context1 isigraph'
> wd   'cc context2 checkbox'
> wd 'bin z'
> wd 'bin h'
> wd   'cc context3 isigraph'
> wd   'cc context4 checkbox'
> wd 'bin z'
> wd 'bin z'
> wd 'pshow maximized'
> 'w h' =. ". wd 'getp wh'
> wd 'pclose'
> smoutput 'testVVHContainer width, height: ' , ": w , h
> }}
>
> form_close =: {{
> wd 'pclose'
> }}
>
> go =: {{
> smoutput 'physical screen dimensions: ' , ": 2 3 { ". wd 'qscreen'
> testNoContainer ''
> testHContainer ''
> testVContainer ''
> testVHContainer ''
> testVVHContainer ''
> }}
>
> go ''
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Using rest API in J

2023-09-20 Thread bill lam
The exact syntax depending on using curl or wget. Their api documentation
should have the information. Maybe you also need to set the cookie.

On Wed, 20 Sep 2023 at 8:56 PM Pablo Landherr 
wrote:

> I have a follow-up question. I've successfully sent a number of requests
> and received data. However, they have a rate limit for unregistered users.
> So I registered and was given keys, but I don't understand how to use them.
> The documentation says that I should add the key in a http header called
> Ocp-Apim-Subscription-Key. Given that my requests were something like this:
>
> gethttp '
> https://api-test.riksbank.se/swea/v1/Observations/SEKUSDPMI/2023-01-01'
>
>
> how do I modify this to include the key?
>
>
> Thank you,
>
> Pablo
>
>
>
> On Tue, Sep 19, 2023 at 1:05 PM Pablo Landherr 
> wrote:
>
> > That was easy enough. Thank you, however the wiki page should be updated
> > as the first examples don't work as shown. E.g.
> >
> > $homepagehtml=: gethttp 'http://www.jsoftware.com'
> >
> > 293
> >
> > 106 {. 306}.homepagehtml NB. as suggested on the wiki
> >
> > homepagehtml
> >
> > 
> >
> > 
> >
> > 302 Found
> >
> > 
> >
> > Found
> >
> > The document has moved https://www.jsoftware.com/
> > ">here.
> >
> > 
> >
> > Apache/2.4.29 (Ubuntu) Server at www.jsoftware.com Port
> > 80
> >
> > 
> >
> >
> >
> > On Tue, Sep 19, 2023 at 12:55 PM Pablo Landherr <
> pablo.landh...@gmail.com>
> > wrote:
> >
> >> Thank you. Will start there.
> >>
> >> On Tue, Sep 19, 2023 at 12:47 PM Ed Gottsman <
> edward.j.gotts...@gmail.com>
> >> wrote:
> >>
> >>> Pablo,
> >>>
> >>> This is a good place to start.  It describes gethttp, an add-on that
> >>> front-ends curl and wget (depending on your platform).
> >>>
> >>>
> >>> https://code.jsoftware.com/wiki/Addons/web/gethttp
> >>>
> >>> Best of luck and feel free to ask questions.
> >>>
> >>> Ed
> >>>
> >>> > On Sep 19, 2023, at 11:42 AM, Pablo Landherr <
> pablo.landh...@gmail.com>
> >>> wrote:
> >>> >
> >>> > I have searched the J wiki but am unable to find some newbie examples
> >>> > showing how to use J (client side) with rest API. I wish to download
> >>> > statistics and my source only supports using their API. Side note, I
> >>> have
> >>> > no experience writing API:s.
> >>> >
> >>> > Can anyone point me to the best place to start?
> >>> >
> >>> > Thank you,
> >>> > Pablo Landherr
> >>> >
> --
> >>> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> >>>
> >>> --
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >>>
> >>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] lapack2 wrapper scripts (WAS: Eigenvectors and eigenvalues of complex matrices)

2023-09-01 Thread bill lam
Lapack2 contains api protocols for all 4 cases,
single and double precision real
single and double precision complex
the signature of single precision in cd is "s"

J doesn't natively support single precision complex so that there will be
automatic conversion when calling functions involving single precision
complex arguments.


On Fri, 1 Sep 2023 at 1:02 PM Igor Zhuravlov  wrote:

> On 20 Aug 2023, at 07:35, Piet de Jong  wrote:
> > Are there an cgee*.ijs scripts equivalent to dgee*.ijs scripts?
> > Or do they have to be crafted from eg their equivalent dgee*.ijs
> > counterparts?
>
> Sorry for delay with answer.
>
> J supports double-precision complex numbers ('Z' in LAPACK), not single-
> precision ('C'). So, you should look for zgee*.ijs scripts instead.
>
> By the way, a lot of math/lapack2 wrappers are in math/mt addon's test
> suite.
> In particular, xGEEV family wrappers are in test/lapack2/geev.ijs script:
>
>   mat=. j./ i. 2 3 3  NB. sample matrix
>   load 'math/mt'
>   load 'math/mt/test/lapack2/geev'
>   'w Vl Vr'=. 'vv' zgeev mat
> NB. 'vv' here is to get both left and right eigenvectors
>
> --
> Regards,
> Igor
>
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J build fail

2023-08-21 Thread bill lam
We only 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 <
programm...@jsoftware.com> wrote:

> They're not the latest,
>
> gcc 12.2.0
> clang version 15.0.7
>
> but I don't get any warnings, and hence errors during compilation. I redid
> it with clang and -Wfatal-errors just now. Selfsame printout and return
> code.
> I executed built_native.sh and build_jamalgam.sh for good measure, but to
> no avail.
> If make2/ is already deprecated, why is make_deprecated/ stil there..?
> How is one supposed to compile it if not with that on UNIX machines?
>
> The stack traces for the .zip'd binary and the compiled one differ
> considerably. I think an or the issue may be the GNU linker ld, since the
> compiled one doesn't get the .zip'd one's second execve:
>
> execve("/usr/bin/ijconsole-9.5", ["ijconsole-9.5"], 0x7ffe3b52bf80 /* 55
> vars */) = 0
> ...execve("/usr/lib/ld-musl-x86_64.so.1", ["ld-linux-x86-64.so.2",
> "--argv0", "ijconsole", "--preload", "/usr/lib/libgcompat.so.0 ", "--",
> "/usr/bin/ijconsole-9.5"], 0x7ffe8f26e128 /* 55 vars */) = 0
>
> gcompat is a "Compatability layer to allow running glibc binaries on musl
> systems". This is why I'd wanted to recompile 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 and scripts in repository are meant for recent versions of
> clang
> > and gcc.
> >
> > On Tue, 22 Aug 2023 at 7:56 AM 'Viktor Grigorov' via Programming <
> > programm...@jsoftware.com> wrote:
> >
> >> 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 following printout, to the J
> >> programming forum.
> >> 55ffd96d7f04: ?:0:  ?
> >> 7f106b331a1d: src/signal/x86_64/restore.s:1:?
> >>
> >> I last compiled 9.4.? ~1--1.5y ago; that was successful. I am missing a
> >> step or..?
> >>
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J build fail

2023-08-21 Thread bill lam
Make files and scripts in repository are meant for recent versions of clang
and gcc.

On Tue, 22 Aug 2023 at 7:56 AM 'Viktor Grigorov' via Programming <
programm...@jsoftware.com> wrote:

> 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 following printout, to the J
> programming forum.
> 55ffd96d7f04: ?:0:  ?
> 7f106b331a1d: src/signal/x86_64/restore.s:1:?
>
> I last compiled 9.4.? ~1--1.5y ago; that was successful. I am missing a
> step or..?
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] JQt startup time - again!

2023-07-16 Thread bill lam
One possibility is finding projects under your user project folder.
Another is that some errors occurred during booting up but there is no jqt
ide to display the error message.
You can try start jqt.exe without profile from the terminal at ~bin folder
like,

jqt.exe /jprofile

Then load the profile manually

0!:1<'profile.ijs'

See what happens and trace the booting sequence.







On Sun, Jul 16, 2023, 5:46 PM 'Michael Day' via Programming <
programm...@jsoftware.com> wrote:

> I've recently been suffering a problem starting JQt under Windows 11 on
> this laptop.
> Dr Google had suggested assigning administrator status to the startup a
> few months ago;
> the problem seemed to have wandered off.  Lately the JQt terminal window
> has come
> to life after perhaps 10 minutes,  so I've kept J open throughout the
> life of the Windows
> session,  including the laptop's times in sleep/hibernation.
>
> But today it's not appearing at all.  My latest attempt to start was at
> 10:10 am - it's now
> 10:33.
>
> Task manager shows it's running:
> ┌───┬─┬───┬┬───┬──┬┬┬───┐
> │Name   │PID  │Status │Username│CPU│Memory│(..)│Architecture│Description│
> ├───┼─┼───┼┼───┼──┼┼┼───┤
> │jqt.exe│15540│Running│mike_   │00 │18,912│K   │x64 │J  │
> └───┴─┴───┴┴───┴──┴┴┴───┘
>
> (Sorry if this doesn't display well but you should get the idea!)
>
> This is the version info:
> JVERSION
> Engine: j9.5.0-beta4/j64avx2/windows
> Build: commercial/2023-07-07T22:38:55/clang-15-0-7/SLEEF=1
> Library: 9.5.1
> Platform: Win 64
> Installer: j9.5 install
> InstallPath: c:/d/j9.5
> Contact: www.jsoftware.com
>
> Quasi-immediate start up for the console & JHS versions,  which I hardly
> use unfortunately!
>
> Thanks in advance,
>
> Mike
> PS - it hasnt opened yet @10:64am !
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta4 available

2023-07-15 Thread bill lam
J android beta available now.
menu > Tools > Check New Version.

On Fri, Jul 14, 2023 at 12:55 AM Michael Dykman  wrote:

> Thank you bill
>
> On Thu, Jul 13, 2023, 12:33 bill lam  wrote:
>
> > J android beta will be available in a couple of days.
> > Also android programs are updated by installing a newer version of APK.
> >
> > On Fri, 14 Jul 2023 at 12:00 AM Michael Dykman 
> wrote:
> >
> > > Thank you again Eric for all the hard work.
> > >
> > > I note that the upgrade option is not available on the android edition.
> > >
> > > load'pacman'
> > > 'upgrade'jpkg'jengine'
> > > upgrade not supported for this platform
> > >
> > >
> > > On Thu, Jul 13, 2023, 11:40 Eric Iverson 
> > wrote:
> > >
> > > > j9.5.0-beta4 available
> > > >
> > > > If you already run the beta, then upgrade is easy:
> > > >load'pacman'
> > > >'upgrade'jpkg'jengine'
> > > >
> > > > To install 9.5 beta:
> > > >  https://code.jsoftware.com/wiki/System/Installation/J9.5
> > > >
> > > > Release notes:
> > > >  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
> > > >
> > > > Questions/bug reports/etc. should go to the beta forum.
> > > >
> --
> > > > For information about J forums see
> http://www.jsoftware.com/forums.htm
> > > >
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta4 available

2023-07-13 Thread bill lam
J android beta will be available in a couple of days.
Also android programs are updated by installing a newer version of APK.

On Fri, 14 Jul 2023 at 12:00 AM Michael Dykman  wrote:

> Thank you again Eric for all the hard work.
>
> I note that the upgrade option is not available on the android edition.
>
> load'pacman'
> 'upgrade'jpkg'jengine'
> upgrade not supported for this platform
>
>
> On Thu, Jul 13, 2023, 11:40 Eric Iverson  wrote:
>
> > j9.5.0-beta4 available
> >
> > If you already run the beta, then upgrade is easy:
> >load'pacman'
> >'upgrade'jpkg'jengine'
> >
> > To install 9.5 beta:
> >  https://code.jsoftware.com/wiki/System/Installation/J9.5
> >
> > Release notes:
> >  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
> >
> > Questions/bug reports/etc. should go to the beta forum.
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] jios 903.2 glitch

2023-07-10 Thread bill lam
I suspect it doesn't suppose train a c n
   /"0
|syntax error
|   /"0


On Tue, 11 Jul 2023 at 7:57 AM bill lam  wrote:

> A simpler way to demonstrate this issue in iOS
>
>mi=: {{ m }}"0
> |syntax error
> |   mi=:{{m}}"0
>
> But removing the rank 0, it runs fine
>mi=: {{ m }}
>
>
>
> On Tue, 11 Jul 2023 at 12:49 AM 'Mike Day' via Programming <
> programm...@jsoftware.com> wrote:
>
>> I'm probably missing the blindingly obvious but why does this happen in
>> JIOS on my iPad but not in J903, J9.4 & J9.5 under Windows?
>>
>>JVERSION
>> Engine: j903/j64/iOS
>> beta-k: GPL3/2023-04-16T23:21:00
>> Platform: iOS/iPadOS
>> Version: 903.2 57
>> Installer: App Store
>> Contact: www.jsoftware.com
>>
>>load'~user/finite.ijs' NB. or any implicit load of finite.ijs
>> |syntax error
>> |   mi=:{{'r0 s0 t0'=:gcd2x m,y...}}"0
>> |[-277]
>> /private/var/mobile/Containers/Data/Application/219E805B-EDC1-4B43-858D-814C13F48E94/Documents/j/user/finite.ijs
>>
>> Here's mi:
>> NB. adverb giving divide (inverse) mod m
>> mi=: {{
>> 'r0 s0 t0'=:gcd2x m,y
>> if. r0=1 do. m|t0 else. 1r0 end.
>> :
>> m|x*m mi y
>> }}"0
>>
>> This "syntax error" also occurs when using the alternative method of
>> definition,
>> mi =: 1 : 0"0
>> ...
>> )
>>
>> Thanks,
>>
>> Mike
>>
>>
>> Sent from my iPad
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] jios 903.2 glitch

2023-07-10 Thread bill lam
A simpler way to demonstrate this issue in iOS

   mi=: {{ m }}"0
|syntax error
|   mi=:{{m}}"0

But removing the rank 0, it runs fine
   mi=: {{ m }}



On Tue, 11 Jul 2023 at 12:49 AM 'Mike Day' via Programming <
programm...@jsoftware.com> wrote:

> I'm probably missing the blindingly obvious but why does this happen in
> JIOS on my iPad but not in J903, J9.4 & J9.5 under Windows?
>
>JVERSION
> Engine: j903/j64/iOS
> beta-k: GPL3/2023-04-16T23:21:00
> Platform: iOS/iPadOS
> Version: 903.2 57
> Installer: App Store
> Contact: www.jsoftware.com
>
>load'~user/finite.ijs' NB. or any implicit load of finite.ijs
> |syntax error
> |   mi=:{{'r0 s0 t0'=:gcd2x m,y...}}"0
> |[-277]
> /private/var/mobile/Containers/Data/Application/219E805B-EDC1-4B43-858D-814C13F48E94/Documents/j/user/finite.ijs
>
> Here's mi:
> NB. adverb giving divide (inverse) mod m
> mi=: {{
> 'r0 s0 t0'=:gcd2x m,y
> if. r0=1 do. m|t0 else. 1r0 end.
> :
> m|x*m mi y
> }}"0
>
> This "syntax error" also occurs when using the alternative method of
> definition,
> mi =: 1 : 0"0
> ...
> )
>
> Thanks,
>
> Mike
>
>
> Sent from my iPad
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta3 available

2023-06-02 Thread bill lam
9.5.0-beta3 available for android. Somehow the check for update button
doesn't work.
please download apk from jsoftware site

* https://www.jsoftware.com/download/j9.5/install/

On Sat, 3 Jun 2023 at 1:49 AM Eric Iverson  wrote:

> j9.5.0-beta3 available
>
> If you already run the beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> To install 9.5 beta:
>  https://code.jsoftware.com/wiki/System/Installation/J9.5
>
> Release notes:
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Search

2023-05-10 Thread bill lam
While ?. produces different results for J32 vs J64.
Regardless of platforms and cpu architectures and J version, ?. always
gives identical results for all J32.
same result for all J64 . In the J engine test suite

(IF64{::'89551d61c612f81fb7553a355bf932d2d8f78ed7';'6ebe83e54f37c4cdb3cfb617e657af9dd2074c42')
-: (128!:6) ": ?.#~1e6
(IF64{::'ac92c5ac4e7c167de5967296ff90791ea334c39b';'ab5ae709e6f9eb15e197a4cd616a3dd044f31a99')
-: (128!:6) ": ?.~1e6

BTW the statistical quality of randomness of ?. is poor but that is
unimportant. The intention is that it always gives repeatable results.

On Thu, May 11, 2023 at 5:05 AM Raul Miller  wrote:

> I think the issue you are talking about here is the result from (?.)
>
> It would be plausibly nice if ?. had a definition which is
> architecture and version independent. But that has not been the case
> and probably will not be the case. Already, there's too many variants
> out there for broad compatibility.
>
> It might be best to replace (?.) with (?) so that people who
> understand the difference are not misled into false expectations.
>
> Thanks,
>
> --
> Raul
>
> On Wed, May 10, 2023 at 1:59 PM Brian Schott 
> wrote:
> >
> > Inspired by the wikipedia links offered below, I sought
> > https://en.wikipedia.org/wiki/J_(programming_language) and was quite
> > pleased with the description. However, the random list and array examples
> > produce different results for me and I suspect those examples need to be
> > changed.
> >
> > Below is an excerpt from my jconsole showing the values I see.
> > I would be happy to try to edit the wiki page but I am not registered, so
> > it would be better if someone else does so.
> >
> >avg=: +/ % #
> >]v=:  ?. 20 $100
> > 94 56 8 6 85 48 66 96 76 59 33 72 63 1 89 52 17 20 9 65
> >avg v
> > 50.75
> >4 avg\ v
> > 41 38.75 36.75 51.25 73.75 71.5 74.25 66 60 56.75 42.25 56.25 51.25 39.75
> > 44.5 24.5 27.75
> >]m=: ?. 4 5 $50
> > 44  6  8  6 35
> > 48 16 46 26  9
> > 33 22 13  1 39
> >  2 17 20  9 15
> >avg"1 m
> > 19.8 29 21.6 12.6
> >JVERSION
> > Engine: j903/j64/darwin
> > Release-b: commercial/2022-01-28T04:11:24
> > Library: 9.03.08
> > Platform: Darwin 64
> > Installer: J903 install
> > InstallPath: /users/brian/j903
> > Contact: www.jsoftware.com
> >
> >
> > On Wed, May 10, 2023 at 3:10 PM Jose Mario Quintana <
> > jose.mario.quint...@gmail.com> wrote:
> >
> > > > I know of at least A,B,C,D,E,I,J,K,M,Q,R, and S
> > >
> > > F (programming language) - Wikipedia
> > > https://en.wikipedia.org/wiki/F_%28programming_language%29
> > >
> > > P (programming language) - Wikipedia
> > > https://en.wikipedia.org/wiki/P_(programming_language)
> > >
> > > T (programming language) - Wikipedia
> > > https://en.wikipedia.org/wiki/T_(programming_language)
> > >
> > >
> > >
> > > --
> > (B=) <-my sig
> > Brian Schott
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.5.0-beta2 available

2023-05-04 Thread bill lam
9.5.0-beta2 available for android. Somehow the check for update button
doesn't work.
please download apk from jsoftware site

* https://www.jsoftware.com/download/j9.5/install/

On Wed, May 3, 2023 at 10:52 PM Eric Iverson 
wrote:

> j9.5.0-beta2 available
>
> If you already run the beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> To install 9.5 beta:
>  https://code.jsoftware.com/wiki/System/Installation/J9.5
>
> Release notes:
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.5
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] 3 x:@^ 33 is not odd on a Mac or iOS

2023-04-27 Thread bill lam
on apple m1

   <. 3 ^ 33
555906056624
   16": 3 ^ 33
555906056623
   3^33x
555906056623

On Fri, Apr 28, 2023 at 11:37 AM bill lam  wrote:

> I can reproduce this bug on apple m1 and android arm64.
>
> On Fri, Apr 28, 2023 at 11:01 AM 'robert therriault' via Programming <
> programm...@jsoftware.com> wrote:
>
>> This is not a problem on the Windows platform according to Raul, but I
>> thought I should alert those who might be counting on powers of 3 above 33
>> being odd.
>>
>> I see the same results in J806 which is as far back as I test. Also,
>> seems to be a problem for both J901 and J701 on iOS
>>
>> Cheers, bob
>>
>>3 x:@^ 33
>> 555906056624
>>   3 x:@^ 32
>> 1853020188851841
>>  3 * 3 x:@^ 32
>> 555906056623
>>
>>   JVERSION
>> Engine: j9.5.0-beta1/j64avx2/darwin
>> Build: commercial/2023-04-22T15:18:16/clang-14-0-0/SLEEF=1
>> Library: 9.5.1
>> Qt IDE: 2.0.3/6.2.4(6.2.4)
>> Platform: Darwin 64
>> Installer: j9.5 install
>> InstallPath: /users/bobtherriault/j9.5
>> Contact: www.jsoftware.com
>>
>>
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] 3 x:@^ 33 is not odd on a Mac or iOS

2023-04-27 Thread bill lam
I can reproduce this bug on apple m1 and android arm64.

On Fri, Apr 28, 2023 at 11:01 AM 'robert therriault' via Programming <
programm...@jsoftware.com> wrote:

> This is not a problem on the Windows platform according to Raul, but I
> thought I should alert those who might be counting on powers of 3 above 33
> being odd.
>
> I see the same results in J806 which is as far back as I test. Also, seems
> to be a problem for both J901 and J701 on iOS
>
> Cheers, bob
>
>3 x:@^ 33
> 555906056624
>   3 x:@^ 32
> 1853020188851841
>  3 * 3 x:@^ 32
> 555906056623
>
>   JVERSION
> Engine: j9.5.0-beta1/j64avx2/darwin
> Build: commercial/2023-04-22T15:18:16/clang-14-0-0/SLEEF=1
> Library: 9.5.1
> Qt IDE: 2.0.3/6.2.4(6.2.4)
> Platform: Darwin 64
> Installer: j9.5 install
> InstallPath: /users/bobtherriault/j9.5
> Contact: www.jsoftware.com
>
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J9.5 beta

2023-04-26 Thread bill lam
Oh sorry. they will have their own ~user folder.

On Wed, Apr 26, 2023 at 7:53 PM bill lam  wrote:

> J 9.5 beta for Android available at
>
> http://www.jsoftware.com/download/j9.5/install/j9.5_android.apk
>
> J 9.4 (blue icon) can coexist with J 9.5 (gray icon). However they will
> share the same ~user folder.
>
> On Mon, Apr 24, 2023, 4:50 AM Eric Iverson 
> wrote:
>
>> The 9.5 beta cycle has started!
>>
>> https://code.jsoftware.com/wiki/System/Installation/J9.5
>>
>> Install it now to help make it as stable as possible come release time,
>> but
>> also to steer it in directions that are relevant to you.
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J9.5 beta

2023-04-26 Thread bill lam
J 9.5 beta for Android available at

http://www.jsoftware.com/download/j9.5/install/j9.5_android.apk

J 9.4 (blue icon) can coexist with J 9.5 (gray icon). However they will
share the same ~user folder.

On Mon, Apr 24, 2023, 4:50 AM Eric Iverson  wrote:

> The 9.5 beta cycle has started!
>
> https://code.jsoftware.com/wiki/System/Installation/J9.5
>
> Install it now to help make it as stable as possible come release time, but
> also to steer it in directions that are relevant to you.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Cannot save plot to format other than PDF

2023-04-23 Thread bill lam
I suspect Devon uses jconsole instead of jqt frontend.

On Mon, Apr 24, 2023, 6:41 AM chris burke  wrote:

> Please send bug reports to general, and respond there, thanks.
>
> This worked for me as below. What is your environment and what
> commands were used?
>
>load'plot'
>plot 2 3 7 5
>pd 'save png tiles.png'
>
>JVERSION
> Engine: j9.4.1/j64avx2/linux
> Build: commercial/2023-02-27T15:24:41/clang-11-0-0/SLEEF=1
> Library: 9.5.1
> Qt IDE: 2.0.3/6.2.2(6.2.2)
> Platform: Linux 64
>
> On Sun, Apr 23, 2023 at 2:38 PM Devon McCormick 
> wrote:
> >
> > It seems like I have this same problem over and over again: I cannot send
> > the result of "plot" to any format other than the default PDF.  Is anyone
> > able to save a plot to e.g. a .PNG file?
> > When I try the command "pd 'save png tiles2.png'", I get a message
> telling
> > me to first display an isigraph plot which I think was available back in
> J6
> > but is not now.
> >
> > --
> >
> > Devon McCormick, CFA
> >
> > Quantitative Consultant
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j.dll change in 9.4?

2023-04-23 Thread bill lam
Right j.dll needs to load pthreadVC3.dll and mpir.dll in j904. This isn't
any problem for jconsole or jqt because they are in the same folder as the
dll.  I assume your front end is not the same folder as j.dll and by the
same token, the pthreadvc3 and mpir.dll.  Therefore you need to put them in
PATH folders, eg windows system32.

Btw J missing mpir.dll still can work but without any extended numbers
capabilities.

On Sun, 23 Apr 2023 at 1:03 PM Michal Wallace 
wrote:

> Thanks, Bill!
> Knowing it wasn't an intentional change was enough.
> Turns out it was dying when trying to load the library, not when calling
> JInit.
> Prior to 9.4, it was sufficient to load the DLL from an absolute path
> constructed from "$J_HOME/j.dll".
> Now it seems j.dll loads something else right away from a relative path,
> and that requires having the J_HOME also be on the path.
> (If I had to take a wild guess, I'd say it was probably the addition of
> pthreadVC3.dll for the new thread primitives.)
> In any case, I added my J_HOME directory to my PATH and that fixed the
> problem.
>
>
> On Sat, Apr 22, 2023 at 10:48 PM bill lam  wrote:
>
> > Without additional details, it is hard to guess what's wrong. You can PM
> me
> > scripts or files to reproduce the issue if you wish.
> >
> > On Sun, 23 Apr 2023 at 7:43 AM Michal Wallace 
> > wrote:
> >
> > > When I try to run my J frontend in J9.4, it crashes when trying to run
> > > JInit.
> > > I don't know how to obtain any kind of error message.
> > >
> > > The same binary works just fine against j903 and j902.
> > > Has something changed?
> > >
> > > (I'm not seeing anything in the changelog. I see a new JInit2 was added
> > > recently in the code, but it looks like JInit is the same...?)
> > >
> > > This is the version that lets me connect:
> > >
> > > Engine: j903/j64avx2/windows
> > > Release-b: commercial/2022-01-28T04:09:50
> > > Library: 9.03.08
> > > Platform: Win 64
> > > Installer: J903 install
> > > InstallPath: c:/j903
> > > Contact: www.jsoftware.com
> > >
> > > This is the version that crashes:
> > >
> > > Engine: j9.4.2/j64avx2/windows
> > > Build: commercial/2023-04-10T01:19:53/clang-15-0-7/SLEEF=1
> > > Library: 9.4.22
> > > Platform: Win 64
> > > Installer: j9.4 install
> > > InstallPath: c:/j9.4
> > > Contact: www.jsoftware.com
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j.dll change in 9.4?

2023-04-22 Thread bill lam
Without additional details, it is hard to guess what's wrong. You can PM me
scripts or files to reproduce the issue if you wish.

On Sun, 23 Apr 2023 at 7:43 AM Michal Wallace 
wrote:

> When I try to run my J frontend in J9.4, it crashes when trying to run
> JInit.
> I don't know how to obtain any kind of error message.
>
> The same binary works just fine against j903 and j902.
> Has something changed?
>
> (I'm not seeing anything in the changelog. I see a new JInit2 was added
> recently in the code, but it looks like JInit is the same...?)
>
> This is the version that lets me connect:
>
> Engine: j903/j64avx2/windows
> Release-b: commercial/2022-01-28T04:09:50
> Library: 9.03.08
> Platform: Win 64
> Installer: J903 install
> InstallPath: c:/j903
> Contact: www.jsoftware.com
>
> This is the version that crashes:
>
> Engine: j9.4.2/j64avx2/windows
> Build: commercial/2023-04-10T01:19:53/clang-15-0-7/SLEEF=1
> Library: 9.4.22
> Platform: Win 64
> Installer: j9.4 install
> InstallPath: c:/j9.4
> Contact: www.jsoftware.com
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] docs for 11!:n (JWd)?

2023-04-17 Thread bill lam
I am unsure if the rust string is unicode or not. Anyhow J strings are utf8
and you may need to convert between unicode and utf8 inside the interface.

On Tue, Apr 18, 2023 at 2:15 AM Michal Wallace 
wrote:

> That makes sense now. Thanks, Bill.
>
> JPrez is (or rather was) a console application, so I wanted to make a new
> frontend
> that could draw a text console quickly, but also do the audio recordings.
>
> My first attempt was to write an extension for the Godot game engine using
> rust, leading to:
>
> https://github.com/tangentstorm/jlang-rs
> https://github.com/tangentstorm/jlang-rs-gd
>
> This is nice because I can mix my J REPL presentations with other effects
> from godot's animation
> system. But while Godot plays audio just great, it's recording system is
> incredibly buggy and I wind
> up having to record the same thing many times (because the wav file has no
> sound or is nothing
> but static about 50% of the time)
>
> Anyway, I built my new console control in free pascal using a nice canvas
> control and then added
> some audio components so I can record.
>
> For now, I'm still planning to use the Jwd mechanism to drive playing back
> the audio files
> from J, but I was thinking I might try to wrap the pascal canvas control as
> a jgl implementation,
> so I could draw directly onto the "terminal" from J.
>
> I was just asking about jqt because I like your idea of breaking the
> frontend into a dll
> coupled with a small executable that calls it. Now that I understand how it
> works, maybe
> I can do the same thing. :)
>
>
>
> On Mon, Apr 17, 2023 at 1:39 PM bill lam  wrote:
>
> > I should have said both j and jqt can call each other directly using the
> > visible dllexport function name as entry points.
> > jlib.h in jsource repos and gl2.ijs etc in qt ide addon.
> > The function prototype of gl2 are listed in gl2.ijs of qt ide.
> >
> > gl2class.h is the implementation already.
> >
> > If you look at gl2.cpp it includes gl2class.h.
> >
> > However I am puzzled, if you write your frontend then jqt won't be used
> at
> > all. You need to implement your own gui functions including gl2..
> >
> >
> > On Tue, Apr 18, 2023, 12:57 AM Michal Wallace 
> > wrote:
> >
> > > Thanks Bill.
> > >
> > > I have JWd working now, but I'm a little confused about what you're
> > trying
> > > to tell me about jQT.
> > >
> > > You're saying that jqt can call j.dll directly, but what does that have
> > to
> > > do
> > > with J calling functions defined in the frontend?
> > >
> > > How does jgl2 (for example) get the address of the corresponding c/c++
> > > function?
> > >
> > > I see wd/gl2class.h in the qtide repo, and I see glcmds inside it, and
> I
> > > see that gl2.h
> > > marks a bunch of functions as "DllExport" but I don't yet see any place
> > > where some
> > > J script puts all the pieces together and tells it to look in the
> jqt.dll
> > > to get the
> > > implementation of jgl... (assuming that's what happens)
> > >
> > > Where should I look?
> > >
> > >
> > > On Sat, Apr 15, 2023 at 7:40 PM bill lam  wrote:
> > >
> > > > Jqt doesn't use 11!:x because it can call j.dll (libj.so) directly.
> > Each
> > > > value of x in 11!:x is exposed as a c function in the frontend. If
> your
> > > > frontend is implemented in c/c++, then you can do the same without
> > using
> > > > 11!:x.
> > > >
> > > > However jandroid uses 11!:x interface because libj is C while
> jandroid
> > is
> > > > written in java. The interface between java and C needs a jni
> wrapper,
> > > > therefore it is more convenient to reduce the number of interface
> calls
> > > by
> > > > using 11!:x callback.
> > > >
> > > > In the prototype of Jwd, the pres the pointer of of result A (pointer
> > to
> > > an
> > > > AD structure), typically the AD structure is allocated by the
> frontend
> > > > using Jga api (see jlib.h).
> > > >
> > > > You need not bother with the AC field.
> > > > The AR (rank) contains other information in its high bits so that you
> > > must
> > > > mask it to the lowest 7 bits only (though it seems safe enough to
> mask
> > > the
> > > > lowest 8 bits, Henry should know better here).
> > > >
> > > > You can browse the jand

Re: [Jprogramming] docs for 11!:n (JWd)?

2023-04-17 Thread bill lam
I should have said both j and jqt can call each other directly using the
visible dllexport function name as entry points.
jlib.h in jsource repos and gl2.ijs etc in qt ide addon.
The function prototype of gl2 are listed in gl2.ijs of qt ide.

gl2class.h is the implementation already.

If you look at gl2.cpp it includes gl2class.h.

However I am puzzled, if you write your frontend then jqt won't be used at
all. You need to implement your own gui functions including gl2..


On Tue, Apr 18, 2023, 12:57 AM Michal Wallace 
wrote:

> Thanks Bill.
>
> I have JWd working now, but I'm a little confused about what you're trying
> to tell me about jQT.
>
> You're saying that jqt can call j.dll directly, but what does that have to
> do
> with J calling functions defined in the frontend?
>
> How does jgl2 (for example) get the address of the corresponding c/c++
> function?
>
> I see wd/gl2class.h in the qtide repo, and I see glcmds inside it, and I
> see that gl2.h
> marks a bunch of functions as "DllExport" but I don't yet see any place
> where some
> J script puts all the pieces together and tells it to look in the jqt.dll
> to get the
> implementation of jgl... (assuming that's what happens)
>
> Where should I look?
>
>
> On Sat, Apr 15, 2023 at 7:40 PM bill lam  wrote:
>
> > Jqt doesn't use 11!:x because it can call j.dll (libj.so) directly. Each
> > value of x in 11!:x is exposed as a c function in the frontend. If your
> > frontend is implemented in c/c++, then you can do the same without using
> > 11!:x.
> >
> > However jandroid uses 11!:x interface because libj is C while jandroid is
> > written in java. The interface between java and C needs a jni wrapper,
> > therefore it is more convenient to reduce the number of interface calls
> by
> > using 11!:x callback.
> >
> > In the prototype of Jwd, the pres the pointer of of result A (pointer to
> an
> > AD structure), typically the AD structure is allocated by the frontend
> > using Jga api (see jlib.h).
> >
> > You need not bother with the AC field.
> > The AR (rank) contains other information in its high bits so that you
> must
> > mask it to the lowest 7 bits only (though it seems safe enough to mask
> the
> > lowest 8 bits, Henry should know better here).
> >
> > You can browse the jandroid repository and also the io.c and andjnative.c
> > in jsource repository.
> >
> > On Sun, 16 Apr 2023 at 6:36 AM Michal Wallace 
> > wrote:
> >
> > > Hrm. That does help a little bit. There's definitely still something
> > called
> > > JWd defined in JLib.
> > >
> > > Here is what I know so far:
> > > (actually more than when I started typing this, so... I'll probably
> move
> > > this to the wiki at some point.)
> > >
> > > When you write a J frontend, you have to call a function called JSM
> > > (session manager)
> > > and you pass in the addresses of four callback functions that your
> > frontend
> > > implements:
> > >
> > >JWr -> session calls this to output to whatever "terminal" you set
> up
> > >JWd -> this window driver thing.
> > >JRd -> session calls this when it needs to read a line of input
> > >???  -> something reserved for future use?
> > >
> > > JWd does still seem to be hooked up to 11!:x  (weird to see that
> called x
> > > instead of n!)
> > >
> > > The signature looks like this:
> > >
> > > int _stdcall Jwd(JS jt, int x, A parg, A* pres, C* loc);
> > >   -- https://github.com/jsoftware/jsource/blob/master/jsrc/jlib.h#L111
> > >
> > > The arguments seem to be:
> > >
> > >   jt -> address of j session object
> > >   x -> the 'n' in 11!:n
> > >   parg -> the y argument to (11!n) (a pointer to a J array)
> > >   pres -> the result array (you modify this to put your return value
> > here)
> > >   loc -> a locale name (?)
> > >
> > > There is an example J frontend here:
> > >
> > > https://github.com/jsoftware/jsource/blob/master/jsrc/jfex.c
> > >
> > > It has this comment for its implementation of Jwd (which is missing the
> > loc
> > > parameter):
> > >
> > > // J calls for 11!:x y - demonstrates all features of jwdw and jwdp
> > > // pa is y and result array (if any) is returned in pz
> > > // return  pz
> > > //  0   - MTM i.0 0
> > > // -1  A- A result
> > > // -2  A- A is pairs of null te

Re: [Jprogramming] avx problem with 904

2023-04-15 Thread bill lam
The following is written in Eric's email announcement of j9.4.2 . It looks
like your cpu is avx but not avx2 capable. If your cpu actually supports
avx2 then you can download and use the appropriate J binary manually.

Previous releases had versions: j64, j64avx, and j64avx2. Machines limited
to avx are less and less common and no longer warrant the support effort.
Install or upgrade will provide the version appropriate for your hardware.
If you are running j64 and are concerned with performance you will at some
point need to upgrade your hardware.

On Sun, 16 Apr 2023 at 7:34 AM Don Kelly  wrote:

> I have installed J904  and  it runs well except that avx  is not
> available , so 903 is faster. Is it that the present 904 does not
> recognize the older version -even though the information  includes it.
> Is there a way to deal with this?
>
> Don Kelly
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] docs for 11!:n (JWd)?

2023-04-15 Thread bill lam
Jqt doesn't use 11!:x because it can call j.dll (libj.so) directly. Each
value of x in 11!:x is exposed as a c function in the frontend. If your
frontend is implemented in c/c++, then you can do the same without using
11!:x.

However jandroid uses 11!:x interface because libj is C while jandroid is
written in java. The interface between java and C needs a jni wrapper,
therefore it is more convenient to reduce the number of interface calls by
using 11!:x callback.

In the prototype of Jwd, the pres the pointer of of result A (pointer to an
AD structure), typically the AD structure is allocated by the frontend
using Jga api (see jlib.h).

You need not bother with the AC field.
The AR (rank) contains other information in its high bits so that you must
mask it to the lowest 7 bits only (though it seems safe enough to mask the
lowest 8 bits, Henry should know better here).

You can browse the jandroid repository and also the io.c and andjnative.c
in jsource repository.

On Sun, 16 Apr 2023 at 6:36 AM Michal Wallace 
wrote:

> Hrm. That does help a little bit. There's definitely still something called
> JWd defined in JLib.
>
> Here is what I know so far:
> (actually more than when I started typing this, so... I'll probably move
> this to the wiki at some point.)
>
> When you write a J frontend, you have to call a function called JSM
> (session manager)
> and you pass in the addresses of four callback functions that your frontend
> implements:
>
>JWr -> session calls this to output to whatever "terminal" you set up
>JWd -> this window driver thing.
>JRd -> session calls this when it needs to read a line of input
>???  -> something reserved for future use?
>
> JWd does still seem to be hooked up to 11!:x  (weird to see that called x
> instead of n!)
>
> The signature looks like this:
>
> int _stdcall Jwd(JS jt, int x, A parg, A* pres, C* loc);
>   -- https://github.com/jsoftware/jsource/blob/master/jsrc/jlib.h#L111
>
> The arguments seem to be:
>
>   jt -> address of j session object
>   x -> the 'n' in 11!:n
>   parg -> the y argument to (11!n) (a pointer to a J array)
>   pres -> the result array (you modify this to put your return value here)
>   loc -> a locale name (?)
>
> There is an example J frontend here:
>
> https://github.com/jsoftware/jsource/blob/master/jsrc/jfex.c
>
> It has this comment for its implementation of Jwd (which is missing the loc
> parameter):
>
> // J calls for 11!:x y - demonstrates all features of jwdw and jwdp
> // pa is y and result array (if any) is returned in pz
> // return  pz
> //  0   - MTM i.0 0
> // -1  A- A result
> // -2  A- A is pairs of null terminated strings for event table
> //  n   - EVDOMAIN etc
>
>
> The 'parg' argument has the following fields, which I am expecting to match
> the structure defined here:
>
>https://www.jsoftware.com/ioj/iojNoun.htm
>
> k  -> "offset of ravel with respect to byte 0 of the array"
> f -> a flag of some sort
> m -> "maximum number of bytes in ravel"
> t -> the type
> c -> reference count
> n -> the length of the data
> r -> rank
> s -> pointers to shape and value
>
> My implementation of Jwd just prints out the arguments...
>
>JWd(x:2000, a:[k: 64 f: 0 m: 117321808 t: 2 c: $8001 n: 5 r:
> $BAADF00D062E0001])
>
> I guess really my main problem is I don't understand how to interpret the
> "rank" and "reference count" fields.
> I'd expect both of these to be small positive integers, like what I see in
> the ioj.
>
> Without the rank, I don't know how to parse the shape and value.
>
> Hrm. I guess technically I know from the docs that all (11!:n) are rank 1,
> so maybe I can just ignore that field?
>
> I will investigate further.
>
>
> On Sat, Apr 15, 2023 at 5:01 PM Raul Miller  wrote:
>
> > Jwd sounds like version 6 of J. This predates Jqt.
> >
> > There's some docs at
> >
> https://www.jsoftware.com/docs/help602/user/win_driver_cmd_ref_overview.htm
> >
> > I hope this helps,
> >
> > --
> > Raul
> >
> > On Sat, Apr 15, 2023 at 4:57 PM Michal Wallace  >
> > wrote:
> > >
> > > Hey all,
> > >
> > > I've been working on JPrez again -- a console-based presentation tool
> > > that can record and play back interactions with a J REPL.
> > >
> > > It also lets you specify text to be recorded for voice overs to narrate
> > the
> > > interaction (for making videos), and over the past week I've embedded
> > > JPrez inside a windows binary that looks like a normal text console but
> > > can peek inside JPrez and actually let me record and play audio for
> > > the individual voice over lines.
> > >
> > > However, right now I'm doing everything from the host application. It
> > polls
> > > Jprez to see what's on the screen and what the current line of text is
> > > (jprez suggests a filename for a corresponding wav file).
> > >
> > > That all works fine for recording one line at a time, but if I want to
> > > actually
> > > play the presentation, I'd much rather have J drive the 

Re: [Jprogramming] Window Driver Mouse Events

2023-04-08 Thread bill lam
 Thank you for reporting this missing mouse event bug for webview. I can
reproduce it.
Fix will be available in the next release.

On Sun, Apr 9, 2023 at 2:43 AM Ed Gottsman 
wrote:

> Hello.  I’m having difficulty with mouse events in wd.
>
> They work perfectly.  I can pick up (e.g.) mouse-move events for a
> particular control (an isigraph).  Unfortunately, I don’t seem to have a
> way of determining that the mouse has left the isigraph and entered (say) a
> webview, since the webview seems to swallow mouse events (which makes
> sense) and does not report them.  (I’ve got a form_webview_mmove
> routine—it’s never called.). No “mouse_leave” event seems to be generated
> for the isigraph.  There also seem to be no mouse events reported at the
> form level when it’s busy in the webview.
>
> I print default events and the webview reports three: curl, load and (for
> some strange reason) mwheel, which is sent when I scroll a web page.  No
> mouse events seem to be reported.  Nor are there any focus-change events
> (which might also be helpful).
>
> All of this is a problem because (for UX reasons) I’d like to know that
> the mouse has left the isigraph.  As it stands, I have to assume that it’s
> hovering at the last-reported isigraph coordinates (when it may actually be
> busy with the webview); that confusion leads to an inappropriate response
> from the application.
>
> Any thoughts on this would be greatly appreciated.
>
> Many thanks.
>
> Ed
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] startup.ijs under Linux ...

2023-04-05 Thread bill lam
Or you can try
   0!:1 <'/home/math/j9.4-user/config/startup.ijs'

to see what's going wrong.

On Thu, 6 Apr 2023 at 3:13 AM chris burke  wrote:

> What do you get when loading that script? Try
>
>loadd '/home/math/j9.4-user/config/startup.ijs'
>
> On Wed, Apr 5, 2023 at 10:45 AM Martin Kreuzer 
> wrote:
> >
> > Dear all -
> >
> > My Linux machine broke down.
> >
> > New J setup (v9.4.1) on different hardware seems to work, except that
> > my startup.ijs isn't recognised:
> > "An error occurred when loading startup script:
> > /home/math/j9.4-user/config/startup.ijs"
> >
> > It's the same file I use under Windows without any problem.
> >
> > These are the current file permissions:
> > -rwxr-xr-x 1 math math 881193 Apr  2 11:57 startup.ijs
> >
> > What am I doing wrong?
> >
> > Thanks.
> >
> > -M
> >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Strange error

2023-03-31 Thread bill lam
I suspect this is a false alarm due to the nsis ( the software that
packaging the aio).

The possible work around is to download the base install for windows and
then install qt and addons manually.

On Fri, 31 Mar 2023 at 4:29 AM Raul Miller  wrote:

> The procedure I have to go through, to execute the AIO installer
> J9.4_win.exe is this:
>
> The browser displays the message: "j9.4_win.exe isn't commonly
> downloaded. Make sure you trust j9.4_win.exe before you open it." And
> below that line is a "See more" link (or maybe pseudo-link -- it's
> blue).
>
> When I click on "See more" I see a trash can icon and a "..." icon
> which gives me "Other options". And, at the bottom of the popup menu
> for "Other options" is a "Keep" option, which I have to select.
>
> This gives me a windows defender popup with the options to "Delete" or
> "Cancel" but also there's a little popup menu offered which is labeled
> "Show more". Selecting "Show more" gives me a "Keep anyway" option.
>
> At that point, I can almost run the thing, though it's still protected
> from my ignorant fingers. Here, I can either right-click on the file
> in the windows file explorer and select "Properties" and then select
> the "Unblock" checkbox down at the bottom, or I can ignore that and
> just run the thing. Since it's an installer, that final stage of
> protection doesn't see to make much difference which, presumably, is
> the reason for the runaround getting it to this point.
>
> Does this match your experience?
>
> If so, I guess we should make a note of this rigmarole in the Windows
> installation instructions...
>
> If not (an all-to-real possibility), I'd like to hear how your
> experience differs.
>
> Thanks,
>
> --
> Raul
>
> On Thu, Mar 30, 2023 at 2:52 PM Richard Donovan 
> wrote:
> >
> >
> > Hi Henry
> >
> > I deleted all the spaces and replaced with “real” ones. Still in error
> >
> > Ran a.i. Which seems ok…
> >
> >a.i.'".@": "."0@": each 405 90'
> > 34 46 64 34 58 32 34 46 34 48 64 34 58 32 101 97 99 104 32 52 48 53 32
> 57 48
> >".@": "."0@": each 405 90
> > |spelling error
> > |
> > |   ^
> > |   ".@":"."0@":each 405 90
> >
> >
> > I would love to migrate to 9.4 but Windows Defender resolutely refuses
> to run the installation file and does not even allow me to override and
> continue. I’ve been installing new releases since J402 and this is the
> first problem I’ve had!
> >
> > Richard
> >
> > > On 30 Mar 2023, at 18:06, Henry Rich  wrote:
> > > My guess is you pasted in a nonbreaking space.  The caret points to
> the error.
> > >
> > > Wouldn't you like release 9.4, which would give more error information?
> > >
> > > Henry Rich
> > >
> > > On 3/30/2023 12:54 PM, Richard Donovan wrote:
> > >> JVERSION
> > >> Engine: j902/j64avx2/windows
> > >> Release-a: commercial/2020-12-05T13:36:01
> > >> Library: 9.02.08
> > >> Qt IDE: 1.9.2s/5.12.10(5.12.10)
> > >> Platform: Win 64
> > >> Installer: J902 install
> > >> InstallPath: c:/program files/j902
> > >>
> > >>".@": "."0@": each 40 5 9008 90
> > >> |spelling error
> > >> |
> > >> | ^
> > >> | ".@":"."0@":each 40 5 9008 90
> > >>
> > >>
> > >> (NB. required output 4 0 5 9 0 0 8 9 0)
> > >>
> > >> The boxed question marks actually appear as an assortment of left,
> up, and down arrows.
> > >>
> > >> This is reproducible.
> > >>
> > >> I need a list of all the digits in y, concatenated as shown, with
> zeros retained
> > >>
> > >> Thanks for any help
> > >>
> > >> Richard
> > >>
> > >> --
> > >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J Console background

2023-03-24 Thread bill lam
The background color is controlled by the terminal emulator (xterm , screen
etc). Jconsole can do nothing about it. You may consider other frontend
such as Qt ide or JHS which has more features.

On Sat, 25 Mar 2023 at 8:29 AM Gilles Kuate  wrote:

> Hi Everyone
> I'm a very new user of J Language. The development environment seems
> terrific et i 've heard nothing but good things about its users :)
> To begin with, is it possible to change the background color of the
> console? I've tried that for a while but i didn't find a way to do it
> Thanks
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Webview, isigraph, core, threads

2023-03-23 Thread bill lam
wd'msgs' is the counterpart of doevents in classic VB. This is an old
fashioned programming paradigm and no longer supported in most gui
libraries including qt.

Decent asynchronous support or multithreading should obsolete this wd'msgs'.


On Thu, 23 Mar 2023 at 8:25 PM Ed Gottsman 
wrote:

> Bill,
>
> Brilliant.  Like solving global warming with a cotter pin.  Many thanks.
>
> Ed
>
> > On Mar 23, 2023, at 7:18 AM, bill lam  wrote:
> >
> > you need to add wd'msgs' to the tight loop to enable asynchronous event
> > processing.
> >
> > sys_timer_z_ =: 3 : 0
> > wd 'set vocContext invalid'
> > wd 'msgs'
> > )
> >
> > On Thu, Mar 23, 2023 at 7:09 PM Ed Gottsman  >
> > wrote:
> >
> >> Raul,
> >>
> >> Yes—I forgot.  Modern browsers’ rendering engines are concurrent and
> will
> >> recruit additional cores, so WebView is not entirely dependent on its
> >> “home” core. Still, there is apparently something that the home core
> needs
> >> to do before a page can be loaded.  Below is a script that demonstrates
> the
> >> problem.
> >>
> >> 1) Evaluate starve’'
> >> 2) Resize the window that appears
> >> 3) Type in a URL and press enter.  It should load in the right pane.
> >> 4) Select the “Draw Frames” check box.  This turns on animation, which
> >> tries (and fails, on my machine) to hit 100 fps.  It’s doing a lot of
> work
> >> per frame; the core is pegged.
> >> 5) Type in a URL and press enter.  On my machine it did not load until
> >> I—eventually—turned off “Draw Frames”.
> >>
> >> This (and your comments) suggest to me that if I thread off all of the
> >> “data wrangling” (which is considerable and could be a lot smarter) and
> >> just leave a shared data structure that a relatively lightweight
> >> main-thread rendering routine can turn into gl2 calls, that might fix
> it.
> >> Unfortunately, the only way to know for sure is to build it.
> >>
> >> Thank you.
> >>
> >> Ed
> >>
> >> load 'gl2'
> >> coinsert 'jgl2'
> >>
> >> buildForm =: 3 : 0
> >> wd 'pc vizform;'
> >> wd 'bin h;'
> >> wd   'bin v;'
> >> wd 'bin h;'
> >> wd   'cc drawFrames checkbox;cn Draw Frames;'
> >> wd   'cc urlBox edit;'
> >> wd 'bin z;'
> >> wd 'cc vocContext isigraph;'
> >> wd   'bin z;'
> >> wd   'cc browser webview;'
> >> wd 'bin z;'
> >> )
> >>
> >> layoutForm =: 3 : 0
> >> 'w h' =. ". wd 'getp wh'
> >> winW =. w - 20
> >> winH =. h - 20
> >> wd 'set drawFrames maxwh ' , (": (<. winW * 0.15) , 30) , ';'
> >> wd 'set urlBox maxwh ' , (": (<. winW * 0.3) , 30) , ';'
> >> wd 'set vocContext maxwh ' , (": (<. winW * 0.5) , winH) , ';'
> >> wd 'set browser maxwh ' , (": (<. winW * 0.5) , winH) , ';'
> >> )
> >>
> >> vizform_resize =: 3 : 0
> >> layoutForm ''
> >> )
> >>
> >> vizform_close =: 3 : 0
> >> wd 'timer 0'
> >> wd 'pclose'
> >> )
> >>
> >> sys_timer_z_ =: 3 : 0
> >> wd 'set vocContext invalid'
> >> )
> >>
> >> vizform_urlBox_button =: 3 : 0
> >> smoutput 'Loading' ; urlBox
> >> wd 'set browser url *' , urlBox
> >> )
> >>
> >> vizform_drawFrames_button =: 3 : 0
> >> if. drawFrames = '1' do.
> >>wd 'timer 10'
> >> else.
> >>wd 'timer 0'
> >>FrameTimeStamps =: ''
> >>wd 'set vocContext invalid'
> >> end.
> >> )
> >>
> >> vizform_vocContext_paint =: 3 : 0
> >> glfill 255 255 255 255
> >> k =. 1e7 ?@$ 1000
> >> drawFrameRate ''
> >> )
> >>
> >> FrameTimeStamps =: ''
> >>
> >> drawFrameRate =: 3 : 0
> >> FrameTimeStamps =: (t =. (6!:1) '' ) , FrameTimeStamps
> >> fps =. +/ (t - 1) < FrameTimeStamps
> >> glfont 'arial bold 24'
> >> glrgb 0 0 0
> >> gltextcolor ''
> >> gltextxy 10 10
> >> gltext (": fps) , ' fps'
> >> )
> >>
> >> starve =: 3 : 0
> >> buildForm ''
> >> layoutForm ''
> >> wd 'pshow'
> >> wd 'set urlBox text "https://www.cnn.com;;'
> >> )
> >>
> >>
> >>> On Mar 22, 2023, at 10:25 PM, Raul Miller 
> wrote:
> >>>
> >>&g

Re: [Jprogramming] Webview, isigraph, core, threads

2023-03-23 Thread bill lam
you need to add wd'msgs' to the tight loop to enable asynchronous event
processing.

sys_timer_z_ =: 3 : 0
wd 'set vocContext invalid'
wd 'msgs'
)

On Thu, Mar 23, 2023 at 7:09 PM Ed Gottsman 
wrote:

> Raul,
>
> Yes—I forgot.  Modern browsers’ rendering engines are concurrent and will
> recruit additional cores, so WebView is not entirely dependent on its
> “home” core. Still, there is apparently something that the home core needs
> to do before a page can be loaded.  Below is a script that demonstrates the
> problem.
>
> 1) Evaluate starve’'
> 2) Resize the window that appears
> 3) Type in a URL and press enter.  It should load in the right pane.
> 4) Select the “Draw Frames” check box.  This turns on animation, which
> tries (and fails, on my machine) to hit 100 fps.  It’s doing a lot of work
> per frame; the core is pegged.
> 5) Type in a URL and press enter.  On my machine it did not load until
> I—eventually—turned off “Draw Frames”.
>
> This (and your comments) suggest to me that if I thread off all of the
> “data wrangling” (which is considerable and could be a lot smarter) and
> just leave a shared data structure that a relatively lightweight
> main-thread rendering routine can turn into gl2 calls, that might fix it.
> Unfortunately, the only way to know for sure is to build it.
>
> Thank you.
>
> Ed
>
> load 'gl2'
> coinsert 'jgl2'
>
> buildForm =: 3 : 0
> wd 'pc vizform;'
> wd 'bin h;'
> wd   'bin v;'
> wd 'bin h;'
> wd   'cc drawFrames checkbox;cn Draw Frames;'
> wd   'cc urlBox edit;'
> wd 'bin z;'
> wd 'cc vocContext isigraph;'
> wd   'bin z;'
> wd   'cc browser webview;'
> wd 'bin z;'
> )
>
> layoutForm =: 3 : 0
> 'w h' =. ". wd 'getp wh'
> winW =. w - 20
> winH =. h - 20
> wd 'set drawFrames maxwh ' , (": (<. winW * 0.15) , 30) , ';'
> wd 'set urlBox maxwh ' , (": (<. winW * 0.3) , 30) , ';'
> wd 'set vocContext maxwh ' , (": (<. winW * 0.5) , winH) , ';'
> wd 'set browser maxwh ' , (": (<. winW * 0.5) , winH) , ';'
> )
>
> vizform_resize =: 3 : 0
> layoutForm ''
> )
>
> vizform_close =: 3 : 0
> wd 'timer 0'
> wd 'pclose'
> )
>
> sys_timer_z_ =: 3 : 0
> wd 'set vocContext invalid'
> )
>
> vizform_urlBox_button =: 3 : 0
> smoutput 'Loading' ; urlBox
> wd 'set browser url *' , urlBox
> )
>
> vizform_drawFrames_button =: 3 : 0
> if. drawFrames = '1' do.
> wd 'timer 10'
> else.
> wd 'timer 0'
> FrameTimeStamps =: ''
> wd 'set vocContext invalid'
> end.
> )
>
> vizform_vocContext_paint =: 3 : 0
> glfill 255 255 255 255
> k =. 1e7 ?@$ 1000
> drawFrameRate ''
> )
>
> FrameTimeStamps =: ''
>
> drawFrameRate =: 3 : 0
> FrameTimeStamps =: (t =. (6!:1) '' ) , FrameTimeStamps
> fps =. +/ (t - 1) < FrameTimeStamps
> glfont 'arial bold 24'
> glrgb 0 0 0
> gltextcolor ''
> gltextxy 10 10
> gltext (": fps) , ' fps'
> )
>
> starve =: 3 : 0
> buildForm ''
> layoutForm ''
> wd 'pshow'
> wd 'set urlBox text "https://www.cnn.com;;'
> )
>
>
> > On Mar 22, 2023, at 10:25 PM, Raul Miller  wrote:
> >
> > If only it were that simple.
> >
> > Sadly, Qt's design is such that all UI activity must happen on the main
> thread.
> >
> > https://doc.qt.io/qt-5/thread-basics.html
> >
> > Looking at how the system works, I believe that this was not the
> > original plan, but instead was an organic response to some of the very
> > reasonable expectations about how a user interface works.
> >
> > Here, it's perhaps also worth noting that a typical web browser, while
> > it will use multiple threads, also uses multiple processes.
> > Effectively, giving control over some part of screen real estate or
> > some underlying form of infrastructure to an independent program. And,
> > the webview control is, roughly speaking, a web browser.
> >
> > --
> > Raul
> >
> > On Wed, Mar 22, 2023 at 6:36 PM Ed Gottsman 
> wrote:
> >>
> >> Hello.
> >>
> >> I've got a Window Driver application whose left side is an isigraph
> control and whose right side is a webview control.  The webview loads pages
> in response to interaction with the isigraph.
> >>
> >> The isigraph side is quite snappy despite almost zero optimization
> effort (a tribute to the developers of the J runtime, the gl2 library,
> etc.).
> >>
> >> The webview…is much less responsive, even when loading locally-cached
> HTML.  In fact, as long as the mouse is moving and frames are being
> generated in the isigraph, the webview is unresponsive.  Only when the
> mouse pauses (and no frames are generated) does the webview load a page.
> >>
> >> I *think* that what's happening is that the two Window Driver child
> controls share a core, and the isigraph side steals all of the available
> cycles to service mouse-move events by generating frames, leaving no cycles
> for the webview to parse and render HTML.
> >>
> >> With that in mind, it seems possible that I could improve the
> responsiveness of the webview by threading off some or all of the
> (considerable) work that goes into generating an isigraph frame, leaving
> most of the 

Re: [Jprogramming] Webview, isigraph, core, threads

2023-03-22 Thread bill lam
jqt is single threaded but it should be responsive for the scenario that
you described. Can you post a simple script to exemplify the behavior?

On Thu, 23 Mar 2023 at 6:36 AM Ed Gottsman 
wrote:

> Hello.
>
> I've got a Window Driver application whose left side is an isigraph
> control and whose right side is a webview control.  The webview loads pages
> in response to interaction with the isigraph.
>
> The isigraph side is quite snappy despite almost zero optimization effort
> (a tribute to the developers of the J runtime, the gl2 library, etc.).
>
> The webview…is much less responsive, even when loading locally-cached
> HTML.  In fact, as long as the mouse is moving and frames are being
> generated in the isigraph, the webview is unresponsive.  Only when the
> mouse pauses (and no frames are generated) does the webview load a page.
>
> I *think* that what's happening is that the two Window Driver child
> controls share a core, and the isigraph side steals all of the available
> cycles to service mouse-move events by generating frames, leaving no cycles
> for the webview to parse and render HTML.
>
> With that in mind, it seems possible that I could improve the
> responsiveness of the webview by threading off some or all of the
> (considerable) work that goes into generating an isigraph frame, leaving
> most of the shared core's cycles for the webview.
>
> I hesitate, however, before re-arranging the code because 1) I'm not sure
> about the diagnosis and 2) I've worked in graphics environments where
> you're not allowed to update GUI controls off the main thread and 3) maybe
> there's a much simpler approach (can I somehow thread off the webview,
> e.g.?).
>
> Comments on any part of this would be greatly appreciated.
>
> Thank you.
>
> Ed
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] IDC_* cursor codes

2023-03-20 Thread bill lam
gl2 is not an real addon because it is provided by the frontend. The gl2
implementation are different for jqt and jandroid. gl2.ijs is loaded
automatically during loading the ide addon.
For backward compatibility some artifact addons such as dll, gl2 etc are
accepted but ignored by the verb load.

On Tue, 21 Mar 2023 at 5:09 AM Raul Miller  wrote:

> open 'ide/qt/gl2' works.
>
> I do not know why open 'gl2' silently fails.
>
> --
> Raul
>
> On Mon, Mar 20, 2023 at 5:05 PM Ed Gottsman 
> wrote:
> >
> > Hi.  If I’m reading the gl2 docs (
> https://code.jsoftware.com/wiki/Guides/Window_Driver/gl2_Command_Reference)
> correctly, I can review the IDC_ cursor codes by entering open ‘gl2’ in the
> terminal.  Unfortunately, this doesn’t seem to do anything and returns an
> empty result.  I poked around for gl2.ijs in the filesystem without success.
> >
> > Where is gl2.ijs (or how can I bring it up)?
> >
> > From the docs:
> > glcursor n ; sets mouse cursor. Values are defined as IDC_... in gl2.ijs
> which can be viewed with open 'gl2'. (added in J804).
> >
> >
> > Thank you.
> >
> > Ed
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] problem with 'plot'

2023-03-18 Thread bill lam
The plot output is at ~temp/plot.pdf

And IIRC there is an option to suppress the display of the plot if you are
only want the plot output file.


On Sat, 18 Mar 2023 at 6:15 PM rsykora via Programming <
programm...@jsoftware.com> wrote:

> Dear Maurice,
>
>
> > If I understand correctly, "plot 1 2 3" will
> > 1. generate j902-user/temp/plot.pdf (default output type) and then
> > 2. launch xdg-open (yes, a sh file) to display it.
> >
> > Does your xdg-open utility work in your linux environment with pdf?
>
> thank you! This was what I needed to know. The linux is actually at a
> frontend
> to a computational grid, and no xdg-open is present there. (I made a link
> to a something that can open a pdf, and it worked.)
>
>
> Best regards,
> Ruda
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] problem with 'plot'

2023-03-17 Thread bill lam
Which frontend are you using? jconsole or jqt?

On Fri, 17 Mar 2023 at 11:24 PM rsykora via Programming <
programm...@jsoftware.com> wrote:

> Dear list,
>
>
> I use j902. When I try:to use 'plot' I get:
>load'plot'
>plot 1 2 3
>sh: line 1: : command not found
>
> Do you have any hint where I should look in
> order to find what could be the problem?
>
> Thanks!
>
> Ruda
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Rank numbering with duplicates

2023-03-16 Thread bill lam
J phrases is good source too.

https://www.jsoftware.com/docs/help807/phrases/rank_class.htm


On Fri, 17 Mar 2023 at 12:35 AM Devon McCormick  wrote:

> This is good to know - thanks!
>
> On Wed, Mar 15, 2023 at 8:40 PM Ric Sherlock  wrote:
>
> > As an adverb we can get the ascending and descending by applying either
> /:
> > or \:
> >
> > open 'stats/base/univariate' NB. in JQt will open the script
> >
> > rankCompete=: 1 :'u~ i. ]'
> >
> > On Thu, Mar 16, 2023 at 1:30 PM Ric Sherlock  wrote:
> >
> > > There are number of adverbs in the stats/base script for getting
> > different
> > > types of rankings
> > >
> > > NB.*rankOrdinal a ordinal ranking ("0 1 2 3") of array y
> > >
> > > NB.*rankCompete a standard competition ranking ("0 0 2 3") of array y
> > >
> > > NB.*rankDense a dense ranking ("0 0 1 2") of array y
> > >
> > > NB.*rankFractional a fractional ranking ("0 1.5 1.5 3") of array y
> > >
> > >
> > > \: rankCompete vec
> > >
> > > 6 0 3 0 4 2 5 6
> > >
> > > On Thu, Mar 16, 2023 at 11:24 AM Devon McCormick 
> > > wrote:
> > >
> > >> These are both way better than what I came up with.  Thanks!
> > >>
> > >> On Wed, Mar 15, 2023 at 5:07 PM 'robert therriault' via Programming <
> > >> programm...@jsoftware.com> wrote:
> > >>
> > >> > Nicely done Elijah!
> > >> >
> > >> > It has a pretty solution in tacit as well
> > >> >
> > >> > vec=. 49 275 93 275 92 99 91 49
> > >> >t=. i.~ \:~
> > >> >t vec
> > >> > 6 0 3 0 4 2 5 6
> > >> >
> > >> > Cheers, bob
> > >> >
> > >> > > On Mar 15, 2023, at 13:59, Elijah Stone 
> > wrote:
> > >> > >
> > >> > > One thing that comes to mind is (\:~vec) i.vec.
> > >> > >
> > >> > > On Wed, 15 Mar 2023, Devon McCormick wrote:
> > >> > >
> > >> > >> Hi, has anyone looked into how to generate a rank numbering where
> > >> > duplicate
> > >> > >> values get duplicate order numbers?
> > >> > >>
> > >> > >> For example, when we rank this vector descending,
> > >> > >>  \:vec=. 49 275 93 275 92 99 91 49
> > >> > >> 1 3 5 2 4 6 0 7
> > >> > >> we see that 1 3{vec and 0 7{vec are the same so I would like to
> end
> > >> up
> > >> > with
> > >> > >> a rank numbering like this 6 0 3 0 4 2 5 6  so the ties for first
> > and
> > >> > last
> > >> > >> place get the same value in the proper order where zero
> designates
> > >> the
> > >> > >> highest.
> > >> > >>
> > >> > >> I know I've done this before and I have a very clumsy way to
> > achieve
> > >> > this
> > >> > >> but I'm wondering if there's a better one.
> > >> > >>
> > >> > >> Thanks,
> > >> > >>
> > >> > >> Devon
> > >> > >>
> > >> > >> --
> > >> > >>
> > >> > >> Devon McCormick, CFA
> > >> > >>
> > >> > >> Quantitative Consultant
> > >> > >>
> > >> --
> > >> > >> For information about J forums see
> > >> http://www.jsoftware.com/forums.htm
> > >> > >
> > --
> > >> > > For information about J forums see
> > >> http://www.jsoftware.com/forums.htm
> > >> >
> > >> >
> --
> > >> > For information about J forums see
> > http://www.jsoftware.com/forums.htm
> > >> >
> > >>
> > >>
> > >> --
> > >>
> > >> Devon McCormick, CFA
> > >>
> > >> Quantitative Consultant
> > >> --
> > >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >>
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] glpixelm seems to be missing

2023-03-12 Thread bill lam
glpixelm should had been decommissioned years ago. Can you point me the url
of glpixelm documentation? Documentation should be fixed if it still
mentions glpixelm.

On Sun, 12 Mar 2023 at 8:04 PM Ed Gottsman 
wrote:

> Greetings.
>
> The gl2 docs mention:
>
> glpixelm x y w h address ; same as glpixels except the argument has the
> memory address of pixeldata.
>
>
>
> …which I would like to use.
>
>
> I definitely have the gl2 library loaded:
>
>glfill
> chkgl2@:('"/Applications/j9.4/bin/libjqt.dylib" glfill > i *i' cd <@:<.)"1
>
>glpie
> chkgl2@:('"/Applications/j9.4/bin/libjqt.dylib" glpie > i *i' cd <)"1
>
> …however glpixelm doesn’t seem to exist:
>
>glpixelm
> |value error: glpixelm
>
>
> Is there something else I need to load?
>
> Thank you.
>
> Ed
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] plot and paint demo

2023-03-11 Thread bill lam
The coordinates of the plot will be converted to integer for rendering.
Therefore any values of infinity or NaN can not be handled.

On Sun, Mar 12, 2023 at 2:07 PM More Rice  wrote:

> Hi,
>
> some questions, if I may ...
>
> 1. plot can't handle asymptote (or "not in domain" issue) right at the
> boundary in its domain?
>
> install 'all'
>
> load 'plot trig numeric'
>
> plot _5 5 ; '%' NB. ok
>
> plot _5 0 ; '%' NB. Bad
>
> |NaN error: plotfintvl
>
> | bakproj=.({:"1 zvals),~"0 1(}."1 zvals) -(}."1 secant)*"1 intsize
>
> plot 0 5 ; '%' NB. Bad
>
> |NaN error: plotfintvl
>
> | fwdproj=.({."1 zvals),"0 1(}:"1 zvals) +(}:"1 secant)*"1 intsize
>
> plot  0 10; '%:'  NB. ok
>
> plot _1 10; '%:'  NB. Bad
>
> |domain error: plotsubd
>
> | mtone1=.
> (<./@:i.&0)@:(2&(<:/\)))>.((i.&0)@:(2&(>:/\"1))@(1&{::)"1 d
>
> JVERSION
>
> Engine: j903/j64avx2/windows
>
> Release-b: commercial/2022-01-28T04:09:50
>
> Library: 9.03.08
>
> Qt IDE: 1.9.5s/5.15.2(5.15.2)
>
> Platform: Win 64
>
> Installer: J903 install
>
> InstallPath: c:/users/myself/software/j903
>
> Contact: www.jsoftware.com
>
>
>
> 2. I'm trying to control plot's y-scale and x-/y-tick labels. I don't see
> its doc in jwiki nor calculus.pdf.  So, I tried scrolling through
> Help|Studio|Showcase...|plot to see if they're possible; but still
> nothing.  For example, instead of a numeric value, I want to do 0, +/-
> 1p1, +/- 2p1, etc.  Can it be done?
>
>
> 3. While looking for solution to #2, I stumbled upon a bug:
> Help|Studio|Showcase...|isigraph.  Repeatedly pressing F12 till you see
> 'Screen Roller' (yes, ignore Paint Demo and just hit another F12).  Once
> you reach this stage, Paint Demo will relaunch if you try to exit the
> window. In the end, I've to kill the jqt to get out of the demo.
>
>
> thanks
>
>
> Maurice
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J shell scripts

2023-03-11 Thread bill lam
If we do  this then J should exit automatically after executing the last
line of the script. This is the normal behavior of shell scripts.

On Sat, 11 Mar 2023 at 9:56 PM Henry Rich  wrote:

> What we have agreed to do is to treat a #! line as a comment ONLY when
> #! are the first 2 characters of a file loaded by 0!:n (which is used by
> the load command).
>
> Henry Rich
>
> On 3/10/2023 7:29 PM, Raul Miller wrote:
> > Byte order mark is another can of worms, as is wide encoding.
> >
> > But, yes, currently, shebang handling on the J side relies on
> > undefined verb parsing.
> >
> > If we handle shebang lines, a question becomes: how much handling
> > should be done?
> >
> > (For example, does #! become a comment prefix? In many interpreted
> > languages, # marks the beginning of a comment which ends at line end.)
> >
> > (Also, if the J interpreter cannot find itself at the shebang path
> > (delimited by a terminating space), should it pass control to that
> > interpreter? This is how perl handles shebang lines...)
> >
> > Etc.
> >
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] J shell scripts

2023-03-09 Thread bill lam
Did you mean put a symlink /usr/bin/ijconsole to j installation under the
user's home folder?
eg. sudo ln -s $HOME/j9.4/bin/jconsole /usr/bin/ijconsole





On Fri, Mar 10, 2023 at 1:29 AM Raul Miller  wrote:

> The recent change in directory naming from j903 to j9.4 introduces an
> interesting issue for shell scripts on unix-like systems.
>
> In J shell scripts, this works:
>
> #!/home/username/j903/bin/jconsole
>
> However, this fails with a spelling error:
>
> #!/home/username/j9.4/bin/jconsole
>
> Or, on OSX, the shebang line is different, but the spelling error remains:
>
> #!/Applications/j9.4/bin/jconsole
>
> That said, there's some other issues here, related to portability. One
> of which is that (as a general rule) a home directory is personal
> rather than portable. Another is that there's official java jconsole
> which does not understand J.
>
> But, also, for a long time now, Debian based distributions have been
> distributing j with /usr/bin/ijconsole as a symbolic link to the
> current installed location for J. (Here, the 'i' in ijconsole stands
> for Iverson.)
>
> So I think that now would  be a good time to adopt that as "documented
> standard practice" for j shell scripts.
>
> FYI,
>
> --
> Raul
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.4.1 release is available

2023-03-02 Thread bill lam
I think that readlink is not guaranteed to be installed by default on linux
or other *nix.

On Thu, 2 Mar 2023 at 6:34 PM 'Viktor Grigorov' via Programming <
programm...@jsoftware.com> wrote:

> 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 allows the
> script to run from without top level of the j dir.
>
>
> Mar 2, 2023, 08:38 by bbill@gmail.com:
>
> > j9.4.1 for android  is available at
> >
> > https://www.jsoftware.com/download/j9.4/install/
> >
> >
> >
> >
> > On Thu, Mar 2, 2023 at 1:49 AM Eric Iverson 
> > wrote:
> >
> >> j9.4.1 release is available!
> >>
> >> https://code.jsoftware.com/wiki/System/Installation/J9.4
> >>
> >> Zip installs are there now and AIO/Debian/apk will be there shortly.
> >>
> >> Do a full install. You can do this on top of an existing j9.4 folder,
> but
> >> probably better to rename it out of the way and start with a clean
> slate.
> >>
> >> Name convention has changed (j904 -> j9.4), so the user folder is:
> >> j9.4-user.
> >>
> >> Do not just upgrade the JE as you did with the beta as this may not
> give a
> >> clean and complete installation.
> >>
> >> ***
> >> If you were on the beta journey you will know that this is a big step
> for
> >> J.
> >>
> >> J now has a threading model ready for serious use. This is going to take
> >> time to settle in, but is going to change the way we tackle some
> problems.
> >>
> >> Roger's original implementation of rationals and extended integers was
> >> always intended as a placeholder. Many years later, we have finally
> moved
> >> to GMP. No new capabilities, but the performance improvement can be a
> game
> >> changer. The hobby horse is now a work horse.
> >>
> >> Improved error messages will be appreciated by new users, but are also
> >> welcomed by old hands. This feature is extensible and will evolve.
> >>
> >> Release Notes are worth a look:
> >> https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.4
> >>
> >> This was a team effort and benefited from significant community
> >> participation. But we should all recognize the major contributions of a
> few
> >> individuals.
> >>
> >> Henry Rich (everything - especially threads)
> >> Raul Miller (GMP)
> >> Bill Lam (steady hand in everything - android/openbsd/freebsd)
> >> Elijah Stone (threads and error messages)
> >> Bill Heagy (testing/testing/testing - beyond value)
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.4.1 release is available

2023-03-01 Thread bill lam
j9.4.1 for android  is available at

https://www.jsoftware.com/download/j9.4/install/




On Thu, Mar 2, 2023 at 1:49 AM Eric Iverson 
wrote:

> j9.4.1 release is available!
>
> https://code.jsoftware.com/wiki/System/Installation/J9.4
>
> Zip installs are there now and AIO/Debian/apk will be there shortly.
>
> Do a full install. You can do this on top of an existing j9.4 folder, but
> probably better to rename it out of the way and start with a clean slate.
>
> Name convention has changed (j904 -> j9.4), so the user folder is:
> j9.4-user.
>
> Do not just upgrade the JE as you did with the beta as this may not give a
> clean and complete installation.
>
> ***
> If you were on the beta journey you will know that this is a big step for
> J.
>
> J now has a threading model ready for serious use. This is going to take
> time to settle in, but is going to change the way we tackle some problems.
>
> Roger's original implementation of rationals and extended integers was
> always intended as a placeholder. Many years later, we have finally moved
> to GMP. No new capabilities, but the performance improvement can be a game
> changer. The hobby horse is now a work horse.
>
> Improved error messages will be appreciated by new users, but are also
> welcomed by old hands. This feature is extensible and will evolve.
>
> Release Notes are worth a look:
> https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.4
>
> This was a team effort and benefited from significant community
> participation. But we should all recognize the major contributions of a few
> individuals.
>
> Henry Rich (everything - especially threads)
> Raul Miller (GMP)
> Bill Lam (steady hand in everything - android/openbsd/freebsd)
> Elijah Stone (threads and error messages)
> Bill Heagy (testing/testing/testing - beyond value)
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.4.0-beta13 available (rename from j904-beta)

2023-02-23 Thread bill lam
9.4.0-beta13 is available for 64-bit amd openbsd and freebsd.

On Fri, Feb 24, 2023 at 12:44 AM bill lam  wrote:

> 9.4.0-beta12 is available for 64-bit amd openbsd and freebsd.
> These 2 platforms are not officially supported, and released as technical
> preview.
>
> https://www.jsoftware.com/download/j9.4/install/
>
> On Fri, Feb 24, 2023 at 12:39 AM bill lam  wrote:
>
>> j9.4.0-beta13 is available for android. due to name change, you need to
>> download from
>>
>> https://www.jsoftware.com/download/j9.4/install/
>>
>> On Thu, Feb 23, 2023 at 10:52 PM Eric Iverson 
>> wrote:
>>
>>> J904 has been renamed to J9.4. Previously 904 indicated 9 major and 04
>>> minor and additional info was in the type (beta-k or release-b). A more
>>> conventional major.minor.revision has been adopted. For example, j9.4.0
>>> (1st stable release) or j9.4.0-beta-13 and j9.4 will refer to the latest
>>> revision available.
>>>
>>> j9.4.0-beta13 is now available.
>>>
>>> If you already run the beta, then upgrade is easy:
>>>load'pacman'
>>>'upgrade'jpkg'jengine'
>>>
>>> There may be hiccups due to the name change. If the above upgrade doesn't
>>> work, you will need to do a full install from the zip file. First delete
>>> the j904 folder, and then do the zip install.
>>>
>>> The new install folder will be j9.4 and the corresponding user folder
>>> will
>>> be j9.4-user. Move stuff from the old j904-user folder to the new folder
>>> as
>>> appropriate.
>>>
>>> If you have not installed the beta, there is still time to take a look
>>> and
>>> help make the final release as stable as possible:
>>>  https://code.jsoftware.com/wiki/System/Installation/J9.4
>>>
>>> This is the final beta and the stable release will be out early next
>>> week.
>>>
>>> Release notes:
>>>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J904 (not yet moved
>>> toJ8.4)
>>>
>>> Questions/bug reports/etc. should go to the beta forum.
>>> --
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.4.0-beta13 available (rename from j904-beta)

2023-02-23 Thread bill lam
9.4.0-beta12 is available for 64-bit amd openbsd and freebsd.
These 2 platforms are not officially supported, and released as technical
preview.

https://www.jsoftware.com/download/j9.4/install/

On Fri, Feb 24, 2023 at 12:39 AM bill lam  wrote:

> j9.4.0-beta13 is available for android. due to name change, you need to
> download from
>
> https://www.jsoftware.com/download/j9.4/install/
>
> On Thu, Feb 23, 2023 at 10:52 PM Eric Iverson 
> wrote:
>
>> J904 has been renamed to J9.4. Previously 904 indicated 9 major and 04
>> minor and additional info was in the type (beta-k or release-b). A more
>> conventional major.minor.revision has been adopted. For example, j9.4.0
>> (1st stable release) or j9.4.0-beta-13 and j9.4 will refer to the latest
>> revision available.
>>
>> j9.4.0-beta13 is now available.
>>
>> If you already run the beta, then upgrade is easy:
>>load'pacman'
>>'upgrade'jpkg'jengine'
>>
>> There may be hiccups due to the name change. If the above upgrade doesn't
>> work, you will need to do a full install from the zip file. First delete
>> the j904 folder, and then do the zip install.
>>
>> The new install folder will be j9.4 and the corresponding user folder will
>> be j9.4-user. Move stuff from the old j904-user folder to the new folder
>> as
>> appropriate.
>>
>> If you have not installed the beta, there is still time to take a look and
>> help make the final release as stable as possible:
>>  https://code.jsoftware.com/wiki/System/Installation/J9.4
>>
>> This is the final beta and the stable release will be out early next week.
>>
>> Release notes:
>>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J904 (not yet moved
>> toJ8.4)
>>
>> Questions/bug reports/etc. should go to the beta forum.
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j9.4.0-beta13 available (rename from j904-beta)

2023-02-23 Thread bill lam
j9.4.0-beta13 is available for android. due to name change, you need to
download from

https://www.jsoftware.com/download/j9.4/install/

On Thu, Feb 23, 2023 at 10:52 PM Eric Iverson 
wrote:

> J904 has been renamed to J9.4. Previously 904 indicated 9 major and 04
> minor and additional info was in the type (beta-k or release-b). A more
> conventional major.minor.revision has been adopted. For example, j9.4.0
> (1st stable release) or j9.4.0-beta-13 and j9.4 will refer to the latest
> revision available.
>
> j9.4.0-beta13 is now available.
>
> If you already run the beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> There may be hiccups due to the name change. If the above upgrade doesn't
> work, you will need to do a full install from the zip file. First delete
> the j904 folder, and then do the zip install.
>
> The new install folder will be j9.4 and the corresponding user folder will
> be j9.4-user. Move stuff from the old j904-user folder to the new folder as
> appropriate.
>
> If you have not installed the beta, there is still time to take a look and
> help make the final release as stable as possible:
>  https://code.jsoftware.com/wiki/System/Installation/J9.4
>
> This is the final beta and the stable release will be out early next week.
>
> Release notes:
>  https://code.jsoftware.com/wiki/System/ReleaseNotes/J904 (not yet moved
> toJ8.4)
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Addon/docs/joxygen

2023-02-23 Thread bill lam
download this file
https://raw.githubusercontent.com/jsoftware/jsource/master/jlibrary/tools/regex/jpcre2.dll
and replace the old jpcre2.dll under your j installation  tools/regex folder

On Thu, Feb 23, 2023 at 4:04 PM William Szuch 
wrote:

> Running test.ijs
>
>
> JVERSION
>
> Engine: j9.4.0-beta10/j64avx2/windows
>
> Build: GPL3/2023-01-24T04:48:26/clang-15-0-5/SLEEF=1
>
> Library: 9.4.16
>
> Qt IDE: 2.0.3/6.2.4(6.2.4)
>
> Platform: Win 64
>
> Installer: J904 install
>
> InstallPath: c:/users/bill/j904
>
> Contact: www.jsoftware.com<http://www.jsoftware.com>
>
>
>
> load '~addons/docs/joxygen/test.ijs'
>
> reading: compare.ijs
>
> |this version of PCRE2 does not have Unicode support at offset 0
>
> (^|[^[:alnum:]_])([[:alpha:]][[:alnum:]_]*) *=:
>
> ^
>
> : regerror
>
> | m 13!:8[12
>
> |[-35] c:\users\bill\j904\addons\docs\joxygen\test.ijs
>
>
>
> Regards
>
> Bill Szuch
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Odd

2023-02-17 Thread bill lam
Can you also confirm this will crash or not

(-/ .*)x: 4 4$_ __ 0 0 1 1 0 0 0 0 1 0 0 0 0 1


On Fri, 17 Feb 2023 at 6:36 PM Jan-Pieter Jacobs 
wrote:

> I recently had problems with GMP too on my AVX (not AVX2) laptop.
> They seem to be solved with the most recent beta.
> With a fresh install from the install package "j904_linux64.tar.gz
> 2023-01-24 17:44  3.4M  j904 linux 64-bit" from
> http://www.jsoftware.com/download/j904/install/ , I initially got a crash
> report when trying x: in jconsole immediately, but that got resolved after
> running updateje.sh .
> My session log:
>
> jpjacobs@icarus:~/j904$ ./bin/jconsole
>x: NB. this was before running updateje.sh
> x:
>x: 100
> JE has crashed, likely due to an internal bug.  Please report the code
> which caused the crash, as well as the following printout, to the J
> programming forum.
> 004030a2: ?:0:  ?
> 7f8788bf451f:
> ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0:?
> 7f8783c1ce2e: ?:0:  ?
> 7f8784343554: ?:0:  ?
> 7f8784343f97: ?:0:  ?
> 7f878434796b: ?:0:  ?
> 7f87843494c1: ?:0:  ?
> 7f878434934b: ?:0:  ?
> 7f87843688d9: ?:0:  ?
> 7f8784354bf1: ?:0:  ?
> 7f87843549a3: ?:0:  ?
> 00402f9f: ?:0:  ?
> 7f8788bdbd8f: sysdeps/nptl/libc_start_call_main.h:58:
> __libc_start_call_main
> 7f8788bdbe3f: csu/libc-start.c:392: __libc_start_main_impl
> 004024ed: ?:0:  ?
> : ?:0:  ?
>
> -
> Aborted (core dumped)
> jpjacobs@icarus:~/j904$ ./updateje.sh
> Engine: j9.4.0-beta11/j64avx/linux
> Commercial: www.jsoftware.com/clang-11-0-0
> Library: 9.04.11
> Platform: Linux 64
> Installer: J904 install
> InstallPath: /home/jpjacobs/j904
> Contact: 2023-02-11T16:14:34
> jpjacobs@icarus:~/j904$ ./bin/jconsole
>x: 100
> 100
>>: x: 100
> 101
>datatype >: x: 100
>
> So functionally it seems fine eventually; and it seems this would also be
> accomplished by doing the install '*' recommended in the installation
> instructions.
> Maybe there is still an incompatibility between the non-avx binary and
> libgmp causing the initial crash? Not an immediate problem for me though.
>
> Best regards,
> Jan-Pieter
>
> Op vr 17 feb. 2023 om 07:34 schreef Devon McCormick :
>
> > If it's the GMP that tripped me up by giving a nonce error on "x:" last
> > month, you need to
> >load 'pacman'
> >install'gmp'
> >
> >
> > On Fri, Feb 17, 2023 at 12:26 AM 'Pascal Jasmin' via Programming <
> > programm...@jsoftware.com> wrote:
> >
> > >
> > >
> > > There is also a numeric library install required (forget which one)
> that
> > > while it shouldn't crash without it, will not produce extended results.
> > >
> > >
> > >
> > >
> > > On Thursday, February 16, 2023 at 10:31:45 p.m. EST, bill lam <
> > > bbill@gmail.com> wrote:
> > >
> > >
> > >
> > >
> > >
> > > We have received reports on the crash but can't reproduce by ourselves.
> > > Would you give detail of the 2 computers such
> > > linux distro name and version, and
> > > version of glibc (  ldd --version)
> > >
> > > On Fri, Feb 17, 2023 at 11:22 AM Omar Antolín Camarena <
> > > omar.anto...@gmail.com> wrote:
> > >
> > > > >  And it no longer crashes.
> > > >
> > > > There's a little bit of luck involved in that. I use J on two
> > computers,
> > > on
> > > > one j904 works just fine but on the other doing anything at all using
> > > > extended integers makes it crash.
> > > >
> > > >
> > > > On Thu, Feb 16, 2023 at 9:19 PM Mike Duvos  wrote:
> > > >
> > > > > Thanks.  I got j904 installed from the zips.  Surprisingly, it is
> up
> > to
> > > > 58
> > > > > times faster doing modular exponentiation on large extended
> precision
> > > > > integers.  And it no longer crashes.
> > > > >
> > > > > On Thu, Feb 16, 2023 at 6:24 PM Devon McCormick <
> devon...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > It's probably blank because there is no all-in-one installer for
> > > 9.04.
> > > > > > Raul is correct that you have to install it from zips.
> > > > > >
>

Re: [Jprogramming] Odd

2023-02-16 Thread bill lam
We have received reports on the crash but can't reproduce by ourselves.
Would you give detail of the 2 computers such
linux distro name and version, and
version of glibc (  ldd --version)

On Fri, Feb 17, 2023 at 11:22 AM Omar Antolín Camarena <
omar.anto...@gmail.com> wrote:

> >  And it no longer crashes.
>
> There's a little bit of luck involved in that. I use J on two computers, on
> one j904 works just fine but on the other doing anything at all using
> extended integers makes it crash.
>
>
> On Thu, Feb 16, 2023 at 9:19 PM Mike Duvos  wrote:
>
> > Thanks.  I got j904 installed from the zips.  Surprisingly, it is up to
> 58
> > times faster doing modular exponentiation on large extended precision
> > integers.  And it no longer crashes.
> >
> > On Thu, Feb 16, 2023 at 6:24 PM Devon McCormick 
> > wrote:
> >
> > > It's probably blank because there is no all-in-one installer for 9.04.
> > > Raul is correct that you have to install it from zips.
> > >
> > > On Thu, Feb 16, 2023 at 8:24 PM Raul Miller 
> > wrote:
> > >
> > > > I don't know why there's a link to a non-existent all in one page.
> > > >
> > > > For now, I think you have to install it from a zip archive:
> > > > https://code.jsoftware.com/wiki/System/Installation/J904/Zips
> > > >
> > > > I hope this helps,
> > > >
> > > > --
> > > > Raul
> > > >
> > > > On Thu, Feb 16, 2023 at 7:50 PM Mike Duvos  wrote:
> > > > >
> > > > > I went to the Wiki page for j904 and clicked on the all-in-one
> > > installer
> > > > > for Windows, and it took me to a Wiki page with nothing on it.  Do
> I
> > > have
> > > > > to install it some other way?
> > > > >
> > > > >
> > > > >
> > > > > On Thu, Feb 16, 2023 at 3:32 PM Raul Miller  >
> > > > wrote:
> > > > >
> > > > > > When I run (genkey 32) under j903, I get a crash.
> > > > > >
> > > > > > When I run (genkey 32) under j904, it works fine.
> > > > > >
> > > > > > A number of issues have been addressed in j904 (and it's almost
> > ready
> > > > > > for release). It might be worth upgrading.
> > > > > >
> > > > > > --
> > > > > > Raul
> > > > > >
> > > > > > On Thu, Feb 16, 2023 at 6:21 PM Mike Duvos 
> > wrote:
> > > > > > >
> > > > > > > I installed it a few weeks ago from the link in the wiki to the
> > > most
> > > > > > recent
> > > > > > > stable version.  If I click on “about” in jqt , it says…
> > > > > > >
> > > > > > > Engine: j903/j64avx2/windows
> > > > > > >
> > > > > > > It said the beta was for “adventurous users.”
> > > > > > >
> > > > > > > Should I be running a different one?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Feb 16, 2023 at 3:01 PM Elijah Stone <
> > elro...@elronnd.net>
> > > > > > wrote:
> > > > > > >
> > > > > > > > What version of je are you running?  I get innocuous results:
> > > > > > > >
> > > > > > > > genkey 32
> > > > > > > > 15970092203996114281 4061548213 3932020837
> > > > > > > > genkey 32
> > > > > > > > 14979749644274477941 4038627851 3709118591
> > > > > > > > genkey 32
> > > > > > > > 15125320685289546439 3974107847 3805966337
> > > > > > > >
> > > > > > > > If you are not running the latest beta, I suggest doing so;
> > among
> > > > other
> > > > > > > > things, support for extended-precision numbers was much
> > improved.
> > > > > > > >
> > > > > > > > On Thu, 16 Feb 2023, Mike Duvos wrote:
> > > > > > > >
> > > > > > > > > I wrote a brief J script to generate random RSA keys in
> > various
> > > > > > > > lengths.  I
> > > > > > > > > put a copy in my Dropbox at the following URL…
> > > > > > > > >
> > > > > > > > > https://www.dropbox.com/s/0y0tpgtjtv4vvd2/rsakeys.ijs
> > > > > > > > >
> > > > > > > > > In this script is a function called “genkey” which crashes
> J.
> > > > > > > > >
> > > > > > > > > genkey =: 3 : 0"0
> > > > > > > > >
> > > > > > > > > q =. p =. randprime y
> > > > > > > > >
> > > > > > > > > while. q = p
> > > > > > > > >
> > > > > > > > > do.
> > > > > > > > >
> > > > > > > > > q =. randprime y
> > > > > > > > >
> > > > > > > > > end.
> > > > > > > > >
> > > > > > > > > if. p < q
> > > > > > > > >
> > > > > > > > > do.
> > > > > > > > >
> > > > > > > > > 'p q'=. q,p
> > > > > > > > >
> > > > > > > > > end.
> > > > > > > > >
> > > > > > > > > (p*q),p,q
> > > > > > > > >
> > > > > > > > > )
> > > > > > > > >
> > > > > > > > > randprime y returns a random prime of length y bits with
> the
> > > > upper
> > > > > > two
> > > > > > > > bits
> > > > > > > > > set as an extended precision integer.  It seems rock solid
> > and
> > > > has
> > > > > > been
> > > > > > > > > called millions of times without issue.
> > > > > > > > >
> > > > > > > > > genkey picks a prime, p, and another prime not equal to it,
> > q,
> > > > and
> > > > > > swaps
> > > > > > > > > them if necessary so p is the larger one.  It then returns
> a
> > > > vector
> > > > > > of
> > > > > > > > > length 3, consisting of p*q, p, and q.
> > > > > > > > >
> > > > > > > > > If you load this script, and type “genkey 32”, you get a “J
> > has
> 

Re: [Jprogramming] LAPACK

2023-02-16 Thread bill lam
You can type dgeev to see its definition (coinsert 'jlapack2' so that
locale _jlapack2_ becomes optional)

It calls dll directly so that you may run the lab on ststem dllwin32 if you
are unfamiliar with calling dll.


On Thu, 16 Feb 2023 at 4:08 PM Erik Papp  wrote:

> Thank you.
>  I run the example flawlessly, but I could't use dgeev and gesvd.
>
> require'math/lapack2'
>
> coinsert'jlapack2'
>
>
>
> ]A=:3 3$63.2 _36.5 _43.8 _36.6 74.4 78.8 _43.9 78.1 35.9
>
> 63.2 _36.5 _43.8
>
> _36.6 74.4 78.8
>
> _43.9 78.1 35.9
>
>
>
> $A
>
> 3 3
>
>
>
> dgeev_jlapack2_A
>
> |value error: dgeev_jlapack2_A
>
> do_dgeev_A
>
>
>
> |value error: do_dgeev_A
>
> dgeev_A
>
>
>
> |value error: dgeev_A
>
>
>
> NB. The example running perfectly.
>
>
>
> NB. How to use dgeev function in a program?
>
>
>
> do_dgesvd A
>
> |value error: do_dgesvd
>
> | do_dgesvd A
>
>
>
> do_dgesvd_A
>
> |value error: do_dgesvd_A
>
> dgesvd A
>
>
>
> |domain error: cd
>
> | dgesvd A
>
>
>
> NB. How to use dgesvd function in a program?
>
>
>
> bill lam  ezt írta (időpont: 2023. febr. 16., Cs,
> 4:20):
>
> > the verb dgeev_jlapack2_ calls the fortran subroutine
> > NB. subroutine dgeev ( character   JOBVL,
> > NB.character   JOBVR,
> > NB.integer N,
> > NB.double precision, dimension( lda, * )   A,
> > NB.integer LDA,
> > NB.double precision, dimension( * )WR,
> > NB.double precision, dimension( * )WI,
> > NB.double precision, dimension( ldvl, * )  VL,
> > NB.integer LDVL,
> > NB.double precision, dimension( ldvr, * )  VR,
> > NB.integer LDVR,
> > NB.double precision, dimension( * )WORK,
> > NB.integer LWORK,
> > NB.integer INFO
> > NB.  )
> > NB.
> > NB. DGEEV computes the eigenvalues and, optionally, the left and/or right
> > eigenvectors for GE
> > NB. matrices
> > NB.
> >
> > its documentation is included inside the file example/dgeev.ijs
> >
> >
> > On Wed, Feb 15, 2023 at 5:21 PM Erik Papp  wrote:
> >
> > > Thank you for your answer!
> > >
> > > The example is running perfectly, but the eigenvalues, the eigenvectors
> > and
> > > SVD are not.
> > > I do not understand why?
> > >
> > > load'math/lapack2'
> > >
> > > load'math/lapack2/example/dgeev'
> > >
> > > 0.799482 _0.0994125j0.400792 _0.0994125j_0.400792 _0.100657
> > >
> > >
> > >
> >
> ┌┬───┐
> > >
> > > │ _0.624471 0.533023 0 0.664141  │ _0.655089 _0.193302 0.254632
> > > 0.125333 │
> > >
> > > │ _0.599489 _0.266616 0.404136 _0.106815 │ _0.523629 0.251857 _0.522405
> > > 0.332022 │
> > >
> > > │ 0.499916 0.345526 0.315285 0.729325│ 0.536218 0.0971825 _0.308384
> > > 0.593838 │
> > >
> > > │_0.0270862 _0.254081 _0.445113 0.124866 │_0.0956068 0.675954 0
> > > 0.722087 │
> > >
> > >
> > >
> >
> └┴───┘
> > >
> > > load'math/lapack2/example/dgesvd'
> > >
> > >
> > >
> >
> ┌──┬─┬───┐
> > >
> > > │ 1.45189  │_0.819947 0.556294 0.134997  │_0.801549 _0.446592 _0.314262
> > > _0.243545│
> > >
> > > │ 0.143339 │_0.466218 _0.512125 _0.721366│ 0.572863 _0.391724 _0.512788
> > > _0.505399│
> > >
> > > │0.00422124│_0.332157 _0.65442 0.679269  │ 0.16912 _0.738115 0.120025
> > > 0.642012   │
> > >
> > > │  │ │0.0272991 _0.319835 0.789862
> > > _0.522569 │
> > >
> > >
> > >
> >
> └──┴─┴───┘
> > >
> > > 1.4518900 0
&g

Re: [Jprogramming] LAPACK

2023-02-15 Thread bill lam
the verb dgeev_jlapack2_ calls the fortran subroutine
NB. subroutine dgeev ( character   JOBVL,
NB.character   JOBVR,
NB.integer N,
NB.double precision, dimension( lda, * )   A,
NB.integer LDA,
NB.double precision, dimension( * )WR,
NB.double precision, dimension( * )WI,
NB.double precision, dimension( ldvl, * )  VL,
NB.integer LDVL,
NB.double precision, dimension( ldvr, * )  VR,
NB.integer LDVR,
NB.double precision, dimension( * )WORK,
NB.integer LWORK,
NB.integer INFO
NB.  )
NB.
NB. DGEEV computes the eigenvalues and, optionally, the left and/or right
eigenvectors for GE
NB. matrices
NB.

its documentation is included inside the file example/dgeev.ijs


On Wed, Feb 15, 2023 at 5:21 PM Erik Papp  wrote:

> Thank you for your answer!
>
> The example is running perfectly, but the eigenvalues, the eigenvectors and
> SVD are not.
> I do not understand why?
>
> load'math/lapack2'
>
> load'math/lapack2/example/dgeev'
>
> 0.799482 _0.0994125j0.400792 _0.0994125j_0.400792 _0.100657
>
>
> ┌┬───┐
>
> │ _0.624471 0.533023 0 0.664141  │ _0.655089 _0.193302 0.254632
> 0.125333 │
>
> │ _0.599489 _0.266616 0.404136 _0.106815 │ _0.523629 0.251857 _0.522405
> 0.332022 │
>
> │ 0.499916 0.345526 0.315285 0.729325│ 0.536218 0.0971825 _0.308384
> 0.593838 │
>
> │_0.0270862 _0.254081 _0.445113 0.124866 │_0.0956068 0.675954 0
> 0.722087 │
>
>
> └┴───┘
>
> load'math/lapack2/example/dgesvd'
>
>
> ┌──┬─┬───┐
>
> │ 1.45189  │_0.819947 0.556294 0.134997  │_0.801549 _0.446592 _0.314262
> _0.243545│
>
> │ 0.143339 │_0.466218 _0.512125 _0.721366│ 0.572863 _0.391724 _0.512788
> _0.505399│
>
> │0.00422124│_0.332157 _0.65442 0.679269  │ 0.16912 _0.738115 0.120025
> 0.642012   │
>
> │  │ │0.0272991 _0.319835 0.789862
> _0.522569 │
>
>
> └──┴─┴───┘
>
> 1.4518900 0
>
>   0 0.1433390 0
>
>   0 0  0.00422124 0
>
> ┌───┬───┐
>
> │ 1 0.5 0. 0.25 │ 1 0.5 0. 0.25 │
>
> │ 0.5 0. 0.25 0.2   │ 0.5 0. 0.25 0.2   │
>
> │0. 0.25 0.2 0.1667 │0. 0.25 0.2 0.1667 │
>
> └───┴───┘
>
> coclass 'jlapack'
>
>
>
> dgeev=: geev
>
> tdgeev=: tgeev
>
> testdgeev=: testgeev
>
>
>
> require '~addons/math/lapack2/geev.ijs'
>
> not found: c:/users/tulajdonos/j903/addons/math/lapack2/geev.ijs
>
> |file name error: script
>
> | 0!:0 y[4!:55<'y'
>
>
>
> dgesvd=: gesvd
>
> tdgsvd=: tgsvd
>
> restdgsvd=: testgsvd
>
>
>
> require '~addons/math/lapack2/gesvd.ijs'
>
> not found: c:/users/tulajdonos/j903/addons/math/lapack2/gesvd.ijs
>
> |file name error: script
>
> | 0!:0 y[4!:55<'y'
>
> load'addons/math/lapack/gesvd.ijs'
>
> not found: C:/Users/Tulajdonos/addons/math/lapack/gesvd.ijs
>
> |file name error: script
>
> | 0!:0 y[4!:55<'y'
>
>
>
> bill lam  ezt írta (időpont: 2023. febr. 14., K,
> 15:43):
>
> > The math/lapack addon was no longer supported on current J.
> > Instead, lapack is provided by math/lapack2. The windows binaries from it
> > has optimized blas,
> > should be order of magnitude faster than that in the older lapack addon.
> > However, usage of these 2 addons are different.
> > You need to study various scripts under the test folder.
> > The dgeev.ijs should be the script you need.
> >
> > FYI the left argument of dyad verb tdgeev there is the parameter for data
> > type/precision.
> > 0 1 2 3   for double complex  single-precision float  and
> single-precision
> > complex.
> >
> >
> > On Tue, Feb 14, 2023 at 10:06 PM Erik Papp 
> wrote:
> >
> > > Dear J Jusers,
> > >
> > > Earlier I used *LAPACK* in t

Re: [Jprogramming] LAPACK

2023-02-14 Thread bill lam
The math/lapack addon was no longer supported on current J.
Instead, lapack is provided by math/lapack2. The windows binaries from it
has optimized blas,
should be order of magnitude faster than that in the older lapack addon.
However, usage of these 2 addons are different.
You need to study various scripts under the test folder.
The dgeev.ijs should be the script you need.

FYI the left argument of dyad verb tdgeev there is the parameter for data
type/precision.
0 1 2 3   for double complex  single-precision float  and single-precision
complex.


On Tue, Feb 14, 2023 at 10:06 PM Erik Papp  wrote:

> Dear J Jusers,
>
> Earlier I used *LAPACK* in the *J602a* and *J804* versions without any
> problems.
>
> I installed the *J903* version along with *LAPACK* based on
>
>  *System/Installation/J903/AIO*. I repeated the installation several
> times, but it does not run,
>
> it *always gives an error*.
>
> I tried running the *Addons/math/lapack* example, but I kept getting
> an error message.
>
> After
>
> load 'math/lapack math/lapack/dgeev'
>
> not found: c:/users/tulajdonos/j903/addons/math/lapack/lapack.ijs
>
> |file name error: script
>
> | 0!:0 y[4!:55<'y'
>
> I getting error message.
>
> It was the same problem after
>
> load 'math/lapack2 math/lapack2/dgeev'
>
> not found: c:/users/tulajdonos/j903/addons/math/lapack2/dgeev.ijs
>
> |file name error: script
>
> | 0!:0 y[4!:55<'y'
>
>
> Has anyone had a similar experience?
>
> How to install LAPACK on J903?
>
> Thank you in advance for your kind help.
>
>  Sincerely, Erik
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] can trace.ijs trace any valid J sentence?

2023-02-06 Thread bill lam
 I can also reproduce the error. I think this line is problematic,
encall =: encall1&.>^:(isname&> *. 3: = nc__userlocale)"0

J interpreter tried to fix the definition while userlocale is undefined.
change it to explicit definition should work

encall =: 3 : 'encall1&.>^:(isname&> *. 3: = nc__userlocale) y' "0

On Tue, Feb 7, 2023 at 10:24 AM More Rice  wrote:

> (Though I understand the following question is more like a general forum
> question, I didn't subscribe there and I think it may be related to this
> thread ... forgive me if I guessed wrong.)
>
> after install'all', it was indeed working in that windows' jqt (J903)
> instance.  But then after a jqt restart, the following error started to
> show up when I do load'trace'.
>
> I noticed the Windows installer uses "J903" as the installation directory,
> but jpath returns "j903." Speculating it may be related to NTFS, I moved to
> linux to remove that variable; but met with the identical error below.  I'm
> not sure what hit me.
>
>install'all' NB. Just to ensure I got latest
> Updating server catalog...
> Installing 1 package
> Downloading base library...
> Installing base library...
> Done.
> All available packages are installed and up to date.
>load 'trace'
> |value error: userlocale
> |   encall=:encall1&.>^:(isname&>*.3:=nc__userlocale)"0
> |[-88] /home/morerice/software/j903/addons/general/misc/trace.ijs
>JVERSION
> Engine: j903/j64avx2/linux
> Release-b: commercial/2022-01-28T04:13:29
> Library: 9.03.08
> Qt IDE: 1.9.5/5.12.8(5.12.8)
> Platform: Linux 64
> Installer: J903 install
> InstallPath: /home/morerice/software/j903
> Contact: www.jsoftware.com
>
> Thanks
> Maurice
>
> On Sat, Feb 4, 2023 at 8:09 PM More Rice  wrote:
>
> > Thank you, Raul. Confirmed working.
> >
> > On Sat, Feb 4, 2023 at 8:03 PM Raul Miller 
> wrote:
> >
> >> I think this should be fixed now.
> >>
> >> This should get you the fix:
> >>install'all'
> >>load'trace'
> >>
> >> And then this should work right:
> >>trace 'd by d over d >>
> >> Thanks,
> >>
> >> --
> >> Raul
> >>
> >>
> >> On Sat, Feb 4, 2023 at 6:52 PM More Rice  wrote:
> >> >
> >> > Hello,
> >> >
> >> > I've a fresh J installation just from last week, and updated
> everything.
> >> > dissect works flawlessly, but I couldn't get trace.ijs to work.  I'm
> >> > testing it with phrases from arithmetic.pdf.
> >> >
> >> > Am I doing something silly again?
> >> >
> >> > Thank you for your pointers.
> >> >
> >> > Maurice
> >> >
> >> >
> >> >over=: ({.;}.)@":@,
> >> >by=: ' '&;@,.@[,.]
> >> >d=: i.6
> >> >load'~addons/general/misc/trace.ijs'
> >> >trace 'd by d over d >> >
> >> >  --- 3 Adverb -
> >> >
> >> > <
> >> >
> >> > /
> >> >
> >> >  >> >
> >> > --- 5 Trident 
> >> >
> >> > d
> >> >
> >> > by
> >> >
> >> > d
> >> >
> >> > |length error: by
> >> >
> >> > | t_z=.(d) (by)(d)
> >> > --
> >> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-04 Thread bill lam
IMO reading documentation seriously by yourself is essential for learning
J. Without doing that others can't help you much.

Please also learn how to use jwiki to search for information you need, eg
using the search button.

On Sat, 4 Feb 2023 at 3:33 PM Ak O  wrote:

> On Fri., Feb. 3, 2023, 04:18 bill lam,  wrote:
>
> > Please see nuvoc foreign conjunction for detail if you don't know
> anything
> > about 3!:1/3!:2.
> >
> Which link takes me to the explanatory documentation that you are
> referencing?
>
> > https://www.jsoftware.com/help/dictionary/d412.htm
> https://code.jsoftware.com/wiki/Vocabulary/bangco
> https://www.jsoftware.com/help/dictionary/dx003.htm
> https://code.jsoftware.com/wiki/Vocabulary/Foreigns
>
>
> > No, Jmf and 3!:1/3!:2 are totally different.
> >
>
> If they are totally different, No as your response
> on a programming help forum is deficient.
> Respectfully. It's not easy to ask for help.
>
>
> Ak
>
>
>
> >
> > On Fri, 3 Feb 2023 at 6:04 PM Ak O  wrote:
> >
> > > I guess one of my questions directed at how the function works under
> the
> > > hood.
> > >
> > > Is it that 3!:2 is the mechanism jmf uses to treat the map?
> > > How do these forms differ?
> > >
> > > Ak
> > >
> > > On Thu., Feb. 2, 2023, 22:31 Raul Miller, 
> wrote:
> > >
> > > > You can measure overhead with timespacex
> > > >
> > > > Maybe you had already been doing that?
> > > >
> > > > --
> > > > Raul
> > > >
> > > > On Thu, Feb 2, 2023 at 11:29 PM Ak O  wrote:
> > > > >
> > > > > Is this less overhead than the jmf form?
> > > > >
> > > > > In your example, every case where I want to operate on a file or an
> > > > object
> > > > > within the file requires translation through the 3!:2 operator.
> > > > >
> > > > > Maybe it is functionally the same as the map_jmf_ function, or am I
> > > > > thinking about this incorrectly?
> > > > > Or can you please explain the difference.
> > > > >
> > > > > Thx
> > > > >
> > > > >
> > > > > Ak
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Thu., Feb. 2, 2023, 15:43 Don Guinn, 
> wrote:
> > > > >
> > > > > > 'testfile.txt' fwrite~3!:1 'Hello World!';(i.3 4);<2 1$'Text
> > Here';1
> > > 2
> > > > 3 4
> > > > > >  456
> > > > > >
> > > > > > 3!:2 fread 'testfile.txt'
> > > > > >
> > > > > > ┌┬─┬───┐
> > > > > >
> > > > > > │Hello World!│0 1 2 3│┌─┐│
> > > > > >
> > > > > > │ │4 5 6 7││Text Here││
> > > > > >
> > > > > > │ │8 9 10 11│├─┤│
> > > > > >
> > > > > > │ │ ││1 2 3 4 ││
> > > > > >
> > > > > > │ │ │└─┘│
> > > > > >
> > > > > > └┴─┴───┘
> > > > > >
> > > > > > On Thu, Feb 2, 2023 at 2:19 PM Ak O  wrote:
> > > > > >
> > > > > > > In this case the data is an array of boxes.
> > > > > > > The datatype is 'boxe'd.
> > > > > > > The data is of some shape.
> > > > > > >
> > > > > > > These things have to be preserved in order to correctly restore
> > > them
> > > > > > > later. (at some cost,  up-front to specify them,  afterwards to
> > > > recall
> > > > > > the
> > > > > > > specifics, or something else) It might be easy to write as
> > literal,
> > > > but
> > > > > > > reverting  back can present some challenges.
> > > > > > >
> > > > > > > For example:
> > > > > > > ary=: 'abcd';4 5 6 7; 2 2 $ 8.9 7.6 .6.5 5.4
> > > > > > >
> > > > > > >  datatype ary
> > > > > > > boxed
> > > > > > >
> > > > > > >  da

Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-03 Thread bill lam
Please see nuvoc foreign conjunction for detail if you don't know anything
about 3!:1/3!:2.

No, Jmf and 3!:1/3!:2 are totally different.

On Fri, 3 Feb 2023 at 6:04 PM Ak O  wrote:

> I guess one of my questions directed at how the function works under the
> hood.
>
> Is it that 3!:2 is the mechanism jmf uses to treat the map?
> How do these forms differ?
>
> Ak
>
> On Thu., Feb. 2, 2023, 22:31 Raul Miller,  wrote:
>
> > You can measure overhead with timespacex
> >
> > Maybe you had already been doing that?
> >
> > --
> > Raul
> >
> > On Thu, Feb 2, 2023 at 11:29 PM Ak O  wrote:
> > >
> > > Is this less overhead than the jmf form?
> > >
> > > In your example, every case where I want to operate on a file or an
> > object
> > > within the file requires translation through the 3!:2 operator.
> > >
> > > Maybe it is functionally the same as the map_jmf_ function, or am I
> > > thinking about this incorrectly?
> > > Or can you please explain the difference.
> > >
> > > Thx
> > >
> > >
> > > Ak
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Thu., Feb. 2, 2023, 15:43 Don Guinn,  wrote:
> > >
> > > > 'testfile.txt' fwrite~3!:1 'Hello World!';(i.3 4);<2 1$'Text Here';1
> 2
> > 3 4
> > > >  456
> > > >
> > > > 3!:2 fread 'testfile.txt'
> > > >
> > > > ┌┬─┬───┐
> > > >
> > > > │Hello World!│0 1 2 3│┌─┐│
> > > >
> > > > │ │4 5 6 7││Text Here││
> > > >
> > > > │ │8 9 10 11│├─┤│
> > > >
> > > > │ │ ││1 2 3 4 ││
> > > >
> > > > │ │ │└─┘│
> > > >
> > > > └┴─┴───┘
> > > >
> > > > On Thu, Feb 2, 2023 at 2:19 PM Ak O  wrote:
> > > >
> > > > > In this case the data is an array of boxes.
> > > > > The datatype is 'boxe'd.
> > > > > The data is of some shape.
> > > > >
> > > > > These things have to be preserved in order to correctly restore
> them
> > > > > later. (at some cost,  up-front to specify them,  afterwards to
> > recall
> > > > the
> > > > > specifics, or something else) It might be easy to write as literal,
> > but
> > > > > reverting  back can present some challenges.
> > > > >
> > > > > For example:
> > > > > ary=: 'abcd';4 5 6 7; 2 2 $ 8.9 7.6 .6.5 5.4
> > > > >
> > > > >  datatype ary
> > > > > boxed
> > > > >
> > > > >  datatype ":ary
> > > > > literal
> > > > > ***Danger***
> > > > >  $ary NB. An array of structures that preserves operational
> > > > > intention.
> > > > > 3
> > > > >  $":ary   NB. An array whose structure is different than its
> > > > > operational intention.
> > > > > 4 22
> > > > >
> > > > > These are different and need to be accounted for.
> > > > >
> > > > >  datatype (>0{ary)
> > > > > literal
> > > > >
> > > > >  datatype (>1{ary)
> > > > > Integer
> > > > >
> > > > >  datatype (>2{ary)
> > > > > floating
> > > > >
> > > > >
> > > > > Each unit has a shape and a type to preserve.
> > > > >
> > > > > If I want to operate on this object with the meaning intended for
> it
> > when
> > > > > it was created, many errors can be avoided when unnecessary
> > intermediate
> > > > > conversions are avoided.
> > > > >
> > > > > Jmf allows you to operate directly without having the need to
> > > > > revert from literal to your operation/operand, datatype (with the
> > > > > associated overhead and tracking).I am not saying that there is no
> > > > overhead
> > > > > with jmf, just that the cognitive load is offset or preset because
> > jmf
> > > > > treats it for the user.
> > > > >
> > > > >
> > > > > (1!2 & 1!:/, fwrite , fread) forms.

Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-02 Thread bill lam
Using Jmf is overkill. Also what are the advantages of jmf over 3!:1/3!:2
in this case?

On Thu, 2 Feb 2023 at 7:17 PM Ak O  wrote:

>  load 'jmf'
> NB. Loads jmf facilities.
>
>  testfile =: {2,\?50#75
>
>  fn =: jpath 'C:\Users\skip\J904-user\temp\foo\testfile_name.jmf'
> NB. Links a covername to the file path.
>  createjmf_jmf_ fn;(([:(*&8)#);testfile)
> NB. Create the container for your file.
> NB. -fn is your reference name
> NB. -(([:(*&8)#);testfile) allocates the size of yor fike in bytes
>
>  map_jmf_ 'testfile_disk';fn
> NB. Maps the file to a noun 'testfile_disk'
>  ] testfile_disk_jmf_ =: testfile
>
>  unmap_jmf 'testfile_disk_jmf_'
> NB. Release mappings
> Or
> Exit 0
> Close session.
>
>
> New session.
>
>  load 'jmf'
>  fn =:  jpath 'C:\Users\skip\J904-user\temp\foo\testfile_name.jmf'
>  map_jmf_ 'testfile1';fn
> NB. Map file
>  ] testfile1_jmf_
> NB. File loaded as noun 'testfile1_jmf_'
>
> Some potential benefits of the .jmf datatype:
> -Preserves header and shape information.
> -If you want to map you file as read only, use the following syntax
> map_jmf_ 'testfile1';fn;'';1
> -If you would like it to be copy-on-write use the following syntax
> map_jmf_ 'testfile1';fn;'';2
>
>
> Ak
>
> On Wed., Feb. 1, 2023, 21:48 'Skip Cave' via Programming, <
> programm...@jsoftware.com> wrote:
>
> > I have a boxed noun:
> >
> > ] testfile =: {2,\?15#50
> >
> >
> >
> ┌┬─┬─┬─┬─┬─┬┬┬┬┬─┬┬───┬┐
> >
> > │9 21│21 47│47 37│37 13│13 33│33 20│20 4│4 49│49 6│6 25│25 33│33 9│9 6│6
> > 43│
> >
> >
> >
> └┴─┴─┴─┴─┴─┴┴┴┴┴─┴┴───┴┘
> >
> >
> > I want to store it in the following location on my machine:
> >
> >
> > ]fn =. < 'C:\Users\skip\J904-user\temp'
> >
> > ┌┐
> >
> > │C:\Users\skip\J904-user\temp│
> >
> > └┘
> >
> > Then I will close that J session.
> >
> >
> > Later, I will start a new J session, and I want to read that saved file
> > into a noun called 'test1'
> >
> >
> > What is the J code for writing the noun into a file in the first session?
> >
> > What is the J code to read the file into a noun in the second session?
> >
> > Should I use 1!2 & 1!:1, or fwrite & fread, or something else?
> >
> >
> > Where in the J doc are these file operations and their tradeoffs
> described?
> >
> >
> > Skip
> >
> >
> > Skip Cave
> > Cave Consulting LLC
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] File Operations

2023-02-01 Thread bill lam
fn =. < 'C:\Users\skip\J904-user\temp'
this is a folder name

you should give a file name, use something like
fn =. < 'C:\Users\skip\J904-user\temp\foo'
or just
fn =. <'~temp/foo'  NB. this work for fwrite but not 1!:2


On Thu, Feb 2, 2023 at 1:16 PM 'Skip Cave' via Programming <
programm...@jsoftware.com> wrote:

> I tried Bill's suggestion:
>
> fn =. < 'C:\Users\skip\J904-user\temp'
>
> fn (fwrite~ 3!:1) {2,\?15#50
>
> _1
>
>
> (3!:2)@fread fn
>
> |domain error
>
> | (3!:2)@fread fn
>
>
> Looks like some kind of write error. Where in the doc are these errors
> defined?
>
> Skip Cave
> Cave Consulting LLC
>
>
> On Wed, Feb 1, 2023 at 11:07 PM bill lam  wrote:
>
> > 1!:1 and 1!:2 can only operate on simple strings (rank 1 literal array)
> > You can use 3!:1 and 3!:2 to convert between J array and simple string,eg
> >
> >  fn (fwrite~ 3!:1) {2,\?15#50
> >
> > (3!:2)@fread fn
> >
> > this way you need not assign the value of {2,\?15#50 to a name
> >
> > On Thu, Feb 2, 2023 at 12:48 PM 'Skip Cave' via Programming <
> > programm...@jsoftware.com> wrote:
> >
> > > I have a boxed noun:
> > >
> > > ] testfile =: {2,\?15#50
> > >
> > >
> > >
> >
> ┌┬─┬─┬─┬─┬─┬┬┬┬┬─┬┬───┬┐
> > >
> > > │9 21│21 47│47 37│37 13│13 33│33 20│20 4│4 49│49 6│6 25│25 33│33 9│9
> 6│6
> > > 43│
> > >
> > >
> > >
> >
> └┴─┴─┴─┴─┴─┴┴┴┴┴─┴┴───┴┘
> > >
> > >
> > > I want to store it in the following location on my machine:
> > >
> > >
> > > ]fn =. < 'C:\Users\skip\J904-user\temp'
> > >
> > > ┌┐
> > >
> > > │C:\Users\skip\J904-user\temp│
> > >
> > > └┘
> > >
> > > Then I will close that J session.
> > >
> > >
> > > Later, I will start a new J session, and I want to read that saved file
> > > into a noun called 'test1'
> > >
> > >
> > > What is the J code for writing the noun into a file in the first
> session?
> > >
> > > What is the J code to read the file into a noun in the second session?
> > >
> > > Should I use 1!2 & 1!:1, or fwrite & fread, or something else?
> > >
> > >
> > > Where in the J doc are these file operations and their tradeoffs
> > described?
> > >
> > >
> > > Skip
> > >
> > >
> > > Skip Cave
> > > Cave Consulting LLC
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] File Operations

2023-02-01 Thread bill lam
1!:1 and 1!:2 can only operate on simple strings (rank 1 literal array)
You can use 3!:1 and 3!:2 to convert between J array and simple string,eg

 fn (fwrite~ 3!:1) {2,\?15#50

(3!:2)@fread fn

this way you need not assign the value of {2,\?15#50 to a name

On Thu, Feb 2, 2023 at 12:48 PM 'Skip Cave' via Programming <
programm...@jsoftware.com> wrote:

> I have a boxed noun:
>
> ] testfile =: {2,\?15#50
>
>
> ┌┬─┬─┬─┬─┬─┬┬┬┬┬─┬┬───┬┐
>
> │9 21│21 47│47 37│37 13│13 33│33 20│20 4│4 49│49 6│6 25│25 33│33 9│9 6│6
> 43│
>
>
> └┴─┴─┴─┴─┴─┴┴┴┴┴─┴┴───┴┘
>
>
> I want to store it in the following location on my machine:
>
>
> ]fn =. < 'C:\Users\skip\J904-user\temp'
>
> ┌┐
>
> │C:\Users\skip\J904-user\temp│
>
> └┘
>
> Then I will close that J session.
>
>
> Later, I will start a new J session, and I want to read that saved file
> into a noun called 'test1'
>
>
> What is the J code for writing the noun into a file in the first session?
>
> What is the J code to read the file into a noun in the second session?
>
> Should I use 1!2 & 1!:1, or fwrite & fread, or something else?
>
>
> Where in the J doc are these file operations and their tradeoffs described?
>
>
> Skip
>
>
> Skip Cave
> Cave Consulting LLC
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] 904-beta-j

2023-01-23 Thread bill lam
Jandroid j904 beta k is available for download now.

On Mon, Jan 23, 2023, 1:10 AM bill lam  wrote:

> Me too. I will check.
>
>
> On Sun, 22 Jan 2023 at 10:34 PM Thomas Arneson  wrote:
>
>> Same for me.
>>
>> > On 01/22/2023 3:00 AM CST Jan-Pieter Jacobs 
>> wrote:
>> >
>> >
>> > I don't know if anyone else tried, but after installing the latest
>> android
>> > APK, supposedly beta-j, JVERSION still reports  beta-i:
>> >
>> >JVERSION
>> > Engine: j904/j64arm/android
>> > Beta-i: commercial/2022-12-14T09:27:03
>> > Library: 9.04.10
>> > J Android: 1.4.23/13/33
>> > Platform: Android 64 (arm64-v8a)
>> > Installer: unknown
>> > InstallPath:
>> > /storage/emulated/0/Android/data/com.jsoftware.j.beta.android/files
>> > Contact: www.jsoftware.com
>> >
>> > Jan-Pieter
>> >
>> > On Fri, 13 Jan 2023, 05:23 bill lam,  wrote:
>> >
>> > > 904-beta-j is available for android
>> > >
>> > > On Sun, Jan 8, 2023 at 1:42 AM Eric Iverson > >
>> > > wrote:
>> > >
>> > > > 904-beta-j is available for windows/linux/macos/rpi.
>> > > >
>> > > > If you already run J904-beta, then upgrade is easy:
>> > > >load'pacman'
>> > > >'upgrade'jpkg'jengine'
>> > > >
>> > > > If you have not yet installed J904-beta, there is still time to
>> take a
>> > > look
>> > > > and help make the final release as stable as possible.
>> > > >https://code.jsoftware.com/wiki/System/Installation/J904
>> > > > <https://code.jsoftware.com/wiki/System/Installation/J903>
>> > > >
>> > > > This might be the final beta and the official release will probably
>> be
>> > > out
>> > > > at month end or early in February.
>> > > >
>> > > >
>> > > > Release notes:
>> > > >https://code.jsoftware.com/wiki/System/ReleaseNotes/J904
>> > > > <https://code.jsoftware.com/wiki/System/ReleaseNotes/J903>
>> > > >
>> > > > Questions/bug reports/etc. should go to the beta forum.
>> > > >
>> --
>> > > > For information about J forums see
>> http://www.jsoftware.com/forums.htm
>> > > >
>> > > --
>> > > For information about J forums see
>> http://www.jsoftware.com/forums.htm
>> > >
>> > --
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] 904-beta-j

2023-01-22 Thread bill lam
Me too. I will check.


On Sun, 22 Jan 2023 at 10:34 PM Thomas Arneson  wrote:

> Same for me.
>
> > On 01/22/2023 3:00 AM CST Jan-Pieter Jacobs 
> wrote:
> >
> >
> > I don't know if anyone else tried, but after installing the latest
> android
> > APK, supposedly beta-j, JVERSION still reports  beta-i:
> >
> >JVERSION
> > Engine: j904/j64arm/android
> > Beta-i: commercial/2022-12-14T09:27:03
> > Library: 9.04.10
> > J Android: 1.4.23/13/33
> > Platform: Android 64 (arm64-v8a)
> > Installer: unknown
> > InstallPath:
> > /storage/emulated/0/Android/data/com.jsoftware.j.beta.android/files
> > Contact: www.jsoftware.com
> >
> > Jan-Pieter
> >
> > On Fri, 13 Jan 2023, 05:23 bill lam,  wrote:
> >
> > > 904-beta-j is available for android
> > >
> > > On Sun, Jan 8, 2023 at 1:42 AM Eric Iverson 
> > > wrote:
> > >
> > > > 904-beta-j is available for windows/linux/macos/rpi.
> > > >
> > > > If you already run J904-beta, then upgrade is easy:
> > > >load'pacman'
> > > >'upgrade'jpkg'jengine'
> > > >
> > > > If you have not yet installed J904-beta, there is still time to take
> a
> > > look
> > > > and help make the final release as stable as possible.
> > > >https://code.jsoftware.com/wiki/System/Installation/J904
> > > > <https://code.jsoftware.com/wiki/System/Installation/J903>
> > > >
> > > > This might be the final beta and the official release will probably
> be
> > > out
> > > > at month end or early in February.
> > > >
> > > >
> > > > Release notes:
> > > >https://code.jsoftware.com/wiki/System/ReleaseNotes/J904
> > > > <https://code.jsoftware.com/wiki/System/ReleaseNotes/J903>
> > > >
> > > > Questions/bug reports/etc. should go to the beta forum.
> > > >
> --
> > > > For information about J forums see
> http://www.jsoftware.com/forums.htm
> > > >
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] web/gethttp does not support https on Android

2023-01-19 Thread bill lam
This is a bit complicated. Android OS does not have wget or curl.

On Thu, Jan 19, 2023 at 12:23 AM Omar Antolín Camarena 
wrote:

> I just noticed that gethttp from the web/gethttp library supports https on
> both Linux and Windows but not on Android. On Android it returns:
>
> only http:// supported
>
> Is there any way to fix this or a good workaround people use?
>
> --
> Omar
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] File name error when running ijconsole

2023-01-15 Thread bill lam
It is unclear what had you done. Please provide sufficient information.

On Sun, 15 Jan 2023 at 10:24 PM August Karlstrom 
wrote:

> I just installed the J interpreter j903_linux64.tar.gz on Debian Linux.
> When I run ijconsole the first line says
>
> |file name error
>
> What is causing this error?
>
> Regards,
> August
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Memory Mapped Files -> Shared Maps -> Syntax

2023-01-14 Thread bill lam
There should be labs on memory mapped file, please run and study from them.

On Sat, Jan 14, 2023, 8:11 AM Ak O  wrote:

> Hi Bill,
>
> I am still getting this error:
>
>  |Win sharename must not have/: assert
>  | 'Win sharename must not have/' assert-. '/' e. sn
>
>
> When I run both:
>  map_jmf_ 'xxx';('fn' jpath 'C:\Users\user\map.jmf);('fn' jpath
> 'C:\Users\user\map.jmf);1
> and
>  share_jmf_ 'xxx';('fn' jpath 'C:\Useq
>
> Am I thinking about this correctly?
> I am try to produce a read-only (MTRO) view to a jmf file.
>
>
> When I open 'jmf' and search:
>   'Win sharename must'
> , it takes me to line 310. (I think this is a convention check for Windows
> setups. )
>
> The Studio_Mapped_Files page says that it flips the '\' to '/':
>
>  'If a sharename with \s is used ...the \s are replaced by /s.'
>
>
> How do I make correct statements for both 'map_jmf_'
> and 'share_jmf_', on a Windows system?
>
> Thank you,
>
>
> Ak
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Memory Mapped Files-> Shared Maps -> Syntax

2023-01-13 Thread bill lam
IIRC You may choose any share name need not the same as file name so long
as they contains no such special characters

On Fri, 13 Jan 2023 at 6:50 PM Ak O  wrote:

> I hope you are all well.
>
> I am trying to clarify the syntax for a shared map.
>
> When I try to execute:
>
>  map_jmf_ 'jdata';jdatafn;jdatafn;0NB. As the
> Studio_Mapped_Files.
>
> |Win sharename must not have /: assert
> | 'win sharename must not have /' assert-.'/'e.sn
>
>
> I am running Windows j-beta-i.
>
>
> Ak
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] 904-beta-j

2023-01-12 Thread bill lam
904-beta-j is available for android

On Sun, Jan 8, 2023 at 1:42 AM Eric Iverson 
wrote:

> 904-beta-j is available for windows/linux/macos/rpi.
>
> If you already run J904-beta, then upgrade is easy:
>load'pacman'
>'upgrade'jpkg'jengine'
>
> If you have not yet installed J904-beta, there is still time to take a look
> and help make the final release as stable as possible.
>https://code.jsoftware.com/wiki/System/Installation/J904
> 
>
> This might be the final beta and the official release will probably be out
> at month end or early in February.
>
>
> Release notes:
>https://code.jsoftware.com/wiki/System/ReleaseNotes/J904
> 
>
> Questions/bug reports/etc. should go to the beta forum.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Fwd: A big beautiful beta regex bomb

2023-01-12 Thread bill lam
I checked there was a recent update to the base library to fix a long
outstanding bug that utf8 defaults to ON but is not functioning.
The libjpcre binary was supposedly built with utf8 support but not so.
Therefore you didn't see the error.

A workaround is to execute
rxutf 0
to turn off  the utf8 support.


On Fri, Jan 13, 2023 at 6:57 AM bill lam  wrote:

> May I know which platform you are referring to?
>
> On Fri, 13 Jan 2023 at 1:28 AM John Baker  wrote:
>
>> Sorry for the duplication. I wasn't sure the message to the beta forum
>> went.
>>
>> There are some changes in how regex'es work in the last J9.04 beta
>> that will probably zing many.
>>
>> John Baker
>>
>> -- Forwarded message -
>> From: John Baker 
>> Date: Thu, Jan 12, 2023 at 10:08 AM
>> Subject: A big beautiful beta regex bomb
>> To: Beta forum 
>>
>>
>> I have been running the latest beta: Beta-j:
>> commercial/2023-01-07T02:25:25
>> and have discovered some issues.
>>
>> FIRST:  changes in regex processing.
>>
>> In j 9.03 the following works:
>>
>>   JNAME=: '[[:alpha:]][[:alnum:]_]*'
>>
>>   JNAME rxall 'anyjname'
>>
>> ++
>>
>> |anyjname|
>>
>> ++
>>
>> In the latest 904 beta we get:
>>
>>JNAME rxall 'anyjname'
>>
>> |this version of PCRE2 does not have Unicode support at offset 0
>>
>> [[:alpha:]][[:alnum:]_]*
>>
>> ^
>>
>> : regerror
>>
>> | m 13!:8[12
>>
>> I presume there is a new PRCE2 dll that must be distributed. If not,
>> this is a major change in how regex's work.
>>
>> --
>> John D. Baker
>> bakerj...@gmail.com
>>
>>
>> --
>> John D. Baker
>> bakerj...@gmail.com
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Fwd: A big beautiful beta regex bomb

2023-01-12 Thread bill lam
May I know which platform you are referring to?

On Fri, 13 Jan 2023 at 1:28 AM John Baker  wrote:

> Sorry for the duplication. I wasn't sure the message to the beta forum
> went.
>
> There are some changes in how regex'es work in the last J9.04 beta
> that will probably zing many.
>
> John Baker
>
> -- Forwarded message -
> From: John Baker 
> Date: Thu, Jan 12, 2023 at 10:08 AM
> Subject: A big beautiful beta regex bomb
> To: Beta forum 
>
>
> I have been running the latest beta: Beta-j: commercial/2023-01-07T02:25:25
> and have discovered some issues.
>
> FIRST:  changes in regex processing.
>
> In j 9.03 the following works:
>
>   JNAME=: '[[:alpha:]][[:alnum:]_]*'
>
>   JNAME rxall 'anyjname'
>
> ++
>
> |anyjname|
>
> ++
>
> In the latest 904 beta we get:
>
>JNAME rxall 'anyjname'
>
> |this version of PCRE2 does not have Unicode support at offset 0
>
> [[:alpha:]][[:alnum:]_]*
>
> ^
>
> : regerror
>
> | m 13!:8[12
>
> I presume there is a new PRCE2 dll that must be distributed. If not,
> this is a major change in how regex's work.
>
> --
> John D. Baker
> bakerj...@gmail.com
>
>
> --
> John D. Baker
> bakerj...@gmail.com
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Thread Primitives -> Execute as task (t.)

2022-12-22 Thread bill lam
As a contrived example, to find the maximum within 10 sets of numbers
   >./@:> t.''"0[  _1e5<\ ?1e6#1e10
+--+--+--+--+--+--+--+--+--+--+
|848805|857715|916190|950164|958186|654397|995337|840462|971302|983414|
+--+--+--+--+--+--+--+--+--+--+

You need not worry about the number of threads or how many tasks are being
used. J will evaluate at the full capacity of the computer.

On Thu, Dec 22, 2022 at 2:59 PM bill lam  wrote:

> I am not sure. But you can check the number of thread created.
>
> On Thu, 22 Dec 2022 at 2:28 PM Ak O  wrote:
>
>> Thank you Bill,
>>
>> Are these two lines equivalent?
>>
>> T.&''"0 (|change)#(*change){1 0 55
>>
>> 0''0^:(0 < #)1$~(1>. (<:MAXTHREADS)-1 T.'')
>>
>>
>> Raul's example:
>>
>> setthreadcount=: {{
>>   change=. y-1 T.''
>>   T.&''"0 (|change)#(*change){0 0 55
>>   1 T.''
>>}}
>>
>>
>> Ak.
>>
>>
>> On Wed., Dec. 21, 2022, 19:20 bill lam,  wrote:
>>
>> > create thread pool:
>> > MAXTHREADS_z_=: {: 8 T.''
>> > echo 'MAXTHREADS: ',": MAXTHREADS
>> > 3 : 0''
>> > if. 1> >  0"0^:(0 < #) 0$~ (1 >. (<:9!:56'cores') <. (<:MAXTHREADS)- 1 T. '')
>> >  echo 'thread pool#0: ', ": n1=. 1 T. ''
>> >  0"0^:(0 < #) 1$~ (1 >. (<:MAXTHREADS)- 1 T. '')
>> >  echo 'thread pool#1: ', ": (1 T. '') - n1
>> > end.
>> > )
>> >
>> > for cpu intensive tasks
>> > f1 t.(0;<'worker';1)"0 foo
>> >
>> > for i/o bound tasks
>> > g t.(1;<'worker';1)"0 bar
>> >
>> >
>> >
>> >
>> > On Thu, Dec 22, 2022 at 9:53 AM Ak O  wrote:
>> >
>> > > Hi Bill,
>> > >
>> > > How is a threadpool assigned?
>> > > For clarity, can you please show two sample commands?
>> > > The command that creates threads in threadpool 0.
>> > > The command that creates threads in threadpool 1.
>> > >
>> > > Thank you for your help.
>> > >
>> > > Ak
>> > >
>> > >
>> > >
>> > > >
>> > > --
>> > > For information about J forums see
>> http://www.jsoftware.com/forums.htm
>> > >
>> > --
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> >
>> --
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Thread Primitives -> Execute as task (t.)

2022-12-21 Thread bill lam
I am not sure. But you can check the number of thread created.

On Thu, 22 Dec 2022 at 2:28 PM Ak O  wrote:

> Thank you Bill,
>
> Are these two lines equivalent?
>
> T.&''"0 (|change)#(*change){1 0 55
>
> 0''0^:(0 < #)1$~(1>. (<:MAXTHREADS)-1 T.'')
>
>
> Raul's example:
>
> setthreadcount=: {{
>   change=. y-1 T.''
>   T.&''"0 (|change)#(*change){0 0 55
>   1 T.''
>}}
>
>
> Ak.
>
>
> On Wed., Dec. 21, 2022, 19:20 bill lam,  wrote:
>
> > create thread pool:
> > MAXTHREADS_z_=: {: 8 T.''
> > echo 'MAXTHREADS: ',": MAXTHREADS
> > 3 : 0''
> > if. 1 >  0"0^:(0 < #) 0$~ (1 >. (<:9!:56'cores') <. (<:MAXTHREADS)- 1 T. '')
> >  echo 'thread pool#0: ', ": n1=. 1 T. ''
> >  0"0^:(0 < #) 1$~ (1 >. (<:MAXTHREADS)- 1 T. '')
> >  echo 'thread pool#1: ', ": (1 T. '') - n1
> > end.
> > )
> >
> > for cpu intensive tasks
> > f1 t.(0;<'worker';1)"0 foo
> >
> > for i/o bound tasks
> > g t.(1;<'worker';1)"0 bar
> >
> >
> >
> >
> > On Thu, Dec 22, 2022 at 9:53 AM Ak O  wrote:
> >
> > > Hi Bill,
> > >
> > > How is a threadpool assigned?
> > > For clarity, can you please show two sample commands?
> > > The command that creates threads in threadpool 0.
> > > The command that creates threads in threadpool 1.
> > >
> > > Thank you for your help.
> > >
> > > Ak
> > >
> > >
> > >
> > > >
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Thread Primitives -> Execute as task (t.)

2022-12-21 Thread bill lam
create thread pool:
MAXTHREADS_z_=: {: 8 T.''
echo 'MAXTHREADS: ',": MAXTHREADS
3 : 0''
if. 1. (<:9!:56'cores') <. (<:MAXTHREADS)- 1 T. '')
 echo 'thread pool#0: ', ": n1=. 1 T. ''
 0"0^:(0 < #) 1$~ (1 >. (<:MAXTHREADS)- 1 T. '')
 echo 'thread pool#1: ', ": (1 T. '') - n1
end.
)

for cpu intensive tasks
f1 t.(0;<'worker';1)"0 foo

for i/o bound tasks
g t.(1;<'worker';1)"0 bar




On Thu, Dec 22, 2022 at 9:53 AM Ak O  wrote:

> Hi Bill,
>
> How is a threadpool assigned?
> For clarity, can you please show two sample commands?
> The command that creates threads in threadpool 0.
> The command that creates threads in threadpool 1.
>
> Thank you for your help.
>
> Ak
>
>
>
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Thread Primitives -> Execute as task (t.)

2022-12-21 Thread bill lam
It would be sufficient to create threadpool when starting an application.
No need to bother how many threads are available inside the application.
Eg if your machine has 8 CPU, then create 7 threads for pool 0 (for CPU
bounded tasks) and 56 threads for pool 1 (for I/O bounded tasks)

On Thu, Dec 22, 2022, 9:07 AM Ak O  wrote:

> Thank you Raul,
>
>
>   Conceptually, the primitives are simple. T. is for configuration and
>   setup. You always have one thread (the master thread), and you
>   probably should have one additional thread for each cpu "core" (which
>   you might think of as a register set -- a small set of variables that
>   represent the machine itself).
> -NB. This is important know. Thank you.
>
>   setthreadcount=: {{
>  change=. y-1 T.''
>  T.&''"0 (|change)#(*change){0 0 55
>  1 T.''
>   }}
>
>   To accomplish this, you might use a routine like
>   setthreadcount=: {{
>change=. y-1 T.''
> -NB. Does this set 'change' to a maximum of one less than the number of
> cores?
>T.&''"0 (|change)#(*change){0 0 55
> -NB. Does this provide (pass) the attributes to each thread created by
> execution of this routine?
> -NB. What does 0 0 55 specify?
> -NB. (Aside) How are tasks passed to a thread
>1 T.''
> -NB. Does this return the number of threads created by execution of this
> routine?
>}}
>  setthreadcount <:{.8T.''
> -NB. Does this create less than or equal to the number of cores on the
> executing system?
>
>
> *
>
>
>   ...That said, I haven't found any good candidates for
>   threading, yet. (By this I mean: simple code which gets improved
>   performance using (t.'') (or (t.{{)n}})) vs using (<@)
>
> -NB. How about cases where operations might lean on boxing?
> Overhead (maybe unnecessary)can quickly accumulate with boxing.
>
> I appreciate your help.
>
> Ak.
>
>
>
>
>
> >
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] missing Qt5Core.dll

2022-12-13 Thread bill lam
try install'gmp' (fine both on jqt and jconsole) and then restart.

On Wed, Dec 14, 2022 at 11:55 AM Thomas Arneson  wrote:

> Thanks Bill, that worked.
>
> When I tried the test for gimp it failed on Windows, but worked on my
> android.
>
> 
> 2022-12-13 21:50
> Machine: HPdesktop2012
> Engine: j904/j64avx/windows
> Beta-i: commercial/2022-12-13T15:19:30
> Library: 9.04.06
> Qt IDE: 2.0.3s/6.2.4(6.2.4)
> Platform: Win 64
> Installer: J904 install
> InstallPath: c:/users/tom arneson/j904
> Contact: www.jsoftware.com
> 
>
>2x*2
> |nonce error
> |  2x*2
> |  ^
> > On 12/13/2022 9:40 PM CST bill lam  wrote:
> >
> >
> > have you tried install'qtide'  ?
> >
> > On Wed, Dec 14, 2022 at 11:28 AM Thomas Arneson 
> wrote:
> >
> > >
> > >
> > >  When I try to run J904 using Qt. I get a message saying "The code
> > > execution cannot proceed because Qt5Core.dll was not found"
> > >
> > > I was able to upgrade to Beta-i by running from console, but I want to
> use
> > > jqt.
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] missing Qt5Core.dll

2022-12-13 Thread bill lam
have you tried install'qtide'  ?

On Wed, Dec 14, 2022 at 11:28 AM Thomas Arneson  wrote:

>
>
>  When I try to run J904 using Qt. I get a message saying "The code
> execution cannot proceed because Qt5Core.dll was not found"
>
> I was able to upgrade to Beta-i by running from console, but I want to use
> jqt.
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j904-beta-i available

2022-12-13 Thread bill lam
J904-beta-i is available for android.
verify gmp is working by executing a simple sentence eg
2x * 2

eformat error message working by
1+'a'


On Wed, Dec 14, 2022 at 1:00 AM Eric Iverson 
wrote:

> J904-beta-i is available for windows/linux/mac/pi.
>
> Please install/upgrade and use it so that the release after the beta cycle
> is as stable as can be.
>
> Usually we would end the beta cycle near year end and have a stable
> release. Multi-threading was ready, but there were a few things we wanted
> to get in the release and this means we will extend the beta cycle into the
> new year as required.
>
> The JE now uses GMP (GNU Multiple Precision Arithmetic Library) for
> arbitrary precision arithmetic, operating on signed integers, rational
> numbers, and floating-point numbers. This is a replacement for the previous
> JE native support and is functionally equivalent, but MUCH faster.
>
>a =. 2 ^ 10x
>6!:2 'a*a' NB. time with GMP - 200 times faster
>
> JE standard error messages are now enhanced by J code
> (~addons/dev/eformat/eformat.ijs).
>
>i.'a'
> |domain error, executing monad i.
> |y has nonnumeric type (character)
> |   i.'a'
>
> The stable release will be in the new year as soon as the betas settle
> down.
>
> *** 904 beta upgrade - extra steps to get the GMP shared library
> 1. start J 904
>load 'pacman'
>install 'base library' NB. get pacman changes for installing GMP
>
> 2. restart J 904
>load 'pacman'
>install 'gmp' NB. install GMP shared library
>'upgrade' jpkg 'jengine'
>
> 3. restart J 904
>JVERSION NB. verify beta-i
>1000x NB. verify gmp works
>
> *** 904 beta install
> browse: code.jsoftware.com/wiki/System/Installation/J904/Zips
> and follow instructions for your platform
>
> *** GMP - https://gmplib.org/#WHAT
> What is GMP?
>
> GMP is a free library for arbitrary precision arithmetic, operating on
> signed integers, rational numbers, and floating-point numbers. There is no
> practical limit to the precision except the ones implied by the available
> memory in the machine GMP runs on. GMP has a rich set of functions, and the
> functions have a regular interface.
>
> The main target applications for GMP are cryptography applications and
> research, Internet security applications, algebra systems, computational
> algebra research, etc.
>
> GMP is carefully designed to be as fast as possible, both for small
> operands and for huge operands. The speed is achieved by using fullwords as
> the basic arithmetic type, by using fast algorithms, with highly optimised
> assembly code for the most common inner loops for a lot of CPUs, and by a
> general emphasis on speed.
> ...
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] j904-beta-i available

2022-12-13 Thread bill lam
The new error message can break J code that relying on checking error
messages.
To revert to old error messages, add this line somewhere before running
your applications

4!:55 <'eformat_j_'

On Wed, 14 Dec 2022 at 1:09 AM Henry Rich  wrote:

> The two new features that Eric mentioned are well worth waiting for IMO.
>
> The conversion to GMP was a big job.  Raul Miller did it.  It brings J
> up to modern standards of speed and space for extended-precision
> arithmetic.
>
> The new error messages started as an idea of Elijah Stone's and
> progressed to a collaboration between him & me.  There is an addon
> script, /dev/eformat, that you can update like any other addon.  If you
> find messages that are missing or incorrect (quite likely!), report them
> here and we will try to update the addon to fix them.  If any user wants
> to add new messages to the addon, that would be great: talk to me about
> getting permission.
>
> Henry Rich
>
> On 12/13/2022 11:59 AM, Eric Iverson wrote:
> > J904-beta-i is available for windows/linux/mac/pi.
> >
> > Please install/upgrade and use it so that the release after the beta
> cycle
> > is as stable as can be.
> >
> > Usually we would end the beta cycle near year end and have a stable
> > release. Multi-threading was ready, but there were a few things we wanted
> > to get in the release and this means we will extend the beta cycle into
> the
> > new year as required.
> >
> > The JE now uses GMP (GNU Multiple Precision Arithmetic Library) for
> > arbitrary precision arithmetic, operating on signed integers, rational
> > numbers, and floating-point numbers. This is a replacement for the
> previous
> > JE native support and is functionally equivalent, but MUCH faster.
> >
> > a =. 2 ^ 10x
> > 6!:2 'a*a' NB. time with GMP - 200 times faster
> >
> > JE standard error messages are now enhanced by J code
> > (~addons/dev/eformat/eformat.ijs).
> >
> > i.'a'
> > |domain error, executing monad i.
> > |y has nonnumeric type (character)
> > |   i.'a'
> >
> > The stable release will be in the new year as soon as the betas settle
> down.
> >
> > *** 904 beta upgrade - extra steps to get the GMP shared library
> > 1. start J 904
> > load 'pacman'
> > install 'base library' NB. get pacman changes for installing GMP
> >
> > 2. restart J 904
> > load 'pacman'
> > install 'gmp' NB. install GMP shared library
> > 'upgrade' jpkg 'jengine'
> >
> > 3. restart J 904
> > JVERSION NB. verify beta-i
> > 1000x NB. verify gmp works
> >
> > *** 904 beta install
> > browse: code.jsoftware.com/wiki/System/Installation/J904/Zips
> > and follow instructions for your platform
> >
> > *** GMP - https://gmplib.org/#WHAT
> > What is GMP?
> >
> > GMP is a free library for arbitrary precision arithmetic, operating on
> > signed integers, rational numbers, and floating-point numbers. There is
> no
> > practical limit to the precision except the ones implied by the available
> > memory in the machine GMP runs on. GMP has a rich set of functions, and
> the
> > functions have a regular interface.
> >
> > The main target applications for GMP are cryptography applications and
> > research, Internet security applications, algebra systems, computational
> > algebra research, etc.
> >
> > GMP is carefully designed to be as fast as possible, both for small
> > operands and for huge operands. The speed is achieved by using fullwords
> as
> > the basic arithmetic type, by using fast algorithms, with highly
> optimised
> > assembly code for the most common inner loops for a lot of CPUs, and by a
> > general emphasis on speed.
> > ...
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] pplatimg in-memory decoding

2022-12-08 Thread bill lam
There is a getimg verb for that purpose. I have just update the addon to
add a line in the test.
Please update and check. Thanks.


On Thu, Dec 8, 2022 at 10:18 PM Ed Gottsman 
wrote:

> Raul,
>
> Thanks for getting back to me so rapidly and for digging into the code.
> I’d been relying on test.ijs for my understanding of the library’s intended
> use—but you’re right: nothing stops me from learning a few things and
> exploiting what’s under the covers.  I happen to be on Windows and all I
> need is to convert encoded in-memory jpg to raw pixels…which, as you imply,
> the library is doing, presumably (in my case) with GDI.  How hard could it
> be? :-)
>
> Thanks again.
>
> Ed
>
> Sent from my iPad
>
> > On Dec 8, 2022, at 8:08 AM, Raul Miller  wrote:
> >
> > I am not familiar with pplatimag, but browsing the code (in jqt:
> >   open 'graphics/pplatimg') shows that it's mostly platform specific
> > calls to external shared libraries.
> >
> > So I guess the answers to two questions would be particularly relevant
> here:
> >
> > (1) which OS are you using?
> >
> > (2) Which parts of pplatimg do you use?
> >
> > That said, looking at the code, I do see stuff like
> > gdk_pixbuf_new_from_data and gdk_pixbuf_save_to_buffer so the answer
> > to your question is probably yes.
> >
> > I hope this helps,
> >
> >
> > --
> > Raul
> >
> >> On Thu, Dec 8, 2022 at 8:40 AM Ed Gottsman 
> wrote:
> >>
> >> Hello.  I have a database of jpgs (~250,000 and likely to grow above
> 1e6) that I’d like to use with gl2’s glpixels routine.  It’s an interactive
> app so responsiveness is important.  It looks as if the most recent add-on
> for working with jpgs is pplatimg, which seems to assume (judging by the
> tests) that the images are kept in a file system…
> >>
> >> …which is unfortunate in this case, because my images happen to be
> comfortably ensconced in a SQLITE BLOB column.  They certainly don’t have
> to be.  I could export them to the file system, thereby splitting my
> database across two data managers (not terribly appealing).  I could also,
> on the fly, retrieve BLOBs, write them to temp jpg files, read them using
> pplatimg, and render them with glpixels (also not appealing on both
> performance(?) and aesthetic grounds).  I’m happy to do either (well…the
> latter) if there’s no third choice available, but I thought I’d check first:
> >>
> >> Does pplatimg (or some other library) have externally-exposed in-memory
> jpg decoding such that I could retrieve a jpg BLOB to memory, decode it to
> raw pixels, and call glpixels with it?
> >>
> >> Or (and the older I get, the more convinced I become that this should
> be my sig) am I looking at this all wrong?
> >>
> >> Thanks very much.
> >>
> >> Ed
> >>
> >> Sent from my iPad
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] EVM

2022-12-04 Thread bill lam
IIRC  u refers to verb or noun while m refers to noun only.

On Sun, 4 Dec 2022 at 11:30 PM Martin Kreuzer  wrote:

> Sorry Bill, gotten distracted, didn't noticed you already answered.
> btw, what's the difference between m and u in this case?
> -M
>
> At 2022-12-04 15:11, you wrote:
>
> >First of all because of change in syntax,  you have to change the line
> >setup x
> >to
> >setup m
> >
> >and then it works like this
> >'*: 4' EVM
> >16
> >hist ''
> >
> >  Queue Stack   Rule
> >
> >  +-+   +--++---+   +-+
> >  |mark *: 4|   |  ||   |   | |
> >  +-+   +--++---+   +-+
> >  |mark *:  |   | 4||   |   | |
> >  +-+   +--++---+   +-+
> >  |mark |   | *:   | 4  |   |   | |
> >  +-+   +--++---+   +-+
> >  | |   | mark | *: | 4 |   |monad|
> >  +-+   +--++---+   +-+
> >  | |   | mark | 16 |   |   | |
> >  +-+   +--++---+   +-+
> >
> >
> >On Sat, Dec 3, 2022 at 8:14 PM Richard Donovan 
> >wrote:
> >
> > > I was reading on the J website of the useful sounding adverb EVM so I
> went
> > > to the link at Help / Learning / Ap 1: Evaluating Expressions - J Wiki
> (
> > > jsoftware.com)<
> > >
> https://code.jsoftware.com/wiki/Help/Learning/Ap_1:_Evaluating_Expressions
> >
> > > and downloaded it.
> >
> > > So far I cannot get it to work at all using the examples given, I get
> > > syntax error in every case! EG
> >
> > > From the wiki page...
> > > *: 4
> > > '*: 4' EVM
> > > 16
> > > 16
> >
> > > Me:
> >
> > > *: 4'*: 4' EVM
> > > |syntax error
> > > | *: 4'*: 4'EVM
> >
> > > Have I catastrophically misunderstood this, or missed something
> obvious??
> >
> > > Thanks
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >--
> >For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] EVM

2022-12-04 Thread bill lam
First of all because of change in syntax,  you have to change the line
setup x
to
setup m

and then it works like this
   '*: 4' EVM
16
   hist ''

 Queue Stack   Rule

 +-+   +--++---+   +-+
 |mark *: 4|   |  ||   |   | |
 +-+   +--++---+   +-+
 |mark *:  |   | 4||   |   | |
 +-+   +--++---+   +-+
 |mark |   | *:   | 4  |   |   | |
 +-+   +--++---+   +-+
 | |   | mark | *: | 4 |   |monad|
 +-+   +--++---+   +-+
 | |   | mark | 16 |   |   | |
 +-+   +--++---+   +-+


On Sat, Dec 3, 2022 at 8:14 PM Richard Donovan 
wrote:

> I was reading on the J website of the useful sounding adverb EVM so I went
> to the link at Help / Learning / Ap 1: Evaluating Expressions - J Wiki (
> jsoftware.com)<
> https://code.jsoftware.com/wiki/Help/Learning/Ap_1:_Evaluating_Expressions>
> and downloaded it.
>
> So far I cannot get it to work at all using the examples given, I get
> syntax error in every case! EG
>
> From the wiki page...
> *: 4
> '*: 4' EVM
> 16
> 16
>
> Me:
>
> *: 4'*: 4' EVM
> |syntax error
> | *: 4'*: 4'EVM
>
> Have I catastrophically misunderstood this, or missed something obvious??
>
> Thanks
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread bill lam
Typo.
doesn't hold true

On Sun, 4 Dec 2022 at 9:08 AM bill lam  wrote:

> When access locality does hold true, such as transposing a large matrix
> in-place , the excessive disk swapping makes computers non responsive.
>
> On Sun, 4 Dec 2022 at 7:56 AM Raul Miller  wrote:
>
>> These days, a cheap laptop might have 8GB ram.
>>
>> Why would 2-3GB ram be a better swap size here than a swap which is at
>> least as big as main memory?
>>
>> (I guess we have write ups with advice about how much swap space is
>> useful, from back in the days when most machines had significantly
>> less than 1GB ram, and maybe we have similar write ups from people who
>> came up with some narrative describing why that advice is still
>> sometimes useful. But it seems to me that insufficient swap space
>> would lead to "unable to launch jbreak when J has grabbed too much
>> memory" issues.)
>>
>> Thanks,
>>
>> --
>> Raul
>>
>> On Sat, Dec 3, 2022 at 5:58 PM bill lam  wrote:
>> >
>> > Setting swap size equal physical ram is reasonable and is the default of
>> > some OS already. But here the problem is still too large to mitigate
>> > excessive disk swapping. Setting swap size to 2 or 3 GB is more
>> appropriate.
>> >
>> > That said, the issue is very serious on spinning hard disk but is
>> > acceptable when using ssd.
>> >
>> >
>> > On Sat, Dec 3, 2022, 11:10 PM Raul Miller 
>> wrote:
>> >
>> > > One approach here would be to have launched task manager before the
>> > > problem arises.
>> > >
>> > > If task manager is running and J is pre-selected within task manager,
>> > > selecting task manager (using the mouse or alt-tab) then hitting the
>> > > delete key (and then confirming on the resulting popup -- probably
>> > > hitting y or enter) should work.
>> > >
>> > > That said, I think you should seriously consider setting the swap file
>> > > size on this laptop to be as large as the amount of physical ram you
>> > > have. (Or, double that, if you have enough free space.)
>> > >
>> > > I hope this helps,
>> > >
>> > > --
>> > > Raul
>> > >
>> > > On Sat, Dec 3, 2022 at 9:10 AM Richard Donovan > >
>> > > wrote:
>> > > >
>> > > > Yes that is exactly what happens to me. I need a global switch to
>> throw
>> > > an interrupt if more than x cpu seconds elapses without termination.
>> Or,
>> > > when local storage is more than y% used. Preferably this could be
>> toggled
>> > > and set from an ide menu or from profile so I wouldn’t have to
>> (forget to!)
>> > > set it every time. There is nothing worse than having to reboot and
>> loses
>> > > loads of work!
>> > > >
>> > > > > On 3 Dec 2022, at 12:23, bill lam  wrote:
>> > > > >
>> > > > > Sometimes this happens to me too when the process allocated far
>> more
>> > > memory
>> > > > > than physical ram available. The disk swapping for virtual memory
>> > > prevented
>> > > > > any mouse click or keyboard response. The problem only way to
>> stop it
>> > > is to
>> > > > > long pressing the power button.
>> > > > >
>> > > > > Therefore sometimes I want to set a lower limit of virtual
>> memory. It
>> > > is
>> > > > > better to trigger out of memory crash than waiting indefinitely
>> and
>> > > finally
>> > > > > power off the computer.
>> > > > >
>> > > > >> On Sat, 3 Dec 2022 at 8:14 PM Richard Donovan <
>> rsdono...@hotmail.com>
>> > > wrote:
>> > > > >>
>> > > > >> Elijah;
>> > > > >>
>> > > > >> Most times I can’t even get in to task manager. As this problem
>> > > crashes
>> > > > >> the whole system and causes the need for a reboot, I am obviously
>> > > loathe to
>> > > > >> try to recreate it!ick Next time it happens I wrepost with more
>> info!
>> > > > >>
>> > > > >> Thanks
>> > > > >>
>> > > > >> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986>
>> for
>> > > Windows
&

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread bill lam
When access locality does hold true, such as transposing a large matrix
in-place , the excessive disk swapping makes computers non responsive.

On Sun, 4 Dec 2022 at 7:56 AM Raul Miller  wrote:

> These days, a cheap laptop might have 8GB ram.
>
> Why would 2-3GB ram be a better swap size here than a swap which is at
> least as big as main memory?
>
> (I guess we have write ups with advice about how much swap space is
> useful, from back in the days when most machines had significantly
> less than 1GB ram, and maybe we have similar write ups from people who
> came up with some narrative describing why that advice is still
> sometimes useful. But it seems to me that insufficient swap space
> would lead to "unable to launch jbreak when J has grabbed too much
> memory" issues.)
>
> Thanks,
>
> --
> Raul
>
> On Sat, Dec 3, 2022 at 5:58 PM bill lam  wrote:
> >
> > Setting swap size equal physical ram is reasonable and is the default of
> > some OS already. But here the problem is still too large to mitigate
> > excessive disk swapping. Setting swap size to 2 or 3 GB is more
> appropriate.
> >
> > That said, the issue is very serious on spinning hard disk but is
> > acceptable when using ssd.
> >
> >
> > On Sat, Dec 3, 2022, 11:10 PM Raul Miller  wrote:
> >
> > > One approach here would be to have launched task manager before the
> > > problem arises.
> > >
> > > If task manager is running and J is pre-selected within task manager,
> > > selecting task manager (using the mouse or alt-tab) then hitting the
> > > delete key (and then confirming on the resulting popup -- probably
> > > hitting y or enter) should work.
> > >
> > > That said, I think you should seriously consider setting the swap file
> > > size on this laptop to be as large as the amount of physical ram you
> > > have. (Or, double that, if you have enough free space.)
> > >
> > > I hope this helps,
> > >
> > > --
> > > Raul
> > >
> > > On Sat, Dec 3, 2022 at 9:10 AM Richard Donovan 
> > > wrote:
> > > >
> > > > Yes that is exactly what happens to me. I need a global switch to
> throw
> > > an interrupt if more than x cpu seconds elapses without termination.
> Or,
> > > when local storage is more than y% used. Preferably this could be
> toggled
> > > and set from an ide menu or from profile so I wouldn’t have to (forget
> to!)
> > > set it every time. There is nothing worse than having to reboot and
> loses
> > > loads of work!
> > > >
> > > > > On 3 Dec 2022, at 12:23, bill lam  wrote:
> > > > >
> > > > > Sometimes this happens to me too when the process allocated far
> more
> > > memory
> > > > > than physical ram available. The disk swapping for virtual memory
> > > prevented
> > > > > any mouse click or keyboard response. The problem only way to stop
> it
> > > is to
> > > > > long pressing the power button.
> > > > >
> > > > > Therefore sometimes I want to set a lower limit of virtual memory.
> It
> > > is
> > > > > better to trigger out of memory crash than waiting indefinitely and
> > > finally
> > > > > power off the computer.
> > > > >
> > > > >> On Sat, 3 Dec 2022 at 8:14 PM Richard Donovan <
> rsdono...@hotmail.com>
> > > wrote:
> > > > >>
> > > > >> Elijah;
> > > > >>
> > > > >> Most times I can’t even get in to task manager. As this problem
> > > crashes
> > > > >> the whole system and causes the need for a reboot, I am obviously
> > > loathe to
> > > > >> try to recreate it!ick Next time it happens I wrepost with more
> info!
> > > > >>
> > > > >> Thanks
> > > > >>
> > > > >> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986>
> for
> > > Windows
> > > > >>
> > > > >> 
> > > > >> From: Programming  on
> > > behalf of
> > > > >> Elijah Stone 
> > > > >> Sent: Friday, December 2, 2022 11:19:58 AM
> > > > >> To: J Programming 
> > > > >> Subject: Re: [Jprogramming] Avoiding J crash
> > > > >>
> > > > >> Rebooting is a bit drastic; can you not kill j from task 

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread bill lam
Setting swap size equal physical ram is reasonable and is the default of
some OS already. But here the problem is still too large to mitigate
excessive disk swapping. Setting swap size to 2 or 3 GB is more appropriate.

That said, the issue is very serious on spinning hard disk but is
acceptable when using ssd.


On Sat, Dec 3, 2022, 11:10 PM Raul Miller  wrote:

> One approach here would be to have launched task manager before the
> problem arises.
>
> If task manager is running and J is pre-selected within task manager,
> selecting task manager (using the mouse or alt-tab) then hitting the
> delete key (and then confirming on the resulting popup -- probably
> hitting y or enter) should work.
>
> That said, I think you should seriously consider setting the swap file
> size on this laptop to be as large as the amount of physical ram you
> have. (Or, double that, if you have enough free space.)
>
> I hope this helps,
>
> --
> Raul
>
> On Sat, Dec 3, 2022 at 9:10 AM Richard Donovan 
> wrote:
> >
> > Yes that is exactly what happens to me. I need a global switch to throw
> an interrupt if more than x cpu seconds elapses without termination. Or,
> when local storage is more than y% used. Preferably this could be toggled
> and set from an ide menu or from profile so I wouldn’t have to (forget to!)
> set it every time. There is nothing worse than having to reboot and loses
> loads of work!
> >
> > > On 3 Dec 2022, at 12:23, bill lam  wrote:
> > >
> > > Sometimes this happens to me too when the process allocated far more
> memory
> > > than physical ram available. The disk swapping for virtual memory
> prevented
> > > any mouse click or keyboard response. The problem only way to stop it
> is to
> > > long pressing the power button.
> > >
> > > Therefore sometimes I want to set a lower limit of virtual memory. It
> is
> > > better to trigger out of memory crash than waiting indefinitely and
> finally
> > > power off the computer.
> > >
> > >> On Sat, 3 Dec 2022 at 8:14 PM Richard Donovan 
> wrote:
> > >>
> > >> Elijah;
> > >>
> > >> Most times I can’t even get in to task manager. As this problem
> crashes
> > >> the whole system and causes the need for a reboot, I am obviously
> loathe to
> > >> try to recreate it!ick Next time it happens I wrepost with more info!
> > >>
> > >> Thanks
> > >>
> > >> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows
> > >>
> > >> 
> > >> From: Programming  on
> behalf of
> > >> Elijah Stone 
> > >> Sent: Friday, December 2, 2022 11:19:58 AM
> > >> To: J Programming 
> > >> Subject: Re: [Jprogramming] Avoiding J crash
> > >>
> > >> Rebooting is a bit drastic; can you not kill j from task manager?
> > >>
> > >> Beyond that, break _should_ work.  I can look into making it a bit
> more
> > >> responsive for long array operations, but am curious to know what
> > >> specifically
> > >> has caused you trouble.
> > >>
> > >>> On Fri, 2 Dec 2022, Richard Donovan wrote:
> > >>>
> > >>> Hi!
> > >>>
> > >>> Is there any way to avoid the situation whereby by  error I put J
> into
> > >> an infinite loop from which the only recovery is to reboot my Windows
> > >> laptop?
> > >>>
> > >>> I guess that my erroneous routine is locking the CPU to such a such
> an
> > >> extent that I can’t even get to run Jbreak.
> > >>>
> > >>> I quite often receive a recoverable situation when a limit has been
> > >> exceeded but if I get the infinite loop situation I have lost my
> entire
> > >> session and have to start again.
> > >>>
> > >>> I really need a global setting which limits the amount of cpu usage
> and
> > >> aborts a function before it gets out of hand.
> > >>>
> > >>> Thanks,
> > >>>
> > >>> Richard
> > >>>
> --
> > >>> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >> --
> > >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >> --
> > >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >>
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Questions about Advent of Code Day 2

2022-12-03 Thread bill lam
J android automatically translates nbsp to normal space when paste from
clipboard.
I think jqt can also be patched to do the same.

On Sat, Dec 3, 2022 at 10:16 PM Richard Donovan 
wrote:

> I’ve had that same thing happen to me - very frustrating!
>
> Can J not be modified to ignore non-breaking space?
>
> > On 2 Dec 2022, at 23:39, Jaume  wrote:
> >
> > Thank you both. That was it.
> > Too long a day.
> >
> > Missatge de bill lam  del dia ds., 3 de des. 2022 a
> > les 0:11:
> >
> >> Perhaps you copy and paste from email to J and it contained nonbreak
> space
> >> that visually identical to a normal space.
> >>
> >> Typing it manually may solve your problem.
> >>
> >>> On Sat, 3 Dec 2022 at 6:47 AM Jaume  wrote:
> >>>
> >>> Thank you both.
> >>>
> >>> Unfortunately neither of your ways work for me.
> >>>
> >>> ev =: (9 3$'A XA YA ZB XB YB ZC XC YC Z')&(4 8 3 1 5 9 7 2 6 { ~ i.)
> >>>
> >>> |spelling error
> >>>
> >>> | ev =: (9 3$'A XA YA ZB XB YB ZC XC YC Z')&(4 8 3 1 5 9 7 2 6 { ~ i.)
> >>>
> >>> | ^
> >>>
> >>>
> >>> No idea how to solve it. I tried the different & related verbs to no
> >> avail.
> >>>
> >>> parse=: ('ABC',:'XYZ') i."1 |:-.&' ';._2 input
> >>>
> >>> |length error
> >>>
> >>> | parse=:('ABC',:'XYZ') i."1|:-.&' ';._2 input
> >>>
> >>> I'm trying to use different input, but all give me the same error
> >> message.
> >>> I tried reading it from the file, unboxing, making it 'A YB XC Z' ...
> >>> without success.
> >>>
> >>> On a different note, I'm writing down all this, breaking down the
> >> sentences
> >>> so I can understand them in the future too, making it in a literate
> >>> programming style. I will add this to my solutions. You can see a work
> in
> >>> progress here:
> >>>
> >>>
> >>
> https://github.com/JaumeGreen/adventofcode/blob/master/2022/day02/log.ijs
> >>>
> >>> Do you prefer if I cite you by name, nick, not at all?
> >>>
> >>> Thanks.
> >>>
> >>>
> >>> Missatge de Raul Miller  del dia dv., 2 de des.
> >>> 2022
> >>> a les 20:39:
> >>>
> >>>> Here's a cleaned up version of how I approached that (here 'input'
> >>>> held the raw text of input.txt provided by the aoc website).
> >>>>
> >>>> parsed=: ('ABC',:'XYZ') i."1 |:-.&' ';._2 input
> >>>> part1=: {{ +/1+y+3*3|(1+y)-x }}/
> >>>> part2=: {{ +/(3*y)+4|&.<:x+y }}/
> >>>>
> >>>> Note that my original implementations were a bit different. For
> >>>> example, for part 1, I had
> >>>>
> >>>> scor=: {{
> >>>>  'op me'=. y
> >>>>  (1+me)+ 3*op {{ (x |. 2 0 1)i.y}}"0 me
> >>>> }}
> >>>>
> >>>> and used
> >>>>   +/scor parsed
> >>>>
> >>>> I hope this makes sense,
> >>>>
> >>>> --
> >>>> Raul
> >>>>
> >>>> On Fri, Dec 2, 2022 at 12:40 PM Jaume  wrote:
> >>>>>
> >>>>> Hello again
> >>>>> I managed to solve it, but I don't like it much, so feel free to
> >>> educate
> >>>> me.
> >>>>>
> >>>>> Reading the file, and evaluating the result is something that looked
> >>>> nice:
> >>>>>
> >>>>> p =. 1!:1<'day02.input'
> >>>>>
> >>>>> +/>ev each cutopen p
> >>>>>
> >>>>> 
> >>>>>
> >>>>> +/>ev2 each cutopen p
> >>>>>
> >>>>> 
> >>>>>
> >>>>> Now are the evaluating functions. I really don't like how they are
> >>> done.
> >>>>> I'd even prefer to create a table and search in it, but I don't know
> >>> how.
> >>>>> So a select. is used.
> >>>>>
> >>>>>
> >>>>> ev=: 3 : 0
> >>>>>
> >>>>> select. y
> >>>>>
> >>>>> case. 'A X' do.

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread bill lam
Sometimes this happens to me too when the process allocated far more memory
than physical ram available. The disk swapping for virtual memory prevented
any mouse click or keyboard response. The problem only way to stop it is to
long pressing the power button.

Therefore sometimes I want to set a lower limit of virtual memory. It is
better to trigger out of memory crash than waiting indefinitely and finally
power off the computer.

On Sat, 3 Dec 2022 at 8:14 PM Richard Donovan  wrote:

> Elijah;
>
> Most times I can’t even get in to task manager. As this problem crashes
> the whole system and causes the need for a reboot, I am obviously loathe to
> try to recreate it!ick Next time it happens I wrepost with more info!
>
> Thanks
>
> Sent from Mail for Windows
>
> 
> From: Programming  on behalf of
> Elijah Stone 
> Sent: Friday, December 2, 2022 11:19:58 AM
> To: J Programming 
> Subject: Re: [Jprogramming] Avoiding J crash
>
> Rebooting is a bit drastic; can you not kill j from task manager?
>
> Beyond that, break _should_ work.  I can look into making it a bit more
> responsive for long array operations, but am curious to know what
> specifically
> has caused you trouble.
>
> On Fri, 2 Dec 2022, Richard Donovan wrote:
>
> > Hi!
> >
> > Is there any way to avoid the situation whereby by  error I put J into
> an infinite loop from which the only recovery is to reboot my Windows
> laptop?
> >
> > I guess that my erroneous routine is locking the CPU to such a such an
> extent that I can’t even get to run Jbreak.
> >
> > I quite often receive a recoverable situation when a limit has been
> exceeded but if I get the infinite loop situation I have lost my entire
> session and have to start again.
> >
> > I really need a global setting which limits the amount of cpu usage and
> aborts a function before it gets out of hand.
> >
> > Thanks,
> >
> > Richard
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Questions about Advent of Code Day 2

2022-12-02 Thread bill lam
Perhaps you copy and paste from email to J and it contained nonbreak space
that visually identical to a normal space.

Typing it manually may solve your problem.

On Sat, 3 Dec 2022 at 6:47 AM Jaume  wrote:

> Thank you both.
>
> Unfortunately neither of your ways work for me.
>
> ev =: (9 3$'A XA YA ZB XB YB ZC XC YC Z')&(4 8 3 1 5 9 7 2 6 { ~ i.)
>
> |spelling error
>
> | ev =: (9 3$'A XA YA ZB XB YB ZC XC YC Z')&(4 8 3 1 5 9 7 2 6 { ~ i.)
>
> | ^
>
>
> No idea how to solve it. I tried the different & related verbs to no avail.
>
> parse=: ('ABC',:'XYZ') i."1 |:-.&' ';._2 input
>
> |length error
>
> | parse=:('ABC',:'XYZ') i."1|:-.&' ';._2 input
>
> I'm trying to use different input, but all give me the same error message.
> I tried reading it from the file, unboxing, making it 'A YB XC Z' ...
> without success.
>
> On a different note, I'm writing down all this, breaking down the sentences
> so I can understand them in the future too, making it in a literate
> programming style. I will add this to my solutions. You can see a work in
> progress here:
>
> https://github.com/JaumeGreen/adventofcode/blob/master/2022/day02/log.ijs
>
> Do you prefer if I cite you by name, nick, not at all?
>
> Thanks.
>
>
> Missatge de Raul Miller  del dia dv., 2 de des.
> 2022
> a les 20:39:
>
> > Here's a cleaned up version of how I approached that (here 'input'
> > held the raw text of input.txt provided by the aoc website).
> >
> > parsed=: ('ABC',:'XYZ') i."1 |:-.&' ';._2 input
> > part1=: {{ +/1+y+3*3|(1+y)-x }}/
> > part2=: {{ +/(3*y)+4|&.<:x+y }}/
> >
> > Note that my original implementations were a bit different. For
> > example, for part 1, I had
> >
> > scor=: {{
> >   'op me'=. y
> >   (1+me)+ 3*op {{ (x |. 2 0 1)i.y}}"0 me
> > }}
> >
> > and used
> >+/scor parsed
> >
> > I hope this makes sense,
> >
> > --
> > Raul
> >
> > On Fri, Dec 2, 2022 at 12:40 PM Jaume  wrote:
> > >
> > > Hello again
> > > I managed to solve it, but I don't like it much, so feel free to
> educate
> > me.
> > >
> > > Reading the file, and evaluating the result is something that looked
> > nice:
> > >
> > > p =. 1!:1<'day02.input'
> > >
> > > +/>ev each cutopen p
> > >
> > > 
> > >
> > > +/>ev2 each cutopen p
> > >
> > > 
> > >
> > > Now are the evaluating functions. I really don't like how they are
> done.
> > > I'd even prefer to create a table and search in it, but I don't know
> how.
> > > So a select. is used.
> > >
> > >
> > > ev=: 3 : 0
> > >
> > > select. y
> > >
> > > case. 'A X' do.
> > >
> > > 4
> > >
> > > case. 'A Y' do.
> > >
> > > 8
> > >
> > > case. 'A Z' do.
> > >
> > > 3
> > >
> > > case. 'B X' do.
> > >
> > > 1
> > >
> > > case. 'B Y' do.
> > >
> > > 5
> > >
> > > case. 'B Z' do.
> > >
> > > 9
> > >
> > > case. 'C X' do.
> > >
> > > 7
> > >
> > > case. 'C Y' do.
> > >
> > > 2
> > >
> > > case. 'C Z' do.
> > >
> > > 6
> > >
> > > end.
> > >
> > > )
> > >
> > >
> > > And the same with different numbers for ev2.
> > >
> > > Would this be an appropriate way to approach the problem? Is there a
> > > "better" way?
> > >
> > >
> > > Thanks.
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
> --
> The fact that an opinion has been widely held is no evidence whatever that
> it is not utterly absurd. -- Bertrand Russell
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] plot makes J hang

2022-11-30 Thread bill lam
I updated plot addon to display error messages on Term without popup box
inside paint loop.
Please update and test again. Thanks.

On Wed, Nov 30, 2022 at 6:56 PM Pablo Landherr 
wrote:

> I really do think that all the ways that the plot package makes J crash or
> hang for the slightest mistake is a major drawback.
>
> JVERSION
>
> Engine: j903/j64avx2/darwin
>
> Release-b: commercial/2022-01-28T04:20:11
>
> Library: 9.03.08
>
> Qt IDE: 1.9.5/5.15.2(5.15.2)
>
> Platform: Darwin 64
>
> Installer: J903 install
>
> InstallPath: /applications/j903
>
> Contact: www.jsoftware.com
>
> load 'plot'
>
> ('xlabels ',":i:10) plot i:10 NB. should have been "xlabel"
>
>
> (goes on forever, have to force J to quit)
>
>
> In J playground:
>
>
> load 'plot'
>
>('xlabels ',":i:10) plot i:10
> |option not found: xlabels: signal
> |   signal'option not found: ',j
> |[-0]
>
>
> Much better.
>
>
> Thanks,
>
> Pablo
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Nano-seconds?

2022-11-09 Thread bill lam
I need to update other foreigns when I have spare time.  There is 6!:18 too,
sfe=: 6!:16
efs=: 6!:17
efp=: 6!:18
NB. parse datetime string
'2022-12-20T14:30:18' -: sfe@:efp '2022-12-20T14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp '2022-12-20T02:30:18 PM'
'2022-12-20T14:30:18' -: sfe@:efp '2022-12-20 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp '2022-12-20 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp '2022-12-20'
'2022-12-20T14:30:18' -: sfe@:efp '12/20/2022 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp '12/20/2022 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp '12/20/2022'
'2022-12-20T14:30:18' -: sfe@:efp '20/12/2022 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp '20/12/2022 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp '20/12/2022'
'2022-12-20T14:30:18' -: sfe@:efp '20/Dec/2022 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp '20/Dec/2022 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp '20/Dec/2022'
'2022-12-20T14:30:18' -: sfe@:efp 'Dec/20/2022 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp 'Dec/20/2022 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp 'Dec/20/2022'
'2022-12-20T14:30:18' -: sfe@:efp '20 Dec 2022 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp '20 Dec 2022 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp '20 Dec 2022'
'2022-12-20T14:30:18' -: sfe@:efp 'Dec 20 2022 14:30:18'
'2022-12-20T14:30:18' -: sfe@:efp 'Dec 20 2022 02:30:18 PM'
'2022-12-20T00:00:00' -: sfe@:efp 'Dec 20 2022'



On Thu, Nov 10, 2022 at 8:21 AM Devon McCormick  wrote:

> Does anyone have examples of using the new nanosecond foreigners?
> I cannot figure out how to use them from the "m=6 (Time)" section here:
> https://code.jsoftware.com/wiki/Vocabulary/Foreigns .
>
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Plot package causing J to crash

2022-10-26 Thread bill lam
The endless loop or crash is a result of jqt popup error message inside
paint loop.
You can workaround it by define
wdinfo_z_=: echo_z_

so that messages won't be popup


On Wed, Oct 26, 2022 at 9:33 PM Pablo Landherr 
wrote:

> Re "a short verb to validate the data"
>
> How does a *short* verb determine that all possible combinations of plot
> instructions are correct? try. doesn't work. And why doesn't plot do it for
> me?
>
> try. 3+3
>
> |spelling error
>
> | try. 3+3
>
> | ^
>
> Consider the following (which I generated in the browser based J):
>load 'plot'
>'xlabel a b c d' plot 3 4 5
> |length error: canvas_text
> |   res=.tolist(  ,each(<','),each(<("1)0 flipxy pos>.0),each<');'
> |[-0]
>
> That is an excellent outcome. But the same sentence "crashes" not only the
> latest J. In 807, you'll find yourself in an endless loop of error messages
> which only stops after you forcibly shut J down.
>
>
>
> On Wed, Oct 26, 2022 at 3:14 PM Don Guinn  wrote:
>
> > Could you write a short verb to validate the data which calls plot if the
> > data is correct to plot or give you an error message if not?
> >
> > On Wed, Oct 26, 2022 at 7:00 AM Brian Schott 
> > wrote:
> >
> > > Resending:
> > >
> > > On Tue, Oct 25, 2022 at 6:02 PM Brian Schott 
> > > wrote:
> > >
> > > > Pablo,
> > > >
> > > > I was able to execute the following code using jconsole.
> > > > See my version info below. Perhaps, this will help.
> > > >
> > > >QA=: {@(a.@]+[QI 26"_)
> > > >QI=: ?.@$
> > > >Fcat=:161 38 QA 'a'
> > > >load'plot'
> > > >('xlabel ',,Fcat,.' ') plot ?161#100
> > > >JVERSION
> > > > Engine: j903/j64/darwin
> > > > Release-b: commercial/2022-01-28T04:11:24
> > > > Library: 9.03.08
> > > > Platform: Darwin 64
> > > > Installer: J903 install
> > > > InstallPath: /users/brian/j903
> > > > Contact: www.jsoftware.com
> > > >
> > > > On Tue, Oct 25, 2022 at 5:21 PM Pablo Landherr <
> > pablo.landh...@gmail.com
> > > >
> > > > wrote:
> > > >
> > > >> As the discussion seems to have ended, it seems to me that the only
> > > >> remedy,
> > > >> i.e. to not have J crash in case I give *plot* incorrect parameters,
> > is
> > > to
> > > >> revert to an older J-version as the problem was not present when I
> ran
> > > >> J602. Can anyone advise on how far back I should go? 602 or would
> 701
> > or
> > > >> J8
> > > >> series be ok?
> > > >>
> > > >> Kind regards,
> > > >> Pablo Landherr
> > > >>
> > > >> --
> > > > (B=)
> > > >
> > > --
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] Plot package causing J to crash

2022-10-20 Thread bill lam
I can reproduce the crash. I think this is not a bug in the plot addon per
se but a change in behavior after migration to Qt 6.
It cannot display any dialog box during paint event but an J error happened
|length error: frames 3 and 4 are not conformable: pdf_text
|   pos=.pos-"1(-:len),.0

It crashed when trying display this error in a dialog box.

On Thu, Oct 20, 2022 at 11:17 PM Pablo Landherr 
wrote:

> Here is an even simpler case
>
> 'xlabel a b c d' plot 4 5 6
>
> On Thu, Oct 20, 2022 at 5:14 PM Pablo Landherr 
> wrote:
>
> > Here is an example
> >
> > $Fcat,.' '
> >
> > 161 38
> >
> > ('xlabel ',,Fcat,.' ') plot ?161#100
> >
> > (j terminates)
> >
> >
> > Fcat is a text matrix. If you need it, I can send it as well.
> >
> >
> >
> > On Thu, Oct 20, 2022 at 5:02 PM Henry Rich  wrote:
> >
> >> If you can give me a way to recreate the error, I will fix it.
> >>
> >> Henry Rich
> >>
> >> On 10/20/2022 9:24 AM, Pablo Landherr wrote:
> >> > Since I upgraded to 904, I've noticed that J will terminate
> immediately
> >> if
> >> > I send incorrect parameters or data to the plot function. That never
> >> > happened before. Plot would signal an error and I would try to
> >> understand
> >> > my mistake. Now, J quits in a blink of an eye and all unsaved work is
> >> lost.
> >> >
> >> > What can I do to avoid this? Not making errors in the use of plot is
> >> not an
> >> > option. ;-)
> >> >
> >> > I enclose (part of) the latest error report in case it helps.
> >> >
> >> > Kind regards,
> >> > Pablo Landherr
> >> >
> >> > -
> >> > Translated Report (Full Report Below)
> >> > -
> >> >
> >> > Process:   jqt [2110]
> >> > Path:  /Applications/j903/*/jqt
> >> > Identifier:jqt
> >> > Version:   ???
> >> > Code Type: X86-64 (Native)
> >> > Parent Process:Exited process [2107]
> >> > User ID:   501
> >> >
> >> > Date/Time: 2022-10-20 15:16:16.6442 +0200
> >> > OS Version:macOS 12.6 (21G115)
> >> > Report Version:12
> >> > Bridge OS Version: 6.6 (19P6067)
> >> > Anonymous UUID:2EC0EE9F-F768-EE9F-E97B-30A341BA8F4E
> >> >
> >> > Sleep/Wake UUID:   FF9375E4-3877-498F-AE99-D49E0DB9EE0C
> >> >
> >> > Time Awake Since Boot: 93 seconds
> >> > Time Since Wake:   170144 seconds
> >> >
> >> > System Integrity Protection: enabled
> >> >
> >> > Crashed Thread:0  Dispatch queue: com.apple.main-thread
> >> >
> >> > Exception Type:EXC_BAD_INSTRUCTION (SIGILL)
> >> > Exception Codes:   0x0001, 0x
> >> > Exception Note:EXC_CORPSE_NOTIFY
> >> >
> >> > Termination Reason:Namespace SIGNAL, Code 4 Illegal instruction: 4
> >> > Terminating Process:   exc handler [2110]
> >> > --
> >> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> >>
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jprogramming] i. et al

2022-10-13 Thread bill lam
i. is lenient but I. is not so that their error handling cannot be
consistent with each other. Eg

   'abcd' i. 1 2
4 4

   'abcd' i. <'abc'
4

   'abcd' I. <'abc'
|domain error
| 'abcd' I.<'abc'



On Fri, Oct 14, 2022, 8:34 AM Elijah Stone  wrote:

> I do not understand what you are getting at.  Obviously I. and i. are
> different.
>
> I. and i. (and many verbs related to i.) have analogous behaviour in that,
> while they nominally have infinite rank, they actually consider y to be a
> collection of x-cells, such that eg x f y is equivalent to x f"(_,<:#$x) y.
>
> But this is one difference in their behaviour.  I find it inconsistent,
> and I
> prefer the behaviour of I. .  And insofar as it might make sense to give
> any
> answer at all given arguments of mismatched shapes, I think it makes
> significantly more sense for I. to give an answer than for i. to do so.  A
> result returned from I. in such a situation will have some informational
> content, whereas the result returned from i. can predicted solely by
> looking
> at the shapes of x and y.
>
> On Thu, 13 Oct 2022, Raul Miller wrote:
>
> > i. and I. have different definitions. They cannot be made to give the
> > same results without breaking one or the other (or both).
> >
> >   V=: ?.~20
> >   V i. 17
> > 13
> >   V I. 17
> > 2
> >
> > --
> > Raul
> >
> > On Thu, Oct 13, 2022 at 7:56 PM Elijah Stone 
> wrote:
> >>
> >> Not consistent with I., though.  And I don't think the result is
> useful; there
> >> is no way there will ever be a match.  (Compare with I., which _could_
> >> plausibly give you useful information if it didn't throw an error.)
> >>
> >> On Fri, 14 Oct 2022, bill lam wrote:
> >>
> >> > I think the results are fine and are consistent with e.~
> >> >
> >> >
> >> > On Fri, 14 Oct 2022 at 7:39 AM Elijah Stone 
> wrote:
> >> >
> >> >> (i.3 3) i.2
> >> >> 3
> >> >> (i.3 3) i. i.5
> >> >> 3
> >> >>
> >> >> Are these results of use to anyone?  I would prefer an error.
> >> >>
> >> >> I. will give one:
> >> >>
> >> >> (i.3 3) I.2
> >> >> |rank error
> >> >> |   (i.3 3)I.2
> >> >> (i.3 3) I. i.5
> >> >> |length error
> >> >> |   (i.3 3)I.i.5
> >> >>
> --
> >> >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> >> >>
> >> > --
> >> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> >> --
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


  1   2   3   4   5   6   7   8   9   10   >