« first day (314 days earlier)      last day (562 days later) » 

ngn
12:02 AM
⎕←3⌽'ngn@' ⍝ just testing :)
 
@ngn
@ngn
 
12:52 AM
@all rank operator costs 6 bytes, right?
 
@Uriel Or seven, if you need a space. In some contexts, it may be cheaper to go all-Unicode.
 
@Adám am I doing it right? codegolf.stackexchange.com/a/149821/65326 (ignore the poor golfing)
 
@Uriel You mean usage of or byte counting?
 
@Adám I know it was shorter before I added rank, but nm, I like it better that way. Asking byte counting wise
 
1:05 AM
@Adám arghh. Guess I'm getting revision history back on
38 bytes are good enough I guess
 
1:43 AM
@Uriel 30<38
 
 
9 hours later…
10:18 AM
@ngn Roger is writing a blog post about scrambling the inner letters of text. How short and how fast can you do it? Current length and speed records are:
⍝ data:
r←' according to research it doesn''t matter what order the letters in a word are the human mind can still read it the only important thing is that the first and the last letters are in the right place'
⍝ shortest:
∊{' ',⍵[∪(1,⊢,⍨?⍨)≢⍵]}¨' '(≠⊆⊢)x
⍝ fastest:
∇  x←ab2 x;n;p;b;S;r
   r←n?n←⍴p←b/b>¯1⌽b←S∧(1⌽S)∧¯1⌽S←' '≠x
   (b/x)←(b/x)[⍋r+n×+\p]
∇
 
Ven
10:56 AM
according to not very good research :p.
 
11:16 AM
@Ven I thought so too, until I researched it.
 
11:47 AM
:41551010 Of course. I am asking you for two submissions. One short and one fast.
 
ngn
@Adám is dyadic ⊆ supposed to work like this? {⎕ml←3⋄⍺⊂⍵}
 
@ngn Yes. That's is its definition.
 
ngn
@Adám with ⎕io←0 I get an error and with ⎕io←1 it doesn't preserve the last letter
@Adám I'm talking about the short solution
 
@ngn Hah, you're right!
@ngn ⊢,⍨?⍨ is wrong
 
12:06 PM
@ngn In that case, the current shortest (working) solution is ∊{' ',⍵[∪1,{⍵,⍨?⍨⍵-1}≢⍵]}¨' '(≠⊆⊢)x
 
ngn
@Adám extra whitespace is tolerated?
 
@ngn No, but input has exactly one space before each word (even the first).
 
ngn
@Adám r[⍋(?≠⍨r)++\1,⍨1 1,' '∊¨4,/r]
⎕←{⍵[⍋(?≠⍨r)++\1,⍨1 1,' '∊¨4,/⍵]}' according to research'
 
@ngn

Rebuilding user command cache... done
Was OFF -fns=off
VALUE ERROR
 __field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on''⊣enableSALT' ⋄ ⎕←{⍵[⍋(?≠⍨r)++\1,⍨1 1,' '∊¨4,/⍵]}' according to research'
                                                                                                    ∧

Real time: 1.062 s
User time: 0.965 s
Sys. time: 0.037 s
CPU share: 94.37 %
Exit code: 0
 
@ngn You have an r
 
ngn
12:15 PM
⎕←{⍵[⍋(?≠⍨⍵)++\1,⍨1 1,' '∊¨4,/⍵]}' according to research'
 
@ngn
 aodnccrig to racreseh
 
I'll leave you two relative experts to do your thing.
 
@ngn I just came up with:
⍞←∊(2∘↑,{⍵[2+?⍨≢3↓⍵]},⊢/)¨' '(=⊂⊢)' according to research'
 
@Adám  adcocrnig to racseerh
 
What challenge is this for anyway?
 
12:17 PM
@Zacharý Internal Dyalog challenge.
 
Oh, and why is ngn doing it? He isn't in Dyalog ...
 
@Zacharý He is the best APL golfer I know.
 
Ven
He's good :P.
 
Yeah, I agree, he and marinus are basically APL-golf Dennises
 
ngn
Thanks, people. I'm flattered :)
 
12:19 PM
@ngn Can I send it to Roger?
 
ngn
@Adám it doesn't look golfed enough yet
 
@ngn OK, I'll give you a few hours.
 
Adám ... is again sort of like Dennis ... being that he works at Dyalog (akin to how Dennis created Jelly)
 
Wizards, both of them. Wizards, I say!
Also, good morning everyone o/
 
@J.Sallé :
⍞←⎕TS
 
12:23 PM
@Adám 2017 12 5 12 23 5 667
 
I'm in UTC-2 :p atm
 
ngn
@Adám is there an APL model for Stencil that can work in older versions?
 
@ngn Yes:
assert←{⍺←'assertion failure' ⋄ 0∊⍵:⍺ ⎕SIGNAL 8 ⋄ shy←0}

T←{
  (⍺⍺{f←⍺⍺ ⋄ (3.2=⎕nc⊂,'f')>'⍺'∊⎕cr'f'}⍬)⍺⍺{⍺ ⍺⍺ ⍵}{
    ⎕io←0                          ⍝ ⎕io delenda est
    assert 0<⍴⍴⍵:
    assert 2≥⍴⍴⍵⍵:
    assert(2>⍴⍴⍵⍵)∨2=≢⍵⍵:
    assert 0<⍵⍵:
    assert ⍵⍵≡⌊⍵⍵:
    (s m)←↓(⍉1,⍨⍪)⍣(2>≢⍴⍵⍵)⊢⍵⍵     ⍝ size and movement
    assert(≢s)≤⍴⍴⍵:
    assert s≤(≢s)↑⍴⍵:

    ws←(≢s)↑⍴⍵
    n←⌈m÷⍨ws-~2|s
    j←⊃∘.,/⊂⍤0¨↓¨(m×⍳¨n)∘.+¨⍳¨s    ⍝ indices required to select each cell
    c←⌊2÷⍨s-1
    y←(ws+2×c)↑(-ws+c)↑⍵           ⍝ argument padded with fills
 
ngn
@Adám wow, thanks :) I didn't expect it to be more than 2-3 lines :)
 
@ngn It really isn't, but this model has argument checking and optimisations.
@ngn ngn/apl?
 
ngn
12:31 PM
@Adám no, Dyalog v15
 
@ngn C'mon apply for a license!
@ngn Do you want too?
 
ngn
@Adám I'm not a student and I hate filling in forms :)
@Adám I have ⍸ and the others, but my stencil didn't work with an even-sized window
 
@ngn Just email Karen and ask her to renew.
 
@Adám +1 to whoever came up with ⍝ io delenda est
 
ngn
@Adám I use these: github.com/ngn/apl-codegolf-2017 (near the bottom)
@J.Sallé that's Roger, no doubt
 
12:34 PM
@ngn well, +1 to Roger, then. Very clever.
 
ngn
⎕←{⍵[⍋(?≠⍨⍵)++\1,⌈/' '=⊢⌺4⊢⍵]}' according to research'
 
@ngn Your @ ignores left args, and what about f@i? Your ⍺⍸⍵ does not handle chars (or large arrays…). Your ⊆⍵ does unnecessary work (no need to attempt to enclose simple scalars).
 
@ngn
 aidnocrcg to rsecaerh
 
ngn
@Adám well, I used them only for the golfing challenge, I don't claim 100% correctness
 
@ngn You've used K too much: ⌈/∨/
 
ngn
12:42 PM
@Adám same thing
@Adám would there be any virtue in making it a train?
 
@ngn Great minds think alike.
 
ngn
⎕←{⍵[⍋0+∘?¨⍨+\1,⌈/' '=⊢⌺4⊢⍵]}' according to research'
 
@ngn
 aridnoccg to reacserh
 
ngn
@Adám I think at this point I can give up. I can turn it into a train which is maybe shorter (depending on how you count), but it would become unreadable even for us old APL-ers.
 
@ngn I don't think you can. You have too many derived monadics.
 
Ven
1:00 PM
⌊/÷.-⊂,⌈/ huh. nice one...
 
ngn
@Ven I think that's the trick that made the difference between winning and second place :)
⎕←(⊂⊃¨⍨∘(⍋+\+∘?≠⍨)1,(' '∊⊢)⌺4)' according to research'
 
@ngn
 adccnoirg to rsaeecrh
 
Ven
well, I didn't complete mine.
not good enough to compete :-). I got somewhat close tho.
 
@ngn Hehe, my very saying "I don't think you can." has causality…
 
ngn
@Adám I don't like trains though. They are hard to read on a higher level than a beginner's "apl is hard to read". Functions at odd and even positions have completely different meaning, so you have to be aware of how squiggles group together and the parity of where the group is.
 
Ven
1:14 PM
needs some kind of visual mode ;p
 
@Ven Like this:
⎕←⊂⊃¨⍨∘(⍋+\+∘?≠⍨)1,(' '∊⊢)⌺4
 
@Adám
┌─┬───────────────────────────────────────┬───────────────────┐
│⊂│┌─────────┬─┬─────────────────────────┐│┌─┬─┬─────────────┐│
│ ││┌─────┬─┐│∘│┌─┬─────────────────────┐│││1│,│┌───────┬─┬─┐││
│ │││┌─┬─┐│⍨││ ││⍋│┌─────┬───────┬─────┐││││ │ ││┌─┬─┬─┐│⌺│4│││
│ ││││⊃│¨││ ││ ││ ││┌─┬─┐│┌─┬─┬─┐│┌─┬─┐│││││ │ │││ │∊│⊢││ │ │││
│ │││└─┴─┘│ ││ ││ │││+│\│││+│∘│?│││≠│⍨││││││ │ ││└─┴─┴─┘│ │ │││
│ ││└─────┴─┘│ ││ ││└─┴─┘│└─┴─┴─┘│└─┴─┘│││││ │ │└───────┴─┴─┘││
│ ││         │ ││ │└─────┴───────┴─────┘│││└─┴─┴─────────────┘│
 
Ven
Yes, that's the joke :).
that is a tad too big :).
 
@Ven ⊢ ?
 
Ven
@Adám see here
 
1:19 PM
@Ven Yeah, that's a font issue. OS/browser?
 
Ven
@Adám os x high sierra(10.12.2)/chrome 61.0.3163.100 64bits
I see how ngn's work now. Well. I had tried some very convoluted approach to be honest.
I still need to finish that APL Autumn tournament video, I'm halfway through.
 
⎕←0 0⍴⎕SE.UCMD'box -t=tree' ⋄ ⎕←⊂⊃¨⍨∘(⍋+\+∘?≠⍨)1,(' '∊⊢)⌺4
 
@Adám
    ┌─┼─────────────┐
    ⊂ ∘           ┌─┼─┐
    ┌─┴─┐         1 , ⌺
    ⍨ ┌─┴──┐        ┌─┴─┐
  ┌─┘ ⍋ ┌──┼────┐ ┌─┼─┐ 4
  ¨     \  ∘    ⍨ · ∊ ⊢
┌─┘   ┌─┘ ┌┴┐ ┌─┘
⊃     +   + ? ≠
 
@Ven ^ should look better for you.
 
Ven
indeed
 
1:23 PM
Maybe I should change the default output.
#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''⊣enableSALT'⋄⎕←%args%

Language Aliases:
apl-dyalog -> [apl]

Message Aliases:
)help -> %handle% [Dyalog APL Language Elements](help.dyalog.com/16.0/Content/Language/Introduction/…)
)ref -> %handle% [Dyalog APL Reference Card](docs.dyalog.com/16.0/ReferenceCard.pdf)
)about -> %handle% You can evaluate an APL expression by typing it into chat prefixed by ⍞←. Use ⎕← in
 
#tio alias command ⎕← #TIO run apl-dyalog (⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT'⋄⎕←%args%
 
@Adám Added alias for ⎕←
 
⎕←⊂⊃¨⍨∘(⍋+\+∘?≠⍨)1,(' '∊⊢)⌺4
 
@Adám
    ┌─┼─────────────┐
    ⊂ ∘           ┌─┼─┐
    ┌─┴─┐         1 , ⌺
    ⍨ ┌─┴──┐        ┌─┴─┐
  ┌─┘ ⍋ ┌──┼────┐ ┌─┼─┐ 4
  ¨     \  ∘    ⍨ · ∊ ⊢
┌─┘   ┌─┘ ┌┴┐ ┌─┘
⊃     +   + ? ≠
 
1:25 PM
@Adám :41552410 do you read this top-down or left-right?
 
@J.Sallé Bottom-right–top-left
@ngn So I can email Roger now?
 
@Adám duh, sometimes I forget it's APL >.> But then again, we start at the bottom-rightmost squiggle and read up, then left?
 
@ngn Do you want to try for too?
@J.Sallé Ah, I guess it should be right-bottom–left-top. 4 comes first, followed by
The (' '∊⊢)⌺4 reads as indicate spaces for every pair of letters including their neighbours.
 
@Adám as well as ≤. seriously, that's a pretty mad train. what does ⊆ stands for?
 
@Uriel is {⎕ML←3 ⋄ ⍺⊂⍵} but I'm just using ∊⊆ as the function /.
 
1:41 PM
@J.Sallé ain't UTC-2 a mid Atlantic time zone?
 
UTC−02:00 is a time offset that subtracts 2 hours from Coordinated Universal Time (UTC). == As daylight saving time (Northern Hemisphere summer) == Principal cities: Nuuk === North America === Greenland - West Greenland Time most of island, including south, west and northwest coasts, including Qaanaaq (except Thule Air Base) - observes European Union DST rules Saint-Pierre and Miquelon (France) - observes North American DST rules - sometimes called PMST, Pierre & Miquelon Standard Time == As standard time (all year round) == === Atlantic Ocean === Brazil Atlantic Islands - Fernand...
 
@Uriel my actual TZ is GMT-3, but we're currently observing DST
Also, I think Fernando de Noronha Island is GMT-2 normally
 
@Adám hmm how do you kick items out while partitioning? Non 1/0 value?
 
@Uriel removes items indicated by 0. And if is Boolean, then it cuts there too. Hence the to merge back together without the removed items.
 
⎕←0 0 1 2 3 0 1 2 2 4 0 0 5 6 1 2⊆'abcdefghijklmnop'
 
1:47 PM
@Uriel
┌─┬─┬─┬─┬──┬─┬─┬──┬─┐
│c│d│e│g│hi│j│m│no│p│
└─┴─┴─┴─┴──┴─┴─┴──┴─┘
 
@Adám so it cuts if alpha is not equal to the previous and non boolean, eh?
 
@Uriel It cuts if ⍺ is larger than the previous. It also removes elements indicated by 0.
@Uriel notice that 6 1 caused 'no'.
 
@Adám yeah, that's why I said no Boolean. Apparentaly it's no greater than
 
@Uriel Yes. Which is weird, but useful at times.
 
@Adám I don't know the word weird when it comes to APL.
 
2:01 PM
@Uriel I think in APL it's spelled ⍵∊⍳⍴∆ >.>
 
ngn
@Adám Sure. I suspect Roger may be able to make it even shorter.
@Adám I don't... performance is hard to measure.
 
and are both useful, but both are also limited in there own way. However can potentially be extended to become much more powerful. If we allow integers, they indicate how many partitions to begin here. E.g. 1 0 3 0 1 0⊂'ABCDEF' should give 'AB' '' '' '' 'CD' 'EF'.
 
@J.Sallé you switched from symbolic resembelance to phonetic >.>
 
And then we can also allow having one more element in than in to add trailing empties: 1 0 3 0 1 0 2⊂'ABCDEF' gives 'AB' '' '' '' 'CD' 'EF' '' ''
 
@ngn well, he can just create a 6 byte unicoder that do just that and put it inside dyalog APL
 
2:11 PM
@Uriel Or a one-byte ASCIIer. % and $ and " and ` are waiting…
 
@Adám why won't dyalig use % for infinity? It bears some resemblance
 
@Uriel 1) We could use . 2) We could use ¯. 3) CXO says infinities, indeterminates, and NaNs over his dead body.
Yay! Stencil is online. Game of life in four bytes: 3∊me
 
@Adám ...non toroidal
 
@Uriel Just add a T in options for a Torus.
@Uriel It also handles an infinite world (I).
 
@Adám I have some uses in mind for that language
 
2:33 PM
 
@Adám cooolll
 
3:01 PM
@ngn Marshall responds: Using floating-point roll rather than deal biases it ever so slightly towards keeping letters in the same order, since two letters in a word might get the same value. So while I certainly don't want to do battle with Nickolov in the realm of code golf, I'm not sure he can declare victory here. Then again, it can be fixed up with only two more characters, which leaves it one shorter than mine: ⊂⊃¨⍨∘(⍋?⍨∘≢+≢×+\)1,(' '∊⊢)⌺4
 
 
1 hour later…
ngn
4:14 PM
@Adám technically true :) I accept his argument
 
@ngn That being said, Marshall has clearly taken "design clues": the following solutions are slightly faster than Morten's and only 32 characters:
{⍵[⍋(?⍨∘≢+≢×+\)1,⍨1 1,4∨/' '=⍵]}
(⊂∘⍋(+\≢×1-¯2⌽≢↑4∧/' '∘≠)+≢?≢)⌷⊢
The dismembered chipmunk could save us a character, but it's not a very fast creature.
 
@Adám You people need a raise for coming up with this stuff
Also, I vote for a )quote function for the chatbot to quote a random comment from APL's original implementation.
 
 
2 hours later…
6:48 PM
@Adám got a list of aliases you've created in the bot for here? Mainly asking because I'd like 'test' aliases for my devleopment of the Python fork of TioBot.
(it's mostly functional)
 
#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%

Language Aliases:
apl-dyalog -> [apl]

Message Aliases:
)help -> %handle% [Dyalog APL Language Elements](help.dyalog.com/16.0/Content/Language/Introduction/…)
)ref -> %handle% [Dyalog APL Reference Card](docs.dyalog.com/16.0/ReferenceCard.pdf)
 
hmm, cool. Time to go test things :P
 
@ThomasWard TioJ?
 
@Adám both TioJ (the Java Tio library) and TioBot which uses TioJ.
 
7:06 PM
@ThomasWard Hey, you're cheating ;-)
 
@Adám diamonds are fun :)
point not withstanding, the Tio request handling library works fine.
even have some tests that work too :P
so making CI work is a good thing :P
but the headache is custom aliases...
 
8:07 PM
@Adám what pitimes function is round?
 
@Uriel Is this a riddle? :○
 
@Adám no, just an urgent golfing issue
 
@Uriel I don't get it. You mean round as in closest int? As in which x rounds y with x○y?
 
@Adám yeah, math.round(y)
 
@Uriel Normal rounding is ⌊.5+
 
8:43 PM
@Adám why can't one set PP inside a dfns?
 
⍞←{⎕PP←34 ⋄ ⎕←⍕÷3}⍬
 
@Adám 0.3333333333333333
 
⍞←{⎕FR←1287 ⋄ ⎕PP←34 ⋄ ⎕←⍕÷3}⍬
 
@Adám 0.3333333333333333333333333333333333
 
@Uriel What do you mean?
 
8:54 PM
⍞←{⎕PP←2 ⋄ ⎕←⍕2÷3}⍬
 
@Uriel 0.67
 
Ok that's weird
@Adám ↑
 
@Uriel ⎕PP is localised in the dfn. Then the value is returned and needs to be displayed, the global ⎕PP applies. You are allowed to put it outside. But is shorter.
 
9:30 PM
@Adám ok thanks, I used format anyway before. btw that's a part of an answer I'm revising, and PP is set with the left argument, not an arbitrary value
 
@Uriel Even better when you can make it into a train as naturally takes the left argument, e.g. ⍕∘(some code which only applies to ⍵)
 

« first day (314 days earlier)      last day (562 days later) »