« first day (1125 days earlier)      last day (1522 days later) » 

1:13 AM
#tio do j echo 'test'
 
@Jonah test
 
@Adám I thought about this again and finally found an improvement over Marshall's idea. In tacit form, his was:
#tio do j echo (_2-~/\[:I.2~:/\0,,&0) 1 1 0 0 0 1 1 1 0 1 0 1 1
 
@Jonah 2 3 1 2
 
I came up with:
#tio do j echo (#/.~@#[:+/\-.) 1 1 0 0 0 1 1 1 0 1 0 1 1
 
@Jonah 2 3 1 2
 
1:17 AM
The key idea was to realize that the number of zeros to the left of each chunk of ones is invariant, and so you can use that fact with a scan sum to create a mask that can then be used for key /..
 
1:38 AM
@Jonah That's clever. I got different code with same byte count:
#tio do j echo (0-.~0#;._1@,]) 1 1 0 0 0 1 1 1 0 1 0 1 1
 
@Bubbler 2 3 1 2
 
Simply prepend a zero, do self-interval cut with frets removed (;._1), get the lengths of the intervals and remove zeros.
 
2:35 AM
@Bubbler, Thanks. That's nice too.
 
 
13 hours later…
3:35 PM
Is there a clever way to generate an inclusive integer range? Best I could think of was to←{⍺,⍺↓1+⍳⍵} but seems a bit wasteful.
(for ⎕IO←0)
 
@xpqz Shorter, but still wasteful: to←{⍺↓⍵,⍨⍳⍵} or use the to from dfns :-)
@xpqz Non-wasting: to←{⍺+⍳⍵-⍺-1}
@xpqz Shorter AND non-wasting: to←⊣+∘⍳1+-⍨
 
lolwut..? I understand the first two...
 
@xpqz Do you understand to←{⍺+⍳1+⍺-⍨⍵} ?
 
So the crooked smiley means flip arguments, as I understand it a trick to avoid (parens).
So I think that's the same as {⍺+⍳⍵-⍺-1}, more or less
 
@xpqz Yes, it modifies a function to use its arguments swapped, but no, it doesn't avoid parens in this case. Tacit functions don't refer directly to their arguments, only in terms of function application. So - means left arg minus right arg, but we want right arg minus left arg. We can't move the arguments, so we modify the function to use its arguments swapped.
@xpqz Yes, exactly, which is how I came up with it. Btw, adding backticks (`) around your code makes it easier to read (and avoids clashes with markdown).
 
3:50 PM
Reading tacits doesn't come naturally to me yet.
 
@xpqz You know about how to make the interpreter help you parse them in the head?
 
4:07 PM
Nope?
 
@xpqz Do ]box on -trains=value where "value" can be one of parens or tree or box, then jsut enter your train into the session. E.g. the bot is preset with tree:
⎕←⊣+∘⍳1+-⍨
 
@Adám
┌─┼────┐
⊣ ∘  ┌─┼─┐
 ┌┴┐ 1 + ⍨
 + ⍳   ┌─┘
       -
 
I see.
Nice
 
4:29 PM
@Adám - I have the instructions for that game I described to you last week partially written out; I'm tweaking them a bit and doing a sanity check on the scoring options I came up with. My guess is that it's best linked from the Learning Resources page, but can you recommend the best section of that page to add the link?
 
@JeffZeitlin Hm, difficulty depends on settable parameters… I think"For novice APLers" as it is intended to sharpen skills. Makes sense?
 
@Adám - Indeed it does, although the game does require at least one experienced APLer as Master...
 
You could include a reference to this room as a place to pick up a master :-)
 
NARS2000 has 5..10 syntax to generate inclusive integer ranges, fwiw
 
@TessellatingHeckler Right, and both Extended and dzaima have 5…10
Extended even has some tricks up its sleeve:
 
4:41 PM
@Adám triple dots? are double dots already taken?
oh it's one character?
 
#tio run apl-dyalog-extended
⎕←…¯10 ⋄
⎕←'a'…'zA'…'Z' ⋄
⎕←6 7 8 9 10 20…50 100 ⋄
⎕←5.5 5.6…6.3
 
@Adám
0 ¯1 ¯2 ¯3 ¯4 ¯5 ¯6 ¯7 ¯8 ¯9 ¯10
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
6 7 8 9 10 20 30 40 50 100
5.5 5.6 5.7 5.8 5.9 6 6.1 6.2 6.3
 
@TessellatingHeckler Yes, it is an
An ellipsis (plural ellipses; from the Ancient Greek: ἔλλειψις, élleipsis, 'omission' or 'falling short') is a series of dots (typically three, such as "…") that usually indicates an intentional omission of a word, sentence, or whole section from a text without altering its original meaning.Opinions differ as to how to render ellipses in printed material. According to the Chicago Manual of Style, each dot should be separated from its neighbor by a non-breaking space. Such spaces should be omitted, however, according to the Associated Press. A third option, illustrated in the opening sentence of...
@TessellatingHeckler I'd rather not overload . even more than it already is (decimal, object, inner product, outer product, and some even use it as way to be sure to cause a syntax error).
 
:53628961 heyy, PowerShell 7 has 'a'..'f' style character ranges too!
but not the cooler other ones
 
@TessellatingHeckler Can you give me an example of that working?
 
4:51 PM
@TessellatingHeckler - I think the 1..10-style ranges in PowerShell go back to PowerShell 3
@Adám - trivial example: 1..10|ForEach-Object {$_} will print each number from 1 to 10 on a separate line.
 
@Adám You'd have to install PowerShell 7, it won't work in Windows PowerShell 5.1 - but after that just 'a'..'q' at a prompt and it will generate characters, .net System.Char types for that range
@JeffZeitlin They do for integers, for characters it's new
 
@TessellatingHeckler - Ah! Never actually had occasion to want it for anything other than integers.
 
@JeffZeitlin I think it mostly comes up in CodeGolf; I'm surprised it made it in, really.
 
@TessellatingHeckler - No, it does make sense, when you consider that you can address hash tables using array subscript notation.
@TessellatingHeckler - And Pascal has had that notation since it was invented, including for user-defined TYPEs.
 
@JeffZeitlin How does that follow?
 
5:53 PM
@TessellatingHeckler - Consider a hashtable t with named members 'a' through 'z' (t=@{'a'=$foo; 'b'="bar"; 'c'=$baz.quux; ...}). If I want to process each of the members individually, with the new construct, I can do 'a'..'z'|ForEach-Object {Process-Object -UseObject $t[$_]}. The equivalent in earlier PowerShells was ... contorted.
 
 
3 hours later…
8:28 PM
@JeffZeitlin Sadly your hashtable keys are System.String, and your lookups are System.Char and they won't find them, and I've tripped over that plenty of times. You would have to 'a'..'z' -as [string[]] | foreach-object {..}
 
8:49 PM
@TessellatingHeckler - Ummm... Good point; I'm actually a little surprised that the conversion has to be forced rather than implicit.
 

« first day (1125 days earlier)      last day (1522 days later) »