Re: [Jprogramming] jqt documentation

2023-02-27 Thread Raul Miller
It's been a few hours, so I went ahead and changed it. FYI, -- Raul On Mon, Feb 27, 2023 at 3:55 PM Henry Rich wrote: > > sys_timer used to be called in base locale. Now it is called in z, as you > can see from the message. Please fix the wiki. > > Henry Rich > > On Mon, Feb 27, 2023, 3:34

Re: [Jprogramming] Math/calculus simplify trig pull request

2023-02-26 Thread Raul Miller
If I remember correctly, the "0 limitation there was because d. was explicitly rank 0 -- https://www.jsoftware.com/help/dictionary/dddot.htm Meanwhile, of course, D. dealt with verbs at rank -- https://www.jsoftware.com/help/dictionary/ddcapdot.htm -- but getting that right would have been a bit

Re: [Jprogramming] Applying a cyclic gerund

2023-02-22 Thread Raul Miller
I'd probably go with (;".)&>/'abc';'13.2' or, (;".)&;/'abc';'13.2' -- Raul On Tue, Feb 21, 2023 at 11:08 PM Gilles Kirouac wrote: > > I have two character strings : > > datatype each 'abc';'13.2' > ┌───┬───┐ > │literal│literal│ > └───┴───┘ > > I want to convert the

Re: [Jprogramming] Odd

2023-02-16 Thread Raul Miller
e 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,

Re: [Jprogramming] Odd

2023-02-16 Thread Raul Miller
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

Re: [Jprogramming] LAPACK

2023-02-16 Thread Raul Miller
dgeev_jlapack2_A |value error: dgeev_jlapack2_A ... dgeev_A |value error: dgeev_A You need a space to the left of the A. Thanks, -- Raul On Thu, Feb 16, 2023 at 3:08 AM Erik Papp wrote: > > Thank you. > I run the example flawlessly, but I could't use dgeev and gesvd. > >

Re: [Jprogramming] LAPACK

2023-02-15 Thread Raul Miller
For documentation, it looks like https://code.jsoftware.com/wiki/Vocabulary/LAPACK and maybe https://code.jsoftware.com/wiki/Addons/math/lapack should be decent. As for the definitions themselves, it looks like require'math/lapack2' brings in all of the lapack2 the definitions, and that

Re: [Jprogramming] LAPACK

2023-02-14 Thread Raul Miller
Hmm... I don't adequately know what's going on here. That said, when I look at the addons/math/lapack/dgeev.ijs in my copy of j64-807 I see: - NB. this stub will be removed in future releases NB. please, update your sources: NB. - replace string

Re: [Jprogramming] Ctrl-c closes JHS - was Re: JHS addon update available

2023-02-13 Thread Raul Miller
I haven't had this problem. But that doesn't mean much of anything, so I was not inclined to bring it up. -- Raul On Mon, Feb 13, 2023 at 7:04 AM 'Mike Day' via Programming wrote: > > No comment? Isn't this a problem for anyone else? > > In a nutshell: > ctrl-c closes the console session

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

2023-02-06 Thread Raul Miller
903/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:

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

2023-02-04 Thread Raul Miller
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 wrote: > > Hello, > > I've a fresh J installation just from last week, and updated everything. > dissect works flawlessly, but I couldn't get

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

2023-02-04 Thread Raul Miller
I can reproduce this error. FYI, -- 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

Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-04 Thread Raul Miller
g data that doesn't fit in memory, but > >> requires care to only apply in-place modification and care not to read more > >> than fits your memory. > >> > > > > Thx > > > > Ak. > > > > > >> On Fri, 3 Feb 2023, 11:04 Ak O,

Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-03 Thread Raul Miller
; 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? > &g

Re: [Jprogramming] Image Background Removal

2023-02-03 Thread Raul Miller
I don't have access to it, but I'd be tempted to try his approach on a freshly generated image with shadows. -- Raul On Fri, Feb 3, 2023 at 7:58 PM Thomas McGuire wrote: > > Oleg Kobenchenko has a short example of removing a shadow from an imaging > using a moving average. > > The code can

Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-03 Thread Raul Miller
; > 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

Re: [Jprogramming] File Operations -> JMF Alternative

2023-02-02 Thread Raul Miller
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

Re: [Jprogramming] "Nonce error" on monadic "x:"?

2023-01-30 Thread Raul Miller
Nonce error should mean that you have not run install'gmp' Maybe we should get some eformat support for the error message reminding people that that's needed. That said, if you have run install'gmp' and you still get the nonce error, that's a severe problem and I guess we'll need to spend some

Re: [Jprogramming] Grade behavior

2023-01-30 Thread Raul Miller
I do not think you should expect this result to be 1 0: /:'((()))';'(())' 0 1 Consider: >'((()))';'(())' ((())) (()) Here, the first character mismatch is in the third column, and '(' comes before ')' As for aoc day 13, I remember it as being rather annoying. What I did there, if I

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-23 Thread Raul Miller
t. So... in addition to my semantic questions, I guess I also am wondering about the syntax. -- Raul On Mon, Jan 23, 2023 at 2:57 AM Raul Miller wrote: > > Hmm... some questions then: > > (1) What would a 5!:1 representation of closures look like? (Is it > basically "just an explicit

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-23 Thread Raul Miller
bound modulo definition order. There would be no > > complication added to the object model. > > > > On Sun, 22 Jan 2023, Raul Miller wrote: > > > >> A problem with closures is that a complete implementation might > >> require a radical change in J's memory management

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-22 Thread Raul Miller
A problem with closures is that a complete implementation might require a radical change in J's memory management mechanisms (and also introduce difficulties for mechanisms like gerunds or 5!:n). Currently, J's arrays are trees, and verbs, adverbs and conjunctions are arrays in this sense. With

Re: [Jprogramming] Verbs returning verbs

2023-01-22 Thread Raul Miller
After thinking about this (and sleeping on it), I think this is a good idea. Thanks, -- Raul On Mon, Jan 16, 2023 at 8:35 PM Henry Rich wrote: > > I have never understood the zeal for having verbs return verbs, but it > must be real if some are willing to use dangerous backdoor hacks into JE

Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-22 Thread Raul Miller
-- Raul On Sun, Jan 22, 2023 at 1:21 PM Jose Mario Quintana wrote: > > I am replying inline... > > On Sun, Jan 15, 2023 at 6:09 PM Raul Miller wrote: > > > > On Sun, Jan 15, 2023 at 3:38 PM Jose Mario Quintana > > wrote: > > > I am aware that BQN has first-cl

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-18 Thread Raul Miller
> >>> > >>> On Tue, 17 Jan 2023, Henry Rich wrote: > >>> > >>>> I don't follow any of this thread, because I don't understand what > >>>> is missing from standard J. I find J adequate for everything I want > >>>>

Re: [Jprogramming] Verbs returning verbs

2023-01-18 Thread Raul Miller
On Wed, Jan 18, 2023 at 6:53 AM Hauke Rehr wrote: > Nice troll ;) Wasn't a troll. At the very least, errors are considered a feature aimed at helping coders find their mistakes. Otherwise, for example, indexing with what we currently consider invalid values could return fill rather than

Re: [Jprogramming] Verbs returning verbs

2023-01-18 Thread Raul Miller
Generally speaking, in computing contexts, "powerful" is orthogonal to "useful". Which might be related to why explicit definitions are looked down on, by some in the J community -- It seems that they're "too powerful". But if the problem is that explicit definitions are insufficiently

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-17 Thread Raul Miller
On Tue, Jan 17, 2023 at 11:09 PM Elijah Stone wrote: > On Tue, 17 Jan 2023, Raul Miller wrote: > > (a) We cannot see locals in a calling environment > > To add to this: it might be desirable to compose modifiers in such a way that > there are _multiple_ calling environments

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-17 Thread Raul Miller
se though that I am content with writing explicit definitions. > >> What do I need beyond the standard language, and for what use case? > >> > >> Henry Rich > >> > >> On 1/17/2023 9:23 PM, Elijah Stone wrote: > >>> (Curried modifiers, as you say, are

Re: [Jprogramming] Closures; WAS: Verbs returning verbs

2023-01-17 Thread Raul Miller
Here, I suspect that you're only getting noun values in your closure -- you'll have to sprinkle those noun references with something like `:6 if you want anything else. That's probably not a huge problem. But, thinking about this, personally I'm not seeing a lot of motivation for this approach,

Re: [Jprogramming] Verbs returning verbs

2023-01-17 Thread Raul Miller
On Tue, Jan 17, 2023 at 12:00 PM 'Pascal Jasmin' via Programming wrote: > > willing to use dangerous backdoor hacks into JE to achieve it > > Dangerous seems harsh. But still meaningful, given that a mis-step here can crash J. -- Raul

Re: [Jprogramming] State machine add multiple words action

2023-01-16 Thread Raul Miller
The sequential machine is a very simple device. When it emits a word, there's a starting index and an ending index and it emits all of that subsequence. The emit vector mechanism is a minor adjustment to emit word -- it basically just changes the current ending index. It still includes the

Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-15 Thread Raul Miller
On Sun, Jan 15, 2023 at 3:38 PM Jose Mario Quintana wrote: > I am aware that BQN has first-class functions. Is there any other array > language that also has them? In this context, a mozilla page on "first class functions" is interesting:

Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-14 Thread Raul Miller
I think it's more of a digestion issue. -- Raul On Sat, Jan 14, 2023 at 10:04 AM Jose Mario Quintana wrote: > > > Cloak strikes again, > > The power conjunction remains (too?) powerful :) > > Many years ago a car magazine was interviewing a few car racing drivers > regarding their impressions

Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Raul Miller
I find it difficult to reason about this n: My best guess is that n: is itself an adverb and that u n: A (where u is a verb and A is an adverb) would be handled by special code which behaves like {{ (u y) A}} : {{(x u y) A}} Does that agree with your thinking? Thanks, -- Raul On Fri, Jan

Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Raul Miller
Near as I can see, none of this corresponds to + r2m {{m&+}} 3 -- Raul On Fri, Jan 13, 2023 at 12:11 PM 'Pascal Jasmin' via Programming wrote: > > Cloak strikes again, > > isNoun_z_ =: (0 = 4!:0 ( :: 0:))@:< > eval_z_ =: 1 : 'if. 2 ~: 3!:0 m do. m else. a: 1 : m end.' NB.1 : ' a: 1 : m' > aar

Re: [Jprogramming] State machine add multiple words action

2023-01-13 Thread Raul Miller
Here, I think we're talking about M=: (a.=LF)+2*a.e.'0123456789' S0=: +.".>cutLF {{)n 1j1 2j1 1j1 NB. start here 1j0 2j0 1j0 NB. non-newline 1j0 1j2 1j0 NB. newline }} The columns correspond to character classes defined in M: column 2 is numbers, column 1 is line feeds, column 0 is

Re: [Jprogramming] best/any way to get verb result to m argument of modifier?

2023-01-13 Thread Raul Miller
Are you convinced that this would be viable? Near as I can tell, for + r2m {{m&+}} 3 to be syntactically valid, r2m must not be a conjunction. And the use of m here means that r2m cannot be a verb. So r2m must be a noun (becoming the m in {{m&+}} which prevents m from becoming the result of + y)

Re: [Jprogramming] State machine add multiple words action

2023-01-13 Thread Raul Miller
In ijrd there's a constraint that j must be strictly less than i. So you might try (0;s0;m0;1 0 0 1) ;: test1 Note that this will fail if the right argument to ;: is empty. Was there anything else that you did not understand about my approach there? Thanks, -- Raul On Fri, Jan 13, 2023 at

Re: [Jprogramming] State machine add multiple words action

2023-01-12 Thread Raul Miller
The fastest to find example here would be parsing of numbers in the original dictionary parsing example: https://www.jsoftware.com/help/dictionary/d332.htm Here, when parsing '1 2 3', each time a space is encountered, the word is "terminated" and the subsequent 4 actions extend the word. (And in

Re: [Jprogramming] State machine add multiple words action

2023-01-12 Thread Raul Miller
Action codes 4 and 5 aren't specifically what I think you would want in this context. What they allow you to do is tentatively emit a token and then return to that state to potentially extend the length of that token. In other words, action codes 4 (and 5) simply give you a longer word which

Re: [Jprogramming] (A n) new train. was: more fun with parallelism

2023-01-11 Thread Raul Miller
On Wed, Jan 11, 2023 at 1:15 PM 'Pascal Jasmin' via Programming wrote: > > I don't think there's a strong need to allow users to set flags on nouns. > It's rather a dangerous thing to do, and you could instead just run the nouns > through /:~ or ~. > > marked nouns would allow those functions to

Re: [Jprogramming] more fun with parallelism

2023-01-10 Thread Raul Miller
scan=. ((~/)\.)(&.|.) -scan p:i.5 2 _1 _6 _13 _24 -/\ p:i.5 2 _1 4 _3 8 -- Raul On Tue, Jan 10, 2023 at 3:18 PM Jose Mario Quintana wrote: > > Indeed, > >scan=. ((~/)\.)(&.|.) > >%&:{./"_1 +/ .* /\ (1 0,:~,&1)"0 ]10$1 > 1 2 1.5 1.7 1.6 1.625 1.61538 1.61905 1.61765

Re: [Jprogramming] substring search

2023-01-10 Thread Raul Miller
If elegance is a concern, I'd go with: 'ab' (1 e. E.)S:0 'ac';'cab';'bca';'bab' 0 1 0 1 Thanks, -- Raul On Tue, Jan 10, 2023 at 1:21 PM Devon McCormick wrote: > > I doubt performance is very important for the sizes of arguments I > typically use but David's expression is more elegant. >

Re: [Jprogramming] (A n) new train. was: more fun with parallelism

2023-01-10 Thread Raul Miller
What would this Associative adverb do? Also, can this approach be made to usefully invoke (+/!.0) ? Thanks, -- Raul On Tue, Jan 10, 2023 at 1:12 PM 'Pascal Jasmin' via Programming wrote: > > There is after all a Conjunction approach that permits ambivalent u verb, > and so for attributes

Re: [Jprogramming] Examples of u . v where u is not a w/

2023-01-09 Thread Raul Miller
< .* is handy for visualizing what the operation does. It's been a while since I've worked in a realm which uses dot products though, so I don't have any other examples at my fingertips. Thanks, -- Raul On Mon, Jan 9, 2023 at 1:21 PM Omar Antolín Camarena wrote: > > Are the some good

Re: [Jprogramming] wsfiles

2023-01-06 Thread Raul Miller
Locale z is inherited by all other locales. When you put the definitions in locale evbwsfiles, and wssave_evbwsfiles_ uses nl'', it finds names in the evbwsfiles locale instead of your locale (which is probably the base locale). FYI, -- Raul On Fri, Jan 6, 2023 at 1:40 PM David Lambert

[Jprogramming] tine

2023-01-05 Thread Raul Miller
Sometimes it seems like it would be nice to have a variation on fork where instead of (f g h) we get *f@[ g h@]) And, of course, we can do that manually. (Also, I forget the contexts where I have wanted to use this. Maybe I'll remember later. I also have a vague memory of someone else asking for

Re: [Jprogramming] [Jbeta] New error Polynomial Representation (padding regime)

2023-01-05 Thread Raul Miller
; > Henry Rich > > On 1/5/2023 3:43 PM, Raul Miller wrote: > > On Thu, Jan 5, 2023 at 7:07 AM Ak O wrote: > >> The point I mean to highlight is the represention (for the purpose of > >> calculation). > > It's probably worth noting here that J's p. verb does no

Re: [Jprogramming] [Jbeta] New error Polynomial Representation (padding regime)

2023-01-05 Thread Raul Miller
On Thu, Jan 5, 2023 at 7:07 AM Ak O wrote: > The point I mean to highlight is the represention (for the purpose of > calculation). It's probably worth noting here that J's p. verb does not, by itself, support polynomials like 7x^2y^3 + 4x^1y^0 - 9x^0y^0. And without a representation for the

Re: [Jprogramming] [Jbeta] New error Polynomial Representation (padding regime)

2023-01-04 Thread Raul Miller
By the way, here's a fairly literal implementation of that concept: pdeg=: 0&~: >./@# i.@# pdeg 1 2 1 2 pdeg 1 2 1 0 0 0 2 On Thu, Jan 5, 2023 at 12:17 AM Raul Miller wrote: > > On Wed, Jan 4, 2023 at 10:24 PM Ak O wrote: > > File -> Wed

Re: [Jprogramming] [Jbeta] New error Polynomial Representation (padding regime)

2023-01-04 Thread Raul Miller
On Wed, Jan 4, 2023 at 10:24 PM Ak O wrote: > File -> Wed Jan 4 03:40:07UTC 2023 > The statement: > So, there's no difference in Degree 1 2 1 0 0 0 and 1 2 1... > > This is not correct. These should not be seen as equalities. That's an interesting perspective. It seems to me that both

Re: [Jprogramming] Thread Primitives -> Configuration 0 T.'' (T.)

2023-01-04 Thread Raul Miller
It's also worth noting that threads do not spin down immediately -- they only spin down when they're idle. And, as you have noted it's basically a stack of threads. So what you'd have to do is spin down as many threads as necessary to eliminate the thread you wish to eliminate and then spin back

Re: [Jprogramming] Beginner: Where to start?

2022-12-28 Thread Raul Miller
t found: /home/galaxybeing/opt/j903/addons/graphics/plot/plot.ijs > : |file name error: script > : | 0!:0 y[4!:55<'y' > : > : |value error: plot > : | plot 1 o.0.1*i.200 > > ...isn't finding plot. Please advise. So what is the best, preferred IDE > for J? Does J need t

Re: [Jprogramming] Beginner: Where to start?

2022-12-28 Thread Raul Miller
(So it's both an array language and a functional programming language, at least approximately speaking...) Anyways, my advice for learning (if you learn the way I learn): try and schedule half an hour a day on learning J and try to spend at least some of that time forming and performing

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

2022-12-23 Thread Raul Miller
On Fri, Dec 23, 2022 at 5:28 PM Henry Rich wrote: > J threading shines when: > > * you want the threads to share data > > * you don't know whether threading will help you or not, and you'd like > to see. It's so easy to make a J verb into a task. Also when you have a task where threading is an

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

2022-12-21 Thread Raul Miller
Oh, wait.. I guess I'm ignorant of the thread grouping issues. Please ignore this previous email. Thanks, -- Raul On Wed, Dec 21, 2022 at 10:55 PM Raul Miller wrote: > > Note that you could have used the 'setthreadcount' implementation for this: > > setthreadcount <:{:8T.'' &

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

2022-12-21 Thread Raul Miller
Note that you could have used the 'setthreadcount' implementation for this: setthreadcount <:{:8T.'' However, I'm not sure that creating the maximum number of threads is going to be the most efficient approach. (In some cases it might be.) Also, I'm realizing that I should have included that

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

2022-12-21 Thread Raul Miller
On Wed, Dec 21, 2022 at 8:07 PM Ak O wrote: > 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

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

2022-12-20 Thread Raul Miller
On Tue, Dec 20, 2022 at 6:21 PM Henry Rich wrote: > The ideal candidate for a task is a compute-intensive > function that doesn't need much more memory than a core's L2 cache. On linux you can find the size of L2 cache from the os command line: lscpu | grep L2 On windows you can find the

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

2022-12-20 Thread Raul Miller
Knowing where to put the primitives is indeed the issue. That's why they're primitives, basically. 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"

Re: [Jprogramming] Questions on day 15th of Advent of code 2022, optimization woes

2022-12-15 Thread Raul Miller
issue, so I ignored it as a possibility. So maybe the code itself doesn't entirely make sense. But it was fairly straightforward to put together within these constraints. Anyways, ... maybe this will make sense to someone... Thanks, -- Raul On Thu, Dec 15, 2022 at 3:51 PM Raul Miller wrote: >

Re: [Jprogramming] Questions on day 15th of Advent of code 2022, optimization woes

2022-12-15 Thread Raul Miller
; and yours. I think they are (roughly) in the correct cpu burning level > (first the ones that require more computation). > I had the right point from my 2nd test, but I had a bad calculation. > > Missatge de Raul Miller del dia dj., 15 de des. > 2022 a les 19:04: >

Re: [Jprogramming] Questions on day 15th of Advent of code 2022, optimization woes

2022-12-15 Thread Raul Miller
I think your approach here, with a slight change, would be superior to the approach I used. In other words, treat the problem as defining a small set of lines bounding the scannable regions. These will all be diagonal lines, though they'll have two different orientations. The point you're

Re: [Jprogramming] Questions on day 15th of Advent of code 2022, optimization woes

2022-12-15 Thread Raul Miller
I also encountered performance issues on the second half of aoc 15. Ultimately, I went with a raster scan approach here: one row at a time, testing one location at a time, and one sensor at a time but skipping forward on x to the final x value within that sensor's range if that would be further

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-14 Thread Raul Miller
I should add: On Wed, Dec 14, 2022 at 4:19 PM I wrote: ... > Here, OP was a gerund such that OP@.0 represented what monkey 0 would > do to the "worry levels", OP@.1 represented monkey 1, and so on. Note that a better representation here would interpret each monkey's operation as a polynomial

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-14 Thread Raul Miller
On Wed, Dec 14, 2022 at 3:49 PM Jaume wrote: > The first days I tried, now I have less time and the problems are harder. That does happen. I expect aoc day 24 to take me a few days to solve (unless it happens to be a problem I somehow have already put a lot of thought into). > I have to say

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-14 Thread Raul Miller
On Wed, Dec 14, 2022 at 2:26 AM Jaume wrote: > Because somewhere in there something broke and on the phone I have the > wrong answer for part 1. Yes... generally it's easier to debug if you have a much smaller implementation. It's also a *lot* easier if you write your code so that you can test

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-13 Thread Raul Miller
, -- Raul On Tue, Dec 13, 2022 at 5:05 PM Raul Miller wrote: > > I was not able to decipher the value of pp which you posted here, > after the email system mangled it. > > Also, it looks like your current github code -- > https://github.com/JaumeGreen/adventofcode/blob/master/2022/day

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-13 Thread Raul Miller
┴─┴─┴───┴───┴─┴─┴───┴───┴───┴─┴─┴─┘ > > sorted=:quickp pp > > |domain error: comp2 > > | ({.tx) <{.ty > > cder'' > > 0 0 > >(1+i.#pp)*2=1 a\ quickp pp

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-13 Thread Raul Miller
p.s. for the tacit stack issue, you did not include your definition of comp2, but if it's from aoc day 13, a plausible issue is that comp2 would be returning _1 or 1 instead of 0 or 1 (which is what that quicksort implementation expects). That said, when debugging stack errors on recursive

Re: [Jprogramming] Questions on day 13 of Advent of Code 2022

2022-12-13 Thread Raul Miller
It used to be that x was more ambiguous. To make quicksort work, use sel=: 1 : 'u # [' I will update the wiki. Thanks, -- Raul On Tue, Dec 13, 2022 at 1:43 PM Jaume wrote: > > Hello all > > Still here and I've done all the days in J except for day 7, But that's not > why I'm here. > > So

Re: [Jprogramming] Is there a Fold for AOC day 6? - was Re: Questions on Advent of code Day 5

2022-12-08 Thread Raul Miller
Yes, a fold with early termination would be faster for this year's aoc day 6. But time was not a bottleneck resource for day 6. And... I'm not going to worry about spoilering aoc puzzles -- there's an entire reddit forum dedicated to sharing solutions and people routinely post their solutions.

Re: [Jprogramming] pplatimg in-memory decoding

2022-12-08 Thread Raul Miller
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

Re: [Jprogramming] Questions on Advent of code Day 5

2022-12-07 Thread Raul Miller
Note also here that replacing move with ,&< in the lfold sentences would construct a sequence of boxes representing the argument pairs being passed to 'move' Or you could replace it with ; which might be even more illuminating (here you would not get pairs from an rfold and instead the nesting

Re: [Jprogramming] Questions on Advent of code Day 5

2022-12-06 Thread Raul Miller
t; > Don't you mean v instead of u. > And even so, that may be the backward stuff that was discussed for a while > in the early Fold stages? > > On Tue, Dec 6, 2022 at 5:21 PM Raul Miller wrote: > > > You should probably spend a few minutes studying the diagram at >

Re: [Jprogramming] Questions on Advent of code Day 5

2022-12-06 Thread Raul Miller
ntext because > move's x is state and move's y is moves; the ~ reverses those, I think. > > Btw, I was struggling to get the email version to work when I checked it > before sending it, too. That's why I sent the attachment, believing that > the errors would be avoided. > > On Tue,

Re: [Jprogramming] Questions on Advent of code Day 5

2022-12-06 Thread Raul Miller
P.S. I was going to mention, but I forgot: email managed to strip trailing spaces from your message. This caused an error in the phrase 1 5 9&{;._2 top One workaround here is to insert trailing spaces so that that phrase evaluates. Another approach though would be to replace it with 1 5 9{];._2

Re: [Jprogramming] Questions on Advent of code Day 5

2022-12-06 Thread Raul Miller
I've not fully digested all of the fold rules yet, so I'll first focus on building an insert version. The key to using insert is building representing the expression which would result from insert. In other words, instead of state tomove moves +-+-++ |C|M|PDNZ| +-+-++ We could look

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Raul Miller
2 3 4 5 6 7 8 9 > move 3 from 2 to 5 > > Sorry - this isn't of much interest for AOC as such! > > Mike > > Sent from my iPad > > > On 5 Dec 2022, at 20:15, Raul Miller wrote: > > > > It looks like the file transfer also is removing tr

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Raul Miller
my first nearly successful pass on the example gave MCD as the > answer for part 1 > before I realised I needed to reverse the removed items as the > CrateMover 9000 could only > manage individual crates, so part 2 was trivial by comparison! > > Mike > > On 05/12/

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Raul Miller
To find the splitting point in the file, I used: split=. 2+I. LF2 E. y To handle the moves, converted the part after the split to a rank 2 array of characters (one row per line), defined to=: , from=: , And used: ".parse sample and ".parse input This means that I had a

Re: [Jprogramming] EVM

2022-12-05 Thread Raul Miller
I've updated the page, fixing at least some of these issues. Specifically: (1) I updated the script to use m in place of x (2) I added a border (and some padding) between columns representing parallel evaluation with EVM examples, (3) I added the J prompt on lines representing content to be sent

Re: [Jprogramming] man_jpacman_

2022-12-04 Thread Raul Miller
HDD drives tend to wear out also, but I've not found an adequate comparison of SSD vs HDD lifetime which would be relevant in the context of swap (aka "pagefile usage"). Some people say that SSD lasts longer than HDD but other people suggest that that's only on certain tests. That said, if you're

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread Raul Miller
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. > > > > I

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread Raul Miller
sandbox for applications that might overload the system? > > Note that I am way over my head in discussing these issues and apologize in > advance for any suggestions that are clearly unworkable. > > Cheers, bob > > > On Dec 3, 2022, at 10:24, Raul Miller wrote: > >

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread Raul Miller
Virtual memory requires an OS configuration change. These things are generally treated as "security issues" -- these settings are supposed to be stable, and arbitrary programs are not supposed to mess with them. Also, having an arbitrary program set aside (for example) 64GB of file system space

Re: [Jprogramming] Avoiding J crash

2022-12-03 Thread Raul Miller
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

Re: [Jprogramming] Questions on Advent of code Day 1

2022-12-02 Thread Raul Miller
t; LF cut ... > missed the empty lines. > > The parsing method I eventually used was far from elegant, so I won't share > it! > > Mike > > Sent from my iPad > > > On 2 Dec 2022, at 19:42, Raul Miller wrote: > > > > Here's the parsing routine I used

Re: [Jprogramming] Avoiding J crash

2022-12-02 Thread Raul Miller
Note that, depending on the resource being limited, ulimit may cause the process to crash or shut down when that resource hits the limit. -- Raul On Fri, Dec 2, 2022 at 9:54 AM David Lambert wrote: > > To avoid this situation is it possible to limit memory and cpu time on > the process? > >

Re: [Jprogramming] Questions on Advent of code Day 1

2022-12-02 Thread Raul Miller
Here's the parsing routine I used for day 1: parse=: {{ +/@(__&".;._2);._2 (y,LF) rplc LF2;LF,'/'}} Its y argument would be the raw text of the input.txt provided for day 1. I hope this makes sense, -- Raul On Fri, Dec 2, 2022 at 11:36 AM Jaume wrote: > > Hello all > > I've been trying to

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

2022-12-02 Thread Raul Miller
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

Re: [Jprogramming] Differentiation problem

2022-11-24 Thread Raul Miller
Presumably you're working with an older version of J, like J807. (J9 tossed the D. conjunction and requires we use the math/calculus library manually.) Anyways, if you increase the size of the plot, you'll see that the display artifact you're looking at is a consequence of discretization -- the

Re: [Jprogramming] Truncating primes

2022-11-21 Thread Raul Miller
For this, I think I would have gone with: selPrime=: #~ 1: seed=: selPrime digits=: 1+i.9 step=:

Re: [Jprogramming] Truncating primes

2022-11-20 Thread Raul Miller
On Sun, Nov 20, 2022 at 12:29 PM Richard Donovan wrote: > I guess I was expecting ‘match’ -: to be an exact compare including data type! Yes, with numbers it's just reporting numeric equality. 1=1 regardless of whether it's 1 apple, or 1 on the complex plane. I guess you might use

Re: [Jprogramming] Truncating primes

2022-11-20 Thread Raul Miller

Re: [Jprogramming] Truncating primes

2022-11-19 Thread Raul Miller
On Sat, Nov 19, 2022 at 6:47 PM 'Skip Cave' via Programming wrote: > Now what is the J verb that will find an n-digit integer that is still > prime when each of the digits are removed? I'd probably go with https://rosettacode.org/wiki/Truncatable_primes#J for that. Thanks, -- Raul

Re: [Jprogramming] density plot tick marks misaligned

2022-11-04 Thread Raul Miller
at 8:43 PM chris burke wrote: > > > That said, currently I do not know which github repository contains > > jzplot.ijs. > > https://github.com/jsoftware/graphics_plot > > On Fri, Nov 4, 2022 at 4:32 PM Raul Miller wrote: > > > > Well, that's certainly doabl

Re: [Jprogramming] density plot tick marks misaligned

2022-11-04 Thread Raul Miller
rtainly not the non-integer > intermediates like 2.5), they should just list the cell indices, centred on > the cells. > > I can't personally see a reason why it wouldn't be better to centre the > ticks on the cells. > > Jan-Pieter > > On Fri, 4 Nov 2022, 14:57 Raul Miller, wrote: &

Re: [Jprogramming] density plot tick marks misaligned

2022-11-04 Thread Raul Miller
Hmm... I think you're asking for the x and y axis labels for that plot to range from 0 to 5. This would result in blocks centered over the integers corresponding to the numbered values. But the axes don't carry much (if any) information here. So maybe it would be better to use

<    1   2   3   4   5   6   7   8   9   10   >