« first day (2296 days earlier)      last day (1622 days later) » 

4:00 PM
The question isn't where, but why?
Forgot about carrot reply userscript
How is Minesweeper Turing Complete?
@Arjun Magic (the gathering)
@Arjun Magic the gathering is TC
4:07 PM
Magic is real! Wow!
CMC: given a string consisting of A, B, C, or D (it can be empty), determine if the first letter is equal to the last letter.
(empty string returns true)
@LeakyNun f=_=>_[0]==_[_.length-1]
@Arjun what the kek
>> undefined == undefined
<< true
I like this hack
Smart me! :p
@LeakyNun Alternatively, f=_=>_[0]==_.slice(-1)
@LeakyNun V doesn't really have booleans at all. Can I do empty string for Truthy, non-empty for falsy?
4:14 PM
@DJMcMayhem alright...
@LeakyNun Perhaps, you can post that as a challenge (you know, for the sweet rep!)
Q: Element of string at specified index

Leaky NunGiven a string s and a non-negative number n less than the length of s, output the character at the n-th position of s. 0-indexing and 1-indexing are allowed. For 1-indexing, n will be positive and less than or equal to the length of s. s will consist of printable characters only. Any reasonab...

+8/-5 ;_;
+9 now
A: Largest Number Printable

user1781498a=Infinity;alert([a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a]) This assumes that this a complex number and Infinity is a number.

May we delete?
4:23 PM
@LeakyNun So, are you going to post it as a challenge?
@Arjun No, I am not
May I?
Or someone else?
it originated from @NathanMerrill though
Oh, than they should post it!
4:26 PM
You could ask him
@NathanMerrill Will you post it as a challenge?
Post what?
Guess the function? Too broad
@NathanMerrill no
19 mins ago, by Leaky Nun
CMC: given a string consisting of A, B, C, or D (it can be empty), determine if the first letter is equal to the last letter.
4:30 PM
None of these will be posted by me
Can someone else post it?
@Arjun if not you, then who?
Probably @totallyhuman, if he wants to
@aditsu Congrats
Okay, I am going to post it, just a minute
4:34 PM
@LeakyNun Jelly, 3 bytes: Ḣ⁼Ṫ
@EriktheOutgolfer fails for one-letter strings (because both functions modify the string)
I knew it had to fail somewhere.
@LeakyNun Jelly, 5 bytes: 2Bị⁸E
(I'm sure there's a 4-byte version too)
@EriktheOutgolfer there's even a 3-byte version
but @Arjun is posting the question
@Sp3000 for t-shirt? thanks :) I wish I won more than that :p
wonder what happened to my A large..
@aditsu glad to see you again
4:41 PM
I suddenly lost power just when the contest started, it was really upsetting
I had so many things open too.. and some unsaved files
Hmm yeah, you were pretty close. C-small would have let you advance :)
@LeakyNun 4-byte version: 1ị⁼Ṫ
@Arjun how is your progress?
damn, if A large was correct, I would have advanced :(
If I had gotten A large I would have a T-shirt :( (was braindead, thought 1+2+3 = 4 for some reason)
4:45 PM
lol what are you talking about?
Erm I was mentioned..?
hm, I made a stupid mistake
@Arjun How is the question going?
we're talking about code jam, btw there's chat.stackexchange.com/rooms/56779/code-jam-stuff
oh I wasn't participating
@LeakyNun 3-byte version: [REDACTED]
4:53 PM
@LeakyNun hai, glad to see you too
wait a unicode char apparently got a couple of chars
@aditsu are you still in HK?
@Sp3000 it looks like you didn't submit it though
...ok by reading up a bit, I think I understand why I was mentioned and my answer is I'm good, if rather earn fake internet points by coming up with something myself lol
@LeakyNun yeah
4:54 PM
@aditsu I see
Arjun is still here?
@aditsu I never ended up doing it because I was under the impression a greedy algorithm wasn't going to work for some reason
(just got told that is wrong)
@Sp3000 how did you choose the shooters in problem C?
1) For each shooter, find all cells covered by | orientation and find all cells covered by - orientation 2) Brute force over all combinations of |- until you find one that covers all dots
for A large, I think I forgot to handle the case where you have a single "2" left..
brute force?!!!
4:56 PM
You need a bit more than that to make it efficient enough though
Wait, just going to post
(e.g. if - and | cover the same cells, pick one arbitrarily)
I coded a greedy solution, apparently it was wrong..
there might be a graph algorithm involved
I thought brute force would be too slow for 5*50
Something something bipartite maybe
oh, is this the 100th time I fail to recognize a bipartite solution?
4:59 PM
I dunno, just guessing since there's two options for each :P (too lazy to think)
As for brute force, if you early exit after finding a shooter that shoots any shooter no matter which of | - it is (i.e. impossible), then the case with the most shooters I saw was a checkerboard with #
But yeah tbh I didn't really expect it to be fast enough, I was just kinda hoping
I think it's a bit trickier for bipartite since you have 2 orientations for each shooter
(except the fixed ones which you can eliminate)
@Arjun Ready yet?
oh, also each shooter shoots many cells, not just one
Hmm I can think of how you might formulate it as max flow, but every time I say that I'm too lazy to implement max flow/forgot how
@EriktheOutgolfer Done.
5:03 PM
Then post it?
I have some generic algorithms pre-coded, but I think I haven't done max flow yet..
Yeah it's basically - given a list of pairs of cell sets, pick one set from each pair such that the union of the sets you pick is all the empty spaces
starts reading analysis
@Arjun Yeah, I finally answered in Jelly!
I hope the specs are clear!
@Arjun nice challenge.
@EriktheOutgolfer my answer was .ịE (fails for the main challenge because of the empty string)
5:08 PM
hmm not sure how to model it even as a max flow problem.. you need 0/1 capacities for orientation choice, but large capacities for shooting cells
@LeakyNun Thanks for the appreciation! Credit goes to you!
@LeakyNun I was lucky that returns 0 for []. ;)
@EriktheOutgolfer indeed.
@aditsu Hmm ignore me then, probably just being braindead :P
@LeakyNun Redacting my own 3-byte version proved good.
5:17 PM
Q: Does the start equal the end?

ArjunThe Task In this challenge, your task is to write a program or function which takes in a String and outputs a truthy or falsey value based on whether the first character and the last character of the input String are equal. Input You may take input in any way you want. But, assuming the input ...

I thought the challenge would be easy but Python trips on the empty strings
Yeah it does, that's what I'm trying too atm.
I think I got it
@totallyhuman which challenge?
Yep and you beat me :P
@aditsu the one new main post's just posted
5:26 PM
oh, I'm pretty sure mender posted it in chat last year
he came up with a cool CJam solution
oh wait, maybe it was just to extract the first and last element
@aditsu {(\)\;}
simple 7 byte solution
in an array; also, not sure why you want a block
Thought I will gain some upvotes by posting my answer most quickly. Not even a single one, yet :p
Wait erik
Doesn't yours post 0 for an empty one?
Yes shouldn't it?
5:32 PM
But it prints False otherwise
I have asked OP about that, but both are falsey.
Is there a need for consistent truthy and falsy values?
OP said it's allowed.
Erik? What happened?
Ah ok
5:34 PM
Also reduced to 26 bytes for me, now it has '' and False for falsey, True for truthy.
@totallyhuman Did you accidentally delete your post?
btw dupe answers are actually allowed, depends on whether you like keeping dupes or not
Wait @EriktheOutgolfer ! I interpreted your question as Can we output any kind of truthy/falsey pair ie. 0/1, true/ false?. But seems like you were asking something else ie Does the truthy/falsey pair need to be consistent?. Well, for that the answer is "Yes". Gonna edit.
Will have to change mine again
@Arjun Oh... ok I'm gonna edit my answer
luckily my Jelly answer still follows the rules
Your answer is still shorter lol
not shorter than Adnan's Dennis's
5:43 PM
Yeah that one....
And Dennis's o0
You guys are nuts
although it's probably got a typo currently (e instead of s...)
That's what it relies on
To raise a name error
Okay, I am going to sleep! Bye! Had a nice day today!
5:46 PM
6:06 PM
@MartinEnder Yep. Looks good.
6:18 PM
Q: Error in using ssl library?

OhboyyWorking on a RSA project and i cant access openssl library on cygwin? #include <openssl/rsa.h> #include <openssl/pem.h> #include <openssl/err.h> #include <stdio.h> #include <string.h> Then i get this compile error fatal error: openssl/pem.h: No such file or directory compilation t...

6:29 PM
There's more of these off topic ones everyday
probably because "programming puzzles" could be taken to mean "programming problems"
6:41 PM
huh, LL# -> -1
Hmm could I made a challenge out of the phrase "all's well that ends well"
should I see this as a bug or a feature? :p
Why not both
@aditsu feature since "" isn't contained in ""
although it's contained in [""]
not as an element, but as a substring
6:45 PM
doesn't # find for the element though?
not with 2 arrays
ooh CJam is more [messed up] than I thought...
@ASCII-only in cheddarshuntingyard what does:
            if (token instanceof CheddarShuntingYard) {
                for (let i = 0; i < token._Tokens.length; i++)
                    this.Tokens = token._Tokens[i];
                unary = false;
6:49 PM
@aditsu also 1 2 3]""# is error
@wizzwizz4 technically not redirection :P
@aditsu where did the cheatsheet go?
@EriktheOutgolfer yeah I noticed..
@LeakyNun I don't know, I didn't write it
Is Lynn still here?
less active but yeah
6:51 PM
I think I have a copy of it..
@aditsu should always be error I guess
even on LL#
@EriktheOutgolfer I think it should always return 0
as it does in java..
I thought of it at first too
That probably makes the most sense
but then I'd expect that L0= would return ""
6:56 PM
nope, element is not substring
L0>"",< would return ""
yeah you're right... less errors I guess
Q: Random Golf of the Day #8: Shuffle an infinite list

Martin EnderAbout the Series First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series in the first post. Hol...

7:57 PM
@Riker Probably because it is very common in the Qur'an.
8:12 PM
Me: I have some free time, maybe I should clean up a few pages of code. Checks out newest commit by trainee:
He certainly managed to created an impressive amount of heap memory leaks in just a few hundred lines of code.
(the trainee, not Rider)
8:27 PM
Q: Random Golf of the Day #8: Shuffle an infinite list

Martin EnderAbout the Series First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series in the first post. Hol...

Somebody explain to me why it won't be as easy as using Python's random.shuffle
because random.shuffle does not support infinite lists?
but uh... how is it possible to input an infinite list?
@totallyhuman Generator, reading from a stream, reading from a pipe, etc.
...yeah this challenge isn't for me yet :D
i'll try later
8:35 PM
I have some ideas of how to go about it
8:49 PM
@MartinEnder Is my answer OK, or should I be taking the generator as input somehow?
@xnor you mean because it's mixed I/O? I think it's fine but I'll have a closer look later
@MartinEnder No, I mean that I assume the stream g is already defined
How could that possibly be valid
I think that's covered under the last bullet point
> Alternatively, you can write a function which takes no arguments and returns one output value each time it is called. In this case, you can assume that a function has been defined which takes no arguments and returns the next input value each time it is called. You may freely choose that function's name.
8:52 PM
@feersum Because it was explicitly allowed in the challenge
well, my code is a program, not a function, so technically it doesn't qualify
but it would be weird if programs and function were allowed different things here
I changed it to STDIN input to be safe for now
@MartinEnder by the rules as I understand, functions being allowed to assume the generator is predefined but programs not being allowed to do so gives a weird incentive to use a function just to save on input-taking boilerplate
Question: how to make REPL-like behavior in java? this is not working :(
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            System.out.println("tnv> ");
it only shows prompt after you submit
That's because in.hasNextLine() waits until there is actually a line.
9:04 PM
@Downgoat System.out.flush()
actually looks like I needed a do..while :P
Oh right, that would do it too
Or just do true and catch the exception.
oh hello there nullpointerexception
9:05 PM
Do-while seems wrong to me.
The input may have no lines.
@feersum yeah, .nextLine() is giving null sometimes now
You don't even need to try catching the exception.
Doesn't Java have a way to read a line from STDIN with a prompt?
@Mego Sys...println("prompt");Scanner.nextLine();
Not built in, no.
Also, @Downgoat you might want print and not println so the input appears on the same line after the prompt.
@Phoenix while(true) loop it is
@Phoenix yeah :P just realized
9:07 PM
Oh, I suggested flush assuming you were doing print and not println...
If the user passes EOF to a REPL, they should not be surprised that some kind of error occurs, anyway.
No, they should not expect an error, they should expect it to exit.
Or you could catch(NoSuchElementException e){System.exit(0);}
I would expect it to reprompt
@JanDvorak oh no, that's what node.js does and i hate it for that
9:10 PM
If you <C-d> into a terminal, it will exit the terminal.
I really don't want the repl to bail out because I copy-pasted an empty line to it, especially if it means the rest of my clipboard goes to the OS console...
Question: how to do BigDecimal.pow(BigDecimal)
Um, how is an empty line an EOF
"" != EOF
Besides, an empty line is "\n"
9:14 PM
Evil idea of the day: make a >= b an alias for a = a > b
@JanDvorak gimme a sec
And don't forget a == b -> a = a = b as well.
@feersum Kinda surprised PHP doesn't do that
plz make a === b -> a = a == b, not a == b -> a = a = b plz
o0 you guys are sorcerors
9:19 PM
@JanDvorak D:
eeevil sorcerers
@ASCII-only on scale of 1-10, how important is having VSL REPL?
Not very IMO
Nice to have, but priorities
it's not that. VSL is compiler however though so scoping is kinda not so simple to share over a REPL
what I could do is copy the entire execution context every line
but that would be slow
9:37 PM
A: Sandbox for Proposed Challenges

flawrPlane Blow-up mathpolynomialgeometryalgebra Blow-ups are powerfull tools in algebraic geometry. They allow to remove singularities from algebraic sets while preserving the rest of their structure. If you're not familiar with any of that don't worry: In the following we are considering the blow-...

Question: how to check if tty in java?
Make a JFrame and check if it errors?
@Downgoat Check if System.console() != null
wtf, java says to disable echo you should backspace faster than user can type...
Alternatively you can use JNI to call isatty
9:41 PM
@Downgoat System.console().readPassword()
I think I am reading very old java docs :/
@Mego thanks, this works :D
@Downgoat Probably, java.io.Console was added in JDK 6
@Downgoat Glad to help
@Mego If you just search "Java doc <class>", it will point you to the Java 7 docs.
@Phoenix I'm not the one reading outdated docs :P
9:48 PM
Yeah, I just wanted to point that out. Kinda weird.
Question: is there a way to have arrow keys (e.g. left, right) work when I do .readLine?
I am trying scanner and Console object
What do you mean?
like right now if I do .readLine and click arrow key I get ^[[C
I don't get it
Well instead if should move the cursor left
I could write my own thing with raw mode and stuff but seems like Java should have built-in
10:03 PM
Q: 11 = (1+2+3+4+5) - (1+2+3) + (6) - (4)

ArnauldGiven a positive integer N, your task is to return the number of steps required by the following algorithm to reach N: Find the smallest triangular number Ti such that Ti ≥ N. Build the corresponding list L = [ 1, 2, ..., i ]. While the sum of the terms of L is greater than N, remove the first ...

@Downgoat Not builtin, but jline.sourceforge.net
It gets really deep at the end
@Okx My video shot me in the feels at the end
@MartinEnder Would a program that takes two number j, k (from 0-19) as a seed, prints out the first j items unchanged, and after that reads in batches of 20, prints the last k items of the batch, and then prints the first 20-k be a valid answer? If not, why?
10:15 PM
@MartinEnder I was wondering about your challenge--my method is to store an array of 9 characters, read characters to fill the array, then randomly output and replace indices in this array. I think this is sort of how the python answer works, and I was wondering if it's a valid approach.
@Okx thats beautiful
haha ping double team. Out of curiosity, are you writing a C answer @feersum?
@betseg you better star it then :P jk
i posted it before you, ninja'd you, you star me :P
10:18 PM
@Riker Now I know why it doesn't work: I put in the method that gets called on the first bite of corpses
not regular food
What is context?
Context is from almost a year ago
something I did not realize until I replied to the message
Oct 8 '16 at 1:04, by quartata
    } else if (otmp->otyp == PROTEIN_SUPPLEMENT || otmp->otyp == VEGGY_SUPPLEMENT || otmp->otyp == STARCH_SUPPLEMENT) {
      pline("This makes you feel disguistingly healthy.");
oh and I typo'd disgustingly apparently
past self was a little dumb
@quartata Such is life
It's kind of funny to go back to this code after a while and remember all the little quirks I learned about nethack along the way
Nethack is that videogame you lot play, right?
10:31 PM
@Phoenix No that's code golf
Nethack is the horse cruelty simulator
AKA the funny Arqade question title generator
@quartata That feeling indicates improvement. You only have to worry if it stops...
@Mego Minecraft isn't as funny but does it more consistently
@Okx Responded to your latest queries just so you know
Wait, sorry, meant @NathanMerrill
Ah, dang it, still have some hours to kill
10:52 PM
@KritixiLithos TIL
@Phoenix yes
@quartata ah lol
@Mego that and CK2
@quartata for that matter: I got stupidly lucky again with a human wizard. wand of wishing on the lvl 2 upstair, 0:3
made it to the quest but died there
@mınxomaτ this confused me for a moment because it looks like my name
@Riker I got a wand of wishing but I still have that savefile because I haven't started playing it again
if you can, ID it
formally, with a scroll
it's quite nice to let you estimate what to wish for next
I was afraid we would be behind the UK in the Eurovision for a moment
honor saved
@Fatalize What country are you in?
11:06 PM
I rather liked Sweden's this year.
Also Belarussia's
11:54 PM
@Phoenix That looks like an attempt to reply to me
@Phoenix Reject imo
I agree, "should be comment" is the correct option there

« first day (2296 days earlier)      last day (1622 days later) »