« first day (1780 days earlier)      last day (875 days later) » 

12:56 AM
CMC: print infinite digits of e (array or float)
 
1:41 AM
@Fmbalbuena is using dfns.ws allowed? otherwise I need to write a big arith myself
⍝ btw the plain algorithm for e in arbitrary precision can be:
 r←expSeries x;nfac;n;s;xp;nx;ns
 nfac←2
 n←3
 s←xp←x
repeat:
 nx←xp×x
 ns←s+(nx÷nfac)
 →(s=ns)/return
 s←ns
 nfac×←n
 n+←1
 xp←nx
 →repeat
return:
 r←1+s
 
 
4 hours later…
5:25 AM
Today's AoC problem is easy with ⎕R.
 
 
3 hours later…
9:16 AM
@AaroneousMiller Python for and while loops also have an "else".
 
quad r is regex?
@Fmbalbuena ah yes let me do some pointer manipulaion in APL
CMP: Hardest concept in APL?
 
@PyGamer0 dyadic transpose
 
@PyGamer0 inner product
 
@Adám inner product harder than dyadic transpose? hmm, maybe
 
9:31 AM
This comment from Morten made dyadic transpose suddenly make sense to me: chat.stackexchange.com/transcript/52405?m=57439754#57439754
 
@rak1507 Obviously not on vectors and/or scalars, but did you hear the Array Cast challenge of the product without each element? Morten answered {⍵×.*∘.≠⍨⍳≢⍵}
 
i still don't quite know what the left arg of a dyadic transpose does. Marshall implemented the one for dzaima/BQN, so I never got to find out ¯\_(ツ)_/¯ (not that I would've written it ever anyways)
 
for something where the left argument is a permutation of the axes, yes, but for repeated axes, no clue
@Adám that makes sense if you know inner product is a generalised matrix product
 
@rak1507 Oh, that's quite simple. Just think of "filling" the result with elements from the argument, but instead of increasing one index of a time, you increase multiple.
 
@Adám so without trying it could you tell me what 1 2 1⍉2 3 4 ⍴ ⍳24 gives?
(I wouldn't have a clue)
 
9:37 AM
I think so, but I'd prefer to at least print/handwrite out 2 3 4⍴⍳24 as it is hard for me to remember the positions of each.
 
      2 3 4 ⍴ ⍳24
 1  2  3  4
 5  6  7  8
 9 10 11 12

13 14 15 16
17 18 19 20
21 22 23 24
      1 2 1⍉2 3 4 ⍴ ⍳24
?
 
Thanks. Trying now. No cheating.
 1  5  9
14 18 22
It is quite simple. The first axis with have length 2⌊4 and the second 3.
 
nice
 
When we increase the index of the first axis, we also have to increase it along the second axis. So the second "layer" (which will become a row, but that's for later) picks up elements from the [;;2] i.e. [2;;2]
And there you have it: The first major cell is [1;;1] and the second is [2;;2] and since we've only got two dimensions left, the first dimension is rows, and the second is columns.
So if the first row is 1 5 9 and the second is 14 18 22 we get the above matrix.
 
well I'm not going to pretend to fully understand it, but definitely a little bit more
 
9:44 AM
By "the second axis" above, I mean the second axis that needs to be merged into the first.
Another way to think of it is by elimination of indices.
Since we're mapping together the first and third axes, any element that has unequal indices in those dimensions is eliminated:
      ⍳2 3 4
┌─────┬─────┬─────┬─────┐
│1 1 1│1 1 2│1 1 3│1 1 4│
├─────┼─────┼─────┼─────┤
│1 2 1│1 2 2│1 2 3│1 2 4│
├─────┼─────┼─────┼─────┤
│1 3 1│1 3 2│1 3 3│1 3 4│
└─────┴─────┴─────┴─────┘
┌─────┬─────┬─────┬─────┐
│2 1 1│2 1 2│2 1 3│2 1 4│
├─────┼─────┼─────┼─────┤
│2 2 1│2 2 2│2 2 3│2 2 4│
├─────┼─────┼─────┼─────┤
│2 3 1│2 3 2│2 3 3│2 3 4│
└─────┴─────┴─────┴─────┘
┌─────┬─────┬─────┬─────┐
│1 1 1│1-1-2│1-1-3│1-1-4│
├─────┼─────┼─────┼─────┤
│1 2 1│1-2-2│1-2-3│1-2-4│
├─────┼─────┼─────┼─────┤
│1 3 1│1-3-2│1-3-3│1-3-4│
└─────┴─────┴─────┴─────┘
┌─────┬─────┬─────┬─────┐
│2-1-1│2 1 2│2-1-3│2-1-4│
├─────┼─────┼─────┼─────┤
│2-2-1│2 2 2│2-2-3│2-2-4│
├─────┼─────┼─────┼─────┤
│2-3-1│2 3 2│2-3-3│2-3-4│
└─────┴─────┴─────┴─────┘
Now you can see the indices of the two major cells that will constitute out result.
@rak1507 Did that help?
 
10:10 AM
yeah, that does, thanks
 
is ,/ actually useful?
 
@PyGamer0 Did you APLcart it?
 
aplcart has regexes?!
 
It sure does :-)
 
wow
that makes searching a lot easier
> All code in APLcart assumes the latest version of Dyalog APL Unicode edition and system defaults, for example ⎕IO←1, ⎕ML←1, ⎕DIV←0
i know quad IO, what are the other 2?
 
10:29 AM
Did you APLcart them?
 
oh wait i am dumb
 
APLcart will turn self-aware very soon, when I have to update it for 18.2.
 
self aware?
 
18.2 has ]APLCart so APlcart will need an entry for that.
 
@PyGamer0 domino , I can not remember when is the last time I used that.
 
@Adám if you have multiple versions of dyalog installed (including pre-releases), which one is run by the jupyter kernel?
 
The latest.
 
By time, or by s/semver/version/?
 
Our version numbers are floats :-)
 
10:58 AM
@Adám I don't think the jupyter kernel is happy with 18.2; at least syntax highlighting is no longer present for me.
I re-installed the kernel.
No difference.
 
That's odd. afaik, the kernel's syntax highlighting isn't connected to the interpreter in any way.
 
 
2 hours later…
RGS
12:36 PM
@Adám I was also under this impression...
The syntax highlighting is done by some JS plugin
 
Can my apl program be compiled to a binary?
 
@knobo Possibly, but what are you trying to achieve?
Also, velkommen til the Orchard!
@knobo What OS are you on?
 
12:52 PM
@RGS It's of course conceivable that I messed something else up in my jupy setup.
 
My setup is broken. Loads and looks fine, but won't connect to the kernel. Good enough to render notebooks, so ¯\_(⍨)_/¯
 
@Adám @RGS I updated my jupyter to the latest; seems to have done the job.
 
RGS
@xpqz glad the issue has been solved!
 
1:08 PM
There are some errors being thrown by jupyter, I note, but looks unrelated to Dyalog. But at least it looks nice again.
 
RGS
1:47 PM
@xpqz What errors are you talking about...? Am I getting numb to detail?
 
I think that image is to show syntax colouring working as it should.
 
RGS
Ah ok 🙃
 
@RGS Errors:
 
RGS
Ah right, errors on the server log
I have a bunch of errors as well, things I have yet to fix D:
 
2:22 PM
@rak1507 just worked through your day9 solution -- that's very clever.
 
thanks
 
@Adám I'm on linux. I just wanted to run my apl program from the command line some how
 
@knobo OK, so you don't actually need compilation or a binary per se, you just want a CLI APL program. I think the best course of action is to wait for 18.2 to be released, as it supports proper #! scripting.
 
@knobo compilation to a binary won't help with that
 
There are various hacks you can do with 18.0, but it probably isn't worth the effort.
 
2:31 PM
Compliation is not important.
It could have made it possible to distribute the program to other computers without installing the runtime
 
@Adám I mean, dyalog -script isn't too bad
@Adám normally 'wait for the next release' isn't ideal
 
@knobo well, you'd need the runtime either way as APL is dynamically parsed of all things
 
It looks like this: 2-'JXN'⍳'JJJJJNNJJNNJJJJJ' does not work the same way on my locally installed dyalog as it does in tryapl.org
 
what's different?
 
Well, on Windows, you can export an exe that contains both interpreter and code.
 
2:35 PM
2-'JXN'⍳'JJJJJNNJJNNJJJJJ' gives me 1 1 1 1 1 ¯1 ¯1 1 1 ¯1 ¯1 1 1 1 1 1 in the web interface
 
Dibs on ⎕IO
 
on my computer I just get :
 
@Adám nah, pretty hard to set to 0 accidentally
 
Way to keep APLers in suspense…
Greek letter iota?
 
2-('JXN'⍳'JJJJJNNJJNNJJJJJ')
2 2 2 2 2 0 0 2 2 0 0 2 2 2 2 2
 
2:37 PM
it is ⎕IO!
 
⎕IO it is!
Called it.
 
lol
 
heh
 
What is ⎕IO?
 
@knobo APL can use 1-based (default) or 0-based indexing, and gives off-by-one results depending on that.
⎕IO←0 enables 0-based indexing, and ⎕IO←1 1-based.
 
2:38 PM
I always set ⎕IO to |ψ〉 = α|0〉 + β|1〉
5
 
@knobo Try ⎕IO←0 ⋄ ⍳10 and then ⎕IO←1 ⋄ ⍳10
 
So What I want is J to become -1 and N to become 1
⎕IO←1 solved that
 
⎕←¯1*'J'='JJJJJNNJJNNJJJJJ'
 
@rak1507 ¯1 ¯1 ¯1 ¯1 ¯1 1 1 ¯1 ¯1 1 1 ¯1 ¯1 ¯1 ¯1 ¯1
 
another way to do that
 
2:41 PM
I wonder how you ended up with ⎕IO←0 by mistake. Maybe copied someone's code?
 
but: 2 - 'JXN'⍳ ⊃⎕NGET '/app/input.txt' ends in the number ¯2
 
There's a LF at the end.
Use ⊃⊃⎕NGET '/app/input.txt'1 instead.
 
@Razetime wth
 
@rak1507 'N' but good call:
    ]runtime -c "2-'JXN'⍳a" "¯1*'N'=a"

2-'JXN'⍳a → 7.2E¯4 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
¯1*'N'=a  → 8.7E¯5 | -89% ⎕⎕⎕⎕⎕
 
WS FULL
 
2:44 PM
@Adám 'J to become -1', presumably they were negating it after
@knobo how big is your file?!
 
@knobo Can you run ⎕ML for me?
 
$ wc input.txt
0 1 10000 input.txt
⎕ML
1
 
Thanks.
 
So I make two matrixes with 10000 elements
 
Matrices?
 
2:46 PM
nums ← 2 - 'JXN'⍳ ⊃⊃⎕NGET '/app/input.txt'1
id ← ∨\(2⍴⍴nums)⍴(1+⍴nums)↑1
m ← +\((2⍴⍴nums)⍴nums) × id
(⌈/,⊃∘(1+⍋)) (⊢/↑⍒¨↓m)-(¯1+⍳⍴nums)
 
@knobo Please press UpArrow, Ctrl+k, Enter here in the chat. Thanks!
 
@knobo oh, you're trying to make a 10000 by 10000 matrix...? no wonder it runs out of memory
 
> 10000 by 10000 matrix
 
you can increase maxws, and it'll probably work
 
100000000 scalars o_O
 
2:49 PM
Yes, that's why I use a computer. Its too much for my head :P
 
@PyGamer0 if they're 1 byte, it's only 12.5mb so not as much as I thought
 
How is it not 100MB?
 
oops, yep, meant 1 bit
 
But the summation +\
 
lets say they all of them
are nested 10 by 10 matrix
 
2:51 PM
How do I set maxws?
 
Just set the envvar MAXWS=2G
 
@Adám true
↑⍒¨↓m can be ⍒⍤1
oh.. beat me to it
 
Wait a minute. Isn't ⊢/↑⍒¨↓m the index of the smallest element in each row?
 
imagine this: 10000 by 10000 matrix, each element being a nested 10 by 10 matrix and each element of that being a complex number
 
@Adám actually yeah, (⊢/↑⍒¨↓m) can be ⊃⍤⍋⍤1⊢m which will be more efficient too
 
2:54 PM
 
@PyGamer0 Recognised by the interpreter as a single token and optimised to not take the literal intermediary steps.
 
ok
 
@rak1507 I have to go very soon. Are you comfortable helping knobo or should I call a colleague?
 
@Adám well, depends what he needs (but yeah until 3:30 ish at least)
 
Well. I'll go back to work now...
Thank you for your help so far.
 
2:57 PM
what's the problem? I don't understand what subtracting indices from the minimums is doing
 
The last line of the code is suppose to give me back the longest sub-list where the sum equals 0, and the index of that sub-list
There are probably ways to do this more efficient.
But I'll try to figure out that later, and learn more. It was my first APL program ever.
 
@knobo That's pretty impressive!
 
nums ← 2-'JXN'⍳'JJJJJNNJJNNJJJJJ'
id ← ∨\(2⍴⍴nums)⍴(1+⍴nums)↑1
m ← +\((2⍴⍴nums)⍴nums) × id
(⌈/,⊃∘(1+⍋)) (⊢/↑⍒¨↓m)-(¯1+⍳⍴nums)
gives the correct answer 8 3
 
wow, nice
 
But it did not give the correct answer for the file, though
@Adám thanx
 
3:09 PM
I think ⎕IO←1 ⋄ (⊃⍤⍒,⍨1+⌈/) (⍳⍤≢-⍨≢-⌽⍳⊢)+\¯1*'J'='JJJJJNNJJNNJJJJJ' might work
oh, so you're trying to find the last zero in the row?
because it can go negative, the last item of ⍒ is the index of the minimum, which isn't always the index of the last zero
 
aha... right. it's a bug in the code. It could actually go negative. So I can just get the absolute value before getting the zero
 
)off :-)
 
Or find a better way.
 
Or ⊃⌽⍸0=, ⊃⍒| is probably better, though
 
 
1 hour later…
4:21 PM
@PyGamer0 you must be unfamiliar with the ministry of vector processing
 
heh
 
4:55 PM
@Razetime hahaha nice to see some bra-kets in this channel xD
 
Weekend starts here, I think. Beer o'clock in Bristol.
 
5:16 PM
will start in about an hour here
 
 
2 hours later…
6:48 PM
Can Dyalog be installed on a chromebook?
If so, what does one download?
 
7:01 PM
I'm assuming chrome OS is installed? You need to download the deb/rpm from Dyalog's website and extract it with rpmextract or debextract. The interpreter will be placed under /opt/mdyalog/18.0/64/Unicode (note, you want the mapl executable not dyalog)

[Related stack overflow post](https://stackoverflow.com/questions/66729267/how-to-get-dyalog-apl-on-arch)

I'm not sure if the architecture matters, I know some chromebooks are ARM
@xpqz Is covered in your book?
 
7:32 PM
I mention it in passing in the glyphiary and finding things chapter, but didn’t dedicate a specific section to it.
Do you think I should? I will do a new revision of the text when 18.2 is released. Put an issue in if you think it should be covered at greater depth.
 
7:58 PM
Yeah, it seems odd it's missing.I can understand omitting ○⌹⍟!, etc because their concepts aren't unique to APL - and are uncommon in code.
 
8:13 PM
Tbf Iota Underbar is less common than I thought, but still beats out many other useful primitives. (Given, these results are effected by the date the features were introduced)
 
 
1 hour later…
9:37 PM
Any word on if Dyalog will release an M1 native version (aarch64) for the new macbooks? The current version actually runs fine under Rosetta, it's just slower and uses more battery than an M1 native version would
Since it (presumably) depends a lot on AVX etc. I realize this may never happen - but it looks like there's a 32-bit build for raspberry pi's so maybe?
 
The Dyalog docs don't have a page for dyadic execute, replicate first or expand first. (The just link to the monadic or / equivalent)
 

« first day (1780 days earlier)      last day (875 days later) »