Re: [Jprogramming] Strange error

2023-03-30 Thread Ric Sherlock
Not sure if it will help with your Windows Defender issues but it might be worth trying to install using the Windows commandline utility: winget PS C:\Users\jblogs> winget search J-language Name Id Version Source --- J-language Js

Re: [Jprogramming] Rank numbering with duplicates

2023-03-15 Thread Ric Sherlock
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/

Re: [Jprogramming] Rank numbering with duplicates

2023-03-15 Thread Ric Sherlock
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 f

Re: [Jprogramming] Numbered locale in Lab Locales

2023-01-29 Thread Ric Sherlock
Hi Giles, Release notes for various J versions can be found on the wiki here: https://code.jsoftware.com/wiki/System/ReleaseNotes In the notes for J901 ( https://code.jsoftware.com/wiki/System/ReleaseNotes/J901) I can see the following which might be what you are seeing? : "Change in behavior of

Re: [Jprogramming] dsv question

2022-08-23 Thread Ric Sherlock
Building on the inverted table defns dfftbl=: {. ,: ifa@}. tblfdf=: {. , afi@{: tblfdf dfftbl B ┌──┬──┬──┬─┐ │Id│Name │Job │Status │ ├──┼──┼──┼─┤ │3 │Jerry │Unemployed│Married │ ├──┼──┼──┼─┤ │6 │Jan │CEO │Marri

Re: [Jprogramming] dsv question

2022-08-17 Thread Ric Sherlock
It looks like you are trying to use the inverted Table format but with a header row. load 'tables/dsv general/misc/inverted' ({. ,: ifa@:}.) ',' readdsv 'test.csv' ┌──┬──┬──┐ │deptno│dname │location │ ├──┼──┼──┤ │10│Accounting│"New York"│ │20

Re: [Jprogramming] ~addons/math/deoptim/deoptim.ijs

2022-05-11 Thread Ric Sherlock
Hi David, Thanks for the feedback. I agree that adding some additional text there may help users trying to work out how to use the addon. Did you have a suggested wording change in mind? The function named will be called from within the 'pdeoptim' locale and so needs to either be in the search pat

Re: [Jprogramming] Test which verb was provided to an adverb

2022-05-04 Thread Ric Sherlock
inities. It's proof territory. > > > > That said, typically we solve this kind of problem by hand, rather > > than using a test on the structure of the verb. > > > > Good luck, > > > > -- > > Raul > > > > On Tue, May 3, 2022 at 5

[Jprogramming] Test which verb was provided to an adverb

2022-05-03 Thread Ric Sherlock
I want to test if a particular verb was provided to my adverb. I came up with the solution below. Is there a better way? myadverb = {{ res=. u {:y if. theverb f.`'' -: u f.`'' do. res=. ({.y) ,: res end. res }} -- For

Re: [Jprogramming] An invitation to participate in developing the J wiki

2022-03-09 Thread Ric Sherlock
Hi Joe, This is pretty slick! I can confirm it appears to work fine for me on Windows 10 with Firefox. It might be nice to provide a method for stopping the script? I ended up refreshing the page to get it to stop. On Thu, Mar 10, 2022 at 8:57 AM Raul Miller wrote: > For people who want to tes

Re: [Jprogramming] DataFrames in J

2022-02-13 Thread Ric Sherlock
;query engine" (too simple to call it that) that takes a boolean > function to filter records "on set of properties/fields" > > Basically an inverted table as a dictionary is a dictionary that only > contains the properties corresponding to fields. Because kv can sto

Re: [Jprogramming] DataFrames in J

2022-02-13 Thread Ric Sherlock
mia.edu/10031088/ORDINAL_FRACTIONS_the_algebra_of_data > > Thanks! > > Bo. > > Den søndag den 13. februar 2022 14.49.06 CET skrev Ric Sherlock < > tikk...@gmail.com>: > > > > > > Inspired by recent threads, I've started experimenting with a DataFrame &g

[Jprogramming] DataFrames in J

2022-02-13 Thread Ric Sherlock
Inspired by recent threads, I've started experimenting with a DataFrame structure in J. I began by building off the 'general/misc/inverted' utilities so that a DataFrame is just a 2-row table, where the first row is a list of labels & the 2nd is an inverted table. It can be installed as 'tables/da

[Jprogramming] Reading Arrow and Parquet files WAS: Report on the Jwiki meeting of January 27, 2022

2022-02-06 Thread Ric Sherlock
that functionality is still missing. > > > On Wed, 2 Feb 2022 at 7:34 pm, Ric Sherlock wrote: > > > Thanks Aaron - that looks really promising. Will check it out & see if I > > can get it to work. > > > > On Wed, Feb 2, 2022 at 8:48 PM Aaron Ash wrote: &g

Re: [Jprogramming] domain error gltext

2022-02-03 Thread Ric Sherlock
Very cool! On Fri, Feb 4, 2022 at 3:06 PM Raul Miller wrote: > On Thu, Feb 3, 2022 at 7:17 PM bill lam wrote: > > gl2 expect ascii or utf8. Try > > gltext 8&u: u:9017 > > Or > > gltext 8&u: 9017 > > Thanks -- that worked. (And, I've updated the gltext entry in the wiki > to reflect this issue.)

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-02-02 Thread Ric Sherlock
t; > On Wed, Feb 2, 2022 at 5:27 PM Stefan Baumann wrote: > > > > Ric, You might want to check out DuckDB (https://duckdb.org/), I > recently > > used it for reading and writing Parquet files. > > It's similar to SQLite but intended to be used for analytics. &

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-02-02 Thread Ric Sherlock
! On Wed, Feb 2, 2022 at 8:27 PM Stefan Baumann wrote: > Ric, You might want to check out DuckDB (https://duckdb.org/), I recently > used it for reading and writing Parquet files. > It's similar to SQLite but intended to be used for analytics. > Stefan. > > On Wed, Fe

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-02-01 Thread Ric Sherlock
else is interested, we could collaborate at > least on the design. > > Chris > > On Mon, Jan 31, 2022 at 10:21 AM Ric Sherlock wrote: > > > Yes, I've been thinking that a Dataframes equivalent in J would be > useful. > > Most things are already possible with J&#

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Ric Sherlock
> otoh, we already have a binding to R where you can deal > with dataframes easily – do we want to “compete” here, too? > > In terms of whether to just adopt/use one of R's/Pandas'/Polars'/Julia's dataframes rather than reinventing the wheel - I think for me that if it were possible to use J primit

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-31 Thread Ric Sherlock
; > > > I’ve tried Jd, it’s equivalent to pandas I think (and about as > performant) though it’s persistent (being a database). > > > > q/k is faster, I think because it’s ordered by default - maybe something > like ordered dataframes could be implemented in J?

Re: [Jprogramming] arrayfire

2022-01-30 Thread Ric Sherlock
The start-up experience is now much more informative & welcoming. Nice! On my laptop (4 cores) with WSL using the cpu backend to run the matmul benchmark, it looks as though the point at which jaf outperforms native J matrix multiplication is about 150x150 On Mon, Jan 31, 2022 at 7:14 AM Eric Ive

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-30 Thread Ric Sherlock
t. > > -E > > P.S. regarding analysis/optimization: I would love to see it, but for some > reason everybody is scared of building a compiler because of the parsing > problem. > > On Mon, 31 Jan 2022, Ric Sherlock wrote: > > > Yes, I've been thinking

Re: [Jprogramming] Report on the J wiki meeting of January 27, 2022

2022-01-30 Thread Ric Sherlock
Yes, I've been thinking that a Dataframes equivalent in J would be useful. Most things are already possible with J's arrays, but conceptually DataFrames are well understood by many now, and they make it easy to work with datasets as named fields. I've spent a reasonable amount of time working with

Re: [Jprogramming] TextMate bundle

2022-01-28 Thread Ric Sherlock
Hi Pete, There is a collection of syntax highlighting efforts for various environments on the J wiki at https://code.jsoftware.com/wiki/Guides/Syntax_Coloring Feel free to add yours! I have also developed a TextMate syntax file for J at: https://github.com/tikkanz/JSyntax I haven't looked at yours

Re: [Jprogramming] arrayfire addon updated

2022-01-27 Thread Ric Sherlock
Thanks Eric - this looks very promising! I managed to get it installed & running on WSL although I needed to amend the instructions on the arrayfire website somewhat so I could write to /etc/ld.so.conf.d/ Any thoughts on where the switchover point is at which Arrayfire is compelling relative to J'

Re: [Jprogramming] erf?

2022-01-25 Thread Ric Sherlock
Raul, Not sure if your request was prompted by your thinking that H. was no longer available in J9, but in case it's useful erf as defined in stats/distribs/normal works on non integers. erf 0.5 1 1.5 0.5205 0.842701 0.966105 NB. erf v error function NB. ref Abramovitz and Stegum 7.1.21 (right) e

Re: [Jprogramming] Rank of an arbitrary matrix

2022-01-14 Thread Ric Sherlock
Or using Igor's math/mt addon: load 'math/mt' coinsert 'mt' calcMatrixRank_qrmt=: #@(] -. 0 #~ #)@([: clean tru@}:@geqrf) calcMatrixRank_qrmt _3 ]\ 1 2 3 5 4 6 9 7 8 3 calcMatrixRank_qrmt _3 ]\ 1 2 3 2 4 6 9 7 8 2 On Sat, Jan 15, 2022 at 3:30 PM Ric Sh

Re: [Jprogramming] Rank of an arbitrary matrix

2022-01-14 Thread Ric Sherlock
Putting John's suggestion of using LAPACK into practice. LAPACK is available in the J9.03 Package Manager via the math/lapack2 addon. Once installed (you also need to follow the simple steps to install the binary library for your OS) Then I think the following should calculate the matrix rank using

Re: [Jprogramming] Rank of an arbitrary matrix

2022-01-13 Thread Ric Sherlock
Not sure this is the preferable way but one solution might be: load 'math/misc/matfacto' matrixrank=: #@(] -. 0 #~ #)@(1 {:: lud) matrixrank _3 ]\ 1 2 3 5 4 6 9 7 8 3 matrixrank _3 ]\ 1 2 3 2 4 6 9 7 8 2 Note that "rank" has lots of alternative meanings in J other than calculating the

[Jprogramming] quantile support added to stats/base addon

2022-01-09 Thread Ric Sherlock
A new version of the stats/base addon has been released. It includes the following new verbs: quantiles vquantiles of y at the specified probabilities x nquantiles v values which partition y into x quantiles iqr v inter-quartile range (IQR) of y ntiles v assign values of y to

Re: [Jprogramming] J Reference card

2021-11-08 Thread Ric Sherlock
ship it with J for iOS in its next > update. > (And how about an extra line in jqt > Help, which opens a window showing > the pdf?) > > On Mon, 8 Nov 2021 at 23:17, Henry Rich wrote: > > > I did the original card, and Ric Sherlock put it into the pretty form it > >

Re: [Jprogramming] sudoku solver

2021-10-13 Thread Ric Sherlock
In case you haven't seen it yet: https://code.jsoftware.com/wiki/Essays/Sudoku On Thu, Oct 14, 2021 at 12:12 PM Hauke Rehr wrote: > After reading what this is about, > I guess a1, a2 and a3 aren’t atomic > so maybe you want > > is&.>/ a1;a2;a3 > instead > > > Am 14.10.21 um 01:00 schrieb Hauke

Re: [Jprogramming] cross product

2021-09-21 Thread Ric Sherlock
Some variation on this? |:(m,:n) {~"1 |: 4$.$. map aA aD bB bC On Tue, 21 Sep 2021, 21:37 bill lam, wrote: > Say I have a boolean matrix >] map=. 3 4 $ 1 0 0 1 0 1 1 0 0 0 0 0 > 1 0 0 1 > 0 1 1 0 > 0 0 0 0 > > and 2 vectors of dimension equal to the 2 sides of the matrix >m=. 'abc

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

2021-08-31 Thread Ric Sherlock
I like the proposed: NB.( Would it be closed with: ) Apart from more consistent "naming", what are the other benefits of multiline comments as a feature that currently aren't provided by {{)n or 0 : 0? Currently I use Note, a variation on 0 : 0 from the stdlib ( https://code.jsoftware.com/wiki/Sta

Re: [Jprogramming] out of memory unexpected

2021-06-14 Thread Ric Sherlock
Cross posting to the beta forum where we should continue the discussion. I can't reproduce the error shown in J9.03 (linux jconsole) or J9.02 linux/windows jconsole/jqtide x9=: 1e6 ?@$ 2e9 y9=: 1e5 ?@$ 2e9 f9=: x9&i.; type 'f9' ++ |verb| ++ JVERSION Engine: j903/j64avx2/lin

Re: [Jprogramming] out of memory unexpected

2021-06-14 Thread Ric Sherlock
I have made a change to the page noting that the Kahan summation feature was added in J9.03. Imre - this thread relates to the current beta version of J. My expectation is that there will be bugs and that this is our opportunity to help the team iron them out before release. If you have come acros

Re: [Jprogramming] Experiment with (+/ .*)

2021-05-24 Thread Ric Sherlock
Just to provide some context to Henry's statement that things have changed a bit since J8.05, below are the timings I get on my phone (Pixel 4a) using J902. ,.f"0]2^>:i.13 0.024127 1e_5 2e_6 3e_6 3.4e_5 0.000909 0.000425 0.012697 0.020461 0.139175 1.00075 6.6658 56.7179 On Mon,

Re: [Jprogramming] histogram in stats/base

2021-05-19 Thread Ric Sherlock
uation > the 'NB. The number of points in the last interval is undercounted by > 1' is good for. I could look it up, but I think comments should focus > on purpose rather than just mention implementation details. Is this > something you feel comfortable elaborating on? >

Re: [Jprogramming] histogram in stats/base

2021-05-19 Thread Ric Sherlock
I've made some changes to stats/base in this Pull request https://github.com/jsoftware/stats_base/pull/5 Any suggestions/objections? Changes are basically: * the current version of histogram is replaced with histogram2 (also called histogramL) * histogram1 is added as histogramR * added Idotr

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

2021-05-03 Thread Ric Sherlock
This link may be of interest. Can QR Decomposition Be Actually Faster? Schwarz-Rutishauser Algorithm https://link.medium.com/s1t2vXHAYfb On Tue, 4 May 2021, 08:48 Hauke Rehr, wrote: > One might also want to trade Householder for Givens, > at least in certain circumstances. Would be nice to > •

Re: [Jprogramming] (GUI) Select from a grid

2021-05-01 Thread Ric Sherlock
Minesweeper appears to be working fine for me in J902 (Windows Qt) and on Android. Bill it looks like the dialogs with xywh commands were introduced to support jnet? However they don't seem to interfere with the Windows Qt version for me. On Sat, May 1, 2021 at 1:40 PM Devon McCormick wrote: >

Re: [Jprogramming] Non array data structures in J

2021-04-11 Thread Ric Sherlock
Hi Emir, In case you haven't seen them yet I've provided a couple of links to resources that may be useful. The first is quite a long forum thread that amongst other things talks about whether trees could/should/will be added as another datatype to J. http://www.jsoftware.com/pipermail/programming

Re: [Jprogramming] histogram in stats/base

2021-04-10 Thread Ric Sherlock
limits=: 14 18 249 312 389 392 513 591 634 720 data=: 1e6 ?@$ 1000 50 timespacex ' limits2 # binnedData data' 0.0135251 2.517e7 50 timespacex ' limits2 histogram2 data' 0.00884346 1.67788e7 On Sun, Apr 11, 2021 at 2:21 PM Ric Sherlock wrote: > Good questi

Re: [Jprogramming] histogram in stats/base

2021-04-10 Thread Ric Sherlock
Good question Brian and interesting discussion. I agree that the key to the problem is to agree exactly what the desired behaviour of histogram should be. Mathematical/statistical convention seems to be that Intervals should be closed on the left and open on the right. This makes life a bit harder

Re: [Jprogramming] "Surprising" performance differences for sum of quotients

2021-03-13 Thread Ric Sherlock
al code off in those cases. Now I get > > 50 timespacex '+/ 8 % tstdata' > 0.005984 4.19581e6 > 50 timespacex '8 +/@:% tstdata' > 0.00598417 4.19594e6 > > But I can offer you one improvement: > > 50 timespacex '8. +/@:% tstdata'

Re: [Jprogramming] Zipping from within J

2021-03-13 Thread Ric Sherlock
Hi Devon, Given that arc/zip is not available on J9 and arc/ziptrees is dependent on it, that addon should also be set to not be available on J9. I'll update that. Thanks, On Sat, Mar 13, 2021 at 4:04 PM Devon McCormick wrote: > Has anyone used the "ziptrees" addon in J? Or the code at > https

[Jprogramming] "Surprising" performance differences for sum of quotients

2021-03-13 Thread Ric Sherlock
I was initially surprised by the big differences in performance between different formulations of the sum of the quotients tstdata=: _2 */\ 1+2*i.100 50 timespacex '+/ 8 % tstdata' 0.00206915 4.19581e6 50 timespacex '8 +/@:% tstdata' 0.0686648 1792 The first is up to 113 times faster (dep

Re: [Jprogramming] Redefining mean..stddev for dyadic weighted usage

2021-02-27 Thread Ric Sherlock
0 0 4 1 2 1 0 # 2 3 5 7 11 13 17 19 23 > > 5.60258 > > equal the dyadic > >1 1 0 0 4 1 2 1 0 stddev 2 3 5 7 11 13 17 19 23 > > 5.82237 > > ? > Den lørdag den 27. februar 2021 14.12.10 CET skrev Ric Sherlock < > tikk...@gmail.com>: > > Any obj

[Jprogramming] Redefining mean..stddev for dyadic weighted usage

2021-02-27 Thread Ric Sherlock
Any objections to redefining mean, dev, ssdev, var, stddev in the stats/base add on to calculate the weighted equivalents if invoked dyadically? I. E. wmean=: +/@[ %~ +/@:* wdev=: ] -"_1 _ wmean wssdev=: [ +/@:* *:@wdev wvar=: (#@-.&0 %~ <:@#@-.&0 * +/)@[ %~ wssdev wstddev=: %:@wvar mean=: (+/ %

Re: [Jprogramming] Tabling and rank

2021-02-23 Thread Ric Sherlock
Hi Emir, Yes _ represents infinity. So in this case x g"1 _ y will pass a row of x (1) and the whole of y (_) to the verb g until all rows of x have been processed. In this case g is actually the verb f"1 1 On Tue, Feb 23, 2021 at 10:07 PM Emir U wrote: > Thank you for the insights Henry. > > I

Re: [Jprogramming] "Amending" a row of boxed data?

2021-02-23 Thread Ric Sherlock
Hi Harvey, Sounds like the data given might be quite a simplification from the reality, but let's start with that for now. The following will subtract 12 from the boxed row of numbers in the example. It assumes that the numeric values are numeric and not text. dat=: '|'&splitstring;._2 -.&' ' nou

Re: [Jprogramming] csvedit

2021-02-18 Thread Ric Sherlock
Actually 0&". Seems to convert number strings containing commas OK. 0 ". > '123,555';'253,562.26' 123555 253562 On Fri, 19 Feb 2021, 02:27 Ric Sherlock, wrote: > My initial reaction is that the tables/csv add on should read those OK, > the issue w

Re: [Jprogramming] csvedit

2021-02-18 Thread Ric Sherlock
My initial reaction is that the tables/csv add on should read those OK, the issue will be converting the number strings in the cells to numbers. If there are no meaningful commas other than the field delimiters, couldn't you use -.&','each after readcsv to remove them? Alternatively: TAB fixdsv

Re: [Jprogramming] Error in comment in addons/math/misc/pollard.ijs

2021-02-13 Thread Ric Sherlock
to > criticism and correction in this and perhaps other forums/fora. > > > > Cheers, > > > > Mike > > > > Sent from my iPad > > > >> On 13 Feb 2021, at 23:20, Ric Sherlock wrote: > >> > >> Hi Mike, > >> I've made

Re: [Jprogramming] Error in comment in addons/math/misc/pollard.ijs

2021-02-13 Thread Ric Sherlock
Hi Mike, I've made the suggested change and pushed to GitHub. Next time the addon is released, the change will be included. I wonder if it makes sense for suggestions like this to be provided as a GitHub pull request where possible? * less chance of miscommunication between report and fix * easier

Re: [Jprogramming] Aspect ratio of plot

2021-02-09 Thread Ric Sherlock
I enlarged the plot window, took a screenshot and then measured the distance between _0.8 to 0.8 on the two axes using an on-screen ruler, the Y-axis distance is about a centimetre longer than the X-axis distance. On Wed, Feb 10, 2021 at 1:52 PM bill lam wrote: > I think it's ok to have differen

Re: [Jprogramming] Progressive insertion into a string

2021-02-05 Thread Ric Sherlock
Better handling for empty string (also from JforC Programmers) would be: ifany=: {{ u^:(*@#@]) }} dedouble=: splitDigraph/&.|. ifany On Sat, Feb 6, 2021 at 3:45 PM Ric Sherlock wrote: > Thanks for that reference. It helped me understand what was going on here > and a good reminder

Re: [Jprogramming] Progressive insertion into a string

2021-02-05 Thread Ric Sherlock
NB. > data=:data1;data2;data3;data4;data5 > > > >NB. Same solution with α instead of X > > > > +---+------+-+--+ > > > > |THEαEQUICKBROWFαFOX|THEαEQUICKBROWFOOX|TαTHEαEQUICKBROWFαFOX|Tα

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
t;"1]_2 ]\ str >;dbld,&.>(>=/&>dbld){'';'X' > AAXAbbCCCXC > > > On Thu, Feb 4, 2021 at 11:56 PM Ric Sherlock wrote: > > > Only repeats that occur within a digraph need to be split, so: > > > >showDigraphs dedouble &#

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
'-.~,str,.' ',~(=/"1 dbld){' X' NB. Assuming there will be no > legitimate spaces > AXAXAbXbCXCXCXC > > > On Thu, Feb 4, 2021 at 11:46 PM Ric Sherlock wrote: > > > Using ideas from the solutions so far, this is the version I currently >

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
ata4;data5 1 On Fri, Feb 5, 2021 at 5:32 PM Ben Gorte wrote: > Ah yes, better! > Works on the five test cases :-) > > > On Thu, 4 Feb 2021 at 23:13, Ric Sherlock wrote: > > > Thanks, yes that works! > > Here's a slightly simpler take on the same approach: >

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
Yes as Hauke has previously identified, we need some more test cases to fully test whether the spec is correctly implemented or not. I'm thinking that the example outputs you've shown in your email aren't correct, but I agree that your approach and Raul's generate different solutions for that input

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
min' via Programming: > > assuming you want all dedoubled on a pass and not just first match, > > > > > > > > ;@:(_2&(,`([,'X',])@.=/each@<\))^:_ 'THEEQUICKBROWFFOOOX' > > > > THEXEQUICKBROWFXFOXOXOX > > > > > > ;@:(_2&(,`

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
FOOX' > > > > s =: 2 : 0 > > a =. 0 -.~ (* i.@#) m=y > > n a} y > > ) > > > > NB. ugly, repetitive junk solution > > res1 = ('?'s'X') (] (>:@(+ i.@#)@(2 I.@:=]) (([e.~i.@#@]){"0 1'X',.~]) > > #~) (i.@# >:@e.

Re: [Jprogramming] Progressive insertion into a string

2021-02-04 Thread Ric Sherlock
d be tempted to go with > > dedouble=: #!.'X'~ 1 j. #{.}.=}: > > But I do not understand why the double O in your second example does > not get an X inserted. So maybe I am missing something. > > I hope this helps, > > -- > Raul > > On Wed, Feb 3, 2021

[Jprogramming] Progressive insertion into a string

2021-02-03 Thread Ric Sherlock
I need to separate any digraphs in a string, that consist of 2 letters the same, by inserting an 'X' between them. _2 ]\ 'THEEQUICKBROWFFOX' TH EE QU IC KB RO WF FO X 'EE' is a digraph that needs an 'X' inserted. Doing so will result in: TH EX EQ UI CK BR OW FF OX So now we also need to separ

[Jprogramming] Changes to math/misc (matfacto.ijs and linear.ijs)

2021-01-21 Thread Ric Sherlock
Hi all, I've made some changes (not yet released) to the math/misc addon. The changes are in the linear algebra area and are predominantly to linear.ijs and matfacto.ijs. Apart from adding the LU decomposition verb from the wiki, the most substantive change was to gauss_elimination which should now

Re: [Jprogramming] Direct Definition Spurious Blank Addition

2021-01-21 Thread Ric Sherlock
Thanks Henry! On Thu, 21 Jan 2021, 15:47 Henry Rich, wrote: > The next beta will remove one leading blank line from the display. > > Henry Rich > > On 1/19/2021 9:22 PM, Ric Sherlock wrote: > > In a similar vein, > > The first line of a multi-line definition doesn&

Re: [Jprogramming] Insert verb

2021-01-20 Thread Ric Sherlock
What makes you think that? As far as I can see it appears to be correctly linked from the website and I have it installed. On Thu, 21 Jan 2021, 00:54 Arnab Chakraborty, wrote: > Aha, nice feature. However, J902 is still not available for Android. > > On Wed, 20 Jan 2021, 17:14 Ric

Re: [Jprogramming] Insert verb

2021-01-20 Thread Ric Sherlock
{{ }} digraphs were introduced in j902 https://code.jsoftware.com/wiki/System/ReleaseNotes/J902 See https://code.jsoftware.com/wiki/Vocabulary/DirectDefinition On Wed, 20 Jan 2021, 22:32 Arnab Chakraborty, wrote: > I could not find any doc on {{ and }} as Raul has used. Any pointer? > > On Tue,

Re: [Jprogramming] Direct Definition Spurious Blank Addition

2021-01-19 Thread Ric Sherlock
In a similar vein, The first line of a multi-line definition doesn't respect indentation, so: mutate=: {{idxmut=. I. x >: (*/$y) ?@$ 0 (populate idxmut) idxmut"_} y }} mutate 4 : 0 idxmut=. I. x >: (*/$y) ?@$ 0 (populate idxmut) idxmut"_} y ) mutate=: {{ idxmut=. I. x >: (*/$y) ?@$ 0

Re: [Jprogramming] String to Rational

2021-01-06 Thread Ric Sherlock
t; This is close, but not equal to the input. > > stringToRational '100.12345' gives: > > 2002469r2 > > This is correct. > > My solution parses the digits exactly as if there were no dot and > divides by 10^(number of digits after point

Re: [Jprogramming] String to Rational

2021-01-06 Thread Ric Sherlock
Hi Justin, I'm not entirely clear what your desired behaviour/use case is, however if you add another closing parenthesis then your definition above does not give a (syntax) error, but doesn't give the number you suggest. stringToRational =: ((_&".)@(-.&'.') %&:x: 10&^@(<:@# - (i.&'.'))) stringTo

Re: [Jprogramming] All combinations from multiple different-length lists

2020-12-20 Thread Ric Sherlock
Hi Skip, Check out the Vocabulary page for { https://code.jsoftware.com/wiki/Vocabulary/curlylf On Mon, Dec 21, 2020 at 9:09 AM Skip Cave wrote: > ]x=.1 3 5;2;3 4 > > ┌─┬─┬───┐ > > │1 3 5│2│3 4│ > > └─┴─┴───┘ > > {x > > ┌─┬─┐ > > │1 2 3│1 2 4│ > > ├─┼─┤ > > │3 2 3│3 2 4│

Re: [Jprogramming] Seeking advice on structures

2020-12-10 Thread Ric Sherlock
Yes Harvey, my mistake, thanks to Ric Sherlock then for writing a very > effective extension. > For me it trumps Emacs because when you hit Cmd+Return on a line that is > the start of a definition of a verb it automatically reads until the > closing ). > > My workflow is usually

Re: [Jprogramming] Seeking advice on structures

2020-12-09 Thread Ric Sherlock
In case it is of interest to others I thought I'd mention the following addon that I use to help me move data back and forth from C structs to J. https://github.com/tikkanz/data_struct On Tue, Dec 8, 2020 at 10:46 PM emacstheviking wrote: > Thanks Devon. > Most helpful. I am a seasoned C/C++ pr

Re: [Jprogramming] Getting indices of matrix elements

2020-11-13 Thread Ric Sherlock
I understand the sentiment, but when it's more concise, faster and leaner, it is hard to ignore! On Sat, 14 Nov 2020, 09:37 Henry Rich, wrote: > /Et tu, R. E.?/ > > Using $. for this is using a sledgehammer to crack an egg. > > Henry Rich > > On 11/13/2020 3:00 PM, R.E. Boss wrote: > > $.$.M

Re: [Jprogramming] Getting indices of matrix elements

2020-11-13 Thread Ric Sherlock
How about 4 $. $. 6=M 1 1 On Sat, 14 Nov 2020, 06:54 Hauke Rehr, wrote: > plus, Henry’s solution looks more idiomatic (too me, at least) > > usually, I try to keep related structures aligned (using grade) > other than that, I hardly remember any cases when linear indexing > didn’t do the jo

Re: [Jprogramming] J902-beta-j available

2020-10-30 Thread Ric Sherlock
For the non-noun form of DD, the wiki states > If the very first character following the leading delimiter is ), the > first line contains control information and is not part of the entity being > defined. > So apart from the first letter after ), is the rest of the line ignored? That is essentia

Re: [Jprogramming] J902-beta-j available

2020-10-30 Thread Ric Sherlock
Henry Rich > > On 10/30/2020 5:16 PM, Ric Sherlock wrote: > > I seem to be getting different closing behaviour for noun DDs, depending > on > > whether I use JConsole or JQt. > > JConsole follows the description of noun DD on the wiki page, i.e. "the > >

Re: [Jprogramming] J902-beta-j available

2020-10-30 Thread Ric Sherlock
I seem to be getting different closing behaviour for noun DDs, depending on whether I use JConsole or JQt. JConsole follows the description of noun DD on the wiki page, i.e. "the trailing delimiter is the two-character sequence }} when found at the beginning of a line." JConsole === 'prefix' ,

Re: [Jprogramming] New video lab for the generating of Large Catalan numbers.

2020-10-26 Thread Ric Sherlock
Hi Bob, Just worked my way through the playlist. Fantastic! From my point of view it was a great balance of maths, computing and problem solving. You also managed to slide a heap of J primitives and features into the Labs without losing the focus on the problem. I thought the animations were very c

Re: [Jprogramming] Calculus & Newton's iteration

2020-10-24 Thread Ric Sherlock
Also if you multiply by x to get 2 + 4.9x = 0 You can solve using p. p. 2 4.9 ┌───┬─┐ │4.9│_0.408163│ └───┴─┘ On Sun, 25 Oct 2020, 09:47 Martin Kreuzer, wrote: > N is at most times sensitive to its start value ... > it does work in this case (but as you stated, it will no

Re: [Jprogramming] Cross platform customized J configuration

2020-09-28 Thread Ric Sherlock
Hi Devon, A quick search on the wiki brings up this page. Does that help? https://code.jsoftware.com/wiki/Guides/Startup On Tue, 29 Sep 2020, 08:12 Devon McCormick, wrote: > I now have J running under both Windows 10 and Ubuntu Linux under WSL. I > would like to ensure that I run the same conf

Re: [Jprogramming] Amending a table

2020-08-06 Thread Ric Sherlock
Would probably have been clearer to say "specifying an unboxed table as a list of selectors is supported" On Fri, Aug 7, 2020 at 4:59 PM Ric Sherlock wrote: > Very nice bob! > > Just to add that as of J9, specifying an unboxed table as a selector is > supported so: >

Re: [Jprogramming] Amending a table

2020-08-06 Thread Ric Sherlock
Very nice bob! Just to add that as of J9, specifying an unboxed table as a selector is supported so: rep (1 0 2 ,: 0 2 1)} t ┌──┬──┬──┬──┐ │0 │1 │2 │3 │ ├──┼──┼──┼──┤ │4 │5 │6 │7 │ ├──┼──┼──┼──┤ │8 │a │10│11│ └──┴──┴──┴──┘ ┌──┬──┬──┬──┐ │12│13│a │15│ ├──┼──┼──┼──┤ │16│17│18│19│ ├──

Re: [Jprogramming] restricting permutations

2020-05-25 Thread Ric Sherlock
Skip, that seems like a very old version of the stats/base addon? According to GitHub the sampledesign script was renamed to combinatorial back in 2008. perm is currently available in ~addons/stats/base/combinatorial.ijs (stats/base/combinatorial) On Tue, May 26, 2020 at 8:45 AM Skip Cave wrote:

Re: [Jprogramming] tables/dsv extreme memory usage

2020-05-04 Thread Ric Sherlock
The current parsers in tables/dsv deal with the worst case scenario (e.g. type is mixed within and between columns, fields can contain field and/or record delimiters). The more you can assume that these edge cases are not present, the more you can reduce memory usage. If for example you know that

[Jprogramming] J901 crash

2020-01-09 Thread Ric Sherlock
I've discovered an issue with the 'stats/distribs' addon that pops up in J901, but didn't before (e.g. J807). To reproduce: load 'stats/distribs' coinsert 'pdistribs' qnorm01 0.95 Segmentation fault (core dumped) However the following works (for a while): load 'stats/distribs' co

Re: [Jprogramming] assert verb from stdlib mismatches assert. control

2019-12-30 Thread Ric Sherlock
I agree that the behaviour of the two should match, but am not sure what the desired definition should be. The Nuvoc page for the assert. keyword says that the entire list must be 1s, which at one level makes sense to me, however the test for if. is that the 1st item of the array is nonzero and the

Re: [Jprogramming] Arg min

2019-12-28 Thread Ric Sherlock
The best source of info on special code or Combinations that I know of is here: https://code.jsoftware.com/wiki/Vocabulary/SpecialCombinations On Sun, Dec 29, 2019 at 1:59 AM Raul Miller wrote: > On Sat, Dec 28, 2019 at 7:38 AM Arnab Chakraborty > wrote: > >Thanks for the code. But I did n

Re: [Jprogramming] New video: building a sprite editor in J

2019-12-27 Thread Ric Sherlock
Very nice Michal!! Very useful reference for building GUIs with J. On Sat, Dec 28, 2019 at 1:03 PM Michal Wallace wrote: > Okay, so still jumping around all over the screen due to editing out all > the ums and errs, but... This one should hopefully be a lot easier to read, > and I tried youtube'

Re: [Jprogramming] Arg min

2019-12-26 Thread Ric Sherlock
You could also use argminall=: 4 $. $.@(= <./@,) However because neither take advantage of the special code (i. <. /), they don't have the same performance. On Fri, 27 Dec 2019, 14:42 Jimmy Gauvin, wrote: > Adding to Henry's idiom : > >argminall =: $ #: I.@(= <./)@, >argminall 3 3$5 >

Re: [Jprogramming] J901 pacman

2019-12-18 Thread Ric Sherlock
As far as I can see, the latest j901 apk is beta L. On Wed, 18 Dec 2019, 21:25 ethiejiesa via Programming, < programm...@jsoftware.com> wrote: > Oh wow. Just stumbled across this myself. > FWIW, doing the dumb thing by copying the url and changing 807 to 901 does > work. > > Arnab Chakraborty w

Re: [Jprogramming] J901 freads

2019-12-17 Thread Ric Sherlock
Thanks Henry - sounds great. On Wed, Dec 18, 2019 at 7:22 AM Henry Rich wrote: > No, no... don't try to reimplement i. . That's a lifetime of work. Or > more. > > I will return the limit on the size of an array back to what it was, > 2^48. That will be enough for all of us! > > The flaw in my

Re: [Jprogramming] J901 freads

2019-12-17 Thread Ric Sherlock
1!:1 <'mybigfile.csv' returns a limit error on J901 but completes successfully on j64_807. On Tue, Dec 17, 2019 at 9:56 PM bill lam wrote: > does 1!:1 work? > > On Tue, Dec 17, 2019, 1:09 PM Ric Sherlock wrote: > > > I have run into a difference between J

[Jprogramming] J901 freads

2019-12-16 Thread Ric Sherlock
I have run into a difference between J901 and J807 that I hadn't come across before when dealing with large (~7GB) files. In both versions I can see the file fexist 'mybigfile.csv' 1 fsize 'mybigfile.csv' 7516003225 I can also read the beginning the file in both versions $freads 'mybigfi

Re: [Jprogramming] Yahoo stock quotes

2019-11-24 Thread Ric Sherlock
Haven't got time to look at your code in detail, but stabbing blindly in the dark - have you tried double quoting your URL? See the following StackOverflow question and answer: https://stackoverflow.com/questions/55753504/reading-csv-file-from-a-a-secured-link-with-j On Mon, Nov 25, 2019 at 3:36 P

Re: [Jprogramming] Occurrence Counts

2019-11-03 Thread Ric Sherlock
Here's one option... ]m=: 5 6 >:@:?@$ 6 2 3 6 3 6 2 6 1 3 3 6 4 2 1 5 2 4 6 1 2 4 6 3 1 4 1 6 6 4 6 oc=: <:@([: #/.~ ,)"1 (>:i.6) oc m 0 2 2 0 0 2 1 0 2 1 0 2 1 2 0 1 1 1 2 1 1 1 0 1 1 0 0 2 0 3 On Mon, 4 Nov 2019, 20:07 Skip Cave, wrote: > NB. Generate multiple sets of 6 random inte

Re: [Jprogramming] Consecutive substrings (was Quora problem)

2019-10-25 Thread Ric Sherlock
> > > (;@:(<@(<\))~ >:@i.@#) 'abcdefg' > > engages the special code for ;@:(<@f)) which avoids boxing overhead and > speeds up ; . All the parentheses are necessary for the fast form to be > recognized. > > Henry Rich > > On 10/24/2019 10:49 PM, Ri

  1   2   3   4   >