« first day (1766 days earlier)      last day (3067 days later) » 

11:00 PM
that's ossm ^
 
No one ran though
 
> I was serious! -23m ago by Alex A.
 
0
A: Bernoulli Numbers

TanMathPython, 180 bytes This is based on Mego's example implementation, except golfed further. import math def n(n,r): f = math.factorial return f(n)/f(r)/f(n-r) def B(m): if m == 0: return 1 else: t = 0 for k in range(0,m): t+=n(m, k)*B(k)/(m-k+1.0) return 1-t Try it here (on the Int...

 
@CSᵠ I starred them all via CTRL+F "henceforth"
 
my new (and working answer)
 
11:01 PM
Alex is going to build a giant wall on the border of the Nineteenth Byte.
 
@Sherlock9 rolf!
 
@TanMath I predict people will complain at you for not just editing your old answer
 
@quartata Donal Trump?
 
That'll keep out us filthy code-golfers.
 
@Calvin'sHobbies but I just asked you guys!
 
11:02 PM
To keep out the Code Reviewers
 
Then he'll put five star restaurants all across the wall, so you can eat and laugh at all the filthy PPCG users that can't get across
 
@TanMath shave some byte for some of the idented lines, puth them on the previous line separated by ;
nopythonic, but hey,,, codegolf
 
Laughing at PPCG: SE's favorite past-time
 
@TanMath Sherlock's advice was not necessarily the best
 
Anyways...
 
11:04 PM
i bet somewhere in the internet universe, there's a bet to how fast this room gets 10k starred msgs
 
@CSᵠ That was passed a longgg time ago I believe.
Thoughts?
 
8525 now
 
Oh. Hm.
 
@Calvin'sHobbies so you should have said something!
 
wth is that number
18k in room info
 
11:05 PM
4
A: Sandbox for Proposed Challenges

quartataGrocery Store Micromanagement You are an employee at the hip new grocery store Half Foods, and it's the day before Thanksgiving. Since the store will be packed with customers rushing to get their turkeys, pumpkin pies and/or lentil loaves, the store needs a traffic manager to send everyone to th...

 
@CSᵠ Is that the total message count, maybe?
 
@Calvin'sHobbies Well, even in its unrefined state, it's better than my solution in byte count
 
ok so... 18.3k are the stars, but the starred messages are 8.5k
@quartata any day now, at this rate
 
@Sherlock9 Right, but new answers should not be advised for things that are only updates to existing answers
4
 
@CSᵠ I meant on my challenge
But yeah I'm sure we'll hit that soon
 
11:07 PM
what is that chlng?
reading..
 
Which I just noticed a big mistake in
 
grocery store?
 
Fixed
@CSᵠ Yes.
 
@quartata K.
 
@Mego Your new avatar is way better=)
 
11:09 PM
@flawr No it's not
I miss the frustrated penguin
 
I do not.
 
anybody here to help me? My bernoulli code does not work for cases 5 and 9
it needs to round to zero
 
@Mego Actually 1.1e-16 was correct. It's close to 0, at least within 6 digits
 
@Mego: 1.1102230246251565e-16 basically is 0.
For the record, my code produces that too.
 
@Calvin'sHobbies Any thoughts on my grocery store challenge?
 
11:10 PM
@Mego so @TanMath is correct. It's just badly golfed
 
Anonymous
@TanMath Come up with your own code rather than stealing the reference implementation? Actually test your code before posting?
 
Anonymous
@El'endiaStarman 6 decimal places would be 1.110223e-16
 
Anonymous
Though I can see where that might be confusing
 
@Mego i tested it for most cases
 
....which is 0.000000000000000111...
 
@El'endiaStarman so your code is wrong too!
 
@Mego I thought decimal places was from the decimal point?
 
wait, is my code bad or not?!
 
@quartata seems compleicated, not my cup o` tea
 
@Mego Since it's 0.000000000000000110223..., that's within the parameters
@Mego Besides, I get the exact same thing
 
11:12 PM
@TanMath It's poorly golfed, but correct, I believe.
 
@Mego so what, it is golfed, and not exactly yours, I take out the factorial part and use math module! is that not fine with you?
 
Anonymous
Meh, that's not what I intended when I wrote it, but it's too late to fix it
 
>>> b(20) [1.0, 0.5, 0.16666666666666674, 0.0, -0.03333333333333344, 1.1102230246251565e-16, 0.023809523809523836, 0.0, -0.0333333333333341, 2.220446049250313e-15, 0.07575757575757303, 3.3306690738754696e-16, -0.2531135531135502, 1.3322676295501878e-15, 1.1666666666666505, 1.7763568394002505e-14, -7.092156862745085, 8.526512829121202e-14, 54.97117794486164, -7.958078640513122e-13, -529.1242424242307]
 
@El'endiaStarman it is? ok...
then i guess @Mego's downvote is still justified by the fact that it is poorly golfed
 
Anonymous
The totality of your "golfing" was changing the function names and importing math
 
11:14 PM
What's going on?
 
@TanMath I think Mego's also ticked at you for not coming up with your solution independently and basically copying the reference implementation. Which I do agree is in poor taste.
 
Anonymous
@quartata @TanMath posted an extremely-poorly-golfed Python answer that is a copy of another solution. So, the usual.
 
the only thing I copied was the bernoulli part.. the nCr is different as well!
 
@Mego Yeah, after golfing his solution some more, I got 136 bytes. Though I won't post it here @TanMath
 
do all the questions(challenges) need to be passed by sandbox first?
 
11:17 PM
i probably would independently derive the same answer anyway
 
Anonymous
@CSᵠ It's a good idea to
 
@CSᵠ It's a very good rule of thumb, not not strictly necessary.
 
@TanMath Your ideone link was broken, I fixed it and also changed a few things with it
Added print B(input()) so that you can do stuff with it
 
k
 
Anonymous
@TanMath No you would probably independently write nonfunctional code and beg for help in chat for days, based on prior behavior.
 
11:18 PM
@CSᵠ I have done it once, and almost did it twice, but I forgot to finish that second post.
 
@quartata that wasn't in the original code
 
@TanMath Yeah, but you can't try it online otherwise...
You also had a syntax error that wasn't in the original code
 
@quartata weird.. oh well!
 
Turns out my byte counter was weird
I need to go through my old answers to check the byte counts again
But I now have less bytes than @TanMath. Good golfing, sir or madam or other
 
Anonymous
B(31) = 0.000013 according to @TanMath's solution
 
Anonymous
11:24 PM
So it's invalid
 
I....I beat Julia! :D
 
Anonymous
#!/usr/bin/env python3
import math
import functools
@functools.lru_cache(maxsize=None)
def n(n,r):
 f = math.factorial
 return f(n)/f(r)/f(n-r)

@functools.lru_cache(maxsize=None)
def B(m):
 if m == 0:
  return 1
 else:
  t = 0
  for k in range(0,m):
   t+=n(m, k)*B(k)/(m-k+1.0)
 return 1-t

for i in range(60+1):
    print(i, "%0.6f"%B(i))
 
Anonymous
I added cacheing so that it had a chance of finishing this year
 
Anonymous
Output:
 
Anonymous
0 1.000000
1 0.500000
2 0.166667
3 0.000000
4 -0.033333
5 0.000000
6 0.023810
7 0.000000
8 -0.033333
9 0.000000
10 0.075758
11 0.000000
12 -0.253114
13 0.000000
14 1.166667
15 0.000000
16 -7.092157
17 0.000000
18 54.971178
19 -0.000000
20 -529.124242
21 -0.000000
22 6192.123188
23 0.000000
24 -86580.253114
25 -0.000000
26 1425517.166667
27 -0.000000
28 -27298231.067816
29 0.000000
30 601580873.900637
31 0.000013
32 -15116315767.092148
33 0.000641
34 429614643061.159058
35 0.013672
36 -13711655205088.136719
 
11:25 PM
@Mego Good idea
 
Now I just gotta wait for Pyth or CJam to beat me... :(
 
@Mego Huh. Why does that happen?
 
@Mego wrong! B(31)!=0.0013
 
Seems strange.
@TanMath Right, and that's your code.
 
Anonymous
@quartata Floating point rounding errors
 
11:26 PM
@quartata oh yeah!
 
Anonymous
@quartata Really it's my code :P
 
so I guess I wasted so much time for this... oh well
 
Anonymous
@Sherlock9 mothereff.in/byte-counter is what I use for byte counts for normal languages
 
@Mego Darn it, my own Python solution broke at b(29)
 
me too ^
 
11:27 PM
@Mego Yeah.
But why at 31 specifically?
Hm.
 
Stupid floating precision
 
Anonymous
@quartata Because IEEE
 
Right then. Now to import Fractions -____-
 
I feel discriminated.. All the other answers have all the same errors, but they have so much upvotes...
 
Anonymous
I cannot emphasize this enough: test your solutions before submitting them
 
11:29 PM
@Mego test from 1-9, which is what you put!!!
 
@Mego In his defense, it would take a while to test that high.
I'd probably only go up to 20 for verification.
 
Anonymous
> Your answer must give correct output for all inputs up to and including 60
2
 
Anonymous
@quartata Laziness is not a defense
 
Sure.
 
Anonymous
Just slapping memoization/cacheing on it makes it finish nearly instantly
 
11:30 PM
But I can see why he would, since if you don't get your answer in early here you basically don't get an upvotes.
 
@Mego it is not laziness, but it is just that it takes time for the program to run anyway
 
Anonymous
@TanMath For the solutions that I have tested, I have voted accordingly, based on whether or not they work. I haven't tested every solution yet - I expect the posters to test them also, which is not an unreasonable expectation.
 
Anonymous
1 min ago, by Mego
Just slapping memoization/cacheing on it makes it finish nearly instantly
 
Anonymous
real    0m0.098s
user    0m0.062s
sys     0m0.030s
 
@Mego Oh, I wasn't really aware of this.
 
11:32 PM
@Mego what is memoization
 
@TanMath Means you store the results of function calls for re-use.
 
@Mego so by that logic, Starman's and Sherlock9's answer is wrong so you should downvote!
 
@TanMath ?
 
@quartata their answers are wrong, so @Mego should downvote, correct? After all he said "I have voted accordingly, based on whether or not they work" And he is definitely now aware Starman's and Sherlock's answers don't work
 
Anonymous
@TanMath I did downvote Sherlock9's. I haven't tested Starman's yet.
 
11:36 PM
@Mego it is wrong too
@Mego B(31) prints 1.3e-5 or so
 
Anonymous
And now I have, so now I have downvoted
 
@TanMath It got posted 13 minutes ago...
 
@quartata yeah, so?
 
You can't exactly blame him for not having tested it yet.
He isn't omniscient.
 
Anonymous
@quartata Hey now don't make claims you can't back up
 
11:38 PM
@Mego Oh, sorry.
 
@Mego so my code only doesn't work for odd numbers?
 
@Mego Working on it, but it's going slowly. IDLE's debugger doesn't like Fractions
 
Anonymous
@TanMath As far as I can tell, yes
 
@Sherlock9 ew IDLE
Use print statements pls
 
@Mego a) Mego is mortal. b) All mortals are not omniscient. Therefore, Mego is omniscient or non omniscient
 
Anonymous
11:38 PM
The odds were the first issue I noticed
 
@quartata Yes well
 
Anonymous
1 min ago, by Mego
@quartata Hey now don't make claims you can't back up
 
@Mego can it return plain zero?
 
@Mego ._. a ∨ ¬a is always true
 
@CᴏɴᴏʀO'Bʀɪᴇɴ The flaw is that you assumed he was mortal.
 
Anonymous
11:40 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Your first premise has an issue
 
Anonymous
@TanMath For odds, yes
 
So? I don't use it.
^_^
Nor did I say it was a premise
 
@Mego good, fixed it, do you want a link right now?
 
@TanMath If you provide a link please use ideone's fork feature so we can edit the input.
 
Anonymous
^
 
11:41 PM
Just hit "fork" then provide the fork link
 
Anonymous
Is there an easy way to run Matlab code?
 
@Mego Yes Octave
 
Anonymous
That doesn't involve going through MathWorks?
 
I added a statement to check if it is odd and not 1
 
why on earth does ideone have support for Whitespace?
 
11:45 PM
@phase Because.
It's actually up there with Brainfuck as one of the more notorious esolangs.
 
@Mego i do not think so
 
SO has a tag for it
 
does this code work?
@quartata you mean PPCG?
 
Edited @Mego ideone.com/fSgUFX for testing
 
@quartata it's hard to see the grid when it's all spaces. Maybe use .?
 
11:48 PM
i guess since @Mego is not responding, it does not work
ooh, what a heated competition with you @Sherlock9
I gota go now, so if it does work, I authorize permission to anybody to correct my answer with the code I posted on ideone and the byte count is 184 BTW
And I am pretty sure nobody cares but dibs on Pyth for the bernoulli numbers!
 
@TanMath I don't think you can call dibs
@TanMath Also, that almost guarantees that someone else will now try Pyth
 
@quartata Better yet (unless I'm really misunderstanding something) just put # everywhere a shopper can't go. That makes it easier to tell whats going on visually
 
Oh, I only need 22 rep to get 200 today
And I have 8 minutes
Shoot
 
#####=#####
#####s#####
#####s#####
#    Y    #
# ## ### ##
#s## ###s##
#s##s###s##
#5##1###2##
 
11:55 PM
Some other day, perhaps
 
@Sherlock9 you sure?
check your account!
 
11:55pm utc
 
@TanMath Thanks a bunch, @TanMath
 
@Sherlock9 Are you @ 200? :3
 
Yep!
 
11:57 PM
@Sherlock9 you are welcome
 
@CᴏɴᴏʀO'Bʀɪᴇɴ And thank you
 
@quartata I don't see the need for the last row. Where do shoppers go if two lines are equal?
 
@Sherlock9 Np :P
 
oh, so close to 500!
 
@Calvin'sHobbies To the third line
 
11:58 PM
exciting!
 
@Calvin'sHobbies And thanks to you as well, if you upvoted as well
 

« first day (1766 days earlier)      last day (3067 days later) »