Re: [Jprogramming] Index of item in table

2023-12-26 Thread Gilles Kirouac
With p defined as p=.3 4 5$?.60$50 NB. ?. 33 (($@])#:[(I.@:=),@]) p 0 2 0 2 1 1 2 3 1 ~ Gilles Le 2023-12-26 à 21:06, 'Skip Cave' via Programming a écrit : What would a general "find the index of the value x in the array y" verb named fixv look like? It would work like this: ] p=.3 4 5$?6

Re: [Jprogramming] Anagram Operator (A.) and Generalized Datatype declaration in function assignments.

2023-08-14 Thread Gilles Kirouac
>>> What expression allows a function to recieve an argument 'y' as a literal >>> without using quotes? None. BTW, do not rely on the output of ": (default format) to determine the type, because it uses a default format with a default precision. Use datatype instead. datatype 18054804326

[Jprogramming] Crash on assignment

2023-04-20 Thread Gilles Kirouac
Say I have ]d=: _2 ]\ 'q1';'19.4';'q2';'878.34000';'q3';'200.3634' +--+-+ |q1|19.4 | +--+-+ |q2|878.34000| +--+-+ |q3|200.3634 | +--+-+ (]`(". each) "0) d +--+---+ |q1|19.4 | +--+---+ |q2|878.34 | +--+---+ |q3|200.363| +--+---+ The fol

Re: [Jprogramming] Applying a cyclic gerund

2023-02-26 Thread Gilles Kirouac
Ah! ah! (,: datatype each) ]`(".each)"0 list ┌───┬───┬───┬┬───┬┐ │foo│1 │bar│2.17│baz│3.14│ ├───┼───┼───┼┼───┼┤ │literal│boolean│literal│floating│literal│floating│ └───┴───┴───┴┴

Re: [Jprogramming] Applying a cyclic gerund

2023-02-23 Thread Gilles Kirouac
Thanks for many different solutions. There is indeed more than one way to skin a cat! Raul's monadic hook with Insert appears as a natural tool for this problem. Why didn't I think of it?! Henry's use of L: is surely an invitation to have a closer look at conjunction Level At. ~ Gille

[Jprogramming] Applying a cyclic gerund

2023-02-21 Thread Gilles Kirouac
I have two character strings : datatype each 'abc';'13.2' ┌───┬───┐ │literal│literal│ └───┴───┘ I want to convert the second one into numerical data datatype each (<@:])`(<@:".)"1 >'abc';'13.2' ┌───┬┐ │literal│floating│ └───┴┘ Can you simplify the a

[Jprogramming] Numbered locale in Lab Locales

2023-01-29 Thread Gilles Kirouac
In J805 w=: <'200' abc_200_=: 123 In J901 + abc_200_ =: 123 |locale error | abc_200_=:123 That is perhaps a change documented in the Release Notes of J901, but I am unable to find those notes. Step 66 of Lab Locales in J904 still says: A numbered locale name can be used

Re: [Jprogramming] Old trace function

2022-10-24 Thread Gilles Kirouac
Richard If you are looking for the trace script, it is in addons\general\misc See also https://wiki.jsoftware.com/wiki/Guides/Language_FAQ/TracePhrase ~ Gilles Le 2022-10-24 à 01:45, Richard Donovan a écrit : Many years ago (J4 or J6) I remember there was a function that showed how

Re: [Jprogramming] Poll questions: new refcard

2022-08-04 Thread Gilles Kirouac
1-c fnotes below each table 2-c main text could be smaller (see note below) 3-c footnote text could be smaller 4-c I like the coloration 5-d adv names are helpful and cj should have similar 6- don't know. See how it was summarized in the J6.02 Ref Card. 7- Is the use of alternating background gr

Re: [Jprogramming] Print every digit in jconsole.sh?

2022-07-23 Thread Gilles Kirouac
To see the full list of digits, use the standard utility foldpara. $a=: ": */ 1 + i.450x 1001 100 foldpara a NB. line length of 100 https://code.jsoftware.com/wiki/Standard_Library/Overview In jqt, the above page is loaded with Help->Standard Library The standard utilities are autom

[Jprogramming] j 9.03 Help menu item error

2022-07-22 Thread Gilles Kirouac
In j9.03, the Help menu item Release Notes loads the j9.02 page instead of the 9.03 one. JVERSION Engine: j903/j64/windows Release-b: commercial/2022-01-28T04:17:43 Library: 9.03.08 Qt IDE: 1.9.5/5.15.2(5.15.2) Platform: Win 64 Installer: J903 install InstallPath: c:/users/mouton/j903 Contact

Re: [Jprogramming] Got stuck...

2022-07-07 Thread Gilles Kirouac
Meino Once you have a working explicit definition, myfn=: 4 : 'y #~ (0=x|y)'NB. 4 for dyadic def 3 myfn 3 5 6 3 6 the interpreter can help you get the tacit form with 13 : def myfn=: 13 : 'y #~ (0=x|y)' myfn ] #~ 0 = | ~ Gilles Le 2022-07-07 à 10:57, 'robert therriault' via P

Re: [Jprogramming] Standalone Window Driver Script

2022-05-08 Thread Gilles Kirouac
The Window Driver wd is normally not available in jconsole, which you are using. wd rests on the QT environment and is available with the J QT ide. wd itself is defined in addons/ide/qt/qt.ijs. To use wd in jconsole, you need to have the QT environment available. To learn more, start here

Re: [Jprogramming] Extended precision question

2022-04-21 Thread Gilles Kirouac
e.jsoftware.com/wiki/Vocabulary/Constants#Extended_Integers Having said that, it is hidden pretty well and most of its references are previous documentation on the jsoftware site. There is certainly work to be done on the wiki! Cheers, bob On Apr 21, 2022, at 11:44, Gilles Kirouac wrote: Ed You

Re: [Jprogramming] Extended precision question

2022-04-21 Thread Gilles Kirouac
Ed You seem unaware of the extended precision constant notation: "digits with a trailing x denote an extended precision integer" https://www.jsoftware.com/help/dictionary/dcons.htm [Where is the equivalent in NuVoc?] I would rather write 1x + *: 9x 82 ~ Gilles Le

Re: [Jprogramming] J cheat sheet (or an alternative view for the NuVoc table)

2022-04-06 Thread Gilles Kirouac
We are working on a J9 version GREAT! Sergey's sheet is nice and well designed. But IMO it is for a somewhat experienced J programmer, while the old J6.02 Reference Card had details and __examples__ useful to the newcomer e.g. Format. It is dense, can be printed and posted. Thanks to Henry

Re: [Jprogramming] HMAC and PBKDF2

2022-02-02 Thread Gilles Kirouac
Standard Library is also an item of the Help menu in JQT. ~ Gilles Le 2022-02-02 à 18:03, chris burke a écrit : I didn't even know there was a standard library The standard library docs are linked from System on the wiki left menu: https://code.jsoftware.com/wiki/Standard_Library/Overview O

Re: [Jprogramming] Loopless merge sort

2021-10-05 Thread Gilles Kirouac
Does this page help? https://code.jsoftware.com/wiki/NYCJUG/2012-05-08 See Merge-Sort Examples. ~ Gilles Le 2021-10-05 à 12:03, Adrien Mathieu a écrit : Hello, I am a beginner, and I would like to know if there is a way to write mergesort without using loops, or an ugly translation of loops

Re: [Jprogramming] Multiline comments WAS: break from loading a script with 'load'

2021-09-01 Thread Gilles Kirouac
Concerning the Toggle Comment Ctl+/ and Toggle Note Ctl+Shift+/ features With my French-Canadian keyboard driver, I can do Ctl+/ using Ctl+Shift+3 since / is uppercase 3 on that kb. But Toggle Note poses a problem. Some Russian and Serbian images likely have a similar problem. Is there a wo

Re: [Jprogramming] histogram in stats/base

2021-05-20 Thread Gilles Kirouac
Perfect upgrade! histogram does not lead to lost data any more. _5 0 5 histogram _2 _7 0 3 9 1 1 2 1 Thanks, Ric, for all future users. ~ Gilles Le 2021-05-19 à 08:01, Raul Miller a écrit : Yes.. I should have been reading the updated code, rather than the commits. It's been too long sin

Re: [Jprogramming] Question about least squares with %.

2021-04-29 Thread Gilles Kirouac
Could you please tell me what I would need to change to fix the following little J program (e.g., how to replace %. with a call to LAPACK)? You should read https://code.jsoftware.com/wiki/Vocabulary/LAPACK ~ Gilles Le 2021-04-29 à 14:29, Henry Rich a écrit : %. does not use SVD

Re: [Jprogramming] histogram in stats/base

2021-04-13 Thread Gilles Kirouac
Thanks to Brian and Ric for their major improvements and in particular for Brian's Histogram wiki page. I was neither asking nor hoping for so much. Both are interesting. I find specially useful the visual representation of the importance of each interval. If there was a way to paint interva

[Jprogramming] histogram in stats/base

2021-04-09 Thread Gilles Kirouac
About the histogram verb in stats/base NB. The result is a list of counts of the number of data points in each interval. Intervals are specified by the left argument. histogram uses dyadic I. The I. primitive defines (1+#x) intervals. See its clear definition in Nuvoc. In short, it

Re: [Jprogramming] Getting indices of matrix elements

2020-11-13 Thread Gilles Kirouac
This topic has been discussed before: http://www.jsoftware.com/pipermail/programming/2018-November/052287.html Another way to learn is to study J Phrases, specially section 4.B., accessible through Help, Vocabulary, Phr. ~ Gilles Le 2020-11-13 à 15:00, R.E. Boss a écrit : $.$.M 0 0 │ 1

Re: [Jprogramming] J counterpart to R's View()?

2020-05-01 Thread Gilles Kirouac
load jpath '~addons/debug/jig/jig.ijs' ^. It seems the tilde is required here. ~ Gilles Le 2020-05-01 à 12:56, 'robert therriault' via Programming a écrit : > load jpath 'addons/debug/jig/jig.ijs' -

Re: [Jprogramming] run debug on stopped line, then stop immediately

2020-04-01 Thread Gilles Kirouac
   dbnxt (13!:5) works, 13!:21 does not. h=: 3 : ('t=. 2 3*y'; '1+t'; 't')    dbr 1    3 4,h 5 6 7 |length error: h |   t=.2 3    *y |h[0]   t=.99   13!:21 '' |length error *   t=.2 3    *y |h[0]    13!:5 '' |stop *   1+t |h[1]    13!:5 '' 3 4 99    JVERSION Engine: j901/j64avx/wi

Re: [Jprogramming] Question about strange verb

2020-01-15 Thread Gilles Kirouac
The N0 V1 V2 sequence was introduced in release 6.02:    https://www.jsoftware.com/docs/help602/release/nvv.htm As for the manywithdrawn bidents and tridents, that was with release 5.01:    https://www.jsoftware.com/help/user/previous504.htm  look for "fork" However the Release Notes page which

Re: [Jprogramming] Yahoo stock quotes

2019-11-26 Thread Gilles Kirouac
Thomas   To avoid the dependency on Linux, without changing your syntax, I redefined epochtime as: NB.create a time stamp [of type character] NB.   epochtime'1/1/2019' NB.1546318800 epochtime =: 3 : 0 ":18000+86400*62091-~todayno _1|.".;._1 '/',y NB.normalized yr mn dy )   and I removed the two c

Re: [Jprogramming] J and data structures

2019-11-18 Thread Gilles Kirouac
Why can't such a class be implemented using s: Symbols? It does calculate hashes and seems appropriate for dictionaries. What is deficient in the implementation of s: ? Why a new hash function? ~ Gilles Le 2019-11-18 à 08:09, Henry Rich a écrit : > Right now I am thinking that the need for dictio

[Jprogramming] webio script examples

2019-11-08 Thread Gilles Kirouac
I am studying the webio script (https://code.jsoftware.com/wiki/Scripts/Socket_System). I tried using the first example, but it fails using gethostbyname because xlatecache has not been defined. It seems that no sockmux object was created, thus preventing the initialize verb to run. After launchi

Re: [Jprogramming] command not found in sdasync

2019-11-04 Thread Gilles Kirouac
select, is atypical socket programming, and may be > decommitted in future releases." > > So we will decommit it now. > > On Sun, Nov 3, 2019 at 2:19 PM Gilles Kirouac wrote: > >> In J805, j806 and current beta for Windows, sdasync defined in >> socket.ijs has the

[Jprogramming] command not found in sdasync

2019-11-03 Thread Gilles Kirouac
In J805, j806 and current beta for Windows, sdasync defined in socket.ijs has the line: hwnd=. ".wd'qhwndx' but qhwndx is not a valid command, resulting in "command not found". ~ Gilles -- For information about J forums see htt

Re: [Jprogramming] length of tessellation [was: odds and nths]

2019-11-01 Thread Gilles Kirouac
  The recent thread on odds and nths made me review the Cut conjunction doing tessellation,  i.e. case ;._3 .   About the tile size, both the Vocabulary and the NuVoc page specify that an infinite size can be used: Voc : an infinite size being replaced by the signed length of the corresponding ax

Re: [Jprogramming] Learning Tacit Programming

2019-08-14 Thread Gilles Kirouac
Josh To understand or write tacit programming, one must master the basic elements just as a carpenter must know everything of a saw, a hammer, a screwdriver. To me, the basic elements of tacit are: @, @:, & (Compose), &:, fork, hook, hook with ~ (e.g. u~v). [ and ] are also essential but they are

Re: [Jprogramming] Gaussian Elimination

2019-08-08 Thread Gilles Kirouac
  In addition to Roger Hui's writings ...   The math/mt addon has equation solving in pure J. You may get useful info there too.   https://code.jsoftware.com/wiki/Addons/math/mt   Doing an exact forum search on "matrix inverse" reveals 67 quotes.   You may also look at foreign conjunction 1

Re: [Jprogramming] A bit-twisting puzzle

2019-07-28 Thread Gilles Kirouac
How about multiply a and b, followed by a branch on zero? ~ Gilles Le 2019-07-28 à 20:51, Henry Rich a écrit : > Many of the members of this Forum will remember the days of assembler > language > >   ...and who could less than merry be >   when writing out BXLE? > > AND, OR, XOR were our meat.  T

Re: [Jprogramming] Applying different verbs to different items.

2019-05-02 Thread Gilles Kirouac
or (not as simple) c=: (128!:2)&.>< g c"0 y ┌─┬───┬─┐ │9│0.5│1│ └─┴───┴─┘ Try removing "0 Le 2019-05-02 à 22:35, 'Rob Hodgkinson' via Programming a écrit : > Hi Piet, not ignorant at all ! > > Try using oblique (an obscure feature is that the u in u/. can be a gerund, > in which case it is

Re: [Jprogramming] Beginner's Question: How to reverse a number's digits?

2019-04-12 Thread Gilles Kirouac
Thomas   The proposed solution makes a conversion from numerical to characters: datatype smoutput ":123  NB. smoutput displays arg and 123  NB. returns empty of the same type literal   You could also separate the digits and keep them as integers with Antibase-Base: datatype s

Re: [Jprogramming] api/expat

2018-08-28 Thread Gilles Kirouac
Did you have a look at Oleg Kobchenko's (old) page? http://olegykj.sourceforge.net/ The xml parser addon is there.   ~ Gilles Le 2018-08-27 à 21:58, bill lam a écrit : readme.txt contains minimalist documentation, but perhaps you had already read it. On Tue, Aug 28, 2018, 1:28 AM Raul Miller

Re: [Jprogramming] g420fg NaN error (defining a dyadic verb)

2018-08-07 Thread Gilles Kirouac
To define alpha1 as a dyadic verb, use alpha1=: 4 :'y /: <./x i."1 _ y'   NB. 4 instead of 3 ~ GIlles Le 2018-08-07 à 03:46, Linda Alvord a écrit : I can't seem to get messages to the forum. Here's a problem in J806 a=:'abcdefghijklmnopqrstuvwxyz' A=:'ABCDEFGHIJKLMNOPQRSTUVWXYZ' aA=:

Re: [Jprogramming] addons/api/python3 updated

2018-02-19 Thread Gilles Kirouac
I had j806/j64/windows, I installed Python 3.6.4 today for my single use (rather than all users). I then had difficulty with "import j". "put j.py and j_config.py where python can find them" I initially placed them with other scripts under Tools\scripts, but that did not work. Putting them in the

Re: [Jprogramming] parsing fixed-width files

2017-11-17 Thread Gilles Kirouac
1(0,+/\}.20 10 12)}42$0 NB. mask for length 10 12 20 1(0,+/\}:20 10 12)}42$0 NB. Drop last, not first; for 20 10 12 Le 2017-11-17 à 00:24, Daniel Lyons a écrit : > Thanks Rob! > > I did feel that the general idea of the rolling sum generating the indices of > the frets was not terrible, it ju

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Gilles Kirouac
   a=:(0 0, 2 _3 ,: _1 2)    a  0  0  2 _3 _1  2    ]b=:1 1,_1 _2,:3 4  1  1 _1 _2  3  4    a(4 :'+/ &.: *:x-y' "1)b    NB. Under since Square Root is obverse (inverse) of Square 1.41421 3.16228 4.47214    a((+/ &.: *:)@: -) "1 b NB. in a tacit way 1.41421 3.16228 4.47214    a([: (+/ &.: *:) -

Re: [Jprogramming] How can I auto-refresh a JHS app page?

2017-09-05 Thread Gilles Kirouac
Depending on your requirements (the browser used by users), you could consider Server-Sent Events, an alternative to websockets, but they are not supported in IE neither (yet?) in Edge. In HTML5, Server-Sent Events are probably what you need. Have a look at the following with a clock example in PH

Re: [Jprogramming] Documenting box display

2017-02-21 Thread Gilles Kirouac
Raul was right: a font issue. Qt IDE has no deficiency. Thanks for all suggestions. ~ Gilles Le 2017-02-21 à 08:24, 'Pascal Jasmin' via Programming a écrit : > working with html, a pre tag enclosing the entire copied session is likely to > format it "right". Your editor may have a "blockquo

[Jprogramming] Documenting box display

2017-02-20 Thread Gilles Kirouac
With the Qt IDE under MS-Win, I would like to document my session output in a text processor. When I copy and paste a boxed display, the lines are distorted as we see in this forum. Is there a solution? I could replace the Box-Drawing Characters with those proposed in Global Parameter 9!:7 giving

Re: [Jprogramming] kill J32 on linux and mac

2016-10-17 Thread Gilles Kirouac
>>> J805 will NOT support J32 for linux and mac. This is about a bug in J804 for linux32 which crashes J. === [gilles@NetV03 j804]$ bin/jconsole Adv=: 1 : 0 u y ( ) 13!:0 ]1 NB. Reset and activate debugger + Adv 2 |syntax error: Adv |

Re: [Jprogramming] GET POST http utilities.

2016-09-26 Thread Gilles Kirouac
Bill On https://curl.haxx.se/download.html , under Win32 - generic, the third line is Win327zip 7.50.3 binary SSL Darren Owen leading to http://winampplugins.co.uk/curl/ The offered downloads "have been built with OpenSSL, ngttp2 and IPv6 support" and are based on the most recent

Re: [Jprogramming] GET POST http utilities.

2016-09-12 Thread Gilles Kirouac
John You don't say much about the problem (error type...). Curl supports https. If it has to do with a rejected SSL certificate, google (curl https) proposes the following url: http://stackoverflow.com/questions/10079707/https-connection-using-curl-from-command-line The discussion t

Re: [Jprogramming] sockets and memr

2014-07-23 Thread Gilles Kirouac
I use the addon web/gethttp to get a page off the net. Unless you have peculiar needs (like login first), this is the ready-made solution. You can get the page as the result of the gethttp verb or have it put in a file. ~ Gilles -- Original Message --- From: Joe Bogner

Re: [Jprogramming] trains

2014-07-18 Thread Gilles Kirouac
The first train I used has been given by Chris: getting the shape and the value (in a console, when you don't have a fancy GUI à la Dyalog). ($;]) a ┌─┬─┐ │1│0│ └─┴─┘ But, Daniel, have you looked at the Phrases? You'll find hundreds of them classified by application type in about fift

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-01-19 Thread Gilles Kirouac
Joe Here is another suggestion. Learn J by example: READ well written J scripts. Library and system scripts are generally such good examples. ~ Gilles -- For information about J forums see http://www.jsoftware.com/foru

Re: [Jprogramming] Sparse with extended integers yields domain error???

2013-08-20 Thread Gilles Kirouac
> Why do I get a domain error? Are sparse arrays not implemented for extended > integers? On the page you refer to (d211.htm), one can read: "A sparse array y may be boolean, integer, floating point, complex, literal, or boxed ...". No extended integers here. You may also look at 3!:0,

Re: [Jprogramming] J and APL symbols

2013-04-05 Thread Gilles Kirouac
Is great Visual Studio integration for J desirable? Definitely yes. J using an enriched APL character set? I am not so sure. Devon said it and I agree. IMO, APL characters for J is not such a good idea. At first glance, it appears doable and attractive to those who have got used to

Re: [Jprogramming] Playing WAV files

2012-10-31 Thread Gilles Kirouac
On my Linux system, the following will play a wave file in a bash shell: mplayer tata.wav NB. Check the doc of mplayer Using the task script, you could call mplayer from J: load'task' _1 fork_jtask_ 'mplayer tata.wav' shell 'mplayer tata.wav' Both will play a .w

Re: [Jprogramming] Execution with time limit

2012-09-19 Thread Gilles Kirouac
Henry Did you look at 9!:32 33? It may not have the wanted granularity under Windows though. ~ Gilles -- Original Message --- From: Henry Rich To: Programming forum Sent: Wed, 19 Sep 2012 16:30:33 -0400 Subject: [Jprogramming] Execution with time limit > I have uses for

Re: [Jprogramming] flattening boxed strings

2012-09-06 Thread Gilles Kirouac
The first time I saw ;: ^: _1 was in a solution offered by Ewart Shaw a long time ago (before 1998, since it is not in the current archives). My reply was: Wow! One may be using J for years and still someday discover such pearls. ~ Gilles --