« first day (3899 days earlier)      last day (1027 days later) » 

12:48 AM
def split_key(control, data):
groups = {}
order = []
count = 0
for key, item in zip(control, data):
key = repr(key) if type(key) == list else key
if key not in groups:
order.append(key)
groups[key] = []
groups[key].append(item)
count += 1
result = [groups[key] for key in order]
if count < len(data):
result.append(data[count:])
return result
Blah
def split_key(control, data):
	groups = {}
	order = []
	count = 0
	for key, item in zip(control, data):
		key = repr(key) if type(key) == list else key
		if key not in groups:
			order.append(key)
			groups[key] = []
		groups[key].append(item)
		count += 1
	result = [groups[key] for key in order]
	if count < len(data):
		result.append(data[count:])
	return result
 
 
4 hours later…
4:25 AM
in The Reading Room, 32 secs ago, by bobble
Jun 12 at 16:33, by bobble
? https://literature.stackexchange.com/q/13/11259
just now, by bobble
in The Reading Room, 32 secs ago, by bobble
Jun 12 at 16:33, by bobble
? https://literature.stackexchange.com/q/13/11259
just now, by bobble
just now, by bobble
in The Reading Room, 32 secs ago, by bobble
Jun 12 at 16:33, by bobble
? https://literature.stackexchange.com/q/13/11259
hehe
 
 
1 hour later…
5:46 AM
test
test
⎕←test
⎕←test
⎕←test
⎕←test
hello
 
⎕←test
 
@hyper-neutrino executing code test
 
5:58 AM
\`
`
 
hello
world
hello
world
3 3 ⍴ ⍳ 9
⎕←3 3 ⍴ ⍳ 9
 
  3 3 ⍴ ⍳ 9
1 2 3
4 5 6
7 8 9
 
⎕←3 3 ⍴ ⍳ 9
⎕←3 3 ⍴ ⍳ 9
⎕←3 3 ⍴ ⍳ 9
 
  3 3 ⍴ ⍳ 9
1 2 3
4 5 6
7 8 9
 
⎕←3 3 ⍴ ⍳ 9
a
⎕←3 3 ⍴ ⍳ 9
 
6:09 AM
  3 3 ⍴ ⍳ 9
1 2 3
4 5 6
7 8 9
 
6:46 AM
⎕← 3 3 ⍴ ⍳ 9 ⋄ 2 2 ⍴ ⍳ 4
 
   3 3 ⍴ ⍳ 9 ⋄ 2 2 ⍴ ⍳ 4
1 2 3
4 5 6
7 8 9
1 2
3 4
 
`\`
\
⎕← +\ 1 2 3 4 5
 
   +\ 1 2 3 4 5
1 3 6 10 15
 
⎕←+\1 2 3 4 5
 
  +\1 2 3 4 5
1 3 6 10 15
 
6:52 AM
⎕←'`'
 
:58418412 abc
 
⎕←'\`'
 
@ExperimentalAPLBot abc
def
@hyper-neutrino
Does this ping you?
 
6:55 AM
it makes the sound and brings up the circle in the corner of my avatar but it doesn't highlight the ping in the message :P
 
:58418431
Does this?
 
nope :(
 
So maybe use the explicit @username form for multiline output
 
yeah, looks like i'll have to do that
 
Does this ping you?
@hyper-neutrino
 
7:00 AM
yes
 
abc
`⎕←⍳3`
OK, good.
⎕←⍳4
 
oh should i also match four spaces plus ⎕←... or diamond ...
 
Sure, if not too much work.
 
that should be hopefully easy to add... assuming i'm not dumb :p
 
Are you sure you don't mind me asking for features?
 
7:08 AM
Yeah, I don't mind - I can't promise I can devote too much time to this but I have enough experience with python discord and SE chat bots and it's a fun project :)
`
the messages i receive on the backend delimit by <code>...</code> which prevents needing to worry about parsing markdown and how backslash or backtick escaping works out :P
it is time to parse HTML with regex
abc<code>def</code>ghi
abcdefghi
those are indistinguishable from the backend it seems :/
oh wait - i am doing html unescape. one of them might be different
abcdefghi
abc<code>def</code>ghi
yeah they're html entities
ofc
hello
world
hello
hello
world
@NewPosts STATUS
 
7:28 AM
RUNNING: [1] 1 1

[07:27:03] request: chat.stackexchange.com/chats/124926/messages/new
[07:27:03] request: chat.stackexchange.com/messages/ack
[07:28:51] status: 1
RUNNING: [1] 1 1

[03:21:40] request: chat.stackexchange.com/messages/ack
[03:27:03] request: chat.stackexchange.com/chats/124926/messages/new
[03:27:03] request: chat.stackexchange.com/messages/ack
 
⋄hello
 
⎕←a ⎕←b ⎕←c ⋄d ⋄e
a
⎕←a ⎕←b ⎕←c ⋄d ⋄e
 
⎕←a ⎕←b ⎕←c ⋄d ⋄e
 
7:40 AM
e
 
⎕←a ⎕←b ⎕←c ⋄d
⎕←a ⎕←b ⎕←c ⋄d
⎕←a ⎕←b ⎕←c ⋄d ⋄e
 
⎕←a ⎕←b ⎕←c ⋄d
 
@hyper-neutrino This doesn't look right. It would need quotes to print letters like that.
 
ik - i'm just trying to parse the input properly :p
but yes, thanks
 
7:46 AM
OK, sorry to disturb.
 
no worries i don't mind at all :)
⎕←a ⎕←b ⎕←c ⋄d ⋄e
 
⎕←a
 
hello
world
<code>hello</code>
⎕←hello
⋄world
1234
⎕←hello
abcd
⋄world
efgh
1234
⎕←hello
abcd
⋄world
efgh
a
1234
⎕←hello
abcd
⋄world
efgh
a
1234
⎕←hello
abcd
⋄world
efgh
 
7:58 AM
1234
⎕←hello
abcd
⋄world
efgh
 
1234
⎕←hello
abcd
⋄world
efgh
 
hello
world
 
⎕←'hello' and also ⎕←'world'
⎕←'hello' and also ⎕←'world'
 
@hyper-neutrino unexpected bot error running this code; if this persists, please contact a developer
 
⎕←'hello' and also ⎕←'world'
 
8:04 AM
@hyper-neutrino unexpected bot error running this code; if this persists, please contact a developer
 
⎕←'hello' and also ⎕←'world'
 
hello
world
@hyper-neutrino
 
⎕←'hello' and also ⎕←'world'
 
hello
world
@hyper-neutrino
 
⎕←'hello' and also ⎕←'world'
 
8:10 AM
hello
world

@hyper-neutrino
 
⎕←'hello'
⎕←'world'
⎕←'hello'
 
@hyper-neutrino hello
 
⎕←'hello'
⎕←'world'
 
hello
world

@hyper-neutrino
 
This line shouldn't be run.
⎕←'hello'
Neither should this line, but the one before and after it should.
⋄'world'
 
8:11 AM
hello
world

@hyper-neutrino
 
⋄3 3⍴⍳9⋄2 2⍴⍳4
 
1 2 3
4 5 6
7 8 9
1 2
3 4

@hyper-neutrino
 
⎕←'abc'
⎕←'abc'
 
⎕←'`\'
 
8:19 AM
@Adám `\
 
Fail!
@hyper-neutrino Maybe switch to multiline if output has any backslashes or backticks in it? (Unless you want to be more clever.
 
oh yeah since backticks can't exist at the end of code blocks i just move them out of the code block and pretend it's fine :p
@Adám i handle backticks and backslashes fine as long as there aren't trailing backslashes
⎕←'```\\`\`\`\\``'
 
@hyper-neutrino ```\\`\`\`\\``
 
using, in fact, the exact same as lynn's solution :P (but not golfed)
 
@hyper-neutrino Oh, cool. Then maybe switch to multiline if there's a trailing backslash.
 
8:22 AM
yeah, i'll do that (and if it's too long)
` `
@hyper-neutrino
 
⎕←'⎕←⍳3'
 
@Adám ⎕←⍳3
@ExperimentalAPLBot 1 2 3
 
o.O
should've anticipated that
` hello `
 hello
world
hello
 
Ah yes, you need multiline for leading and trailing spaces.
 
` hello `
 
8:29 AM
 abcd
 
` hello `
 
Actually no.
Even multi-line strips trailing spaces.
` abc`
` abc`
` abc`
abc
 
removing trailing spaces is... unfortunate but at least it shouldn't screw up formatting/alignment
 
abc
 
if the output is a single line is it acceptable to strip spaces? or should i just multiline it
the left alignment will become visible with the ping
 
8:30 AM
@hyper-neutrino Single line output can have trailing spaces.
 
right but i'm not sure how to include those
oh probably nbsps
 
a
abcd
@hyper-neutrino Huh, I just write them as normal spaces.
 
wait really?
hello
tf
a
that's annoying
so multiline can have leading spaces
 
SE chat ftw
 
and single line can have trailing spaces
thank you SE, very cool
 
8:36 AM
I'm less concerned about trailing spaces, so I say: If you need leading spaces on a one-liner output, switch to multiline.
 
alright, yeah that makes sense
\
`\
well we finally figured out a way to do that... but with a space at the end unfortunately
⎕←
⎕←'hello'
 
@hyper-neutrino hello
 
⎕←'hello '
 
@hyper-neutrino hello
 
⎕←' hello'
 
8:39 AM
 hello

@hyper-neutrino
 
⎕←'\'
 
@hyper-neutrino \
 
⎕←'\\'
 
\\

@hyper-neutrino
 
\\
⎕←'\\'
 
8:41 AM
@hyper-neutrino unexpected bot error running this code; if this persists, please contact a developer
 
⎕←'\\\\\'
⎕←'\\\'
 
@hyper-neutrino \\\
 
⎕←'a\\\'
 
a\\\

@hyper-neutrino
 
a\\\
\`\\
a`\\
`````
```\``
a`\
 
8:43 AM
 
a`b`c`\
\`\`\\
`abc`
okay so as long as it doesn't end with backslashes or (doesn't contain a leading backtick and doesn't contain any double backtick) i can inline it
 
ok that works
 
@hyper-neutrino Why are leading backticks an issue?
`leading backtick
 
because then you have triple backtick
the only way to have a trailing backslash is with double backticks which prevent escaping
 
Ah, that's what you mean. The combination of leading backtick and trailing backslash
Only in that case do you need to go multi-line, which isn't a problem, since there clearly isn't any trailing space.
⎕←÷0
 
8:46 AM
sorry just rebooted
 
Oh.
 
⎕←'`'
 
@hyper-neutrino `
 
⎕←'\\\\'
 
⎕←÷0
 
8:46 AM
@hyper-neutrino \\\\
DOMAIN ERROR: Divide by zero
      ÷0
      ∧

@Adám
 
Wait, you put the ping at the bottom?
 
⎕←'`\\\'
 
`\\\

@hyper-neutrino
 
⎕←''
 
@Adám <empty response>
 
8:47 AM
yeah. idk which makes more sense
 
I think at the top.
 
probably
 
And you don't need a blank line.
⎕←0 5⍴0
 
true
okay rebooted
 
⎕←0 3⍴0
 
8:49 AM
@Adám <empty response>
 
⎕←3 3 ⍴ 1 2 3 4 5 6 7 8 9
 
⎕←4 0⍴0
 
@hyper-neutrino
1 2 3
4 5 6
7 8 9
@Adám
 
:-)
 
hmmm
test
 
8:50 AM
SE chat doesn't allow leading or trailing blank lines.
 
.-.
at this point i'm tempted to just format every response into like
 
​
abc
 
@ping
--------------------
body
goes
here
--------------------
or smth silly like that
 
​
abc
​
​
 
8:51 AM
I added a 0-width space to the blank lines.
 
@hyper-neutrino That's really noisy, though.
 
yeah...
oh wait i can use zwsps for trailing backslashes too
 
Yeah, but they get included if one selects and copies text.
`\​
​ abc
 
oh :/
 
8:52 AM
Heh, leading zwsp to get leading spaces.
` abc`
 
oh wait i remember this being an issue a while back
where people's comments would get screwed with by zwsps
and people copying code out of comments on SO would run into weird issues popping up seemingly out of nowhere
 
Exactly, and especially with code.
 
i think i'll stick to just accepting blank lines disappearing
 
I think that's fine.
If you want to be really fancy, you could customise the <empty response> message by detailing what the response should be.
⋄⎕UCS 60 101 109 112 116 121 32 114 101 115 112 111 110 115 101 62
 
@Adám <empty response>
 
8:55 AM
@ExperimentalAPLBot No it isn't!
 
@Adám wdym?
 
It could say <5-by-3 all-space result>
 
oh that's very fancy. i'll see if i can figure out something good for that
 
Or even "Result is 5 3⍴''"
 
8:57 AM
Either way, the empty respons message shouldn't be code.
 
yeah, true. it's definitely a good idea to make that output more helpful too - i'll work on that tomorrow probably. i should go to bed now :)
thanks for the suggestions
 
No, thank you for making this. It is a huge plus for the community.
Sleep well.
 
i'm glad i can help :) thanks o/
 
9:11 AM
]state
⋄]state
 
@Adám
Operating system is Debian GNU/Linux 10 (buster)
APL interpreter is 64-bit Dyalog 18.0.39712.0 Unicode
Server is Jarvis 1.8.5
TryAPL version is 3.4.5
Expressions may run for up to 10 seconds
Workspace used: 2 / 512 kilobytes
 
So if I let a←⍳3 then what is ⋄+/a?
 
@Adám
VALUE ERROR: Undefined name: a
      +/a
        ∧
 
So if I let ⋄a←⍳3 then what is ⋄+/a?
 
9:13 AM
Thanks.
 
9:44 AM
I have a challenge for you all
I want you to rotate the string sns n 180 degrees
 
 
3 hours later…
12:19 PM
⎕←3 4⍴''
 
⎕←¯4↑'a'
 
⎕←4↑'a'
 
12:20 PM
⋄1234⌶0
 
@Adám
DOMAIN ERROR: ⌶ is limited to case conversion (819⌶) and date formatting (1200⌶)
      1234⌶0
           ∧
 
⋄⍞←1
 
@Adám
NOT PERMITTED: Illegal token
      ⍞←1
     ^
 
⎕←⎕←2
 
12:21 PM
⎕←a←2
 
@Adám <empty response>
 
@hyper-neutrino ^^ leave the ⎕← in.
 
 
1 hour later…
1:25 PM
will do
 
1:37 PM
@Adám do i need to watch for tabs
like will there be any whitespace in the output other than space and newline?
(well, not really newline in the output itself because of the return format)
 
@hyper-neutrino There could be tabs: ⎕←⎕UCS 65 9 66
 
Seems to "just work"
⎕←'a',⎕UCS 9
 
ah. okay
 
1:42 PM
⎕←'a',⍨⎕UCS 9
 
@Adám ` a`
 
Fail.
I guess you should deal with tabs as with spaces (but preserve them as tabs).
 
yeah
test
test
                a
@Adám how should we handle trailing whitespace-only lines? i can use a zwsp but that messes up copy-pasting, i can put an extra line at the end if there are trailing blank lines, i can add a note (in codeblock) indicating how many lines there were, or i can send an extra (non-code) message after that indicates how many lines there were
 
@hyper-neutrino (3 trailing lines)
blah



␄
 
oo cool
alright
should i only make ␄ appear in case of trailing lines
 
1:55 PM
Yes. I think the combination of the message and the unusual char makes it clear that the ␄ isn't part of the output (should you want to copy it).
 
alright
 
⎕←3↑''
 
@Adám <empty response>
 
This one is more important to deal with.
 
yeah i definitely need to change that response
 
1:58 PM
I think "Result looks like n m⍴''" would work
Where n is the number of lines, and m is the length of the longest line.
 
oh, even if it's like " \n "?
 

« first day (3899 days earlier)      last day (1027 days later) »