« first day (2375 days earlier)      last day (2461 days later) » 

11:09 AM
TIL there exists a character that crashes Python IDLE when you type it.
In fact, there are several.
On a related note, how can I cram 417622 characters into an answer?
 
probably gonna have to stick it in a paste
 
@totallyhuman It's fine - I've come up with a notation that will allow me to fit them in.
On a related note, I may have won a thing for the first time ever.
 
11:38 AM
hey guys
 
Heyyo
 
i intend on posting this challange today (codegolf.meta.stackexchange.com/a/13472/66418)
is there anything else that should be changed?
i didn't get much feedback from the sandbox
 
Like I said in the comments you might want to expect some close votes.
@FelipeNardiBatista Is it only possible with threading?
 
@TheLethalCoder It's certainly possible without threading in C.
Or in any language where you can check whether the buffer is empty or not.
 
@wizzwizz4 mmm I was trying to work out how you could do it in C# because all Console.Read...() calls wait on the input so you couldn't check the time whilst waiting.
 
11:44 AM
@TheLethalCoder async can kinda :P
 
@ASCII-only Aye but that's fancy threads... without going into it too deep :P
 
any mods here?
11
Q: Products that equal a sum and vice versa

orlpA fun pair of equivalences is 1 + 5 = 2 · 3 and 1 · 5 = 2 + 3. There are many like these, another one is 1 + 1 + 8 = 1 · 2 · 5 and 1 · 1 · 8 = 1 + 2 + 5. In general a product of n positive integers equals a sum of n positive integers, and vice versa. In this challenge you must generate all such ...

I want this challenge deleted because everyone misunderstands the rules and I can not be bothered any longer to explain them
everyone is whining about what exactly 'fastest code' means, trying to hardcode stuff, and in general acting in bad faith
 
@wizzwizz4 yeah DLosc discovered you couldn't type non-BMP characters into IDLE when we were testing characters for Charcoal
 
@ASCII-only It's because Tkinter doesn't support them.
At least, that's the error when you try to print them.
 
@Dennis you here?
 
11:52 AM
@orlp well there are four answers i don't think that counts as everyone
 
@orlp It's not their fault the challenge is confusing
 
@Xanderhall and I can't be bothered any further to explain the basic rules that (I think) are perfectly clear, so the only solution is to just take the challenge down
 
can't you delete the challenge?
 
I can not
 
@orlp They're not perfectly clear. That's the problem.
 
11:53 AM
@Xanderhall and I disagree
 
@totallyhuman No, there are answers with positive votes
 
@Xanderhall What's the problem with the rules?
 
so a mod deleting the question doesn't negate the rep?
 
@orlp How am I supposed to check if my code is generating complete sets?
 
11:54 AM
@Xanderhall You don't?
 
@Xanderhall that's your problem
if someone beats you, they win
 
@orlp Could you ask for disassociation?
 
@TheLethalCoder considering that I'm the one responsible for scoring, no
 
oh @orlp there's no discovered upper bound right?
 
@orlp What
 
11:55 AM
did I mention that I'm tired of explaining this?
 
@orlp If you go with "Take your word for it" then that doesn't matter. Or you could just ignore people asking for clarification?
 
people aren't even posting valid answer that take a parameter n
 
Yeah if you think the challenge is too far gone, might as well get it deleted.
 
You didn't specify that they had to.
"In this challenge you must generate all such combinations of positive integers, excluding permutations"
 
I thought that was obvious but I can add that
 
11:58 AM
You didn't say the program had to take input. You simply said it had to generate the most combinations.
 
I think you implied that they must take n but never clearly stated it.
Might be worth deleting it and sandboxing for a bit?
 
That's why people are hard-coding things. Because they're assuming they simply ahve to loop through as many ns as they can
 
if a program doesn't take input how can it even be a fastest-code challenge?
 
while(i++)?
 
the challenge doesn't even make sense
if there's no parameter n
 
11:59 AM
Go until the timer runs out
 
see this
angers me so much
 
you gave an end condition in the form of time.
 
and I don't want to deal with it anymore
either the challenge gets deleted or it rots I don't care anymore
 
Make sure your challenge is clear then.
Don't get angry when a bunch of people try to take advantage of your exact wording.
There's a reason the standard loopholes exist.
And the Sandbox.
 
I can see how the challenge is clear and unclear. For that reason people should have requested clarification until the challenge was edited to be clear. By answering they have made it more unclear.
 
12:02 PM
@totallyhuman It does.
Next recalc.
 
@Xanderhall loopholes are fine if the challenge is a code-golf
it's in the spirit of the challenge
they're not fine for a fastest-code challenge, as they entirely bypass the challenge
they're in bad faith and against the spirit of the challenge
 
@orlp And I disagree.
 
@Xanderhall If something is against the spirit of the challenge how can you disagree that, that is a bad thing?
 
@TheLethalCoder Because the challenge is unclear.
Therefore, it's quite difficult to violate the spirit of it.
 
@Xanderhall That doesn't mean going against the spirit of it is correct. That means you should request clarification.
I fail to see your point in this, it kind of looks like you're arguing for the sake of it.
 
12:07 PM
@TheLethalCoder your answer on the diagonal question has an example of where C# is possibly dependant on whitespace. i+++"" has 2 possible meanings.
 
@TheLethalCoder But you can't be violating the spirit of the challenge if you don't know what the spirit of it is.
 
@LiefdeWen How does it? It must be i++ + "" surely?
 
If the parameters of the challenge are not clear, you can't be violating them if they're clarified afterwards.
 
Then you shouldn't be answering, your point makes no sense. If it is unclear you don't answer. You don't guess at what it could be then moan about it.
 
@TheLethalCoder The parser may not know that
 
12:09 PM
@TheLethalCoder What if you believe it's clear enough to answer?
Your point makes no sense.
 
@TheLethalCoder okay yeah but what is the intention behind lets say int a=5,b=5,c=a+++b?
 
@LiefdeWen That's a different case because they are both ints. The string and int case is well specified. In the int and int case it falls down to operator precedence.
@Xanderhall You, and they, obviously don't otherwise this conversation wouldn't be happening in the first place...
 
@orlp I've commented on your post. I think the misunderstandings are because some people have predefined expectations of what a challenge should be, so find ways to misinterpret what, to me, is a well defined spec. I don't think it would take much editing to close that possibility, so they can no longer distress you. It wouldn't require changing anything about your scoring mechanism, just stating some things that are obvious to those of us interested in fastest-code, but are not to everyone.
 
@TheLethalCoder do you think it would be better to rephrase the challange to be a BPM v2 to avoid close votes? the problem would be the same, count how many beats per t seconds wich is the oposit algorithm that the original question uses
 
@TheLethalCoder Obviously some people did, as they submitted answers.
 
12:13 PM
@trichoplax I edited the challenge to clarify a bit, feel fry to clarify further
 
@TheLethalCoder Yes, wasn't arguing with your solution, just wanted to share something to think about, like that means there is a code golf solution somewhere where you must leave a golfable whitespace intentionally.
 
@FelipeNardiBatista No I think the challenge is fine. I was just letting you know to expect it.
 
@orlp That last edit should cover most of it. I'll tweak it slightly
 
@TheLethalCoder thanks, i'll edit to try and address it
 
@LiefdeWen I agree it is a corner case. I think I actually have an answer on here somewhere that leaves the whitespace because of it.
 
12:15 PM
@trichoplax what bothers me so much is that there have been dozens of challenges like this
where it didn't pose an issue at all
obviously the point is to generate complete solutions
but I don't want to have to find out what complete solutions are, so with this mechanism I incentivize generating the most complete solutions
 
Wait, what happened?
 
@orlp You're assuming people have seen them.
 
@orlp I think your problem is probably that you have attracted people unfamiliar with those. There are probably plenty of people who wouldn't see any problem with your spec, but you only hear from the ones who do
 
@Xanderhall no that wasn't my point
@Xanderhall I'm saying that this isn't an issue in the past, so why now?
 
Are you talking about orlp's last challenge?
 
12:18 PM
I really hope this debate isn't bad enough to make it orlp's last challenge :P
 
@orlp I think trichoplax's answer there explains it pretty well
 
@trichoplax last challenge as of now, don't misinterpret what I said like people misinterpret orlp's challenge
 
@Mr.Xcoder I think that was a joke. x.x
 
@TheLethalCoder what about now?
 
@Mr.Xcoder It just amused me, with all the misinterpretation of the obvious already going on...
 
12:20 PM
I don't understand what people don't (want?) to understand
 
It's more clear now.
 
@orlp I only added one redundant statement as I think your edit covers everything. I wouldn't even have added that if not for all the strong attempts at finding a way to misinterpret. Seems watertight now
 
@FelipeNardiBatista That was about a C# whitespace thing.
 
@feersum this was also the solution I thought of, however I wasn't convinced that it's O(n) in the worst case
 
>.< Helka Homba has 2 Socratic badges :)
 
12:22 PM
@TheLethalCoder sorry, i forgot to mention it. i edited the question codegolf.meta.stackexchange.com/a/13472/66418
 
@FelipeNardiBatista Seems a good idea to state it clearly like that.
 
@orlp I can relate to your irritation. I've also had people comment with supposedly helpful suggestions like "Why don't you just make this code-golf", and try to make me rewrite all the parts that don't suit them personally. I like the way you have this one set up. I think the approach of not requiring proof of completeness is particularly elegant, as it gives people the opportunity to attack other answers, and for other answers to use imperfect heuristics until such attacks arrive.
@Xanderhall Yes whenever I put :P on the end it's a joke, although that doesn't always come across so maybe I need a better indicator...
 
I would like to add in that I also like the challenge. I was just trying to argue the point that certain aspects weren't as clear as orlp seemed to think they were. Those points are clarified now, and I don't have any other problems with it.
 
@trichoplax Use </j>
 
Might be just as obscure to some people. I hope I don't have to be as explicit as </joke>
 
12:31 PM
Well </s> is usually fine
 
:p can be used sarcastically what just about :D or xD
 
@LiefdeWen In this case it was sarcasm so :P was probably appropriate :)
 
Is a sarcastic joke :PxD then?
 
I don't know. I have the same problem in speech as I tend to say sarcastic things in my normal voice
 
I mean this is the stuff that truly matters most...
 
12:33 PM
Indeed. Maybe we should define this rigorously on meta...
 
We need something to accompany the chatiquette
 
let's define a standard for all of SE chat
 
"You will be kicked for using the incorrect emoticon with sarcasm"
9
Oops I didn't put an emoticon on that...
 
Kick yourself...
Or was it not sarcastic?
 
@orlp it's definitely O(n) as each entry is zeroed only once, you know
 
12:36 PM
@LeakyNun that's not sufficient
looking at entries and incrementing/decrementing pointers are also operations
 
@orlp you only look at n entries
 
Anyone else dream about a challenge idea that they then forgot? Or is that just me...
 
@LeakyNun not only do we not look at exactly n entries, not every input permutation looks at the same amount of entries
I'm fairly convinced it's O(n) now, but just saying that every entry gets set to 0 only once is not sufficient
 
@orlp but the maximum is 2n
 
@LeakyNun That's enough to convince me it's O(n) :)
@LeakyNun perhaps you want to compete in my challenge?
14
Q: Products that equal a sum and vice versa

orlpA fun pair of equivalences is 1 + 5 = 2 · 3 and 1 · 5 = 2 + 3. There are many like these, another one is 1 + 1 + 8 = 1 · 2 · 5 and 1 · 1 · 8 = 1 + 2 + 5. In general a product of n positive integers equals a sum of n positive integers, and vice versa. In this challenge you must generate all such ...

 
12:51 PM
@orlp nah thanks :p
 
@Cowsquack Can you have "programs in programs" in Carrot or at least the new interpreter like 2^F*(2^F+1) to give 2^F*3 = 6.
 
@LeakyNun I saw an interesting problem the other day as well
let's say I give you a certain budget B
and I tell you you're going to flip n coins
 
@TheLethalCoder yes, that is the plan
 
and you have to land at least k coins with heads
but here's the twist, before every flip you can choose a number p that gives the probability the coin lands on heads
however every p you choose goes off your budget
and you can't go over your budget
@LeakyNun what is the optimal strategy?
 
@orlp well, depends on B of course, and n and k
 
12:55 PM
of course :)
 
I would just choose 1 every time if B>k
 
yes, that's the trivial case
but what if B < k
 
@orlp that's out of my budget :p
 
Anonymous
@orlp That is an interesting problem. So, to formalize it, you have a positive real number B, a positive integer n, and a positive integer k. You perform n Bernoulli trials where you set p, under the constraint that for all trials b_i, sum p_i <= B. The goal is to have at least k trials succeed.
 
@Mego it should also be very clear that you can choose each p_i when you know the outcome of all trials <i
you don't have to choose in advance
 
Anonymous
12:59 PM
@orlp Oh that makes it even more interesting
 
a real world equivalence of this problem is if you're sports coach, and you have to win a best of n series, and you want to decide what players to field
you don't want to exhaust all your best players in a single match
 
Oh, my challenge is #1 on HNQ with a difference of 100 hotness points to the #2.
 
lol i'm learning arithmetic sequences in math right now
 
Anonymous
The strategy would have to maximize the expected value of each trial until you have achieved k successes, keeping in mind that you have to save some budget for future trials.
 
not learning much i didn't get from oeis
lol
 
Anonymous
1:03 PM
A naive strategy would be to assign p=B/n for each trial until you have k-1 successes. Then, if you have B >= 1, you set p=1 for the final trial to guarantee success. Else, you continue with p=B/n.
 
Anonymous
I should write a program to simulate this
 
I could make a challenge out of this
code-optimization
but I'm worried someone finds an optimal strategy
or that strategies are close enough to be within the error of measurement
 
0
A: Sandbox for Proposed Challenges

Ian H.Happy Birthday, let's have some cake! Disclaimer: The story told within this question is entirely fictional, and invented solely for the purpose of providing an intro. It's my friend's birthday soon and since he is a programmer and ASCII art lover, I thought I'd make him some ASCII cake! ...

0
A: Sandbox for Proposed Challenges

Carlos AlejoRestack the buckets! My little kid has a toy like this: This toy consists of 10 stackable little buckets, that we are going to number from 1 (the smallest one) to 10 (the biggest one). Sometimes he makes small piles and the toy end up like this: We can represent schematically the piles lik...

0
A: Sandbox for Proposed Challenges

GryphonWhere is this value? code-golf array-manipulation My boss now wants me to implement a mechanism that lets him search for an item in an array, and gives him the indice(s) where that value occurs. Your Task: Write a program or function that receives an array and a value (String, Integer, Float...

 
@orlp It could even be a KotH...
 
Anonymous
I don't know that it would make for a great code challenge, but maybe a post on Puzzling, Math, or Stats instead.
 
1:05 PM
@Mego I already know a post on a stackexchange website
but I don't want to link it yet, as it's no fun :P
 
Anonymous
If an optimal strategy is found, it's game over, and thus there's no point in having more entries
 
When I say a KotH, I mean you could be aiming to beat all your opponents, rather than a fixed k
 
Anonymous
@trichoplax I still think that has the same flaw - once someone figures out an optimal strategy for maximizing their number of successes, it's game over. KotHs are more interesting when there is an element of direct competition - where an opponent can hamper your strategy, rather than just being a number to beat.
 
If there's an optimal strategy for the Budget posted, I agree
Would the problem reduce to the problem where you have to choose all the p_i in advance, and just applying that strategy to the remaining problem after each throw? Then it would just depend on whether the problem choosing p_i in advance can be solved optimally
 
Anonymous
If there is a provably-optimal strategy, it would stifle competition. If not, and the strategies employed are more or less similarly successful, then it comes down to the whim of the RNG, and anybody who would be interested in such a competition is too busy playing NetHack.
 
Anonymous
1:11 PM
Without an element of direct competition, there's no difference between a KotH and a code challenge.
 
another crucial part of a KOTH
is that winning is not transitive
so you get rock -> paper -> scissors -> rock scenarios
 
@orlp Just had to rewrite the leaderboard calculations for my KotH for that very reason...
@Mego If you have access to the other players moves and remaining budget there might be the opportunity for tailoring in-game based on that
 
@trichoplax @Mego there is a recursive definition for the chance to win
def chance_to_win(n, k, b):
    if k == 0: return 1
    if n == 0: return 0

    return max(p*chance_to_win(n-1, k-1, b-p) + (1-p)*chance_to_win(n-1, k, b-p)
               for p in realrange(0, min(1, b)))
given optimal strategy
the problem is that it involves finding the optimal value in a real range of recursive calls
 
You should patch Python to include realrange. It would solve a huge number of problems... :)
 
1:28 PM
@trichoplax well that's the beauty of me writing it down like this
 
@orlp surprise, I've actually been thinking about your problem for the last half an hour or so
goodest English
it's very interesting.
for n=3, as you have shown, the max of min is 2
but for any higher n, it is 1.
 
@LeakyNun huh?
def realrange(lo, hi, steps):
    for s in range(steps):
        yield lo + (hi-lo)/(steps-1)*s


def chance_to_win(n, k, b, steps):
    if k == 0: return 1
    if n == 0: return 0

    return max(p*chance_to_win(n-1, k-1, b, steps) + (1-p)*chance_to_win(n-1, k, b, steps)
               for p in realrange(0, 1, steps))
 
I'll leave the proof to you :)
 
what do you mean
with the max of min
 
@orlp max of min means the maximum of the minimum number (for {2,2,3} the minimum is 2; for {1,1,6} the minimum is 1; the max of min of these two is 2)
 
1:30 PM
Are you both talking about the coin tossing problem?
 
yeah I'm confused kenny
 
Anonymous
@trichoplax It would solve ℵ_0 problems, but cause 𝖈 more.
 
@Mego You lost me at the second squiggle
 
@LeakyNun oh you're referring to my other challenge, not the one in chat
the product/sum equivalences
 
@trichoplax it's the continuum, i.e. the cardinality of real numbers
 
1:31 PM
@Mego Aleph zero and ... c?
@LeakyNun Ah - thank you
 
@orlp yes
 
Is that Aleph one?
 
@trichoplax that's the continuum hypothesis.
 
I got ℵ_0 problems, but a 𝖈 ain't one.
@LeakyNun in my (somewhat optimized) solution, I placed limits I could argue about on the maximum size of an element in a product/sum
 
I must say, Aleph looks much better not in monospace
 
1:34 PM
@orlp and I'm thinking about the minimum
 
Anonymous
@LeakyNun That's not right. ℵ_1 = 2**(ℵ_0) = 𝖈 which is indeed the cardinality of the continuum (aka the real numbers). The continuum hypothesis is about whether or not there is some set whose cardinality lies between ℵ_0 and ℵ_1.
 
@Mego what you said is entirely false.
except the 2**(ℵ_0) = 𝖈 part
 
Anonymous
@LeakyNun No, it is not. I suggest you do some research before flatly telling people they're wrong.
 
@Mego maybe you should do some research
 
1:36 PM
@Mego read those yourself
 
*grabs regular polyhedra shaped popcorn*
 
> the continuum hypothesis is in turn equivalent to the equality ℵ_1 = 2**(ℵ_0)
 
Anonymous
@LeakyNun I mispoke. ℵ_1 is only equal to 2**(ℵ_0) if the continuum hypothesis is true. So you were correct in what you stated, but it was stated in a way that confused me and thought you meant something else.
 
Anonymous
So I apologize for saying you weren't right, but your response came off as overly hostile.
 
Apr 27 at 20:20, by Luis Mendo
I agree @LeakyNun often comes across as hostile. I like to think it's a cultural thing. I'm pretty sure it's not on purpose.
:P
 
Anonymous
1:40 PM
@LeakyNun Yes, and I keep that in mind so that I don't get offended by your brusqueness. I just wanted to point it out so that you could keep it in mind to try to avoid coming across as hostile to someone who might not understand the cultural differences.
 
@Mego I have to go now.
 
Anonymous
Back to the original conversation, I created a Python program to simulate playing the game. I can guarantee that it only has a finite number of bugs.
2
 
@Mego I would choose B a random real 0<B<=k
we all know that B > k is trivially solvable
 
@Mego that whole conversation came from "finite number of bugs"?
 
Anonymous
@orlp Hmm, that's what I intended, but my accursed keyboard must have sent the wrong signals. Surely that oversight wasn't due to my sleepiness.
 
Anonymous
1:43 PM
@betseg What?
 
Anonymous
@orlp B = k is also trivially solvable, so I made it choose 0 < B < k
 
@Mego you you were talking about infinite stuff, did it come from "finite number of bugs"?
 
Anonymous
@betseg No, "finite number of bugs" was a joke referencing the conversation about cardinalities
 
Anonymous
Also because I don't think it's possible to have an infinite number of bugs in a program unless it's written in PHP
 
Hey is there an iterative function for Fibonacci?
 
Anonymous
1:46 PM
@totallyhuman Yes, quite trivially
 
Anonymous
int a, b = 0, 1; for(int i = 0; i < n; ++i){int temp = a; a = b; b += temp;}
 
Anonymous
b = F_n at the end of the loop
 
Hmm is iterative the wrong term for what I mean
 
Anonymous
(or a, depending on which definition you want)
 
Anonymous
@totallyhuman What do you mean?
 
1:50 PM
Ok so essentially what I want is a function that does this without looping or calling itself
 
Anonymous
So a closed-form solution?
 
Say something I could use in math..?
 
Anonymous
F_n = (phi**n - (-phi)**(-n))/sqrt(5), where phi = (1+sqrt(5))/2 is the golden ratio
 
@Mego yes
Oh huh
That's really interesting
That would have too many rounding issues to be practical in actual implementation though
 
Anonymous
Alternatively, you can use floor((phi**n)/sqrt(5) + 1/2), which is more convenient for programming. With either of those methods, though, you'd have issues with floating point imprecision.
 
1:54 PM
fib=lambda n:(4<<n*(3+n))//((4<<2*n)-(2<<n)-1)&~-(2<<n)
no loops
no floating point
 
Anonymous
There's also that one :P
 
Anonymous
I was searching the fib challenge for that solution but I didn't find it fast enough
 
that one is my invention :P
 
I'm back for half an hour
 
Anonymous
1:55 PM
@orlp Is that one derived from the solution arising from the matrix form of the linear system?
 
@LeakyNun do you mean "I'll be back in half an hour"?
@Mego no :)
 
@orlp no I don't
 
OK, I just hacked the crap out of this, I'm adding items to an invisible list and getting their height so I can tell another list how tall they are
 
f x|x<2=1|1<2=f(x-1)+f(x-2)
no loops either, just recursion
 
1:56 PM
@Mego "what you said is entirely false" < "you're entirely wrong" < "what you said is plain BS" < I can't go on now, it's too hostile :p
 
Anonymous
5 mins ago, by totallyhuman
Ok so essentially what I want is a function that does this without looping or calling itself
 
@totallyhuman you mean this formula? From the OEIS: ((1+sqrt(5))^n-(1-sqrt(5))^n)/(2^n*sqrt(5))
 
Anonymous
@totallyhuman That's mostly correct. It only skips the second 1.
 
Apr 25 '16 at 1:28, by orlp
>>> n = 10**3
>>> n**16//(n*n-n-1)
1001002003005008013021034055089144233377610
 
Anonymous
1:58 PM
@StepHen That's a generating function, which is something different
 
my solution is based on the generating function
 
@Mego I think I noticed and switched it (maybe it's still one, I dunno)
I don't intuit abbreviations like G.f. yet
 
G.f. is generating function right?
 
Anonymous
@StepHen That version is almost exactly equivalent to my version, except it's incorrect.
 
Anonymous
@totallyhuman Yep
 
1:59 PM
Dunno what e.g.f. is though
 
@totallyhuman exponential generating function
 
Anonymous
@totallyhuman Exponential generating function
 
@totallyhuman exponential generating function
haha
 

« first day (2375 days earlier)      last day (2461 days later) »