« first day (2635 days earlier)      last day (2223 days later) » 
00:00 - 18:0018:00 - 00:00

6:02 PM
Would a pop-con to illustrate the limerick be on-topic?
 
Any KoTHers around? (@NathanMerrill?)
 
So I have a KoTH controller that I'm trying to keep language-agnostic
 
@Adám who wins
 
heh
written in?
 
6:04 PM
To accomplish this the bots write their moves to named pipes that the controller reads
Python
 
subprocess?
 
Yeah
 
It's actually just STDIN/STDOUT, looking at it (this is very old code)
 
I've written a class just for this, if you want me to pull it out
 
6:05 PM
then no i don't think it would be on topic per what the community has decided for popcons
 
The trouble Im having here is the input format. It needs to be as fast as possible for reading/writing while still being easy for a variety of languages
 
if there's no reason for a user to upvote something other than "i like this answer" then the community will close that challenge straight away
 
What I have currently is essentially just CSV
 
^^ This, if upvotes naturally map to the "best" solution, then pop-cons are fine. Most of the time, they don't
 
I'm not sure how bot writers would feel about it
 
6:07 PM
I think I did CSV format for most of everything
 
Do you think it's OK from a usability perspective?
 
CMpop-con: Illustrate this in your chosen language.
 
@Adám "voice"
 
An actually packed message, like a struct, would be even faster but would be annoying for higher level languages (in Python you'd have to use struct and what not). This is a decent compromise I feel
 
Passive-active is voice
 
6:09 PM
@FrownyFrog Yeah, I was wondering as I wrote that whether I was using the right grammatical term. Thanks.
 
For perspective, it should take the controller maybe 5 ms tops to parse a move. I figure JSON will be too slow
(the hard budget is 66 milliseconds, other stuff has to happen then)
 
CSV is definitely easy for parsing, if you have a flat structure
 
Here let me dig up the schema
in King of the Control Point, Jul 17 '16 at 0:01, by quartata
my x
my y
my z
my health
my clip
my pitch
my yaw
enemy x
enemy y
enemy z
enemy health
enemy clip
enemy pitch
enemy yaw
position of my grenade 1, midair?; position of my grenade 2, midair?; ...
position of my stickybomb 1, position of my stickybomb 2, ...
position of enemy grenade 1, midair?; position of my grenade 2, midair?; ...
position of enemy stickybomb 1, position of enemy stickybomb 2, ...
 
yep, you have nested
 
6:12 PM
Some of the last bits are like [[...,...],...] so I need nested yeah
Thats what the controller sends to the bot
The bot just sends three numbers separated by newlines back
I suspect constructing the game state is the big slowdown
So I need to think about this
 
so, what I'd do is x;y;z;health....gren1,midair1,pos2,midair2;stick1,midair1...
 
The tricky part is they need to know what grenades belong to whom
that's why I have separate lines for my vs enemy
 
...my format is equivalent to yours
 
I could have another Boolean but I figured two separate arrays would be easier for the bot
 
instead of newlines, I did semicolons, and you don't need semicolons between multiple grenades
 
6:16 PM
@NathanMerrill Oh, woops. I get it now
Since there will always be two elements you can make it 1D, you just flattened it
 
Yeah that would work
 
another format is protobuf
it's fantastic, is fast, but means that people need a protobuf library
 
Protobuf would be very good but I wonder if it's too much of a hassle for the bot authors
 
it's easy if you have a library
it's not if you don't
 
6:17 PM
Ideally I would use Protobuf, since I actually already have it in the controller for other things
Hmm
 
I've never actually used it in a controller
I moved to single-language challenges when I was considering it
 
This is already a fairly hard KoTH. would you as a potential answered bother if it meant needing Protobuf? that is the question
@NathanMerrill not everyone here is a big Python fan, I just wonder if making people use it would limit the answerers
 
well that sucks. Now i get why everyone in my school dislikes this science teacher. every single class besides us gets to go outside. Us, we have to stay inside and study. Yet we already took our science test and have no reason to study at the moment
 
It would be much easier for me to just call a function
 
well, I switched from Python to Java because I ran into speed issues. I've had people complain about it, but I feel like I've still gotten a decent number of submissions
it's obviously impossible to know how much it actually affected the number of submissions I got
 
6:20 PM
My only alternative to Python for this controller is C++. not gonna do that
 
annnd now i'm in trouble because i couldn't see a small number that was written in the bottom left corner of the board, out of my line of sight. >_>
 
Hm
 
I've ran one KOTH before and I used C++
I don't know what I was thinking
 
Well I mean requiring the bots to use C++
 
@qu
 
6:21 PM
would be a step too far
 
I've never done speed tests in Python. I'd test how fast method calls are vs pipe calls
 
@quartata they could technically use anything you can load from a .so
 
(I'd love that data)
 
@ConorO'Brien would you participate in a certain KoTH if you had to use Python
@moonheart08 That's true, although C++ answers would have to use extern "C" for me not to lose my mind
 
6:23 PM
@NathanMerrill method calls are certainly going to be faster than writing to a pipe
Although... Hmm.
 
I know. I want to know the factor
I've done the test with java
 
One of the advantages of the pipe is that the bot works asynchronously and queues up its moves
 
you can do async with a single language.
 
This is important design wise because I expect bots to occasionally miss the deadline for submitting a move, if it's computing something long-term
 
...when is this challenge coming? I'm actively writing a KotHComm server
 
6:25 PM
Conversely this lets bots submit multiple moves if it's certain of them and not gonna change them
@NathanMerrill well I wrote a controller for it two years ago
It's too slow though
Your server would probably not be able to handle this
 
it will boot multiple games up and run them at the same time
 
Your server would definitely not be able to handle that. This is going to have to be one match at a time
 
oh really? why?
 
matches could take about a minute, they're best of 3
@NathanMerrill It's hooking into a real video game
TF2, to be precise
 
a "match" is a game for my server
so, you could definitely run them in parallel
 
6:27 PM
Right but you'd need to be able to run multiple instances of SRCDS
(source dedicated server)
Also I wanted to have SourceTV on so people could watch it live, since it's real time
 
ew. yeah, I don't support that
I don't even allow a single instance of SRCDS :)
 
Whatever moves the bots have queued up would get run every ~66 ms, synchronized with the game
 
no external binaries
 
But the actual movement of things is at a human timescale more or less
I can increase host_timescale which increases the speed of the game, but I have no idea how that would affect the controller
 
...I feel like your controller shouldn't be anything more than a "server"
aka, you don't send the entire game state at once
you simply wait for commands, and process them
 
6:32 PM
Oh, you mean when it's asked for the game state?
 
if they ask for data, then you give it
 
Perhaps
That's a fair point, since some of the game state is not always important
 
and its not important every turn
 
And sending it every 66 ms only for it to be discarded is wasteful
The only trouble is threading
 
yeah, well, you want threads
that's the only way to reasonably do this
 
6:33 PM
The game is not thread safe, so I cannot modify game state "out-of-sync" -- it has to wait for the next tick
I can probably safely fetch parts of the game state though
So in essence rather than relying on the pipe to form a natural queue I'd have to maintain my own queue for the moves
 
right, you simply have a concurrent action queue, and "game state" that is updated in sync with the game
 
That probably wouldn't be terrible
It would certainly clean up this code...
And as a bonus bots could just send one command if all they need to do is change buttons or something for a turn
 
I wonder if using d-bus for a KoTH would be a good idea
 
the bonus here: players have a reason to speed up their code: it means they can do more
 
Rather than saving their current yaw/pitch (the direction they're looking) and sending it with the changed buttons
The only trick is "merging" moves. If I get a request to change yaw followed by a request to change pitch, those should be one move and not two (assuming its not too late and the first move already happened)
 
6:36 PM
1
Q: Isogram checker

Muhammad SalmanDescription : You are given a string as input. Your job is to check whether the given string is an isogram or not. You can output the result as true or false (or any other truthy and falsey value). Note : You will be ignoring letter case. Examples : "Dermatoglyphics" ---> true "aba" ...

 
@moonheart08 for most, no. The slowest part of most KotHs is the latency of each call. As far as I can tell, there's nothing faster than pipes (in terms of latency)
 
@NathanMerrill yeah that was always my intent, to reward fast bots
Ideally bots should maintain a short-term agenda for the tick-to-tick stuff while they work on computing things for longer-term goals in the background
I think this design might make that easier?
Only trouble is the bots have to be designed to wait for stuff
 
@quartata why not just have them send a single move that involves changing both?
 
@NathanMerrill because often times you'll want to change one and not the other
 
right, have them set it to "0"
 
6:39 PM
There's three things they change, although one is technically a bunch of bit flags
 
merging makes this really complicated, and unreliable (what happens if you've already consumed the move that was to be merged?)
 
@NathanMerrill how do I know that's not a legitimate request to look at yaw angle 0
the angle changing is absolute rather than relative
 
oh, then have them pass in the current yaw
 
They have to save that though
 
yeah, well, if they were just calculating how to move, they better have that saved
 
6:40 PM
I was hoping they wouldn't need to replicate too much game state
All I know is that asking me for it every tick will hurt them
Yeah I suppose it's not really a big deal
 
actually, I expect that the players will duplicate the game state
because that's far more efficient than asking for it
but I don't think that memory is your bottleneck here
 
@NewMainPosts Jeez, I swear this is a dupe, because I got deja vu when typing out my solution, but I can't find one.
 
@quartata anyways, I'm leaving this room (to get work done). If you have more to talk about, feel free to ping me :)
 
0
Q: Scrabble scorer

Stewie GriffinChallenge: Take a string of upper or lower case letters as input (optional), and calculate the score that string would get in a game of Scrabble. Rules: The score of each letter is as follows (use this even if there are other versions of the game): 1 point: E, A, I, O, N, R, T, L, S, U 2 poin...

 
7:07 PM
@quartata I douuubt it, it has to be really good
 
@ConorO'Brien that's OK I decided not to go that way
You know what KoTH this is right
 
is this the one you picked up like a thousand years ago
 
Good mornings. I'm looking in chatrooms arount the network, searching for the place(s) where people who use J go. Is it ever mentioned / discussed around here?
oh but wait. there a starred message with J \o/
 
7:24 PM
@FélixGagnon-Grenier Not for J specifically, but...

 The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
 
@Pavel It is actually tagged .
 
@Adám I know, but what I meant was that it was for APL and J, not just J.
 
I can live with that :) thanks!
think I'll lurk a bit before posting however...
 
@ConorO'Brien the tf2 one yes
We had a dedicated J room but it got frozen
only Conor, Kenny and I were ever there
 
7:52 PM
I would love to have a J room (unfrozen) but yeah no one goes there
 
It doesn't seem like the glamour-est of them all, one must admit
I'm really just starting reading about it, but the change in thinking initiated to reason about something like *: 2 * 1 9 75 63 is really... unsettling
 
8:20 PM
oh it's so much fun
 
Just realized I have no idea if a grenade and a stickybomb can collide with each other
(While in motion)
I hope this doesn't end up needing too much kinematics for the bots
Can I get this room unfrozen? chat.stackexchange.com/transcript/42560
 
@quartata yessiree
 
Thanks
 
@quartata I know a rocket and a grenade can collide
@FélixGagnon-Grenier if you were interested, here's some J example source written by me. it's no testament to readability but its functional
 
8:38 PM
@ConorO'Brien why, thank you :)
 
@ConorO'Brien Hm, interesting. I'll need to get the mass of them in addition then
 
dat github highlighting tho
 
8:49 PM
@ConorO'Brien Syntax mis-colouring aside, that looks way more readable than most J I've seen.
 
@Adám thanks!
 
It also appears to me that Jers (?) tend to name things more than APLers, which I suspect is due to "pure" J (i.e. just sequences of built-ins) being much harder for humans to read.
One thing that always gives me a bad taste from J is that neither round parens, square brackets, curly braces, nor double-quotes have to be matched up in pairs.
 
@Adám perhaps. I'm just a freak about abstraction
 
@ConorO'Brien head =: {. is hardly abstraction.
 
@Adám that's fair enough. not a big problem for me, after having had so many conventions broken by a plethora of languages haha
@Adám well in that case it's a memory problem
 
8:55 PM
@Adám What do double quotes even do in APL
 
@ConorO'Brien :-D APL in comparison looks much more like conventional mathematics.
@Pavel In some dialects nothing, in some they can be used as alternative to single quotes, and some use them in special situations to group for parsing purposes of non-APL-syntax commands.
 
@Adám But what does Dyalog do
 
@Adám yes, that's one of the main things that appeals to me about APL
I really am a fan of "typeable symbols" like a right arrow, since they have natural digraphs (namely, ->). in attache I've tried to include unicode character aliases for any appropriate multibyte operators
 
@Pavel In Dyalog APL, you can use double quotes to dictate parsing for system and user commands. E.g. )load "filename with spaces" or ]runtime "⊃,/'abc' 'def'" "∊'abc' 'def'"
 
Does )load 'filename with spaces' not work?
 
8:59 PM
@ConorO'Brien APL has a lot better libraries (at least Dyalog) it's kind of a tricky trade off
 
Dyalog also has the .NET library
 
J can do FFI but it's not easy
 
@Pavel No. I think it follows what the OS uses.
 
Well that's actually the shell's problem
It's really just that load doesn't take a string, right
to get it to parse as one identifier you need the double quotes
 
@quartata Right. APL has non-syntactical, so-called system and user commands, where J only allows functions which follow the normal J syntax.
 
9:02 PM
yeah, most languages have their import equivalents work like that
 
The initial ) or ] is a clear indication that this is not APL code. In fact, in Dyalog APL, there's no way for a program to issue such commands. They have proper-syntax alternatives available instead, but they tend to be harder for humans to type, so it is really convenient to have the system and user commands.
 
what's the stance on breaking a KotHController? I think that there are fundamental problems with the DollarBillAuction, but to really nail it down, I'd need to post some submissions.
 
@quartata What is FFI?
 
foriegn function interface
basically how you call C-based functions
from any process
 
@NathanMerrill Thanks.
Yeah, calling C(++) functions from APL is really easy.
 
9:15 PM
@quartata that is not necessarily true, J has a crudton of libraries
 
@NathanMerrill Do you mean intentionally posting a submission that breaks the controller?
 
9:32 PM
anyone here good with Haskell?
 
@ASCII-only Iirc quartata is
 
@Adám I have a tough question for you :P
what is APL's biggest weak point?
 
@orlp The language or the implementation?
 
I guess you can answer both :P
I meant the language though
 
For me it's the docs. Everything is documented, but the documentation is hard to read and hard to search through. I pretty much have to ask someone who knows better to figure anything out.
 
9:39 PM
obviously it's the fact that you need a custom keyboard layout to type APL at all :P
 
I don't think that's a problem when you're a bit more experienced. It's more understandable than J.
 
@orlp I think the few syntactic anomalies due to requiring half-century backwards compatibility.
 
@betseg because parseInt takes a string...
@Pavel :| but i like typing in ASCII only
like I always use Charcoal's verbose mode so I don't have to type unicode :P
@J.Sallé hey, JS isn't that bad, it just implicitly casts a lot, kinda like Perl. it was designed to fail as little as possible, so if you mess one thing up the rest probably still works
 
Except Perl does the implicit casting in a mostly consistent way
 
@LeakyNun tuna salad with tuna, lettuce, capers, red onion, eggs, mayonnaise, pepper, salt
 
9:48 PM
@orlp where's the tuna :|
 
@ASCII-only Do you need someone good at golfing Haskell or just in general, if the latter I can help, if the former I can try to help.
 
@orlp My CXO is sitting across from me. He says: APL's weakest point is that it allows people with limited software engineering skills to build successful multi-million dollar applications.
 
@Potato44 never mind, i gave up >_>
 
@Adám rolls eyes :P
@ASCII-only all throughout it? it's the brown-pink stuff
 
but if you know: can you do dynamic template haskell?
e.g. let's say foo is a TH function, how would you do $(foo n)
 
9:50 PM
@ASCII-only By dynamic do you mean at runtime?
 
@Potato44 yeah that
 
Template Haskell is a compile time thing.
but you can run arbitrary Haskell code in it, including other template Haskell.
 
wait, actually
 
what exactly are you trying to do, this smells of XY
 
trying to attempt BMO's curry question
 
9:55 PM
@orlp Dyalog APL in particular: Difficulty in interfacing with the modern world. (Though we are working hard to fix this.)
 
another question: how to have a function that might return either a lambda with an unknown signature or a value
 
@Pavel While we're working on a new delivery format, we'd be extremely interested in any ideas for improvement you can come up with.
@ASCII-only The language bar and "backtick" keyboard allow you to fully use APL without any custom layout.
 
@ASCII-only If that is possible at all, it involves Typeclass trickery. Unless your still trying to do it Template Haskell which as far as I know can manipulate the syntax tree.
 
@Adám I think having more examples generally would be nice. When the existing docs use an example, it generally covers a really simple case that doesn't encompass the full usage of the feature.
 
@Pavel (You'll probably like the new language bar tool tips in 17.0.) Any particular docs you're talking about? Language bar tool tips? F1-help? PDFs?
 
10:11 PM
Mostly the PDFs, the tool tips aren't really useful at all currently.
 
@Pavel I know. In 17.0 they are quite good, and even have a More link.
 
Nice
Another big problem is that I have no idea how to search for, e.g. what ⌺ does.
The more link should help
 
@Pavel (Which OS are you on?) Have you tried tried typing it and pressing F1?
 
Linux
Most of the time
 
@Pavel Using RIDE?
 
10:17 PM
Oh yeah More isn't gonna help there ;-;
I use the CLI
 
@Pavel Oh. This page is probably your best bet for that right now, although I do think we are considering an I-beam which takes a glyph/quad-name/keyword/syntax-element and returns an appropriate help url.
 
Cool
 
@Pavel There's also work in progress on a ]help user command which allows you two write "anything" after it to get most appropriate help on that, e.g. ]help ⌺ or ]help tcp/ip or ]help dll.
 
10:52 PM
1
Q: Seidel Triangle

Bolce BussiereThe Seidel Triangle is a mathematical construction similar to Pascal's Triangle, and is known for it's connection to the Bernoulli numbers. The first few rows are: 1 1 1 2 2 1 2 4 5 5 16 16 14 10 5 16 32 46 56 61 61 Each row is generated as follows: If the row number ...

 
11:25 PM
@Adám What's the difference between )commands and ]commands?
 
@Pavel )SystemCommands are an integral part of the interpreter. ]UserCommands have a very thin hook-in from the interpreter's side, and the rest is written in APL. They are called user commands because they essentially allow the user to easily complement the built-in commands with additional commands of their own.
 
that's scary, security wise
wonder if they know Java can do pointer arithmetic
 
@quartata "Security is achieved through the absence of pointer arithmetic and the inability of an application to get linked to an object other than by calling a public method."
not sure if they prevent pointer arithmetic/reflection though
 
yeah I doubt it
 
00:00 - 18:0018:00 - 00:00

« first day (2635 days earlier)      last day (2223 days later) »