[Jchat] Please help debug my AOC December 12 part 1

2023-12-12 Thread David Lambert
My program correctly scores the example.  Which indexes from my data set are incorrect please? data file: https://www.dropbox.com/scl/fi/ihuwsmsnxdgl2yne331qw/c?rlkey=sn9my1ymqq02zzwlwo8cmdx30=0 Counts:

[Jchat] notional under, YAY!

2023-12-09 Thread David Lambert
   /:~&.>&.(1&{)"1 MAPS ┌┬┐ │seed-to-soil map:   │50 98  2│ │    │52 50 48│ ├┼┤ │soil-to-fertilizer map: │ 0 15 37│ │    │37 52  2│ │    │39 

[Jchat] (id. expression )id.

2023-01-27 Thread David Lambert
Intent: aid programmer to match parentheses in j sentences. Problem: counting parens is insufficient, it's important also to enclose the correct train grouping which can be difficult to see. Solution: proposal uses named parenthesis to assist writing/reading j.  named paren are (id.  and

[Jchat] almost!

2023-01-14 Thread David Lambert
(^6)-+/1p4 1p5 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jchat] gotchas

2022-12-20 Thread David Lambert
my_verb=: {{  n=. # y   NB. whoops!  Not a verb.  Gotme. }} -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jchat] J according to ChatGPT...

2022-12-08 Thread David Lambert
As mentioned, I helped train a programming assistant AI. The project team asked me to propose a question for this auto-pair-programmer to find out whether it lies. "Do you test the code you propose?"  was my answer. -- For

[Jchat] aoc22-7 :-(

2022-12-08 Thread David Lambert
I must misunderstand the instructions since I get same wrong answer in every language I try. Strategy: create a list of rooted path to all files.  Make a set of the directories-part, producing a unique list of all directories.  For each of these, add the file sizes for all files with matching

[Jchat] aoc22 day 5

2022-12-06 Thread David Lambert
I found that with appropriate definitions and setup, to evaluate the stack operations with do (".). move 1 from 2 to 1 move 3 from 1 to 3 move 2 from 2 to 1 move 1 from 1 to 2 for example,  from=:to=: , -- For information

[Jchat] The AI assistant says j is readable.

2022-09-25 Thread David Lambert
Human: How do you write a program to determine the highest marks in pseudocode? Assistant [alpha]: Here is one way you could write this in pseudocode: Highest = 0 For each mark in the list of marks:   If mark > Highest:     Highest = mark Output Highest This loops through all the marks, keeps

[Jchat] Automatic pair programming partner

2022-07-08 Thread David Lambert
I've gotten a job to produce training data for an AI programming assistant, a pair programmer.  Training takes place by my choosing the best of 5 answers it offers, and in some cases write better answers.  Anyway, I'm showing j to it. Assistant check_columns=: (0 -.@:e. [: , (0 1,9 1)

[Jchat] operator overloading

2022-05-16 Thread David Lambert
If I come across this again I might remember to let you know.  J comes pre-overloaded, (we call it dense) such as the forty-x uses of b. or cuts.  The issue I recall was for class dependence of operators.  Concretely, in Ken's J there would not be a locale specific definition of + .  The

Re: [Jchat] jerdle - J wordle/nerdle game?

2022-05-15 Thread David Lambert
Hmmm.    15|i.10 3  NB. 4 words, 9 chars    1!:1<'a'   NB. 5 words, 8 characters I like it.  Might force me to consider ! to A. to Z: to ~: . Somewhere on the jsoftware site is a puzzle, roughly  `generate the year without using digits'. Date: Sun, 15 May 2022 08:20:56 +0530 From: Razetime

[Jchat] Day 14 aoc

2022-01-05 Thread David Lambert
Quite a thrill, on Day 14 I for the first time deliberately used dyadic bond. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jchat] Advent of Code

2021-12-30 Thread David Lambert
Laughing aloud, I haven't yet pretended to read those baffling instructions. On 12/30/21 7:00 AM, chat-requ...@forums.jsoftware.com wrote: Date: Wed, 29 Dec 2021 19:44:34 + From: "'Michael Day' via Chat" To:c...@jsoftware.com Subject: Re: [Jchat] Advent of Code

Re: [Jchat] aoc

2021-12-03 Thread David Lambert
Private leaderboards cover all yearly events.  To some extent, this has some little bit to do with current Advent.  High point scores initially involve willingness to solve at inconvenient time, and will later in the month involve problem solving skill. Anyway, the SmartyStreets leaderboard

[Jchat] aoc

2021-12-01 Thread David Lambert
of Code 2015. You can use a different [Ordering], manage your [Private Leaderboards], use an [API], or switch to another [Event].  1) 3200 *  David Lambert  2) 3149 *     3) 3083 *  mdwhatcott (AoC++)  4) 3061

Re: [Jchat] Advent of Code

2021-12-01 Thread David Lambert
It's catching on. 41 thousand solutions in 8 + 1r2 hours Part 1 Part 2 Day Time Rank Score Time Rank Score 1 08:20:23 47807 0 08:23:53 40931 0 |Date: Tue, 30 Nov 2021 18:44:14 -0500 |From: Raul Miller |To: Chat forum

[Jchat] Android version thanks!

2021-05-12 Thread David Lambert
This winter I needed time average of an outdoor gauge and called out periodic readings into voice recognition with j session on smart phone. Easy! Thank you all who made the code and Android port happen. -- For information about

[Jchat] fold

2021-03-02 Thread David Lambert
I am surprised that the unlimited folds don't stop on convergence, namely ^:_ . -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jchat] https://adventofcode.com/2020/day/19

2020-12-31 Thread David Lambert
As I recall, yacc's default token is the ASCII value of a character. The lexer in this case needn't be more complicated, therefore, than getchar. The rule in question means "An `a' is expected here." Were there a `b' in the input, and none of the other paths through the rules matched, the

Re: [Jchat] https://adventofcode.com/2020/day/19

2020-12-31 Thread David Lambert
The terminal rule 4: "a" matches the single character `a' expressed in C as 'a' . PS. and thank you for the j implementation, a good deal simpler than my effort. |Date: Wed, 30 Dec 2020 17:27:06 -0500 |From: Raul Miller |To: Chat forum |Subject: Re: [Jchat] https://adventofcode.com/2020/day/19

Re: [Jchat] https://adventofcode.com/2020/day/19

2020-12-30 Thread David Lambert
/* file y.y */ /* $ YACC=bison make y # build */ /* $ bison y.y && gcc -g -Wall y.tab.c && echo bababa | ./a.out # alternative */ /* $ echo ababbb ./y # use */ %glr-parser %{ # include void yyerror(const char*a) { fprintf(stderr, "\n%s\n", a); } int yylex(void) { return

Re: [Jchat] https://adventofcode.com/2020/day/19

2020-12-29 Thread David Lambert
Part 2 changes the rules to be recursive. Encountering shift/reduce or reduce/reduce conflicts the generalized bison parser tries both. Anyway, I applied the rules to match each string rather than trying to itemize productions. Maybe that works since there's a maximal string length. When

[Jchat] https://adventofcode.com/2020/day/19

2020-12-28 Thread David Lambert
bison with %glr-parser turned out to be the best attack. Nearly a direct translation. -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] AOC wrap

2020-12-24 Thread David Lambert
--- Day 19: Monster Messages --- Part b: unsolved --- Day 21: Allergen Assessment --- No solutions. --- Day 23: Crab Cups --- Part b: implemented my brutish j model in c, which ran 5 hours on a mainframe. Didn't bother to seek a pattern. --- Day 24: Lobby Layout --- Struggled with complex

Re: [Jchat] AOC2020

2020-12-20 Thread David Lambert
Oh that's nice. {{m*n}} must be the new conjunction notation. (because of m,n) On 12/20/20 7:00 AM, chat-requ...@forums.jsoftware.com wrote: Date: Sat, 19 Dec 2020 15:36:04 -0500 From: Raul Miller To: Chat forum Subject: Re: [Jchat] AOC2020 Message-ID: Content-Type: text/plain;

[Jchat] AOC2020

2020-12-19 Thread David Lambert
Otherwise, I've solved all with j. --- Day 18: Operation Order --- Part 2: Operator overloading usually doesn't include precedence alterations.  I abandoned j and used python.  Swapping operators and wrapping the numbers with a class that evaluates + as * (and multiplies for +), I evaluated

[Jchat] resolution

2020-12-17 Thread David Lambert
Months ago I had reported j installation  difficulties.  After installing 9.02 release, ijconsole 9!:14 indicated 9.01 from January was sufficiently frustrating that I successfully hunted j libraries, jqts, and jhss.  Installed the correct qt libraries. Now ijconsole, jqt, and jhs all report

Re: [Jchat] Stumped!

2020-12-14 Thread David Lambert
Thanks all. I've now learned the (how have I survived without it?) Chinese Remainder theorem. My implementation is not an improvement on Joseph's. |Joseph Novakovich josephnovakovich at gmail.com |Mon Dec 14 17:48:23 UTC 2020 | |For part 2, I implemented a chinese remainder theorem dyad, built

[Jchat] Stumped!

2020-12-14 Thread David Lambert
https://adventofcode.com/2020/day/13 Part 2. I understand the problem sufficiently to solve the examples. I fear the run time of my program, which counts upward in increments of the maximum value starting from some residue, will take too long for the actual data. Please offer suggestions for a

Re: [Jchat] symbols

2020-12-10 Thread David Lambert
The symbols seem unusual to me in that the internal details are exposed in high level language. I was implementing a red black tree at the same time I first read about j symbols which in particular confused me about their purpose. And wondered, with all this machinery, why doesn't j directly

[Jchat] symbols

2020-12-08 Thread David Lambert
Is there a chance to make the symbols reset able? I chose against them for https://adventofcode.com/2020/day/7 because I'd need a new j session for the several development efforts. On second thought, perhaps we'd all be better off if I read about and practice the amazing s: before requesting

Re: [Jchat] Raspberry Pi

2020-11-20 Thread David Lambert
I found online several designs for cases and 3d printed one at our local library. -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] Chess playing chatbot

2020-11-08 Thread David Lambert
'Tis the dream of each programmer, Before his life is done, To write three lines of APL, And make the damn things run.' --blikII www.freechess.org -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] challenge

2020-11-08 Thread David Lambert
create a sudoku with TENSORIAL ORIENTALS in parallel. -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] Oddity

2020-10-26 Thread David Lambert
J forbids operator overload. Yet if a train has conjunctions that train must be evaluated to find out whether the final step is fork or hook. Odd or even? Can't necessarily tell by looking. Maybe this is a reason to remove hooks from the language. Or is this a reason hooks must remain? I

[Jchat] under

2020-10-03 Thread David Lambert
Though they have shorter lives, my cats are outdoor cats.  My opinion, they have better lives. Rest in peace good mouser Zippy hit by car.  I thought of &. during the burial. -- For information about J forums see

[Jchat] APL/360 an Interactive Approach

2020-08-25 Thread David Lambert
The book exists as pdf. http://www.softwarepreservation.org/projects/apl/Books/GillmanAndRose I was recently challenged to find applications of matrices in civil engineering, and remembered that examples existed in the inner product chapter. The examples are macroscopic graph theory rather than

[Jchat] plot options

2020-03-23 Thread David Lambert
I keep a browser bookmark to the plot options. https://code.jsoftware.com/wiki/Plot/Options > >Date: Mon, 23 Mar 2020 00:21:40 + >From: "'Michael Day' via Programming" >To: programm...@jsoftware.com >Subject: Re: [Jprogramming] crash >Message-ID:

[Jchat] P:

2020-03-12 Thread David Lambert
P: would be the parallel processing adverb advising the interpreter to run the verb in parallel if possible. Automatic parallel processing would be a mistake as there could be reasons to avoid it, such as evaluating data in chunks to manage memory use.

Re: [Jchat] Sour grapes

2019-12-24 Thread David Lambert
I haven't managed to find all the initialization files. |file name error | 0!:0md'),ids)]system,'/util/boot.ijs' |[-52] /usr/bin/profile.ijs |syntax error | r_jrx_=:'',}.; ',',&.>{."1 UserFolders_j_ |syntax error | r_jrx_=:'',}.; ',',&.>{:"1 UserFolders_j_ |value error: boxdraw_j_ | 0

[Jchat] Sour grapes

2019-12-22 Thread David Lambert
Congratulations for finding the infinite error loops in wd (Michal Wallace) problem. I haven't gotten jqt or jhs to work since initial release. :( -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] Subject: Re: Explicit vs tacit with assignment

2019-11-24 Thread David Lambert
Finally, confirmation for my long held view that our singing group should first learn the composer's intent (perform according to the score) before we "fix" that score. Thanks Louis. >Date: Sun, 24 Nov 2019 02:52:57 +0100 >From: Louis de Forcrand >To: programm...@jsoftware.com >Subject: Re:

[Jchat] _ ~ -

2019-10-26 Thread David Lambert
- would have been a convenient choice for negative, then _ could have been minus or additive inverse. I seem to do a lot of conversions between systems and certainly haven't learned to use the number formatting library code. Oh well. The convention was right for me back in the APL '70s.

Re: [Jchat] The stockmarket is now run by machines.

2019-10-17 Thread David Lambert
> > > Date: Wed, 16 Oct 2019 20:09:27 -0400 > From: Jose Mario Quintana > To: c...@jsoftware.com > Subjec > Message-ID: > < > cabtfpktz+8jmvt-oup0yutkb9oxjgxjksdnzvbgfv2qygm4...@mail.gmail.com> > ... > On the other hand, we are in a kind of a symbiotic relationship with the > machines: we

Re: [Jchat] Introducing J to Financial & Actuarial Students

2019-09-11 Thread David Lambert
Circuit break if the the market climbs too fast?  All I see is "designed to rise". Date: Tue, 10 Sep 2019 10:49:40 -0400 From: Raul Miller To: Chat forum Subject: Re: [Jchat] Introducing J to Financial & Actuarial Students Message-ID: Content-Type: text/plain; charset="UTF-8" On Mon,

Re: [Jchat] New web page

2019-05-03 Thread David Lambert
Thanks Eric.  "Navigation should and will be improved." is good to know this plan. Newcomers won't know to search the site for control structures, nor will they know to follow the links to control structures via the "explicit definition" entry in NuVoc. The header bar Usr Pri JfC LJ Phr Dic

[Jchat] New web page

2019-05-02 Thread David Lambert
Difficult to find control structures from the new main www.jsoftware.com page. I haven't yet thought of a good solution. -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] AOC 2016 14

2018-12-09 Thread David Lambert
Finally solved it. On (many) prior attempts I must have overlooked the "Only consider the first such triplet in a hash." instruction. I peeked outside of j for a faster md5 algorithm, used python which has a compiled implementation. A ".dll" or a ".so" depending on your camp.

Re: [Jchat] [Jprogramming] Advent of Code 2018

2018-12-02 Thread David Lambert
Hats off to all of you who write substantial j on a cell phone. I cannot! -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] Nothing much

2018-06-08 Thread David Lambert
If God created the universe who created nothing? <https://www.quora.com/If-God-created-the-universe-who-created-nothing> https://www.quora.com/If-God-created-the-universe-who-created-nothing/answer/David-Lambert-86?prompt_topic_bio=1 <https://www.quora.com/If-God-created-the-uni

Re: [Jchat] A Glimpse Of Heaven, by Bernard Legrand

2018-05-26 Thread David Lambert
Do you trust me to fix the index origin trouble? The entire indexing section needs revist.  Thank you.  I will start recommending this page on the forums where I sell j. In:http://code.jsoftware.com/wiki/Articles/APL_-_a_Glimpse_of_Heaven Indexing Returning to our vector of numbers:Val=:

[Jchat] J, APL, or calendars?

2018-05-23 Thread David Lambert
Our credit union had used employee numbers for account numbers. But ran out of 5 digit numbers. Did they change our accounts to 0abcde? No! They multiplied 10 leaving us as abcde0. -- For information about J forums see

Re: [Jchat] How close is J to APL?

2018-05-17 Thread David Lambert
"APL and J are conceptually similar. That is, one knowing one language can easily pick up the other. " Verbs and rank thinking are easily transferred. Tacit programming was new and difficult for me, having used APL, APL2, and a VAX-VMS APL from DEC. .QQ is quote quad, .BX is box, etceteras.

Re: [Jchat] Convention to stop loading a script

2018-05-09 Thread David Lambert
I replace head of line with NB. through end of file which is just a few keystrokes in emacs and probably in other editors as well. I can cut these with rectangular block or regular expression later. Another trick is to cut through end of file, save, and undo. Again, emacs backs up the work so I

[Jchat] optimization

2018-03-16 Thread David Lambert
Seems that it's possible in some cases that the interpreter could look ahead a bit and change, well, here's my example,  I just answered a quora question involving arithmetic with an asterisk operator to be determined (if the first three what is 2*6)    3 4 5 6 *&>: 2 3 4 2 12 20 30 21

Re: [Jchat] rosettacode

2018-03-13 Thread David Lambert
Zeckendorf arithmetic might be an easy target given that we have an essay. http://code.jsoftware.com/wiki/Essays/Fibonacci_Sums http://rosettacode.org/wiki/Zeckendorf_arithmetic On 03/13/2018 08:00 AM, chat-requ...@forums.jsoftware.com wrote: Date: Mon, 12 Mar 2018 16:14:15 -0400 From: Raul

[Jchat] Favorite blog shows global sea level rise per decade isoclines.

2018-03-07 Thread David Lambert
https://www.wunderground.com/cat6/weaker-gulf-stream-means-trouble-coastal-new-england This is the cat6 wunderblog started by Jeff Masters of wunderground, bought by weather.com, bought by IBM. Soon they'll be coding in APL & j!?

Re: [Jchat] ordinal fractions

2017-12-22 Thread David Lambert
Rather than searching for a problem for this answer, I confirmed some comprehension of the ordinal fraction idea.  Maybe I'll return to learn addition and subtraction since the algebra of logic is intriguing.  "2 of 3 witnesses thought the suspect might have had reddish hair" will ``always''

[Jchat] ordinal fractions

2017-12-21 Thread David Lambert
I'd use an index vector to store the ordinal fraction as I understand them. Check my comprehension please.  Do the ordinal fractions and tree agree?    c /    b - d  /   \ a  e  \    q 0 0 0   a 0 1 0   b 0 2 0   q 0 1 1   c 0 1 1   d 0 1 2   e Boxes take a long time in j

[Jchat] sure, I can make it work.

2017-12-16 Thread David Lambert
(density of plutonium) / (density of iron)  works at wolfram alpha. plutonium % iron oh well.  (about 2.5, by the way) -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] negative numbers elementary school

2015-01-05 Thread David Lambert
Teach negative numbers as if they are natural. Don't the number line posters run both directions? Leave the negatives on the subtraction chart. The pattern is quite obvious. I recall talking with other kids on the elementary school bus about what a negative number could possibly mean. I

Re: [Jchat] Music one-liners

2014-12-08 Thread David Lambert
On linux (ubuntu tested) the aplay command plays a file. $ aplay -rate 4000 whistling_pixies $ ijconsole heavy_carp.ijs | aplay -rate 16000 From: Raul Millerrauldmil...@gmail.com To: Chat forumc...@jsoftware.com Subject: Re: [Jchat] Music one-liners

Re: [Jchat] Response Summary: J From K-G12

2014-09-21 Thread David Lambert
I'm not convinced that mathemetica isn't a best choice. Is it not free on Raspberry Pi? Today's Topics: 1. Response Summary: J From K-G12 (lb_tay...@charter.net) -- Message: 1 Date: Sun, 21 Sep 2014 00:07:41 -0400

Re: [Jchat] Programming contest

2014-09-17 Thread David Lambert
The collaborative golf code (shortest program somewhere on stackoverflow) projects have been fun and instructive. On the wiki are puzzles: http://www.jsoftware.com/jwiki/Puzzles Date: Wed, 17 Sep 2014 15:33:17 +0900 From: Jon Houghjgho...@outlook.com To:c...@jsoftware.com Subject: [Jchat]

Re: [Jchat] FSM enhancement proposal

2014-01-29 Thread David Lambert
/2014 07:00 AM, chat-requ...@forums.jsoftware.com wrote: Message: 1 Date: Mon, 27 Jan 2014 22:30:14 -0500 From: David Lambert b49p23t...@stny.rr.com To: chat c...@jsoftware.com Subject: [Jchat] FSM enhancement proposal Message-ID: 52e72446.2000...@stny.rr.com Content-Type: text/plain; charset=ISO

[Jchat] FSM enhancement proposal

2014-01-27 Thread David Lambert
I have information of the forms ABC, AB, BC, AC, A, B, C which I'd like to separate into 3 boxes. If a part is missing the box should be empty. I think it is impossible with the current FSM implementation because it must read a character to yield output. With only one character on input I

Re: [Jchat] my programm looks terrible

2013-10-02 Thread David Lambert
When Dan Bron writes, people read. Define nouns in reverse order. Of course! No, really! -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jchat] Chat Digest, Vol 86, Issue 17

2013-08-29 Thread David Lambert
, 28 Aug 2013 22:49:40 -0400 From: Raul Miller rauldmil...@gmail.com To: Chat forum c...@jsoftware.com Subject: Re: [Jchat] stitch fill Message-ID: CAD2jOU8NvF3_eT1jw=QkUuyvGAic4RFGuc+SoGY=ctam4w+...@mail.gmail.com Content-Type: text/plain; charset=UTF-8 On Wed, Aug 28, 2013 at 9:44 PM, David

[Jchat] stitch fill

2013-08-28 Thread David Lambert
What, please, is the reasoning for stitch not using the fill? 2 3,.5 6 7 |length error | 2 3,.5 6 7 2 3|:@:,:5 6 7 2 5 3 6 0 7 -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jchat] Propose (NOUN verb) parses as NOUNverb

2013-08-20 Thread David Lambert
I frequently make this sort of syntax error: f=:(F;S;M);: |syntax error | f=:(F;S;M);: f=:(F;S;M);: Usually this happens from quick cut-n-paste rather than oversight. I'm proposing to replace the noun verb production syntax error to instead parse as nounverb I haven't thought