« first day (1547 days earlier)      last day (1115 days later) » 

1:54 AM
@rak1507 '{xlObj←⍎'xl'⎕WC'OleClient' 'excel.application' ⋄ xlObj.Evaluate⊂'SUBSTITUTE(ADDRESS(1,',(⍕⍵),',4),"1","")'}
LOL, seriously that was just a joke. But touche for pointing that out! Just when I thought I had it with a simple ⊤, edge cases started popping up. I'll have to think about neater ways to handle the edge cases (52 is a good example number to test, and so is 1 or 26 for that matter)
 
 
2 hours later…
4:10 AM
@JoshD That was exactly a question on a previous Dyalog competition, and the exact intended answer :D
@JoshD Usually it would be a map (finding index in the alphabet, or subtracting 64 from byte value if the alphabet is fixed) followed by a fold (26 times accum plus next). Only slightly less elegant than APL.
 
4:27 AM
@Bubbler Wow, yeah I just looked into it, it was on last year's competition. The presentation winner had it up on the slide for a second with all his Phase 1 solutions. Maybe that's how it was in my subconscious lol. But it really is the most natural solution to arrive at in APL
 
4:41 AM
It was one of those expressions where everything in the language just "clicked" right and I had to share with other APLers. I'll be holding on to it to show to other programmers who are interested in the language.
Obviously there are many expressions like that, it would be interesting to see everyone's favorite "go to" APL expression when showcasing the language to non-APLers
This is my favorite collection of them (far more cooler than excel column names to number) jsoftware.com/papers/50
I'm sure most of you have already seen that
 
5:23 AM
Aplcart describes ⊆ as being what is ⊂ in ISO APL. Then describes ⊂ as being partition on 1. Now, what I actually need is partition on 1.
Now, I can implement it myself like so: {⍵⊂⍨+\⍺}
 
ISO and Dyalog have swapped and .
 
Except that ISO doesn't have ⊆. Is my version the best one?
 
Or APL2 I guess
 
I'm pretty sure APL2 doesn't have it either.
 
I think the dfn would do the job (assuming works like 'bcd' 'ef'≡0 1 1 1 2 2⊂'abcdef' as Dyalog's does)
at least for vector args. Not sure about higher rank
and only for boolean left argument. Dyalog v18 extends to non-booleans which can't simply be emulated with ISO
 
5:33 AM
I'm still trying to understand trains. Is there a way to trainify my version?
It's crazy. I implemented trains and forks, they work, but I still don't understand them :-)
 
@EliasMårtenson (+\⍤⊣⊂⊢) or ⊂⍨∘(+\)⍨ or +/⍛⊂ with extensions
 
@dzaima Thanks. I still don't understand how it works though.
 
@EliasMårtenson Relevant reading
 
@dzaima I don't get how the ⍤ works in the first example
 
@EliasMårtenson The first one is a modified version of (⊣⊂⊢) (which is equal to just dyadic ), by also doing a +\ on the left argument. The second one is an expanded version of the 3rd, and the 3rd is just by definition applying +\ (typo'd :/) to the left arg before invoking
@EliasMårtenson f⍤g post-processes the result of g by f. So here it first computes ⍺⊣⍵, and then gets +\ of it
 
5:44 AM
@dzaima Oh I see. It's a completely separate feature compared to regular FN⍤X
 
@EliasMårtenson yeah. f⍤g is equal to (f g)
 
OK, that explains my confusion
I can sort of see what you did, but I'm still struggling to create my own.
 
@EliasMårtenson Have you seen the 3 webinars?
 
@Adám Very unlikely.
@dzaima I feel that using {...} feels much more natural to me. But I'm still willing to accept that it may be just a lack of experience with the trains.
 
i actually started by writing the wrong (+\⊂⊢) (looks quite obvious - you want +\ on the left, and the right argument on the right), then just added ⍤⊣ to fix it
 
5:47 AM
@EliasMårtenson Check out apl.wiki/tacit including all the resources at the bottom.
 
@Adám I will. Thank you very much.
 
@EliasMårtenson dfns are usually more natural, but sometimes longer :)
 
Would dfns ever be shorter if replicate and expand were not hybrids?
 
As I mentioned before, after I changed to not allow enclosed numbers anymore, I could clean up a lot of ugly hacks, and once I compiled it all the testcases just passed beautifully. The web version isn't updated since I can't ssh to the server from the office. I have to wait until I get home.
 
@Adám monadic functions
 
5:50 AM
@dzaima Monadic primitives, I guess.
 
But now I have to go and get myself some lunch. :-)
 
{f g h ⍵}f⍤g⍤h
@dzaima Monadic derived functions.
{f/g/h/i/⍵}f/⍤(g/)⍤(h/i)
 
@Adám why derived?
 
See example ^^
 
{|*÷-⍴⍵} is shorter than |∘*∘÷-∘⍴ and has no derived functions
 
5:56 AM
If the monadic functions are named (not primitive), they need to be separated by spaces, which has the same byte cost of chaining them with
 
@dzaima That's why I wrote "primitives".
 
oh, your 2 replies were 2 separate alternatives, in no way related or overriding one another
 
Yes, sorry.
 
RGS
6:26 AM
None of my business @dzaima, but are you already up, or still up? xD
 
@RGS already
9:25 here
yes i often sleep for approximately no time
 
where approximation is flooring by 8-hour unit
 
@Bubbler lol
 
And we can conclude that most people sleep for approximately no time :P
 
 
3 hours later…
9:09 AM
How do I use 2⍕ for complex numbers?
 
You don't :-(
> Y must be a simple real (non-complex) numeric array
 
oh well
 
9:27 AM
@rak1507 2⍕ ?
 
yea I wanted to format a complex number to 2 decimal places
 
Ah
One more feature that I didn't know of.
 
@rak1507 You can split the number into its Re and Im and format those.
 
yeah, that's what I ended up doing
 
APLcart material?
 
9:37 AM
nah, it's pretty obvious
 
CMC: Given an array N of complex numbers, round real and imaginary parts to Is decimals.
 
RGS
What is ¯8○Y?
The tooltip says ¯8○⍵ is ¯8○⍵ xd
 
{1 0J1+.×⍤1⍉⍺(⍎⍕)¨9 11∘.○⍵}
 
@RGS lol yeah someone must've got bored doing them
oh, no, it says -8○⍵
not ¯8○⍵
 
RGS
9:46 AM
@rak1507 What's the ⍎⍕ for?
 
@RGS rounding
 
RGS
@rak1507 Nvm
@rak1507 Well spotted.
 
maybe should be clearer, I misread it at first as well
 
Yeah, maybe it should have the whole formula.
It is the only one defined in terms of another
 
I wonder if any of these can be useful in golfing
other than when you actually need to do what it does
I was working on a convex hull question a while ago and used 12○ iirc, don't think I have the code now though :(
 

« first day (1547 days earlier)      last day (1115 days later) »