« first day (1765 days earlier)      last day (3072 days later) » 

9:00 AM
What does the range thing do?
 
Anonymous
Same as for(int j = m; j > 0; j += -1)
 
Oh! :D
 
Anonymous
Basically, range creates a list of the integers between the first arg and the second arg, with the third as the step
 
Anonymous
And for j in... iterates over that list
 
Python has no traditional for loop. It only has a for-each which it calls a for loop.
 
9:04 AM
:D (Javascript doesn't have that...aww..)
 
Anonymous
^^
 
@Stefnotch coffescript ftw ^.^
 
Anonymous
^
 
reference implementation
def B(n):
    n += 1
    A = [0] * n

    for m in range(n):
        A[m] = 1 / (m + 1)
        for j in range(m, 0, -1):
            A[j-1] = j * (A[j - 1] - A[j])

    return A[0]
 
Anonymous
@Stefnotch Also note that Python 3's range (as well as almost everything else) acts subtly differently
 
9:06 AM
^^^ XD
 
A bit more than just subtly I believe, as anyone who's done range(99999999999) can confirm :P
 
what's way worse is if you do range(10**9) or something like that.
 
xrange has just been renamed to range in Python3
Python 2's range has been deleted
 
10**9 reminds me of something...JS will get the ** operator!
 
Anonymous
9:26 AM
@Stefnotch Only like 7 years late
 
:D
 
I WANT KITTIES
I WUV KITTIES
kitties are the best.
 
@xsot I like explaining my solutions because I'm a show-off
@Stefnotch Yeah, Bernoulli numbers are pain in the butt because they're hard to explain and are in a surprising number of places
@Stefnotch Which is why it's impressive that the "first computer program" by Ada Lovelace calculated the Bernoulli numbers
Factorial:
from math import*
lambda n:exp(lgamma(n+1))
@Maltysen ? Then what is a traditional for loop?
 
Anonymous
@Sherlock9 lazy
 
9:44 AM
You can do lazy with generators though, right? (Confused)
 
@Mego Also, inaccurate as it turns out. Darn
 
Anonymous
@Sherlock9 You could just do import math; factorial = lambda n:int(math.gamma(n+1))
 
Anonymous
Though I dunno if that'll also be inaccurate
 
Anonymous
Also not golfed because reference implementation
 
If you bring in floats, it's bound to be inaccurate :P
Is there no factorial in the math module?
 
Anonymous
9:51 AM
@Sp3000 durr
 
Anonymous
reference implementation
 
Anonymous
Which means it's allowed to be bad
 
@Mego Just checked. Pretty inaccurate
 
No, reference implementation means it's supposed to be correct.
 
Two functions not golfed at all
def comb(n,k):
 a=range(max(k,n-k)+1,n+1);b=range(1,min(k,n-k)+1);c=1;d=1
 for i in a:c*=i
 for i in b:d*=i
 return c//d
 
10:05 AM
today I got to use the word 'parenthesizations'
 
^ is this a word?
 
def b(m, l=None):
 r = l if l else [1.0]
 if m < len(r):
  return r[m]
 else:
  s = 0.0
  for k in range(m):
   if k >= len(r):r=b(k,r)
   s += comb(m,k)*r[k]/(m-k+1)
  r.append(1-s)
 return r
 
anesthetization is.
parenthesizes also.
 
(2+3)*4 and 2+(3*4) are two different parenthesizations. <-- I'm guessing this is the meaning?
 
>>> b(10)
[1.0, 0.5, 0.16666666666666674, 0.0, -0.03333333333333344, 1.1102230246251565e-16, 0.023809523809523836, 0.0, -0.0333333333333341, 2.220446049250313e-15, 0.07575757575757303]
Need to work on that rounding
 
10:07 AM
Yeah, start sanding those edges!
 
@Sp3000 yes
 
What were you using the word for? :P
 
@flawr What?
 
rounding = sanding edges
too late, i'm sorry for the bad pun=)
 
@flawr oic lol
 
10:10 AM
I need your opinion on my edge counting challenge in the sandbox. The goal is counting the number of edges in a pixel image.
 
Changing r.append(1-s) to r.append(round(1-s,6)) doesn't work very well >>> b(10) [1.0, 0.5, 0.166667, -1e-06, -0.033332, -1e-06, 0.02381, -0.0, -0.033334, 1e-06, 0.075758]
 
I want to allow (but penaltize instead) answers that do not perfectly solve the task, in order to allowe creative solutions that may not work perfectly.
 
@flawr Your polygons' edges appear to need some sanding.
 
@feersum I know, right=)
What is your opinion on this, would you allow non-optimal answers?
 
How many test cases are there going to be?
 
10:14 AM
I think about 10-12.
Depending on how many interesting ones I'll find=)
 
How many do you think it needs to solve to be interesting?
 
I do not know, I just thought of different cases like with convex and concave vertices etc.
@feersum So would you disallow non optimal answers completely?
 
Do you mean optimal as in solving all the test cases or should it theoretically work with some other inputs as well?
 
Finding the correct number for each test cases.
 
I posted a new challenge \o/
good luck
 
10:26 AM
If there are limited test cases then you could already take some shortcuts, probably
 
(The ansers should work for other inputs as well anyway, as optimizing for testcases is not allowed by default, I think?)
 
0
Q: Fully parenthesize expressions

orlpToday your challenge is to produce all possible full parenthesizations of an expression. Your input is a single line of printable ASCII containing one or more variables separated by operators. The input might also contains spaces - you must ignore these. A variable is [a-zA-Z], an operator is [^...

 
10:46 AM
@Optimizer you here?
it doesn't matter what the terms/operators are anyway
it's always TERM OP TERM OP TERM OP TERM
so you can just strip spaces and split
 
@orlp Right. Now the pain in the ass is getting all the parentheses
 
 
1 hour later…
12:09 PM
still no answers after an hour
damn
 
sunday..
 
@Optimizer isn't that the best day?
 
not on holidays
thanks giving
blah blah
 
12:36 PM
It's been a while since I've been here last but I just had an interesting code golf related thought
are there challenges (likely koth) where one could compete by employing branch prediction?
 
@overactor you mean implementing?
 
No I mean employin it, as in:
12759
Q: Why is processing a sorted array faster than an unsorted array?

GManNickGHere is a piece of C++ code that seems very peculiar. For some strange reason, sorting the data miraculously makes the code almost six times faster. #include <algorithm> #include <ctime> #include <iostream> int main() { // Generate data const unsigned arraySize = 32768; int data[arr...

 
ah
perhaps
I was thinking of a code challenge where you must implement a branch predictor in limited space
 
basically, suppose there's a challenge which requires you to recognise patterns in a series of ones and zeroes
@LegionMammal978 well, one thing it could do is predict what comes next in a series of 1's and 0's
 
How would you define a "pattern"?
01010010001000001000000001 has a pattern
 
12:49 PM
Though I'm not sure how clever branch prediction is
i know it recognises 11111111111111111 as a pattern
probably 1010101010 too
 
It can't use too many resources
 
as well as 110011001100
@LegionMammal978 good point
 
Or it would defeat the purpose
 
2
Q: Help the architects visualize the skyline

Stewie GriffinAs part of a city planning project, you've gotten the assignment of creating a program of function that will display the city skyline, given some input from the architects. The project is only in the startup phase, so a very rough sketch is sufficient. The easiest approach is of course to simply ...

 
Mathematica is too verbose
See my most recent solution as an example :P
 
12:52 PM
It would be more of a fun answer than an actually competitive one obviously
 
Especially string manipulation
Also, how do you put posts into chat?
 
1:05 PM
@LegionMammal978 Just paste in the link
 
If I have an object that represents a Vote, would it contain a "Voter" and "Votee", or a "Voter" and "Candidate"?
 
Depends on what the votes are cast on. For votes on PPCG, votee is the better choice.
 
well, anybody can vote for anybody
so, it sounds like Votee then?
(its for the controller for my next KoTH)
Oh, I could also do "Voted"
 
1:22 PM
Without more details, I don't know if candidate would fit. But votee/voted fits always.
Not sure if votee is an actual word, but whatever.
 
 
2 hours later…
2:53 PM
9
Q: Help the architects visualize the skyline

Stewie GriffinAs part of a city planning project, you've gotten the assignment of creating a program or function that will display the city skyline, given some input from the architects. The project is only in the startup phase, so a very rough sketch is sufficient. The easiest approach is of course to simply ...

@NewMainPosts It's interesting that the vote count in chat linked messages doesn't update. That must mean they keep track of the exact time of each vote.
Unless the message history is hiding something.
 
we should make a leader board
"most challenges won"
@Calvin'sHobbies are you going to answer codegolf.stackexchange.com/questions/65210/…
we need more answers from you :(
 
@orlp I'm currently confused about parentheses and bogged down by assignments
I will try to answer though
Incidentally, around what time does @aditsu come on?
 
I never leave :p
 
SLEEP IS FOR MORTALS
 
Dennis, Howard, Peter, isaac, Martin...
 
3:10 PM
@aditsu Your CJam implementing the prime divisors thing for sums of squares
It's driving me NUTS that I can't get it to work in Pyth
ARG!
 
didn't somebody already do it in pyth?
 
... Did they? I thought it was all array of pairs of squares then filter?
 
ah, you did
are you saying it doesn't work?
 
Yeah, I was the one who posted it
It works
It's 41 bytes!
That's far too bloated!
 
anyway, I can't help with pyth
 
3:15 PM
Ah fair enough
Pyth is kicking my ass
At this rate, I'm going to switch to CJam anyway
 
yay :)
 
3:32 PM
@Calvin'sHobbies not a very good indicator
most challenges do not accept answers =/
 
@aditsu how did you go about implementing the [ and ] operators? How do they deal with stuff like 7[;] ?
 
I have a stack of marks (positions in the main stack); when you pop something, it moves back any mark that was at that position
 
huh?
ohhh, I see
I think
 
@aditsu so [;] is an empty array?
 
@orlp But if they all did the order would presumably be about the same. I doubt Dennis and co. only try to answer questions made by users who accept answers.
 
3:36 PM
yeah, assuming there was something before the [
 
so if I did [, the stack would contain 0?
the mark stack that is
 
depends what's before the [
 
well, if the stack was only 0
 
@Calvin'sHobbies maybe the relative ordering has some form of accuracy, but the absolute numbers are worthless
 
0 length*
 
3:38 PM
if the whole program is [, then you get an error
 
@Calvin'sHobbies if you go through my answers you'll find that I've won a good chunk of them, yet barely any are accepted
 
hm? why would that be?
 
oh wait, is the comma part of the program or not?
 
no, it's not
just the [
 
I see.. ok, then it just adds a 0 mark (internally)
 
3:39 PM
cool!
thanks! I'm probably adding arrays to my language next so that will help
 
@orlp Well you go ahead and score every question without an accepted answer and tell me the proper results.
 
@Calvin'sHobbies It should be possible, using the same logic the per-question leader board uses
was more of a potential fun side project idea :P
@Calvin'sHobbies I also had an idea for a code-challenge
 
@orlp tell me
 
writing a branch predictor
 
what?
so I added carrots to scg
@aditsu have you seen usandfriends.github.io/CJam101/ ?
I use it all the time :P
 
3:44 PM
yeah I linked it from the wiki
 
really?
Cool.
 
Hello, everyone!
 
Hi Sock
 
Hi @anOKsquirrel!
 
So I got the Pyth solution I've been bashing my head on to 35 bytes
J4VrPQ8=J*J?nhtN2.&tt%htN4hhN1;?QJ1
 
3:50 PM
@Sherlock9 what challenge
 
@orlp Sums of squares
@orlp Remember last night when I posted that ugly 45 byte solution?
 
My power went out

Power outages suck
 
26
Q: Count sums of two squares

xnorGiven a non-negative number n, output the number of ways to express n as the sum of two squares of integers n == a^2 + b^2 (OEIS A004018). Note that a and b can be positive, negative, or zero, and their order matters. Fewest bytes wins. For example, n=25 gives 12 because 25 can be expressed as ...

?
 
@orlp Now I have an ugly 35 byte solution
@orlp Yes
 
it's back tho
 
3:52 PM
there's a 13 byte solution for you to learn from :P
 
@Sock Town of Socks huh?
 
does anyone know which meta question handles the function length counting guidelines?
 
yes, somebody knows
Not me though
 
@orlp I was trying to implement in Pyth the CJam solution @aditsu made and the Python solution I made from the OEIS algorithm
 
anyways gtg bai
 
@Calvin'sHobbies Yeah, @ಠ_ಠ is my neighbour.
 
@Mego ಠ_ಠ
 
@quartata += Sock
 
@Calvin'sHobbies nuu
That's not my sock
 
@Calvin'sHobbies thanks, that's exactly what I wanted, I have starred it now
 
3:59 PM
@quartata Did you mean "That's not my Sock"?
 
@Sock Do you speak sockish?
 
Sock sock sock, sock sock Sock Sock! Sock sock sock; sock, sock: sock? Sock sock Sock.
@Calvin'sHobbies Does that answer your question?
 
Are you a squirrel?
 
@Calvin'sHobbies You should ask this to @anOKsquirrel. But no, I am not a squirrel.
 
Are you a penguin?
 
4:04 PM
I am just a Sock; nothing more, nothing less.
@Calvin'sHobbies Are you a sock?
 
Of course
 
Of who?
 
Aah, now everything makes sense to me. Thank for helping me understand who I am, sock.
Is there anyone here who speaks the Ancient Language?
 
"the Ancient Language"?
 
Cool, you also read Eragon!? :D
 
I also read Eldest and Brisingr.
 
user image
3
Sock revealed
 
Atra esterni ono thelduin.
 
If Mos Eisley is the Science Fiction chat? What's the name of the Fantasy chat?
 
4:14 PM
@Calvin'sHobbies Ooops, you weren't supposed to see that...
 
I vote for The Prancing Pony if we're using the pub theme. Or The Mended Drum
 
@Sherlock9 Eisley Mos?
 
Eh, in Germany/Austria, all the books are called Eragon....
(I did read the other part too! :D)
 
@Sock apipoulaï, bom on deno?
 
@aditsu Translation?
 
4:16 PM
@Sherlock9 Moss Wisely
 
bah, you were supposed to understand :/
 
@aditsu This website tells me you were not using the Ancient Language.
 
I'm not using that Ancient Language :p
 
@aditsu Yeah @Sock, he was using Golfscript :P
 
4:29 PM
Hey, somebody should make an ancient language golfing competition! :D
 
@ Do you mean the shortest Ancient Language translator?
why don't you work, stealth ping?
 
because you're doing it wrong?
 
What's a synonym for "layer" that starts with S?
 
ping
 
stratum
 
4:33 PM
Does this stealth ping work?
And, yeah, I meant that!
 
Does this stealth ping work?
 
Hey, what happened to Doorknob's pinned message?
 
It got automagically unpinned.
 
ok seriously stop abusing stealth pings
For real here.
 
4:35 PM
stealth ping
 
@Doorknob Ah.
 
Can anybody please teach me how to stealth ping?
 
no
 
@Sock no
We're never teaching anyone that again.
 
<stealthping />
 
4:35 PM
Large mistake
 
stealth ping
 
@Sock You know, because you're a sock account, you're much more susceptible to being nuked. ;)
5
 
<@Doorknob" rel="nofollow">​ Does this stealth ping work?
 
@Sock No of course not
Stop trying.
 
Maybe
 
@Calvin'sHobbies what is wrong with you Calvin stop it
 
@Sock That pings, but it isn't very stealthy.
 
@Calvin'sHobbies quiet
 
We really don't need more of this
 
4:39 PM
@quartata "rel="nofollow">​ Does this stealth ping work?
 
@quartata Better than letting them do loads more fruitless testing
And yet...
 
hovers over "suspend @Sock" button
 
@Sock No it doesn't stop trying
 
presses down Doorknob's hand
 
You can't use HTML in a message jeez
 
4:39 PM
10:37 < Rodney> stth (Tou Hum Mal Neu) wished for "", on turn 13728
10:37 < stth> wow
10:37 < stth> lol wtf
10:37 < stth> i somehow managed to cancel that one, i just wanted to dip out my
              crappy potions lol
@quartata :P
 
@Doorknob rekt
 
tempted to make a shortest stealth ping to message adder challenge
 
@Stefnotch There is no real skill to it
It wouldn't be that tricky
 
Yeah....so, I guess I could leave it.
 
@Stefnotch" rel="nofollow">​ Does this stealth ping work?
 
4:41 PM
@Sock NO STOP TRYING
 
Yeah! Totally stealthy!
 
It's really annoying.
@Doorknob trash can
 
@Sock I think that is enough for now
 
/trash/ pls
 
4:41 PM
It was fine at first, but perhaps we're going to have to forbid stealth pings entirely if the annoyance continues...
1 message moved to Trashcan
ok :)
:P
 
@Doorknob Could make some sort of bot that detects them
 
@Doorknob Have they ever been brought up on mother meta? They seem like an undesired behavior of chat
 
^^
 
@Doorknob That wasn't the message I meant, but OK.
 
@quartata Too much work; easier to warn people and suspend if they continue
@Calvin'sHobbies Good point; perhaps a meta.SE post is a good idea
@quartata that's the joke :P
 
4:43 PM
@Doorknob Fair enough
I figured it might be easier to have a 24/7 solution though
 
fgitw, go!
 
@Calvin'sHobbies sgitw that's me
 
My last stealth ping... maybe not last...
 
Stop trying. pls
 
@quartata But it works!
 
4:46 PM
Or did it?
 
@quartata I see a square for that one
 
@Calvin'sHobbies ?
 
I'm pretty sure that was a stealth ping.
 
What kind of lame browser are you using that can't even render invisible separators
 
4:47 PM
But that's what I'm using...
 
Bye, everyone!
 
1
Q: N Slab Slanted Slash Cake

Calvin's HobbiesWrite a program or function that takes in a positive integer N. When N is 1, output /\ \/ When N is 2, output /\/\ \/ / / / \/ When N is 3, output /\/\/\ \/ / / / / / \/ / / / \/ When N is 4, output /\/\/\/\ \/ / / / / / / / \/ / / / / / \/ / / / \/ For larger N the pattern continues...

 
Why does this exist
An Emacs SE
 
Vi & Vim exists too
 
@Doorknob Oh phew
 
4:55 PM
Test stealth ping
 
0
A: Sandbox for Proposed Challenges

StefnotchAncient Language Translator <insert a silly story here> Task: Write a program that takes an English sentence and translates it into the Ancient Language. You have to implement at least 42 words. For the purpose of this challenge, you do not have to care about special rules such as "(may be sho...

 
@Calvin'sHobbies stawp it it isn't funny anymore
seriously stop abusing stealth pings.
 
seriously stop abusing "seriously stop abusing..." just to get stars
 
0
Q: Ignore chat pings found in links

DoorknobThis chat message: Hi, http://example.com/a/very/long/url/@Doorknob renders as this: but it also pings me, due to the @Doorknob at the end of the URL. This message: Here is another sample message.[​](http://@Doorknob) mysteriously sends me a ping: This is because the link text consis...

 
@Optimizer But I was being
 
4:57 PM
@Calvin'sHobbies fgitw'd
 
puts on sunglasses
SERIOUS
EHHHHAYYYAAAAAAA
 
Seriously though, isn't this annoying?
 
@Doorknob created an account on meta se just to upvote that
Thank you based Doorknob
 

« first day (1765 days earlier)      last day (3072 days later) »