« first day (1325 days earlier)      last day (1330 days later) » 

 
1 hour later…
1:23 AM
Only loses to math+BQN.
 
 
1 hour later…
2:50 AM
@TessellatingHeckler So UTF-8 characters does give lower score because of multi-byte nature? I used to think only number of character matters...
 
@jimfan UTF-8 gives worse (higher number) score because many characters need multiple bytes each. Dyalog APL does not use ASCII character set, it uses a custom one, so it can represent the normal ⌊⌈⍣⍟⊂⊃∩⊇⊆... APL characters all in one byte each.
If you're just writing APL with numbers and text and standard things then you can count number of characters == number of bytes. If you go outside that, like those ≮ in the question, you need to switch to some other encoding like UTF-8 and count more bytes than characters
(does that make sense? I'm never sure with encoding things)
(otherwise, you could make a language with one symbol that solved the entire problem and count it as score 1, even though it took 40 bytes to encode the symbol - and that's the code)
 
<moon-child> nominally, there's apl classic, which uses one byte per symbol; and apl unicode, which uses utf8, so multiple bytes per symbol. However, there's github.com/abrudz/SBCS which makes an apl-specific encoding using one byte per symbol, which lets you count it that way for codegolf. However, this only works because there are fewer than 256 apl symbols
 
3:11 AM
@TessellatingHeckler Okay. So far I only list number of characters (instead of byte) alongside with my answer. After all I feel char/byte count doesn't matter too much because there is always answer shorter than mine.
My personal view is byte count has nothing to do with preciseness of the language/answer itself. Penalising APL or other languages for its charset defeats the purpose somehow.
For example the C expression "4<=4" and APL expression '4≤4' essentially express the same meaning. APL loses because '≤' is composed of 3 bytes (0xE2 0x89 0xA40). Preciseness of language comes with cost. The cost however does not undermine preciseness and the beauty of it. And beauty prevails.
 
<moon-child> how about ~4>4 - tied :)
 
how can I detect from the first of one symbol like ( to the next )
all I can see online is stuff like if they're correctly balanced and nested, but that's not relevant here, it should work for "blah ) blah ( blah ( blah )" and just take the () pair
I have a long and convoluted boolean masking
⋄ {⍵/⍨~s∧⌽∨\⌽<(']'=⍵)∧s←∨\<\'['=⍵}⍣≡⊢'blah ] blah [ blah [ blah ]'
 
@TessellatingHeckler SYNTAX ERROR
 
no there isn't
I can start with {'[]'∘.=⍵} which looks like a decent start
 
<moon-child> @TessellatingHeckler yes there is. 'The function requires a left argument' on the first <
 
3:27 AM
@jimfan I think it's no fun when someone posts a golfing language answer and they say "in my language % means 'read a number from stdin and generate the nth Mersenne Prime so it's 1 char".
what
⋄ {⍵/⍨~s∧⌽∨\⌽<(']'=⍵)∧s←∨\<\'['=⍵}⍣≡⊢'blah ] blah [ blah [ blah ]'
 
@TessellatingHeckler SYNTAX ERROR
 
I ran that, it worked, then copy pasted it
but copy it back from here to Dyalog, it's broken
something is treating \ as an escape
that should be <\ scan
⋄{⍵/⍨~s∧⌽∨\⌽<\(']'=⍵)∧s←∨\<\'['=⍵}⍣≡⊢'blah ] blah [ blah [ blah ]'
 
@TessellatingHeckler Adding a 1-byte built-in for a challenge is a loophole.
The bot is somehow not catching up
Btw, there's if you're worried about SE chat's weirdness.
⋄ +/2 3 4
 
@Bubbler 9
 
⋄ +/2 3 4
 
3:33 AM
@Bubbler 9
 
⋄ +/2 3 4
So it doesn't work with multiline code block
 
⋄{⍵/⍨~s∧⌽∨\⌽<\(']'=⍵)∧s←∨\<\'['=⍵}⍣≡⊢'blah ] blah [ blah [ blah ]'
I'm not posting a multiline code blockkkkkk
that was one line, no newline, four indent spaces
 
<moon-child> I'm not sure why it's not working. The bot is quite hackily written, and should probably be re-written
<klg> ⋄ -⍣=1
Execution timed out
 
bot aside, that does "first [" and "first ] after that" and a run of 1 1 1 between them
but it's so ugly
and it took so many hours to cobble together
 
4:44 AM
@TessellatingHeckler That is a multi-line block, in much the same way as 1 4⍴⎕A is a matrix, not a vector.
@TessellatingHeckler Cheating? ⋄ ∊'\[.*?]' '.'⎕S{~⍵.(Lengths⍴PatternNum)} 'blah ] blah [ blah [ blah ] blah'
 
@Adám 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
 
5:03 AM
@TessellatingHeckler Proper APL solution: ⋄ {l∧⌽∨\⌽<\(']'=⍵)∧l←∨\'['=⍵} 'blah ] blah [ blah [ blah ] blah ] blah'
 
@Adám 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
 
Oh, the Regex solution detects all such pairs, and you only wanted the first. ¯\_(⍨)_/¯ APL FTW.
Ah, here we go:
      Regex←≢↑0 1/⍨∘⊃'\[.*?]'⎕S 0 1
      ]runtime -c "Regex t" "APL t"

  Regex t → 3.5E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  APL t   → 1.4E¯6 | -60% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
      t←⎕UCS 31+?1000⍴95
      ]runtime -c "Regex t" "APL t"

  Regex t → 2.5E¯5 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  APL t   → 1.5E¯6 | -94% ⎕⎕
 
 
1 hour later…
6:30 AM
@TessellatingHeckler For large inputs, avoiding double-reversal improves performance:
      APL ←{l∧⌽∨\⌽<\(']'=⍵)∧l←∨\'['=⍵}
      APL2←{r∨l>∨\r←<\(']'=⍵)∧l←∨\'['=⍵}
      t←⎕UCS 31+?1e3⍴95
      ]runtime -c "APL t" "APL2 t"

  APL t  → 1.5E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  APL2 t → 1.8E¯6 | +16% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
      t←⎕UCS 31+?1e4⍴95
      ]runtime -c "APL t" "APL2 t"

  APL t  → 3.8E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  APL2 t → 2.4E¯6 | -38% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
      t←⎕UCS 31+?1e5⍴95
      ]runtime -c "APL t" "APL2 t"
@TessellatingHeckler If you just want to extract the text, then simple indexing does the trick: ⋄ ((⊢↑⍨¯1+⍳∘']')⍳∘'['↓⊢) 'blah ] blah [ blah [ blah ] blah ] blah'
 
@Adám blah [ blah
 
6:59 AM
how do I apply a function to specific indices of a scalar string?
 
@Razetime f@indices, except that f runs only once over the array of elements at the given indices
⋄ ⌽@1 3⊢'abcde'
 
@Bubbler cbade
 
like, ⎕C at indices 4 6 8 on 'abcdefgh' to give 'abcDeFgH'
 
⋄ ⎕C@4 6 8⊢'abcdefgh'
 
@Bubbler abcdefgh
 
7:02 AM
⋄ 1 ⎕C@4 6 8⊢'abcdefgh'
 
@Bubbler abcDeFgH
 
@Razetime ^
 
works perfectly
 
@Razetime "scalar string"?
 
what was the correct term
just scalar?
 
7:11 AM
Just string.
 
'abcdefgh' is a "character vector" or a "vector of character scalars".
@Bubbler That's slightly ambiguous though. Does it mean 'abcdefgh' or ⊂'abcdefgh'?
 
I use "string" for the former and the latter is "enclosed string" to me, but there are multiline strings and stuff...
 
how do i split a character vector at a list of indices?
 
Maybe I should add ⋄ 3 7{⍵⊂⍨⍸⍣¯1⊢1,⍺}'abcdefgh' to APLcart?
 
@Adám DOMAIN ERROR
 
7:18 AM
@DyalogAPL We should fix that
 
 
3 hours later…
RGS
10:09 AM
@Adám this helped a lot, yes. However, when I compare it to your previous two messages, I don't understand why (2 2⍴⍳4)⍳Y is different when Y ← 3 4 5 or Y ← (0 1)(2 3)(4 5).
From your explanation, it feels like these two are the same, because we first conclude that r is 1, because X is a matrix, so we are going to look for 1-cells in Y. But Y is itself a 1-cell because it is a vector (right?) so it just compares the whole Y with major cells in X
Then I would think it should return 3 but instead we get a LENGTH ERROR, but that is another story
 
Right.
 
 
4 hours later…
1:40 PM
@Marshall i think i figured out what you were saying. the joys of learning a new way of thinking
part i got stuck at was to include "⊣𝕩"
 
1:54 PM
21
Q: Find the Convex Hull of a set of 2D points

Dr. belisariusWhen you hammer a set of nails into a wooden board and wrap a rubber band around them, you get a Convex Hull. Your mission, should you decide to accept it, is to find the Convex Hull of a given set of 2D points. Some rules: Write it as a function, the point's list coordinates (in any ...

wish I knew the math to solve these kinds of questions
 
RGS
@Razetime maybe you don't know the math to derive the formula/algorithm (maybe you do!) but googling these things usually yields interesting search results
and it is often a nice learning opportunity
 
RGS
2:12 PM
Welcome @AndriyMakukha
When someone new shows up, Adám offers a personalised intro to APL; I believe you don't need one ;)
 
@AndriyMakukha Ooh, what an honour!
 
haha yeah
lot of the time its interesting
but one section of math relies on more math, which relies on even more math and so on..
I guess eventually I'll get somewhere
did Andriy leave?
 
RGS
@Razetime you will :)
 
Woo, Andriy Makukha who is now in HKU?
 
Yeah. Hello everyone.
I already "know" some of you from GitHub and APL Wiki. (Thanks, @Adám, for always improving my articles there.)
 
2:25 PM
My greetings from Hong Kong! Congrad you have the competition triumph this year.
 
Thanks. Greetings from Ukraine!
 
RGS
(@Adám not sure if this is a bug or not, but typing and pressing F1 opens the help page and puts focus on it. Hovering over ⍳ in the language toolbar and clicking "see more" opens the help page behind the interpreter (this is not specific to ))
(I would expect the help page to always be opened and focused, regardless of the method I use to open it)
 
Yes, you already reported this 2020-05-08. It is issue 18111.
 
RGS
@Adám ah ok, I forgot I had already reported it ⍥
 
2:40 PM
, by any chance, are you a student, @jimfan? There will be another student programming competition in two weeks.
Conveniently, the "phase 0" problem is almost the same as Problem 8 in the APL Problem Solving Competition 2020 😇
 
RGS
@AndriyMakukha is it a HKU competition or is it open to the "general public" (students)?
 
It's a worldwide university student competition sponsored by one French bank. Hong Kong and Singapore have their own division.
 
RGS
@AndriyMakukha Can you share the name of the competition, please?
 
Sure: Credit Suisse Coding Challenge
 
RGS
Thanks, will look into it!
 
2:45 PM
Unfortunately, APL is not in the list of the allowed programming languages, however...
 
RGS
@AndriyMakukha is this the page I'm looking for? It says the competition has ended
 
@AndriyMakukha I haven't been a student since 2007 :-) But thanks for letting me know
@RGS Looks like it is meaning the competition of 2019 has ended
 
@RGS @RGS, they didn't update the page yet since last year for some reason. I only have registration page link for HK & Singapore.
 
RGS
@jimfan Yup but I'd expect it to say something about the upcoming edition, no?
 
@RGS That's what I think too
 
RGS
2:50 PM
@AndriyMakukha Can you show me the link? Maybe I can guess the correct link for european individuals? (also, after you press the "reply" arrow, a new message starts with :XXXXXXXX. If you leave a blank space after that, the person you are replying to will be mentioned automatically)
 
Looks like it is still open to registration
 
Might as well try it out
 
@AndriyMakukha It isn't limited to students, or it it?
 
@Adám not exactly cheating, but the original question was with number patterns where regex wouldn't apply. I also did want all such pairs eventually, but was trying to get one pair working assuming that would be easier.
 
2:56 PM
@jimfan Yeah, this specific link is limited to university students from Hong Kong & Singapore.
Anyway, I think, APL ought to be added to popular competitive programming archives, such as Open Kattis or SPOJ.com. Particularly the last one: it even supports such exotic programming languages as BF and Whitespace, but not APL, K, J... :(
 
unsure if its been posted already but April creator did a (very) in depth talk about APL & april/lisp released yesterday
https://youtu.be/AUEIgfj9koc
 
@AndriyMakukha Such a pity. Anyway I wish you success with the Credit Suisse contest. And be very careful of the virus stuff when you are coming back here.
@cannadayr Such a great pastime for this weekend
Sorry a bit off-topic. I have the same sweater in green colour of Mr. Andrew Sengul......
 
3:15 PM
@cannadayr Interesting. By coincidence, there is a photo of Hong Kong Cultural Centre on the second minute of that video.
 
Indeed!
 
@AndriyMakukha I wonder if thats his idea of "array language in building form"
 
I am admiring the old computer keyboard with APL chars on it in 5:45 of the vid
 
RGS
@jimfan You can buy a keyboard with APL keys for yourself :P (this chat message is not endorsed by Dyalog Ltd. or any of its affiliates)
 
@RGS OMG it's a Cherry G80-3000. I guess I would need one (this chat message, too, is not endorsed by Dyalog Ltd. or any of its affiliates)
 
3:43 PM
I wonder if you can buy only keycaps
any good way to shorten it?
just tell me, don't modify pls
 
RGS
@Razetime Are you trying to golf it to the max or trying to make the dfn look better?
 
golf it to the max, surely
Hey there @user4069
 
RGS
@Razetime first things first; just delete the extra blank space that is doing nothing in there :P
 
gotcha
 
ngn
@Razetime when you have a lot of character/string literals, sometimes it helps to replace them with integers and do an indexing at the end
 
3:49 PM
oh, like replace all of it at the end
 
looks like you have repeats of (4×⌈⍵÷2)⍴ maybe making that a function could shorten it
 
yep, twice
 
RGS
@TessellatingHeckler and (4×⌊⍵÷2)⍴ as well, so maybe even an op might be worth. Just go with what saves more characters
probably an op isn't worth it. Defining an op is expensive because of {⍺⍺}...
 
not sure where to put it though
 
RGS
@Razetime e.g. {O←{4×⍺⍺⍵÷2}⋄...}
 
3:53 PM
⍺⍺ rounds it?
 
RGS
⍺⍺ is the left operand of your operator.
so ⌈O⍵ would do 4×⌈⍵÷2 and ⌊O⍵ would do 4×⌊⍵÷2
But don't take golfing tips from me :p
 
why not? :P
 
RGS
@Razetime Because I can't golf well
 
oh lol too bad
well, the function addition has added two bytes lmao
nvm, 1 byte
 
RGS
Perfect :P then have a go at what ngn suggested
 
3:59 PM
@AndriyMakukha Kattis is working on adding APL.
@jimfan See here too.
 
hmm, maybe decode by 4, encode, transpose, convert.
 
4:12 PM
@Razetime
 
@Razetime When input is 4, your code output is a character matrix of shape 3 10. If you can find a formula to deduce the character value (being one of '/__\' and space), you can generate an integer matrix of 3 10 and use this integer matrix to index the char array ' /__\'.
Not sure if it'd work best for you but that's how my mind goes when golfing.
 
yep pretty much what i was thinking
encode as 3xn with 4 distinct number, then convert it
 
@dzaima (down to 76 with non-non-trivial changes)
 
non-non-trivial?!
 
4:27 PM
@Razetime i wouldn't quite call the changes trivial, but they're not really non-trivial either
 
a lot of ⍨ is guess
 
@Razetime only 5 (so, ≡ 5 saved bytes)
 
hmm
 
@dzaima (another 2 off with slightly more non-trivial changes - the main function is now a fork, with the big dfn in the center)
 
oh god
 
4:35 PM
@Adám fantastic!
 
@dzaima (another -1 by squeezing more into a side of the fork to not need 2 s)
 
73 right
now to get it down to that myself
 
@Razetime yep
 
ngn
4:50 PM
i have 70 :P
 
@ngn i expected quite lower :p (at 72 now)
71
and 70 (using one more )
 
ngn
69 :)
68
67
 
5:06 PM
don't see any way to cut mine
 
ngn
{' \_/'[4|⌽0@0(2|⍵)@(2×~2|⍵)⌽0@0 1@0⊃,/{-⌽⍵}\(1+⍵)⍴⊂3 2⍴⍎¨⍕220332]}
 
@ngn ah, you completely rewrote it. i was just modifying Razetime's
 
ngn
@dzaima yeah, using ints and indexing
65: {' \_/'[4|⌽0@0a@(2×~a←2|⍵)⌽0@0 1@0⊃,/{-⌽⍵}\(1+⍵)⍴⊂3 2⍴⍎¨⍕220332]}
62: {' \_/'[4|⌽0@0a@(2×~a←2|⍵)⌽0@0 1@0⊃,/{-⌽⍵}\1⍵/⊂3 2⍴⍎¨⍕220332]}
 
19 in canvas because why not
 
ngn
60: {' /_\'[4|⌽0@0a@(2×~a←2|⍵)⌽0@0 1@0⊃,/{-⌽⍵}\1⍵/⊂3 3 3⊤19 23]}
59: {' /_\'[4|⌽0@0a@(2×~a←2|⍵)⌽0@0 1@0⊃,/{-⌽⍵}\1⍵/⊂⍉3 3⊤8 1 5]} and i think i'll stop here
 
 
1 hour later…
6:40 PM
presumably if this was possible you would have done it, but can {-⌽⍵}\ become -⍤⌽\ ?
 
6:51 PM
@TessellatingHeckler {-⌽⍵} is called dyadically, but -⍤⌽ is {⍺-⌽⍵}
 
@dzaima ahh, ok
 
7:29 PM
⋄<\0 0 1 0 0 0 1 0 0
 
@TessellatingHeckler 0 0 1 0 0 0 0 0 0
 
but why does the second 1 get turned off, isn't that doing 0 < 1 and should be 1 just like the first one?
 
@TessellatingHeckler remember that \ is O(n^2), and, in, in this case, is equivalent to </¨,\0 0 1 0 0 0 1 0 0
 
@dzaima why on earth would a running total be implemented in a way that's O(n^2) instead of O(n) ?
 
@TessellatingHeckler who knows. (Dyalog in particular optimizes a lot of f\s to O(n); i made it do the sane O(n) thing in dzaima/APL)
 
7:44 PM
I mean, why does it need optimising at all? On a vector, isn't it a map() which carries the previous result along with it? Where's the n^2 which needs optimising away?
@dzaima that looks like the output I would expect it to give from a naive understanding, yep
 
@TessellatingHeckler f\1 2 3 4 is 1 (1 f 2) (1 f (2 f 3)) (1 f (2 f (3 f 4))) - nothing in that is a duplicate so all fs must be individually executed
 
8:11 PM
IMO, it is a desirable or important characteristic of an APL to be well-suited for writing. Possibly even writing on a blackboard.
Sorry. writing on paper.
 
@eyepatch I know it was originally intended that way; who these-days wants an APL on a technology which can't execute it?
 
APL is suitable for use as an algebra and as a notation for describing problems and algorithms. Whiteboards, etc. are preferred in those contexts by many people.
 
@dzaima an APL where every dyadic function has ¨ over it and without that it's monadic
 
Related to using APL in proofs: youtube.com/watch?v=EJONZpNA81s @TessellatingHeckler
 
@eyepatch (is this related to scan having quadratic runtime, does that make it shorter to write or easier to comprehend?)
 
8:20 PM
Huh?
Did you mean to at dzaima?
 
were you saying that about APL being desirable to handwrite, in relation to the thing dzaima was explaining to me? or just saying it
 
Just saying it.
 
9:10 PM
<alexshendi> What is this <APLBot> stuff about? Are people talking somewhere else using arcane, newish software.
 
not sure how it looks on the IRC side, but i am writing this message from chat.stackexchange.com/rooms/52405/the-apl-orchard
 
10:04 PM
<alexshendi> Looks like this: "<APLBot> <dzaima> not sure how it looks on the IRC side, but i am writing this message from chat.stackexchange.com/rooms/52405/the-apl-orchard";
 
 
1 hour later…
11:09 PM
How do I get here from IRC?
 
<klg> it's #apl on freenode
 

« first day (1325 days earlier)      last day (1330 days later) »