« first day (1592 days earlier)      last day (3252 days later) » 

9:00 PM
that i don't know
 
If I make it harder, then CJam will win with a 32 byte solution.
 
We're losing trees now lol
 
I don't think there's anything inherently wrong with simple challenges.
3
 
@MitchSchwartz I better go.. but please do post it as an answer.. it is great :)
 
That said, I did consider making it harder and somehow requiring that people at least have to skip straight over the gaps.
 
9:02 PM
and well done! :)
 
for (a,b,s,t) as i named them, a is the first element of A, b is the last element of B, s is the inner product of A[:n] and B, and t is the inner product of A[1:] and B[:-1] -- i think i wrote that properly
 
Look at this storm and how it just appeared on top of us lol accuweather.com/en/us/tyler-tx/75702/weather-radar/331126
 
thanks again
 
just ran it with pypy too.. even faster.. ok really off now
 
It rained for like 5 minutes and we lost a tree
 
9:08 PM
Are your trees made of sugar?
 
No, I don't think so
 
@MartinBüttner ask for an O(1) solution and get no answers? :)
 
@MartinBüttner You could generalise it to higher bases and take 2 inputs... ;)
 
the existence of languages like cjam and pyth are rather discouraging to me. I did a lot of golfing in contests that allowed ruby, perl, and python, and even though perl is pretty good for golf, the other languages often came close and sometimes even won
lately, with a few exceptions, the golfing languages always win
hell, I remember seeing C entries win a few golfs, just for having the most compact pointer syntax.
 
Why does it matter to you who wins
 
9:18 PM
The golfing languages tend to win the golfs, C/++ tends to win the fastest code contests, languages with good graphical output support do well where that's needed - all of our challenges can be approached as a challenge to choose the right tool, or a challenge to use the wrong tool as best as you can.
2
It's fun either way...
 
Can't you just pretend that the languages you don't want to see don't exist?
2
Block them from your mind and compare your answers to only the answers that use a language you feel is fair
 
Language-specific leaderboards are helping to move towards that way of thinking
 
I forgot we had those
 
My prog can take a base if needed
 
What if we start leaving comments on people's posts like "Some people find it fun to compete against languages that are in the same league. If you want to encourage this, add this stack snippet to your post to get a language specific leaderboard."
 
9:24 PM
Since the leaderboard is already written that makes sense for any questions that wouldn't require it to be modified much (most questions?)
 
@Sparr you need at least O(log N)
but I'm not sure if that's possible.
@trichoplax that complicates the spec, not the challenge.
 
Fair point
 
@Sparr So what about the APL family? None of those are golfing languages, and if GolfScript, CJam, Pyth didn't exist, they'd win all the challenges.
 
I can't find the meta post that looks like "Golfing languages always win, I am not having fun."
 
@Rainbolt It's still there - I was reading it yesterday. Will look now
 
9:38 PM
So I just made a new meta post. I'm sure it's a dupe but I cannot find the other one no matter what I search for
I will delete and repost as an answer if I need to
 
@Rainbolt did you just post a solution in a question on meta? ;)
@Rainbolt just sort the meta questions by votes meta.codegolf.stackexchange.com/q/286/8478 :P
 
86
Q: J and GolfScript suck all the enjoyment out of Code Golf

TimwiI have found code-golf a fascinating pastime for several weeks now. However, I’m already losing interest because the contests allow any language, and because of that it is pretty much impossible for anything other than J or GolfScript to get anywhere close to winning. As soon as I see a less-tha...

 
Oh wow. It's four years old. No wonder
I sorted by active
Because I thought we discussed this recently
 
@MartinBüttner beat me to it...
@Rainbolt You may be thinking of one of the many linked questions to that one
 
Deleted, and reposted as an answer.
Do meta answers get oneboxed by our bot?
0
A: J and GolfScript suck all the enjoyment out of Code Golf

Rainbolt The golfing languages always win. I am not having fun. Four years later, people are still complaining about this. Whether or not this complaint has any merit, if people say they aren't having fun, then they aren't having fun. I think I have a solution. We can start commenting on code golf c...

 
9:42 PM
@Rainbolt no, only if they are posted in the sandbox or the loopholes
 
I see
 
+1
42 votes to go...
 
@Martin Were you winking at me because I was (a year ago) adamantly against posting answers as questions on meta? Or because that's actually weird and nobody does that?
 
For what?
 
What for what?
 
9:44 PM
What what in the butt?
 
@Rainbolt I believe it was much less than a year ago. I just remember you pointing it out fairly often when someone does that.
 
Pics or it didn't happen
 
May 6 at 13:04, by Rainbolt
That's a prime example of why asking non-question questions on meta is a bad idea. Should have been
Question: "Here is what I consider a problem. How can we solve it?"
Self-Answer: "Here's what I think we should do about this?"
 
Actually, I was having a hard time posting this one. It's hard to formulate a question like "I am not having fun. What can the community do for me?"
Month ago, year ago, same thing.
Okay okay my question was bad.
12 minutes left and no fire drill...
 
Anyone know if there's a zfill equivalent in Pyth?
 
9:56 PM
@MartinBüttner your xkcd thing was fun
 
did you just solve it by counting up?
 
@MartinBüttner I've only seen APL used a few times. I don't know it, myself. It seems to not do signficantly better than perl/python/ruby usually?
 
what, did you want an O(1)? >_>
I can do O(n) >_>
 
you can't do less than O(log n)
but I don't if O(log n) is even possible
 
i dont know if thats possible
 
9:57 PM
0
A: Sandbox for Proposed Challenges

Faraz MasroorI'm thinking I want to make a KOTH challenge that has bots play the classic game of Mafia. Bots will be placed in groups of seven, roles randomly assigned, and they play the game! Explanation of Game Mechanics The game proceeds in multiple turns, each turn consisting of Night followed by Day. A...

 
im pretty sure the function is self-dependent.
 
@Sparr APL, J, K, Q are capable of beating the golfing languages sometimes
and they are definitely much shorter than perl/python/ruby (except on string manipulation challenges maybe)
 
Anyways, the JS version, roughly golfed, is
f=n=>{for(o=0;n--;c?o+=Math.pow(3,s.length-c):o++)s = t(o),c=s.search(2)+1;return t(o);},t=a=>a.toString(3);
it iterates through, and on a search for 2, adds whatever that power is instead of 1
a lot simpler than i thought it would be originally
I'm sure a mathematician will go LOL casual O(n) and do some crazy thing though
 
@trichoplax the site gets more active over time. if we don't have enough challenges, that will get better on its own. however, ascii art has grown faster than the rest of the site, lately.
 
@Sparr I think Optimizer's ASCII Art series had something to do with that...
 
10:01 PM
I'm tempted to start marking some of them as duplicates of each other. Especially the "take this ascii art and scale it up" challenges.
 
@Compass ah that's actually much faster than I think most people will solve it
@Sparr as far as I'm aware my diamond tiling scaling challenge was the first to do that in a non-trivial way (there was one that just required each character to be copied to an NxN block). unless you're referring to "take an integer N and output this fixed ascii art/fractal in size N"
@Compass interesting: 2^(n+2) becomes 1000....0001 with n zeroes
Could someone quickly figure out for me how long it takes to iterate up to 1162261468 in C?
 
10:20 PM
Doing what? I'm not sure I know of a compiler I'd trust to not optimize an empty loop out.
 
well if it does optimise it out, you'll notice
just do some cheap hashing in the loop
(and print the hash at the end)
I'm starting to wonder whether the inverse function would be more interesting.
then again, that's just counting down
so no.
 
What the f. My C is broken.
 
@MartinBüttner takes around 3.2-3.4 seconds with -O3
 
I get a segfault after about that time :(
 
10:28 PM
well I guess that's okay actually
because if you do that in C, you'll still have to do the ternary conversion yourself.
 
I'm not sure that "well other languages will be that much slower" is smart thinking here. I've done loops into the billions in Java in well under ten seconds, too, for simple things.
 
yeah, I'm trying CJam in the Java interpreter right now
 
Something simple in the loop like a+=i%37 takes me about 1.5 seconds in Java.
 
hm yeah, even CJam can manage it in a minute
(although honestly, Java is probably one of the faster language used around here)
maybe if I pull it down to 10 seconds that makes more sense
the thing is, there's actually a factor of 1000 between the input and the output for the last test case
and the naive solution is iterating over the output, and the interesting solution (Compass's) is iterating over the input
ideally I'd like to require most languages to iterate over the input
 
Yea, that's going to be a tough line to set to cover all languages.
 
10:38 PM
wait what?
 
of course, I could just add a harder test case (that would also increase that factor), but then it will take quite a while in slower languages even with the nicer approach
 
i dont get what i did
2
Oh, I get it
I think
 
0
Q: Worst Case Manhattan Exclusion

trichoplaxImagine a W by H grid of squares that wraps toroidally. Items are placed onto the grid as follows. The first item can be placed on any square, but subsequent items must not be within a Manhattan distance R of any previous item (also known as a Von Neumann neighbourhood of range R). Carefully cho...

0
Q: Compute minimal string segment sizes

FUZxxlA common optimization to save space in binaries is to merge string literals where one literal is the suffix of another. For instance, a binary with the string literals a: foobar b: bar c: barbaz d: foobarbaz e: baz might contain the following string literal pool (# representing the \0-terminat...

 
Is it because I skip over all the ternary values and just do a full sandwich iteration, i.e. the larger n is, the more efficient it becomes?
You know what, I'll just pretend I know what I'm doing even though my mug says I don't know what I'm doing
 
@Compass yes that
the alternative is to iterate over all ternary numbers until you found N valid ones
 
10:42 PM
ah
well this picture still applies
 
I suspect there is no coffee in that mug, therefore rendering it incorrect for the time being.
 
I am actually not that big a fan of hot coffee.
I prefer iced drinks.
 
Waste of a mug then :P
 
I can deal with a mocha, but during the summer, that's bleh for me.
Not if I put one of these in there:
 
Iced coffee is greaaaaaat
 
10:44 PM
Which by the way, is about 3" in diameter
 
I've got nothing against iced coffee, but it doesn't need a mug.
A 3" ice ball? Yea, probably won't fit most glasses.
 
its probably designed for whiskey glasses
 
Probably takes 24 hours to freeze that thing, though :)
 
not really
maybe 4 hours or so
 
I did have a whisky with a 2 inch ice cube in it a few months ago... that was... weird.
 
10:46 PM
and when its on cooldown, i have these avengers ice cubes
I'm probably one of the few programmers here where beer in does not equal code out.
 
(it was a whisky cocktail actually... I wouldn't let ice anywhere near my whisky)
 
That Death Star mold costs $13 on Canadian Amazon :(
 
Really? I know there's a cheapy version let me check
 
Well the one that has prime is $13
 
10:48 PM
The whole "giant ball/cube of ice" thing for drinks is a novelty only, IMO, random blogger claims to the contrary or not.
 
because it is a silicone mold, you might get some weird strands of blue silicone your first few molds, is the only problem
but it does look like the death star!
 
Does it include the vent shaft so you can blow it up with one tiny shot?
 
ha ha ha
actually there's a hole in the top of the mold
which is the bottom of the death star
if you underfill it you can make it look like the death star 2
if you overfill it, it looks like it has a tumor
I blame JRE7
 
You should blame JRE6 for being sloppy instead.
 
Nah, in all honesty, whoever wrote that comparator should be blamed.
What a headache. And to have the problem appear in production is even worse.
 
10:53 PM
@trichoplax I know you wrote "Will crash if the snippet times out.", but is there a way to know if running it will crash my entire browser without finding out the hard way?
 
@Geobits Snippets just give up after a timeout (unlike if you run the same code in a jsfiddle) so you will be able to refresh the tab to get it working again.
So perhaps crash was not the best word
 
Ah, okay. The word "crash" scared me. The browser is life.
 
@MartinBüttner I am also referring to the ones that take an integer and output ascii art at that scale.
 
(I provide no guarantees though - I'm just learning JS)
 
@MartinBüttner the ones with fractals are at least somewhat different, since they aren't trivially scaled.
 
10:55 PM
@Geobits I'm wondering how to reword it
 
JS crashes typically just break the page and not the browser if you stop the script
it'll say something about the script not responding
in which case you can just press stop and it'll terminate and go splat
 
Yea, if that's what he meant, I'm not sure a warning is even needed.
 
I know this from experience. Infinite loops count as experience, right?
 
Something like "large numbers may cause it to hang" at most.
 
I've found that in jsfiddle I can crash the whole browser with that code (I'm guessing because it uses a lot of memory for the recursion) but in the Stack Snippet it always seems to time out and just stop (only the snippet dies, not the page, let alone the browser)
 
10:58 PM
I'm starting to think I won't be running this code ;)
 
lol
 
Javascript is great about not failing on time.
 
Stack Snippets don't seem to wait for the browser to inform that the script is hanging - they just stop by themselves
 
Not like Java. Java goes Stack Overflow when you're about 200 iterations in or something.
Javascript just goes hungry hungry hippo.
 
Set recursion depth to kill.
8
Holy stars
 
11:01 PM
I'll just leave this here and go to bed...
 
The star button seems to include splash damage
 
dropbox.com/s/jos3fgdsz6uf1k4/… <-- this is the most complicated partial answer to a math question I've ever gotten
 
stabs eyes out. again
What do the # signs even do?!
Are they hashtags for twitter?! Gah!
 
oh, sorry, #(en) was defined earlier in the answer
 
Since they're only used before the e's, I'd suspect it's just the extra vowels they like to use in the UK. So #e is pounde :P
 
11:08 PM
"given an edge e=(n1,n2)∈E we denote #(e) the number of edges in the sub-tree with root n2 plus one."
 
The capital pis make it look like the gateway to some strange mathematical temple
 
capital pi is just the multiplication equivalent to capital sigma for addition
 
I know - but they still look like temple pillars :)
 
ahh
 
this is why I'm not a mathematician
 
11:28 PM
0
Q: Help me carry my shopping bags

Renae LiderIt was a warm summer evening... when my stupid car decided to break down in the middle of the road on my way back from the supermarket. I pushed it to the sideline and decided to walk home. I opened the trunk to take out the grocery and other stuff. It was then that I noticed the items were not ...

 
@Compass @Geobits I just noticed... The fun fact I discovered earlier about powers of 2 in xkcd-base should give a logarithmic solution for the problem. I might remove the time constraint but offer a bounty for the shortest solution that can handle something like 2^64
I'll try coding that up tomorrow morning
 
im not a math guy x_x
 

« first day (1592 days earlier)      last day (3252 days later) »