« first day (1283 days earlier)      last day (1374 days later) » 

 
5 hours later…
7:42 AM
(Should I push "Dyalog 18.0 + Jupyter" Dockerfile to Docker Hub?)
 
@Bubbler Why not?
 
@Bubbler Super -- I'd definitely look into running my notebooks that way.
 
RGS
@Bubbler sry for the dumb question but what is this for?
 
@RGS Being able to run notebooks directly from a git repo without dyalog installed locally -- anyone can run them.
Click the 'run in binder' button in @Bubbler's repo.
Would be pretty cool if you know anyone writing documentation/examples as notebooks :)
 
RGS
7:59 AM
@xpqz doesn't nbviewer do more or less the same thing?
 
@RGS nbviewer is not interactive. Binder allows to try out your own code.
 
I can change @Bubbler's code and run it in binder.
@Bubbler in binder, can I refer to data files in the repo as normal? data←⊃⎕NGET'data/file.txt'1
 
@xpqz I think it should work, since it's basically the same kernel running in the cloud (with the file system)
 
ngn
this must be the most complicated way ever invented to run an interpreter
 
@ngn :D for sure. Cute, but a lot of magic.
 
8:15 AM
@Bubbler Added.
 
 
3 hours later…
11:06 AM
Now I want to do some APL
 
RGS
@HighlyRadioactive Seems like the sensible thing to do; might I ask you what made you decide that?
 
@RGS Boredom.
 
RGS
@HighlyRadioactive the noblest of causes
 
RGS
Do you know any APL? Or are you a complete beginner?
 
11:11 AM
Huh
I'm not a complete beginner
I'm a 99% beginner
 
RGS
Alright, and can you specify what is that 1% you know? E.g. can you sum the first N natural numbers?
 
The 1% I know is what Adam taught in that lesson
 
RGS
@HighlyRadioactive hm what lesson? Was it an Apl Cultivation? or was it a 1-on-1 session w/ you?
 
In this room
Apr 24 at 0:26, by Adám
@HighlyRadioactive Told you APL wasn't a golfing language :-)
(Search transcript with keyword "golfing language")
:55114686
 
Adam does that quite often here, @HighlyRadioactive; there's some transcripts of his lessons here aplwiki.com/wiki/APL_Cultivation that link back to this chatroom history. If you don't have anything specific to ask about, maybe one of those would be interesting?
 
RGS
11:24 AM
@HighlyRadioactive following up on TessellatingHeckler's suggestion, you might also want to pick a problem to solve with APL and we can just help you get there, teaching you what you need to learn in order to solve the problem.
 
Also if you're feeling dedicated, you've got about 10.5 hours left before the Dyalog APL Competition 2020 closes tonight, and you only need to solve two problems to be allowed to enter
 
11:47 AM
@TessellatingHeckler Yes I know
Every time I enter this room Adam is teaching someone APL
(That's the purpose of this room right?)
(When will 1+ be this popular?)
@TessellatingHeckler Tonight? In my timezone, it's already night.
Also wat is Dyalog APL Competition 2020
(Write APL Conway's Game of Life search tool)
 
@HighlyRadioactive No:
> Learn and teach, questions about both golfing and general coding.
 
@Adám Oh okay you win
 
@HighlyRadioactive Tonight in UK timezone, half a day away. It's dyalogaplcompetition.com
 
(Actually, I have problems writing CGoL search tools, even the most simple ones, and with even with my preferred language Python 2)
@TessellatingHeckler I feel like a noob
(Gets distracted by irrelevant links)
 
@HighlyRadioactive me too, I only APL basic things occasionally.
 
12:01 PM
@TessellatingHeckler "Basic" (to you) things? Like a red-black tree?
Also
shouldn't the "easy to learn" link link to this room
Also link the "previous winners" link here
and "learning resources"
and "online documentation" since people here is basically an online documentation! XD
 
@HighlyRadioactive Nothing like that; basic things like the "very easy" and "easy" programming problems on Edabit.com
 
@TessellatingHeckler That's modest
 
12:18 PM
not too untrue though; I'm mostly a PowerShell and Python scripter, and though I have a computer science background, APL is mad and far more math like than anthing else
 
Ha
> Announcement: APL Seeds ( a language based on random seeds where the output is fed into APL instead of Befunge)
 
12:33 PM
@HighlyRadioactive You can write it in Dyalog APL, which has Mersenne Twister as one of its RNGs, and the seed is configurable.
Just that it's possible, not that it's interesting.
 
Where's the APL cheatsheet?
 
@HighlyRadioactive This one? (warning: slightly out of date)
 
Yep
Oh, forgot, thx
 
12:56 PM
@HighlyRadioactive These days I prefer (and recommend) aplcart.info which lets you search everything on that reference card, plus a few more knick-knacks.
 
@Adám But if you search for ¯ for example you'll have to scroll along those snippets before seeing the operator description
 
@HighlyRadioactive The idea of APLcart is to find out how to do something, not what something does. For the latter, simply press F1.
 
It's annoying though
 
1:22 PM
Wow the competition is hard
I'll come back to CGoL search tool
 
1:37 PM
@HighlyRadioactive You can also type e.g ¯ syntax or + primitive.
 
part of the competition difficulty is the feeling "I bet there's a much nicer, neater reference answer than my code"
 
@TessellatingHeckler Correct, but add "golfier"
@Adám oh
 
@HighlyRadioactive Trying to use a Powershell golf answer to one of them, and it's being disallowed >_>
 
@TessellatingHeckler Wait, what‽ That should work.
 
@Adám ... how do you know it should work?
 
1:51 PM
@TessellatingHeckler Because Marshall managed to make the system accept a J answer.
 
@Adám you're thinking too cleverly for me. I doubt we're allowed to discuss good working solutions, but this doesn't work and is a poor APL solution anyway - I was trying to farm the work out to DateTime.IsLeapYear¨
 
@TessellatingHeckler That should work, but what does PS return?
 
{⎕using←'System'⋄ DateTime.IsLeapYear ¨⍵} 1900 1904
it works in DyalogAPL desktop, it just doesn't work in the competition site, saying VALUE ERROR, so I guess ⎕USING is blocked
unless you're suggesting ⎕cmd 'powershell...' should work 🤔
 
@TessellatingHeckler That's .NET, not PS, and TIO's APL doesn't have .NET.
@TessellatingHeckler Right.
 
@Adám technically yes; PS is basically ".Net Script" in my head; [datetime]::IsLeapYear(1900)
( the "proper" powershell golf answer is shorter than that code.golf/scores/leap-years/powershell )
@Adám well, it's no surprise, Marshall can do magic
 
2:07 PM
@TessellatingHeckler It isn't really hard. If you give me the correct ⎕CMD incantation, I'll see if I can make it work.
 
@Adám Thank you, but it's fine, it wouldn't be a useful route to go down from this context
 
2:49 PM
@TessellatingHeckler Could still be fun, but I don't know how to do the PS part. ⎕cmd 'powershell 2+2' works fine, but, I don't know how to use DateTime from PS.
 
The code `[datetime]::IsLeapYear(1900)` is powershell code, that's the syntax for calling .Net framework static methods, it will return true or false.
It won't handle an implicit map over a vector of inputs, so that would either need to be done on the APL side to put scalars into that call repeatedly and launch multiple processes, or it could be done on the PS side `$args | foreach-object { }` but I don't know how to connect the vector to the $args through the command line
 
3:17 PM
as far as i've gotten in the competitions problem 9, it seems it'd be way prettier in dzaima/APL with ⎕VI←1. (yes i know, there are like 7 hours left to submit, yay me :|; also implementing BQNs has finally made me not afraid of , who would have known)
(well not way prettier, but still)
 
@TessellatingHeckler {'T'=⊃⊃⎕cmd'powershell [datetime]::IsLeapYear(',(⍕⍵),')'}¨ should work, but I get a domain error on 1752
 
3:33 PM
that works for me in 17.1 Desktop edition, but NB I have to change it to

{'T'=⊃⊃⎕CMD'powershell -noprofile [datetime]::IsLeapYear(',(⍕⍵),')'}¨1752
(otherwise it runs my profile script which prints some output)
7 of the Phase I problems done
 
uh, cutting it close, much?
 
@Adám sure, if I started earlier I'd have to face that I can't do them, now I can blame it on "not having time" instead ;-)
 
3:46 PM
clever
 
@dzaima i haven't implemented however, so, as expected, i have no clue how it works. ¯\_(ツ)_/¯
 
RGS
4:02 PM
@dzaima what is ⎕VI? Dyalog 18.0 docs show nothing helpful
 
@RGS it's a dzaima/APL-specific thing, changes how things related to indexes with high-dimensional arrays work
 
RGS
@dzaima AH, ok :P
 
4:34 PM
stoopid edge cases
 
ngn
5:03 PM
@Bubbler only a byte short of matching that in plain dyalog: {2÷⍨⍺⊃⍵1,⍵+1}/b⊤⎕××/b←1,⍨⎕⍴3
 
ngn
5:25 PM
matched it! 27 bytes: {2÷⍨⍺⊃⍵1,1+⍵}/(,∘1⊤⎕××/)⎕⍴3
 
RGS
@Adám your keyboard does not have an upperscript 'a' similar to °, does it?
 
@RGS No, it only has a degree symbol.
 
RGS
@Adám Yup, that's what it looked like from the mapping image I got, just wanted to be extra sure.
In Portuguese we use upperscript 'o' and 'a' in some abbreviations and in ordinal numbers, that's why I was asking
 
@RGS You can't just use <sup>?
 
RGS
(often, those superscript 'a' and 'o' even come underlined)
@Adám of course I can! But that's in my blog or in places that have html support
 
5:32 PM
@RGS Right, you actually want &ordm;/&ordf;
@mocqoro Hi there. Interested in APL?
Roger Hui's APL equivalent for "Göde…" is Gö∇
 
6:14 PM
How are you supposed to code in Malbodlge
 
6:32 PM
@Adám I've always loved that one!!
Anyone remember how to apply a function to the deepest level of nesting in an array?
Having trouble finding in APLcart!
Eg.
    2+/ (1 2 3)⍬((4 5 6)(7 8 9))
(3 5)⍬((9 11)(15 17))
 
ngn
@AviFS is the deepest level the scalars?
i see. your example implies it's the vectors, not scalars.
 
@ngn No, no! Sorry, the deepest cells
@ngn Yeah, thx
Easier to see for the others:
┌─────┬┬─────────────┐
│1 2 3││┌─────┬─────┐│
│     │││4 5 6│7 8 9││
│     ││└─────┴─────┘│
└─────┴┴─────────────┘
If you apply {2+/ ... } something or another:
┌───┬┬────────────┐
│3 5││┌────┬─────┐│
│   │││9 11│15 17││
│   ││└────┴─────┘│
└───┴┴────────────┘
@ngn Any ideas?
I remember there's a way...
 
ngn
@AviFS something like {1<|≡⍵:∇¨⍵⋄..}
 
Of course, a simple scalar function like 1+ will automatically map over the various depths and preserve structure, but this one is slightly trickier...
 
@AviFS if there was the depth , it'd be (2+/⊢)⍥1, but it's not in dyalog
 
6:41 PM
@ngn Well, I suppose. I just could've sworn there was a better way. But maybe not...
@dzaima Hmm, maybe that's the conversation I was thinking about ^
So maybe there isn't a better way :(
 
ngn
@AviFS how is this tree of vectors created?
 
Should I just do the recursion, or work around it if possible?
@ngn Good question!
 
Isn't it dfns.saw?
 
@ngn I'm not really sure there's any overarching pattern to summarize though. Or how to do that succinctly
It's just something not that bad (not actually encoding anything remotely related to trees or recursion), that definitely could've been avoided with smarter coding
And could be refactored if I thought about it and undid a fair bit
@Bubbler I can't tell, but thanks a bunch for sharing that resource! If it's anything that gets libraries related though, I should definitely be able to figure out a better way! It's embarrassingly simple, really, what I'm trying to express here.
But thanks a bunch everyone! Oh depth operator, where art thou!
Perhaps a good reason not to implement it, is precisely because in some cases, like this, it encourages bad code. Or at least makes writing bad & inefficient code much easier ⍥
Not that it's a sufficiently good reason, or I'd ever argue it. But it's a counter-argument nonetheless
Much like Python's walrus operator drama that made Guido resign from BDFL :(
 
ngn
@AviFS the data structure itself encourages bad & inefficient code. can't you flatten the tree somehow?
 
6:49 PM
Do you need Depth? Here it is.
 
@Bubbler Thanks a bunch! Trying to avoid using the standard library for now, though, since I must be able to do better with this one
@ngn It actually started flat ⍥
Unflattening it was a preprocessing step
I could do it all in one go, but that's rather ugly
Analogy:
I only want to apply my function, to the n-tuples within each major cell of the flat array. And I know for certain that each major cell will have a multiple of n elements
So to pre-process, I did: {⍵⊂⍨1=n|⍳≢⍵}
Which if n←2 yields: (1 2)(3 4)(5 6) ≡ {...} ⍳6
 
ngn
@AviFS if you reshape to an n-column matrix and use the rank operator (⍤) it should be faster
 
And that would be done to each major cell within
@ngn Great idea! How does one do that again?
 
Each major cell = ⍤¯1
 
@Bubbler The 'reshape to an n-column matrix' part
 
ngn
6:57 PM
@AviFS example: n←4⋄a←⍳12⋄(2+/⊢)⍤1(⊢⍴⍨n,⍨n÷⍨≢)a
(or ⍤¯1 as bubbler says)
 
@ngn Processing...
 
ngn
in k9 creating the "matrix" is just n^a, by the way. used to be (0N;n)#a in older k-s.
 
@ngn Very impressed, thanks a bunch! Wanted to do this over several of these in a matrix, but still works:
      (2+/⊢)¨(⊢⍴⍨4,⍨4÷⍨≢)¨⍳¨4 8 12
┌─────┬────────┬────────┐
│3 5 7│ 3  5  7│ 3  5  7│
│     │11 13 15│11 13 15│
│     │        │19 21 23│
└─────┴────────┴────────┘
Is ⍤1 preferred over ¨?
 
I think so, performance wise
 
ngn
@AviFS for rectangular data usually yes
 
7:04 PM
@Bubbler @ngn Thanks a mill!!
 
ngn
note that mixes the result (as if with monadic ), so if your function returns arrays of different sizes, they'll be padded with a filler (0, ' '..)
 
@ngn Ah, thanks!
Any chance you simplified that from a dfn (aka non-tacit)? Because if you go from tacit→dfn it's beyond nightmares...
{(((≢⍵)÷4),4)⍴⍵}
 
ngn
@AviFS yeah, that should work
 
But the one you sent me doesn't do the tacit-agnostic readers any favors either.
@ngn It does, but hoping you had something more elegant
It's hard to come up with a dfn uglier than an ugly tacit
 
ngn
@AviFS you can save a few characters with swaps ()
 
7:15 PM
But with that one, the other was better
@ngn Sure, but one may as well do the tacit then
 
ngn
but i don't think there's an elegant n-column reshape in dyalog
 
I had thought given the additional flexibility of dfns, there might be a better way :(
@ngn Should seriously be a primitive by now! Anyway, thanks a bunch @ngn
Now that I know what we're looking for, all 4 possibilities are on APLcart:
It's basically the same, but the one you sent can be made into:
4(⍉⊢⍴⍨⊣,÷⍨∘≢)⍳12
@ngn The 4 possibilities in the link are quite neat!
 
 
2 hours later…
9:26 PM
@Adám Noticed that if you do an interrupt in the REPL while you're in the middle of running code from another namespace, you're left in that new namespace in the REPL. Makes perfect sense, but wondering if it wouldn't be more convenient to be put back in whatever namespace you were in before running the function. Is this intentional?
The worst part is certainly a bug. I'll add an issue tomorrow if I remember. I'm interrupting while a function is accessing one of the libraries and then when I try and edit the function it gives me a whole bunch of the library's documentation that it was mid-way through running.
Took a screenshot which I'm happy to share. Replicated it 3 times which is good enough for me!
 
@AviFS i don't seem to be experiencing that, at least on Linux/RIDE
(i've defined this inside a namespace (2 levels deep but i doubt that matters), interrupting with either strong or weak interrupt leaves me wherever I was before)
 

« first day (1283 days earlier)      last day (1374 days later) »