« first day (1121 days earlier)      last day (1532 days later) » 

4:16 AM
I am making so little progress on a non-yikes answer to that challenge
Was about to say I can get the acronym from the longest run of caps, which fits all the test cases - but just now thought of a case it won't handle. And that's ((⊃∘⍒≢∘⊃⍤0)⊃⊢)(⊢⊆⍨⎕A∊⍨⊢) which isn't particularly short.
Or I can get it from the first characters, which are bounded on the left by a space, with 2⊃¨((' ',⊢)⊂⍨' '=' ',⊢)s which is perhaps more reliable but the string needs preceding with a space to pick up the first one at the start of the string.
Or I can find the locations of the acronym in the string by the caps which are bounded on the left by a space, and on the right by another caps, OR-ing the bitmasks ⍸((1↓¯1⌽(' '(⊣=,)⊢))∧((1∘⌽∧⊢)(⎕A∊⍨⊢)))s which again isn't short
and I have no plan what to do next
other than the recursive approach, treating it like a tree structure; can't seem to make use of ⎕R to replace text with nested vectors, can't seem to use @ without getting things like PIPER Is PIPER Expanded Recursively│I│P│E│R│ │I│s│ where only the first letter is removed and the rest is kept - and all the letters turn into cells.
"The previous output @ the indices of the acronym ⍣ until count times" except power can't do something no times
Haven't tried partitioning into Acronym/Not-Acronym and pushing onto a stack, but can't see it being nice code or easy code
(*AND-ing the bitmasks)
 
4:53 AM
⎕←2{⍵{1↓(' ',⊃¨⍺⊆⍨' '≠⍺)(' ',⊂⍵)(⎕SE.subs)' ',⍺}⍣⍺⊢⍵}'GNU''s Not Unix'
 
@Bubbler
┌──────────────────────────────────────┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│┌──────────────┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐│'│s│ │N│o│t│ │U│n│i│x│
││GNU's Not Unix│'│s│ │N│o│t│ │U│n│i│x││ │ │ │ │ │ │ │ │ │ │ │
│└──────────────┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘│ │ │ │ │ │ │ │ │ │ │ │
└──────────────────────────────────────┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
 
5:10 AM
⎕←0{⍵{1↓(' ',⊃¨⍺⊆⍨' '≠⍺)(' ',⊂⍵)(⎕SE.subs)' ',⍺}⍣⍺⊢⍵}'GNU''s Not Unix'
 
@TessellatingHeckler
GNU's Not Unix
 
isn't enclosed
 
I thought zeroth iteration shouldn't be enclosed. And boxing is wrong anyway
 
⎕←1{⍵{1↓(' ',⊃¨⍺⊆⍨' '≠⍺)(' ',⊂⍵)(⎕SE.subs)' ',⍺}⍣⍺⊢⍵}'YourYOPY Own Personal YOPY'
 
@TessellatingHeckler
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬──────────────────────────┐
│Y│o│u│r│Y│O│P│Y│ │O│w│n│ │P│e│r│s│o│n│a│l│ │YourYOPY Own Personal YOPY│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴──────────────────────────┘
 
5:13 AM
@Bubbler I dunno; it isn't in the () examples, but it looks like it is in the example nested boxed version
 
⎕←2{ac←' ',⊃¨⍵⊆⍨≠⍵⋄(⍵⊂⍨1↓⊃∨/(-1,≢ac)⌽¨⊂ac⍷' ',⍵){(⊂1↓ac)(⊂⍵)(⎕SE.subs)⍺}⍣⍺⊂⍵}'YOPY Own Personal YOPY'
 
@Bubbler
SYNTAX ERROR
      ⎕←2{ac←' ',⊃¨⍵⊆⍨≠⍵ ⋄ (⍵⊂⍨1↓⊃∨/(-1,≢ac)⌽¨⊂ac⍷' ',⍵){(⊂1↓ac)(⊂⍵)(⎕SE.subs)⍺}⍣⍺⊂⍵}'YOPY Own Personal YOPY'
                      ∧
 
⎕←2{ac←' ',⊃¨⍵⊆⍨' '≠⍵⋄(⍵⊂⍨1↓⊃∨/(-1,≢ac)⌽¨⊂ac⍷' ',⍵){(⊂1↓ac)(⊂⍵)(⎕SE.subs)⍺}⍣⍺⊂⍵}'YOPY Own Personal YOPY'
 
@Bubbler
┌──────────────────────────────────────────────────────────────────┬──────────────┬──────────────────────────────────────────────────────────────────┐
│┌────────────────────────┬──────────────┬────────────────────────┐│ Own Personal │┌────────────────────────┬──────────────┬────────────────────────┐│
││┌──────────────────────┐│ Own Personal │┌──────────────────────┐││              ││┌──────────────────────┐│ Own Personal │┌──────────────────────┐││
│││YOPY Own Personal YOPY││              ││YOPY Own Personal YOPY│││              │││YOPY Own Personal YOPY││              ││YOPY Own P
 
⎕←2{ac←' ',⊃¨⍵⊆⍨≠⍵⋄(⍵⊂⍨1↓⊃∨/(-1,≢ac)⌽¨⊂ac⍷' ',⍵){(⊂⍵)@{⍵≡¨⊂1↓ac}⍺}⍣⍺⊂⍵}'YOPY Own Personal YOPY' ⍝ without dfns
 
5:23 AM
@Bubbler
SYNTAX ERROR
      ⎕←2{ac←' ',⊃¨⍵⊆⍨≠⍵ ⋄ (⍵⊂⍨1↓⊃∨/(-1,≢ac)⌽¨⊂ac⍷' ',⍵){(⊂⍵)@{⍵≡¨⊂1↓ac}⍺}⍣⍺⊂⍵}'YOPY Own Personal YOPY' ⍝ without dfns
                      ∧
 
⎕←2{ac←' ',⊃¨⍵⊆⍨' '≠⍵⋄(⍵⊂⍨1↓⊃∨/(-1,≢ac)⌽¨⊂ac⍷' ',⍵){(⊂⍵)@{⍵≡¨⊂1↓ac}⍺}⍣⍺⊂⍵}'YOPY Own Personal YOPY' ⍝ without dfns
 
@Bubbler
┌──────────────────────────────────────────────────────────────────┬──────────────┬──────────────────────────────────────────────────────────────────┐
│┌────────────────────────┬──────────────┬────────────────────────┐│ Own Personal │┌────────────────────────┬──────────────┬────────────────────────┐│
││┌──────────────────────┐│ Own Personal │┌──────────────────────┐││              ││┌──────────────────────┐│ Own Personal │┌──────────────────────┐││
│││YOPY Own Personal YOPY││              ││YOPY Own Personal YOPY│││              │││YOPY Own Personal YOPY││              ││YOPY Own P
 
@Bubbler 👀
 
6:08 AM
#tio apl-dyalog-extended ⎕←2{⍵⊂⍤⊣@{⍵≡¨⊂a}⍨⍣⍺∘⊂⍨⍵⊂⍨¯1↓a(-∘≢⍛⌽∨⊢)⍵⍷⍨⍥(' '∘,)a←⊃¨⍵⊆⍨≠⍵}'GNU''s Not Unix'
 
@Bubbler
   GNU's Not Unix   's Not Unix   's Not Unix
 
6:46 AM
@Bubbler does that cope with YourYOPY Own Personal YOPY? I think it's not
 
@TessellatingHeckler The task is to substitute prefixes only.
e.g. In GNU's Not Unix, GNU's is a word and GNU is a prefix of it.
 
@Bubbler It should still expand the last YOPY, the last test case in the question; your code encloses the whole thing and doesn't expand it; TIO
vs YourYOPY Own Personal (YourYOPY Own Personal (YourYOPY Own Personal YOPY))
 
7:49 AM
@TessellatingHeckler Fixed, 60 bytes
 
 
5 hours later…
1:00 PM
@Adám I refactored my code following your advice, and did part 2. Even when trying to be more explicit (less "golfy"), the code is still remarkably compact compared with my previous (admittedly hacked-out-quick) solutions in other languages.

Dyalog: https://github.com/xpqz/aoc-19/blob/master/day03.dyalog

Scheme: https://github.com/xpqz/aoc-19/blob/master/day03.rkt
Python: https://github.com/xpqz/aoc-19/blob/master/day03.py
 
1:17 PM
@xpqz Looks nice now. Dare I ask how you use that .dyalog file?
@xpqz Follow uses a default left argument of 0 0, right? Instead of specifying that when it is called, you can build it in by adding the line ⍺←0 0
@xpqz path1 {∪⍺∩⍵} path2 can be written as path1 (∪∩) path2 or simply ∪path1∩path2
@xpqz If DAY3 only has two rows, then path1←Pairs 0 0 Follow DAY3[0;] ⋄ path2←Pairs 0 0 Follow DAY3[1;] can become (path1 path2)←Pairs∘Follow¨↓DAY3 or you could even just batch them with paths←Pairs∘Follow¨↓DAY3 and then use crossings←1↓∪⊃∩/paths
 
1:35 PM
@Adám I've not figured out how to run a dyalog "script" from the command line on macos (I assume it's possible somehow). At the moment that file is a cut-paste job from a Jupyter notebook.
 
@xpqz You can pipe it into dyalog, but then your multi-line dfns will fail.
 
@Adám Aha -- that's a useful thing to know -- so ⍺←0 0 would only be executed the first time?
 
@xpqz Yes, it is special syntax meaning "if called monadically, then let ⍺←…"
@xpqz If you put around your multi-line dfns, piping should work.
 
Ok, handy to know. From what I can tell, Dyalog doesn't install itself in a "unixy" way on macos -- it would have been nice if it put a symlink or something in /usr/local/bin -- I can obviously do that myself, but not explored much beyond the jupyter kernel yet (which works wonderfully).
I'd love to be able to say #!/usr/local/bin/dyalog at the top of scripts
 
@xpqz The embarrassing reason is that it hasn't had proper support for scripts until now. The piping is really a hack. Rest assured, script support is coming…
 
1:44 PM
That gets a +1 from me.

On a more basic level -- the difference between trad-fns and dfns -- is one preferred over the other?
 
1:57 PM
@xpqz (… and tacit functions.) No, you should use whichever form is best for your purposes. If you're doing something functional, or for small inline helper-functions, dfns are best. Tradfns are good for larger structured functions and programs, especially if you have lots of conditionals and case statements etc. Tacit functions are good for tiny idiomatic things or to avoid a scope.
Basically, if you have a flow that splits based on some condition and then remerges, then I'd say go with a tradfn.
You usually don't want to let dfns have side effects, unless you're just using a tiny dfn as a helper to accumulate a variable.
 
 
1 hour later…
3:01 PM
@Adám What do you mean by dfns having "side effects"?
 
@TomCockram Like writing a file and then continuing with other tasks. Dfns even make it difficult for you, as they quit upon the first non-assignment.
 
@Adám ah that makes sense, thanks
 
dfns feel like writing scheme, but with fewer brackets. I like it.
 
4:01 PM
Hello everyone!
@fftwj In order to speak here, you need 20 Stack Exchange reputation points or the grant of explicit write access. If you want access, email me: adam@ with the domain of www.dyalog.com
@fftwj My mistake, you should have explicit access already.
@user708821 The above ↑↑ does apply to you, however. Email me if you want in.
 
@Adám - Minor infelicity that I discovered yesterday: I installed Dyalog-for-Ubuntu on my Mint VM (running in VMWare under Windows 10). While for a "Linux-on-the-iron" installation, WinKey is a good choice for the APL key, on a Windows-hosted VM, there's the risk of conflict with Windows' own use of it. Specifically, using WinKey+G both input ∇ into Dyalog and opened the Windows GameBar.
(Also, is there a GUI for Dyalog/Linux, and/or a console UI for Dyalog/Windows?)
 
4:18 PM
@JeffZeitlin There is RIDE which is identical on all OSs but we have no console UI for Windows.
@JeffZeitlin And WinKey+L will probably lock your PC rather than producing .
 
@Adám - Yeah, that's likely - or it'll do both, like WinKey+G did both. Which is why I mentioned it... I really wish the "Fn" key that seems to be common on pretty much all keyboards (for doubling up on the F-keys) was actually detectable by Windows, so it could be used as an application meta key.
 
@JeffZeitlin This is why I recommend AltGr (a.k.a. right-side Alt) for all platforms, at least for English keyboards. Alternatively, the backtick keyboard is an option, and I have an idea for an entirely different approach which doesn't use the traditional layout either.
 
Don't want to butt in, but does anyone have any tips for the 2016 counting challenge? It's seemed like a nice way to get used to the language, but I get a lot of bloat once I get to 10
 
@Adám the chat seems to be broken for the webinar?
 
@famous1622 You're always welcome to ask.
 
4:29 PM
@Adám - Hmmm... RIDE looks like it might be worth using on Linux... As far as AltGr, I default to using the US-International layout on my computers, which pre-empts AltGr (right-alt) to handle such characters as ß, ø, æ, and so on.
 
@TomCockram Yes, but feel free to ask/comment here, and I'll convey to Richard.
 
found two ways of writing it, both of which seem pretty wordy
 
@JeffZeitlin All of those can be written with my Windows AltGr keyboard.
 
(2~0)×a←1×6-a b←2⋄016-b+b+b
 
@famous1622 If that was intended for the bot, begin with or ⎕← (and I recommend 4 spaces before that too).
 
4:31 PM
⎕←(2~0)×a←1×6-a b←2⋄016-b+b+b
 
@famous1622
8
10
 
wait what?
 
What?
 
ig I only have one that evals to 10 then
still feels like there's a better way, probably just getting caught up in the restrictions though
 
@famous1622 b←2⋄016-b+b+b you mean.
 
4:33 PM
yeah
I think that's the shortest I'm going to get it
 
@famous1622 Think about how you can split the digits into multiple numbers, see if your target has a simple relationship to one of those numbers, then use the other to exploit the relationship.
 
@xpqz Largely a matter of taste. That being said, there is almost never a reason to use a trad function.
With control structures, you avoid naming many things, which of course is easier - naming is hard, but worth it.
While it may seem that programming without control structures is a limitation, it can have huge benefits.
Control structures promote laziness and contribute to technical dept.
 
@PaulMansour Dropping out of a loop early is hard with dfns.
 
Dfns require more thinking and design about the names of things, and more functions, as the functions themselves take the place of control structures.
Whats a loop? ;)
 
Is there a lesson today?
 
4:45 PM
@JPeroutek No, every other week. You can see the schedule here.
 
Gotcha, misremembered the date
 
@JPeroutek Any suggestions for topic?
@famous1622 It can be done with 7 characters. Do you want guidance for 10?
 
Nope, I'm far from an expert. I have little (or zero) understanding of Tacit functions, trains, and a few other topics
 
I got 7
forgot the number 5 exists
 
@famous1622 Huh?
 
4:49 PM
found the 7 character solution, I was thinking the wrong way
 
But you used 5 somehow?
 
1-6 = -5, 2*-5 = -10 -(-10)=10 so
⎕← ¯2×01-6
 
@famous1622
10
 
Sorry I'm not the best at explaining
 
5:05 PM
@Adám More seriously, is it more than just a guard?
 
@famous1622 That's a really nice one. I had 20÷≢1 6. Another nice one is 2×0-1-6
@PaulMansour You'd still be entering the looping dfn for each element, even if the looping dfn drops stops early. With a :For that has a conditional :Leave, you avoid any further processing whatsoever.
@JPeroutek Have you looked at the (tacit programming tutorials on APL Wiki](aplwiki.com/wiki/Tacit_programming#Tutorials)?
 
5:42 PM
Is there a fold that goes the oppsite way to /?
Or just reverse the rhs?
 
 
1 hour later…
@Adám Not sure what you mean by a "looping dfn". I generally think of looping in dfns as tail recursion, in which case the guard behaves just like :Leave, no?
 
@PaulMansour Let's say you want to find the first file that contains a certain pattern. You have a looping fn that is applied with ¨ to the file names, opens each and searches for the match, returning the match if found, and some placeholder value if not. Then you get the first non-placeholder value. Instead, with tradfn loop, you process the files in order until you find a match, save that, then quit the loop early.
 
7:15 PM
@Adám OK, sure. Clearly in that case you don't want to use the each operator but tail recursion (if one is staying in dfns) which allows exiting early, no?
 
@PaulMansour So you'd use recursion on the list, chopping one file name each time through until the condition is met?
 
Yes. Or I'll keep all the state in a namespace if there are a lot of things to track or for efficiency purposes.
 
7:38 PM
Using a namespace argument can of course break the guideline of avoiding side effects with dfns, but I don't think that is a good guideline.
 
 
1 hour later…
8:54 PM
@Bubbler split on not-string at the start is something I'm kicking myself for not seeing; I was so focused on trying to split into (acronym) (not acronym) sections in one move, or trying to work with (space word) as the separator only. I can follow most of it; it's neat
 

« first day (1121 days earlier)      last day (1532 days later) »