« first day (356 days earlier)      last day (2291 days later) » 

8:00 AM
@Uriel Why did you delete your find-the-letters solution?
 
 
9 hours later…
5:04 PM
@Adám if I have a boolean vector of size x, and need to index another vector of size x, how do I do it? I've tried doing boolvec ⍳ (⍳x) but it doesn't seem to work the way I assumed?
Just to clarify, I wanted to index a vector 1 2 3 4 5 6 with 1 1 0 0 1 0 so it'd return 1 2 5
 
Ven
@J.Sallé replicate? /
 
@Ven ...I had no idea replicate would do that >.>
I need to brush up on the lessons I guess
 
Ven
well if you replicate something 0 times... :P
I also need to start reading the lessons!
 
ngn
a 0-1 replicate is also known as "select" in the APL world and "filter" in the Lisp world
another way to achieve this is to use "where" (⍸) to turn the boolean mask into a list of indices
⎕←'ABCDE'[⍸0 1 1 0 1]
 
@ngn
BCE
 
5:18 PM
@ngn I tried using that as well (just not like this, so I failed :p). I think in my case using replicate is shorter
 
5:56 PM
@ngn I don't think I've ever heard "select". It used to be called compress before it was extended to positive integers..
@J.Sallé If you need it in a train, / may cause you grief. If you use a simple vector, then ∊⊆ may do what you want:
⍞←∊1 1 0 0 1 0⊆'ABCDEF'
 
@Adám ABE
 
@Adám In my case, using replicate worked fine. I'll keep the ∊⊆ trick in mind though
 
@J.Sallé Do you want golfing tips with that one?
 
@Adám sure, go ahead
I already golfed it a bit from {(+/¯1↓(0=⍺|⍨⍳⍺)/⍳⍺)=⍵^(+/¯1↓(0=⍵|⍨⍳⍵)/⍳⍵)=⍺}
 
@Adám That's nice, but a rule just came up that you should return falsy for equal values
so f 6 6 should be 0. I just fixed that in my code
 
@J.Sallé heheh, I have no idea what the challenge is ;-)
@J.Sallé OK, show me your new code, and I'll try to golf it again, this time taking note of each step so you have a chance study it.
 
 
1 hour later…
8:20 PM
@Adám Oh nice, thanks a lot! I was on my way home so I didn't see the message until now. Good news though, my internet is back :p
 
 
1 hour later…
9:43 PM
@ngn Can you simplify ×/ (∨\⌽<\⌽(⍴⍺)≠⍴⍵) / (⍴⍺)⌊⍴⍵ ?
 
ngn
10:25 PM
@Adám I'll try to. Which challenge is this?
 
@ngn TAO
 
ngn
×/⊃⌽(⍴⍺)(≠⊂⌊)⍴⍵
so, it multiplies together all dimensions after and including their last difference
 
@ngn correct. max number of elements necessary to compare before finding which precedes which.
@ngn Nice. You're the man! I'll ask that we send our TAO Axioms draft for your review before publishing. That is, if you're interested.
@ngn "Save" as in not mention?
 
ngn
... "spare"
bad English
 
:42322085 Yeah, it would be off-topic anyway. We're genuinely trying to add something valuable here. And you know we won't back off from existing features. (Or so I thought, MK has mentioned removing ⍺⍋⍵ !)
 
ngn
10:40 PM
@Adám second try :) don't give me anything to review as I'm too critical and people don't like being criticised
 
@ngn I, for one, appreciate your critique. What I hope to accomplish is to utilise your brains for error-checking and inconsistency-checking.
 
ngn
@Adám well, go ahead then
 
@ngn I'll email you when it is ready for review by the language group.
 
ngn
@Adám ok
 
@ngn Btw, its publication will bring my Iverson-number to 2. Yay!
 
ngn
10:47 PM
@Adám if you publish something together with Roger, you also get Erdos number 3 :)
 
@ngn Wow, Roger is listed as 2 on Wikipedia. But I think papers have to be peer-reviewed and published in recognised journals for the number to be official.
 
ngn
https://codegolf.stackexchange.com/questions/153109/3d-ascii-block-building/153159#153159
this answer of mine would benefit 1 byte from TAO
 
@ngn You mean remove the , right?
 
ngn
@Adám something like that, I don't remember the details, but I remember thinking about it :)
 
@ngn I have a feeling Dyalog APL will be the first programming language with a thought-through, working TAO.
 
ngn
11:03 PM
@Adám it's impossible - ns refs spoil it
 
@Adám what's TAO?
 
@ngn reffy stuff is not in scope. For actual "data". Roger calls them basic arrays.
 
ngn
@Adám you can be the okayest language :)
@Uriel total array order
 
@Uriel Total Array Ordering. All possible arrays are in a canonical order.
@ngn NARS's is not lexicographical (extended shortlex), J's is not total (two different arrays can occupy the same position in the order), K's is not arithmetic, Mathematica's does text normalisation, MATLAB auto-converts numbers to chars, PHP auto-converts strings to numbers, PowerShell's is unstable, ngn/apl's is just plain broken… The only one that I have no complaints about is Excel!
 
ngn
ngn/apl's is broken consistently with JavaScript's .sort() :)
I don't understand most of the other terms you use
@Adám out of curiosity, what does "K's is not arithmetic" mean?
 
11:17 PM
@Adám too long
 
@Uriel Interesting method though.
 
@Adám I have a 32 byter but I think I won't revive it
 
@ngn No, ⍋'abc' 'xyz' and ⍋'xyz' 'abc' both give 1 0 while JavaScript's ["xyz","abc"].sort() works fine.
 
ngn
@Adám 1:0 for JS :)
 
@ngn <0.5,1 gives 1 0 (all ints before all floats)
 
@ngn Ah, sort() converts to strings. Fail.
@ngn NARS sorts 'xyz' before 'abcd' because it is shorter.
 
ngn
@Adám as designed in the EcmaScript standard
 
@ngn So how do you sort numbers in JavaScript?
 
ngn
@Adám .sort(function(x,y){return x-y})
@Adám you pass a comparator function as argument
 
@ngn I see. Yeah that cmp function is what we're trying to design.
 
ngn
11:28 PM
@Adám in Python they had .sort(cmp=...) but they changed it to .sort(key=...)
@Adám so now it's a function that returns a "sorting key" for each element
 
ngn
@Adám I should learn to read J...
 
@ngn It first, I thought Python2 had proper TAO, but upon further investigation, it turns out it sorts by the English name for its data types!
 
ngn
@Adám well, any better ideas?
 
@ngn /: is and ; is {⍺⍵} and < is but works on scalars.
@ngn Sure, sort by the French name for its data types!
@ngn Why French you ask? Well, which type of organisation sorts the most letters?
 
ngn
11:34 PM
@Adám l'Academie? :)
 
@ngn Post offices! And the international postal language is French, don't you know‽
 
ngn
@Adám I didn't know there's an international postal language :)
@Adám where do you stand on the []ct argument?
@Adám it would be interesting to see how they reconcile TAO and comparison tolerance
 
@ngn Mathematica at least has a consistent progression from numbers via formulas to text. If it just wouldn't "normalise" - to spell m-i-n-u-s!
@ngn ⎕CT←⎕DCT←0 for TAO.
 
ngn
@Adám great :)
 
@ngn This is already the case:
⍞←1=1-⎕CT
 
11:40 PM
@Adám 1
 
⍞←⍋1,1-⎕CT
 
@Adám 2 1
 
ngn
hahaha :)
I once tried tally uniq of 1 + a random permutation of very small numbers, and it was fun :)
 
@ngn What would you expect? Every carpenter knows that A=B, B=C ⇏ A=C. I do think that Roger made some improvements to that in 17.0 though.
 
ngn
@Adám you can't fix it, it's theoretically broken
@Adám that's what you get when you learn programming from carpenters :)
 
11:46 PM
@Adám wat
Why does it behave like that?
 
@Uriel Because 1-⎕CT is in fact slightly smaller than 1, but they are tolerantly equal.
 
@Adám why are they equal for comparison but different for grading
 
NH.
@ngn but when you learn programming from Jewish carpenters... the code is amazing beyond belief
 
@Adám why are they equal for comparison but different for grading?
 
@Uriel Grading is always exact (otherwise it wouldn't be stable). = is subject to ⎕CT but you can always set ⎕CT←0 if that's what you want.
@NH. Welcome to the APL chat room!
 
11:50 PM
@Adám that should prevent a custom grading (i.e. grading by given comparison function) if dyalog plans to add any
 
NH.
@Adám thanks. mind if I play with your chatbot?
 
@NH. I don't mind if it is for APL.
 
ngn
@NH. Jewish or otherwise, "uniq" needs transitivity in order to split an array into equivalence classes; []CT kills transitivity
 
@Uriel It has been proposed as an alternative to my proposal for simple sorting primitives.
@ngn Not the only thing it kills, but it is very practical nonetheless. Here:
 
@NH.
 
NH.
11:53 PM
)about
 
@DyalogAPL Are you feeling alright?
)about
 
@Adám
 
NH.
lol, what I was wondering
 
#tio alias view
 
@Adám
Command Aliases:
⍞← -> #TIO do apl-dyalog ⎕TRAP←(0 1000)'E' '''ERROR: Use ⎕← for a full error report'''⋄⎕←%args%
⎕← -> #TIO run apl-dyalog (⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''←box on -fns=on -trains=tree''⊣enableSALT⋄'''''⋄⎕←%args%
) -> #TIO do apl ⎕←('%args%'⍳⍨S/t)⊃(S←~t∊⎕A,819⌶⎕A)⊂t←'+ConjPlus-NegMinus×SgnMult÷RecDiv*ExpPow⍟LnLog⌹InvDiv○PiTrig!FactBin?RollDeal|AbsMod⌈CeilMax⌊FloorMin⊥Base⊤Number⊣Left⊢Right≡DepthMatch≢TallyNatch∨GCD∧LCM⍲Nand⍱Nor↑MixTake↓SplitDrop⊂EnclPartdFirstPick⊆NestPart⌷Index⍋Asc⍒Desc⍳Inds⍸WhereInterv∊ListIn⍷Find∪UniqUnion∩Inters~NotExc/ReplRed\ExpScan⌿Repl1Red1⍀Exp1S
 
11:54 PM
Oh, I get it.
#tio alias rcommand )
 
@Adám removed alias for ")"
 
)help
 
NH.
oh
 
@NH. There you go. My bad.
 
NH.
11:55 PM
wicked trick there
 
⎕←2=/+\1,9⍴⎕CT
 
@Uriel
1 1 1 1 1 1 1 1 1
 
NH.
+23
 
@NH. You need ⍞← or ⎕← in front.
 
NH.
oh is THAT how it picks it up...
⎕←+23
 
11:57 PM
@NH.
23
 
NH.
ok.
 
⍞←=/2 2J1E¯14-0
 
@Adám 1
 
⍞←=/2 2J1E¯14-1
It seems to have trouble with multiple commands in rapid succession.
⍞←=/2 2J1E¯14-1
 
@Adám 1
 
11:58 PM
Now watch:
⍞←=/2 2J1E¯14-2
 
@Adám 0
 
Wat?
 

« first day (356 days earlier)      last day (2291 days later) »