« first day (1546 days earlier)      last day (3593 days later) » 
00:00 - 17:0017:00 - 00:00

00:13
@MartinBüttner: PPCG question for you.
Would "tips for creating a challenge leaderboard" be on topic here?
0
A: Sandbox for Proposed Challenges

Martin BüttnerBirthday Paradox with Leap Years code-golf probability-theory Background The birthday paradox is a popular problem in probability theory which defies (most people's) mathematical intuition. The problem statement is: Given N people, what is the probability that at least two of them have the...

@AlexA. Ummm, I don't think so. What exactly would be asking for?
Tips... on creating a leaderboard.
I don't know how but I'd like to.
They're becoming increasingly common in challenges, so it seems like a reference for folks who'd like to include them in their challenges would be a good resource to have.
just copy mine :P
well I could make it a meta post
those are increasingly common.
Haha
I just like to know why it should be done a certain way. Basically I'm a knowledge whore.
00:23
I don't know, I just went with the most practical approach
(scrape the data from the SE API, parse the headers with regex, and build a HTML table)
I don't know if there's a reasonable other way
Ah, okay.
I looked at Calvin's leaderboard code once and there was all sorts of JavaScript and I was simultaneously impressed and confused.
@MartinBüttner I wonder what algorithm would be fastest for these kind of numbers
in the past I've used pollard-brent
although pollard-brent is kinda complicated
@MartinBüttner A meta for your snippet's usage would be nice.
^ Agree
@orlp I couldn't tell, I've never looked into factorisation algorithms.
00:31
oh
it's pretty cool
I did an optimized implementation once
@randomra @AlexA. Yeah, as well as the unminified code I guess. I'll try to get it up on meta tomorrow.
@MartinBüttner are you familiar with montgomery multiplication?
nope
one day I will learn some number theory...
it's a fast way of doing a*b mod m
if m stays the same a lot
really cool stuff
It was invented in Montgomery, Alabama
00:33
well, I need to head off... got a meeting tomorrow morning.
@PhiNotPi btw you never accepted answers for unscramble the source code.
@MartinBüttner Goodnight! Hope your meeting goes well.
@MartinBüttner a really cool property of my implementation was that it wasn't deterministic
and I abused that by simply not accounting for integer overflow at all
it was faster to just redo trials when something went wrong then to check for it :P
00:53
Me: "There's a helicopter outside." Dad: "That's where they belong."
how does .d work in pyth? it's non-intuitive to me
like, .d,1z should create {1:z}, right?
but i get TypeError: cannot convert dictionary update sequence element #0 to a sequence
01:14
nvm, i got it. .d,,1z works
01:56
@orlp How to load a constant into a variable?
If I were to learn the Chapel programming language, could I turn my laptop into a supercomputer?
^ urgent
 
1 hour later…
03:19
Nothing like staying up late at night summing infinite series...
 
1 hour later…
04:25
...still awake...
Is anyone on here willing to help with a homework problem?
(I know the answer, but I can't prove it)
For what values of p does the following series converge?
(log(k) should really be ln(k))
The answer is, I think, p>1
I think it's going to be a two-part problem...
3 part, actually
:/
:(
This is awful
05:06
Finally, I proved it. It converges when p > 1.
I feel like there should be something called "proof golfing."
05:53
0
A: Sandbox for Proposed Challenges

DLoscA Golf of Two Cities code-golf kolmogorov-complexity Write a program in as few bytes as possible to output the opening sentence of A Tale of Two Cities: It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, ...

@TheNumberOne mov a, 42
Whenever a register is used as an operand you can use an immediate value instead.
06:12
@PhiNotPi that should be >= 1, no?
k*log(k) goes to positive infinity, so 1/(k*log(k)) goes to 0
and then you can write k^p * log(k) as log(k^(k^p)) for the p < 0 < 1 case
and I don't see how that doesn't converge either
so p>0?
aaaaaaaaaaaaaaaaaaand I'm being stupid
scrap all that above
scrap scrap scrap scrap scrap scrap
you're interested whether the sum converges, not the value
@Optimizer trust Optimizer, always there when I need him
06:28
yay, I am back on my 5 upvotes per answer average :D
33/8 more to go
 
1 hour later…
07:28
0
A: Sandbox for Proposed Challenges

randomraCounting in pyramids code-golf numbers You should write a program or function which receives a list of non-repeating integers as input and outputs number of occurrences of each of the input numbers in the following upside-down number pyramid. Starting from the original list in every step we cr...

07:39
sweet
write_int:
    divu o, m, o, 10
    jz write_int_done, o
    call write_int
write_int_done:
    add m, m, ord("0")
    sw -1, m
    ret
 
1 hour later…
08:39
@randomra if you need a reference implementation to generate test results: cjam.aditsu.net/#code=q~%5D__%2C(%7B_2ew%3A%3Ae%3E%7D*%5D(%5Ce_fe%3DS*&inp‌​ut=5%202%209%201%206%200
ugh, why didn't I expect that...
@MartinBüttner Thanks, have one but it doesn't hurt to double check :)
I find it a bit easy though
haha ew
but the O(n*log n) is quite difficult for golfing (in the way I solved it)
@Optimizer I believe that's the shortest way to do generalised differencing now
I tried with vectorised operators as well, but that always came out two bytes longer
oh, is that a challenge ? :P
08:45
sure, why not. you can start working based on this if you want:
[5 1 2 6]
e#{_@e>\}*;]
e#_1>\W<.e>
e#_,(ew~.e>
e#2ew::e>
@randomra s/non-repeating/unique ?
s/unique/distinct/
what is this syntax?
vim
replace
perl replace
anything really
I think it actually works in some chats (Skype. might work in gitter. don't know about IRC)
08:52
def. not irc without client extensions
weird, never saw it before, s as in replaces? :)
I only know the language ///
s as in substitute
ahh, I see
I've seen an irc bot that parsed substitutions and responded with "X meant to say ..."
also, sed uses that syntax too :)
btw, the choice of "ew" in CJam is meaningful
09:04
s/$/ to me/
hehe, let me make an image
no I think I can see it ;)
@MartinBüttner 24 bytes
kk
might try to improve mine later
could you shorten the generalised differencing?
no, I followed a different algorithm
which requires a few new tricks ;)
literally
@randomra planning to posting it soon ?
@Optimizer dude, it's been in there an hour. we always try to encourage people to leave it there for at least a day, so don't start rushing it, because you're impatient to post your solution. :P
@MartinBüttner dude, I didn't say NAO, I said soon :P
Don't be jelly that I have a shorter solution :P
@aditsu What do vectorised operations do for unequal lengths? just append the elements of the longer vector? I would have expected it to either wrap or truncate the shorter one.
but if you just append the original array then you potentially end up with different types where you don't expect them
they work just like z
09:16
that's a shame :/ ... if I wanted z, I'd have used z :D
What ?
@aditsu beautiful
ugh, sans font in chat
09:17
that was really not how I pictured it :D
@MartinBüttner yeah [1 2 3][1 2].+ -> [2 4 3], since 2+2=4 and 3=3
right but that's weird if you do "def""ab".-
@Optimizer tomorrow probably
@randomra cool
@aditsu but how does the image relate to this ?
@aditsu if you truncated, then we could save another byte on generalised differences. (_1>.op instead of 2ew::op)
@Optimizer it doesn't. it's the explanation for why it's ew.
@aditsu btw, this is why I thought it's w:
1  2  3
 \/ \/
 12 23
09:21
that's a similar idea
@MartinBüttner ohhh
(hmm, a new language using only the "topology" of the (individual) code characters...)
in recent times, has CJam ever won over Pyth ? (in competitions where Jakube has participated)
or rather, what are the number...
I can smell a new CHallenge being cooked up
10:17
Is it normal to have 6 of the newest 15 questions on hold?
define normal
!abnormal
10:35
With Evolution of OEIS (also known as EOOEUS), I'm thinking scoring could be votes multiplied by a function of its depth on the tree (maybe SQRT()?).
SO then scoring would be votes * sqrt(level)
On the other hand, I feel like there should be a golfing aspect.
10:55
@PhiNotPi I vote for golf+depth based score. If you write a snippet maybe votes could be added somehow. Idk how that worked out in the past.
Hello!
@randomra I'm unsure how to get partitions right.
@Optimizer Pyth > CJam
suck it haters
@FUZxxl I posted a code for it in the comment. (<@(<;.1)~1,.2#:@i.@^<:@#) 'abc'
@orlp Shouldn't it be Pyth < CJam if it's a golfing contest?
@PhiNotPi > here means 'better than'
11:01
@randomra Looks like it could work.
@Optimizer Martin's CJam answer beat Jakube's Pyth by 1 byte here
I'm leaving for lunch now.
@Zgarb this is unacceptable
@FUZxxl have you written any GOLF yet?
if yes, how's it going so far?
I need to create a language called Prl based on Perl like how Pyth is based on Python.
@orlp numbers or it didn't happen
11:12
@Optimizer 42, 1, 2, 3, Python > CJam, 4, 5, 6
there
plenty of numbers
@orlp proof or it didn't matter
I don't have a proof, but I can cite an authority on the matter
15 mins ago, by orlp
@Optimizer Pyth > CJam
self referencing is never called citing
I am genuinely trying to find numbers here, so trollers be gone
@aditsu is it possible to make List 0 ew work ?
11:27
@Optimizer you can look at the stackexchange dump, download PPCG, and programmatically extract the smallest answer, and check if it's Pyth or CJam
@orlp no thanks.
11:46
@Optimizer what is that supposed to do?
just kind of a no-op
creates length many empty arrays
because in general, you don't have a way to create an array of 1 to N
so combining ew somehow with , requires an additional step of :)
o_O
N,few will never work
where N is a number
12:14
@orlp I haven't actually! I'm still thinking and I have some calculus homework to do.
And I asked a question in the meanwhile:
11
Q: Is it legal to call memcpy with zero length on a pointer just past the end of an array?

FUZxxlAs answered elsewhere, calling functions like memcpy with invalid or NULL pointers is undefined behaviour, even if the length argument is zero. In the context of such a function, especially memcpy and memmove, is a pointer just past the end of the array a valid pointer? I'm asking this question ...

12:25
@orlp I'm now getting a struct.error: unpack requires a bytes object of length 8 when I try to read from address -1.
@TheNumberOne you have to use lw/sw when reading/writing to/from -1
or is this a different error
I'm using lw
give me a sec
post full trace please
actually, what you say should be impossible
are you sure you got the order right?
lw c, -1
@TheNumberOne git pull
you have an outdated version - there is no struct.unpack on line 80
12:29
ah. okay
fixed in new version?
I think my brain just exploded with respect to the aforementioned question.
@orlp Nope, it's not :(
@orlp It could just be Windows I/O
12:41
@TheNumberOne can you post a minimal assembly example that does this?
that doesn't spoil your answer
    call read_int
    halt 0


read_int:
    mov x, 0
read_int_loop:
    lw c, -1
    cmp q, c, ord("\n")
    jnz read_int_done, q
    sub c, c, ord("0")
    mulu x, d, x, 10
    add x, x, c
    jmp read_int_loop
read_int_done:
    ret x, c
directly copied from one of your examples.
you see
I'm confused
open up golf.py
go to line 69
that checks for -1, and it should never get to line 84
@TheNumberOne what command do you use to compile and run?
in particular, did you recompile after git pull?
python as.py factor.golf
python golf.py factor.bin
Python is python3 on my system.
@orlp yes i did.
after line 68
(` def load(self, a, width):`)
insert print(hex(a))
weird. it's working now.
12:52
does it break again when you remove the print(a)? :P
if so we have a succesful heisenbug
no, it doesn't... that's very unusual.
I think you might've not recompiled before running again, or the file was in use, not allowing python to write or something
by the way, I made a better write_int than the one in the examples right now
5 hours ago, by orlp
write_int:
    divu o, m, o, 10
    jz write_int_done, o
    call write_int
write_int_done:
    add m, m, ord("0")
    sw -1, m
    ret
aha, the file being in use is plausible, maybe I can close the files more aggressively
Hey everyone, my chrome doesn't seem to like the meta site's certificate
@isaacg same here
I don't use https on SO though
It says it's a cloudfare certificate, not a SE certificate
Main site is working fine though.
13:00
@ChrisJester-Young ^
13:40
0
Q: Pedantic Birthday Paradox

Martin BüttnerBackground The birthday paradox is a popular problem in probability theory which defies (most people's) mathematical intuition. The problem statement is: Given N people, what is the probability that at least two of them have the same birthday (disregarding the year). The problem is usually...

grc
grc
@MartinBüttner wow you have 40k rep already :O congrats!
you were on about 20k not long ago
14:00
@orlp Thanks, I'll pass that on to the dev team, though TLS certs were wonky for meta even before our CloudFlare transition anyway, as far as I remember.
@isaacg correct - meta sites do not support SSL/TLS
(meta.<not stack exchange> are special exceptions with valid certs)
@grc thanks :)
I think it's been almost exactly half a year since I hit 20k. I've got a screenshot from 28 October.
@MartinBüttner on your Birthday problem challenge, you post that 99 => 1.0 Is that because of rounding?
I thought so, making sure I wasn't missing anything
14:15
@NathanMerrill clarified that in the post
Rules updates for Evolution of OEIS (EOOEIS) idea: meta.codegolf.stackexchange.com/a/4921/2867
I think I would want 2 stack snippets in the question (is that possible?). One will be a scoreboard, and one will show the tree.
yes, that is possible
"at the highest level possible." seems ambiguous (depending on how you picture the tree). do you mean the deepest level?
Deepest
greatest
wtf, how is Telescopic Parentheses still on the HNQ
14:28
I didn't even find it that interesting
@NathanMerrill I didn't expect you to :P
not sure if that was an insult or not :P
It's also a total ripoff of Explanation Formatter. (It's actually completely different, I just don't like being the "inspiration for a more popular question")
@NathanMerrill it wasn't. I just don't remember you being particularly interested in golfing.
well, some golfing problems are interesting
I just didn't think that one was
14:34
@PhiNotPi if you want to sum the scores for a submitter's multiple submits you should use the reciprocal so higher score will be better and addable
@NathanMerrill "not sure if that was an insult or not :P"
?
I understood you were replying that statement
yeah, no I'm saying it back at you :D
oh lol
I didn't even realize you wrote it
no problem ;)
how do I search OEIS for sequences starting with a given subsequence?
14:38
^ I couldn't figure that out either. :(
@Peter do you know if that's possible? ^
It should be a really simple thing to do.
Is there some obscure language where an empty program always outputs 0?
there's probably some esolang which automatically prints the value of some register or stack at the end of the program
@MartinBüttner I spent a lot of time trying to find it out but couldn't. :(
I don't know one off the top of my head though
14:47
@MartinBüttner Partial solution: seq:1,2,3,6,11,23 -seq:_,1,2,3,6,11,23 finds those sequences where 1 2 3 6 11 23 occurs in the beginning and nowhere else.
@PhiNotPi or outputs the input number
The sequence 1 2 3.... could show up as deep as level 3. (Preceded by 1,1,1, and 1,2,4,8,)
@Zgarb Thanks, great! (given the possibilities)
@PhiNotPi it could show up at almost any level
just like 0 0 0 0
@PhiNotPi actually, I can probably make a 0-byte retina solution
the default operation mode is counting matches. so this will give no. of decimal digits + 1
lol at probably :D
14:52
well it depends if that's an OEIS sequence
It really can show up at any level as long as there's a sequence that matches the first however many terms. There's probably a lot of sequences that start with 1,2,3,4
0 0 0 is a sequence. I checked.
It does sound funny. " I can probably make a 0-byte solution if I write it well enough."
Do you think deeper level scores could compete with 1-2 char solutions at starting levels?
hm yeah, the zero sequence is definitely possible with a single character in many languages.
(and possibly with zero characters)
or the natural numbers
I would do a scoring like level/(length+10) (I know I already said it before)
I think an empty fractran program would output the input
14:57
Maybe change the requirement to "print the first N terms"?
But that might exclude some stuff.
I should quickly add decimal to unary conversion to Retina ;)
going to bed, bye all!
@MartinBüttner Download the database. It's a text file, a bit under 50MB, which contains just the names of the sequences and the first few terms.
Oh, neat. Thanks :)
@PhiNotPi You might want to add that as a suggestion to the post.
it's not entirely obvious where to find it. it appears to be the stripped.gz link on this page
15:17
Here's an idea as to how to score stuff:
Each user will have a score created by combining the scores of their answers.
Each answer's score will be calculated with something like (length/depth + 1).
And their combined score is like resisters in parallel: inverse is sum of inverses.
I can probably simplify this.
Answer Score = depth / (length + depth)
User Score is sum of answer scores.
15:35
This guy is really getting on my nerves lately.
That's not the first time you've said that. Is there any evidence that it's CJam hate and not just a normal downvote? I've had answers downvoted, despite not using CJam.
Well, I don't see a reason for a down vote considering it a normal answer
and I can point to several questions where someone mass downvotes just golfing language based submissions
Well the question itself has 6 DVs. I'm pretty sure I've seen people say they DV answers to "bad" questions, too. It could be any number of things.
since this question has no other answers, yeah there is a doubt that this is not cjam hate..
15:46
Either way, I'd be happy with +31/-1 :P
+32/0 is still better :P
@AlexA. @randomra meta post for the leaderboard snippet is up.
0
Q: Leaderboard Snippet

Martin BüttnerI've been using a stack snippet for a while to generate leaderboards for my simpler or more popular code golf challenges. I want to share the code for this snippet here so others can use it more easily as well. Feel free to put feature requests and bug reports in answers, or let me know in chat....

var answer = 574b6d73-42db-4091-b2de-8e05fd1d2eaf(answer)
@MartinBüttner ^ What does that line mean?
ugh...
I forgot that meta still has mathjax activated
15:55
ah
s/\$/jQuery/
@MartinBüttner so the adjusted_for_leap_year probability when N = 23 is 1 - 366!/(366^23 * 343!) right ?
fixed
@Optimizer no, that gives 0.506323
(instead of 0.506876)
yeah, that is what i was wondering ..
so do we have to calculate the formula ourselves ?
16:01
well yeah, it's not quite as simple as the problem without leap years :P
and any year range ?
yes, just assume it's equally distributed over the 400 year cycle
16:16
There's 97 leap years every 400 years, right?
so its just a challenge of finding out the formula first :P
@orlp yes
@Optimizer yes, that's part of the challenge, and there might be multiple ways to calculate it.
@MartinBüttner might?
this is math we're talking about
well yeah of course there is an infinite number of ways, but I don't know if there are multiple substantially different approaches which are feasible to golf and still meet the time limit.
everyone might end up using the same approach.
@orlp Does the golf-cpu flush after every output?
16:24
@TheNumberOne open the source code :)
but yes
I've got the formula, trying to golf it computationally
hmm, i was pretty sure my formula was correct, still I get 0.507061151502729 for 23
@MartinBüttner may you use a builtin for the gamma function?
@orlp sure
@MartinBüttner so simply replacing the probability to have birthday on a day (1/365) to the actual value (over 400 years) is not the answer ?
because its not giving the right values
16:40
@Optimizer no that doesn't work, because you get different probabilities depending on whether someone actually has their birthday on 29 Feb or not.
This challenge isn't pedantic enough to be called pedantic. The fact that birthdays are far from uniformly distributed surely matters more ;)
I've got a very simple formula which gives the first 5 decimal correct for all inputs and the sixth one correct for 40 numbers :D
@Geobits Feel free to come up with a better title ;)
@Optimizer could that be due to different rounding, or is that sixth one way off for some of them?
(Somewhat) Pedantic Birthday Paradox
@MartinBüttner off by 1
16:50
how do you round then?
oh, I haven't rounded at all
just truncated?
CJam gives me 10 decimals
yeah, truncated
let me round
aww
gamma not enough range :(
@Geobits I actually went with that.
16:55
:D
I just now noticed Peter ninja'd my chat message in the comments an hour ago :(
00:00 - 17:0017:00 - 00:00

« first day (1546 days earlier)      last day (3593 days later) »