« first day (1755 days earlier)      last day (2137 days later) » 

4:03 PM
A: Sandbox for Proposed Challenges

TensibaiCompete with awk fastest-code The goal of this challenge is to see if the assertion often see in awk question on SO is true: This would be faster in whatever Input A 10 million lines file generated by this script line: awk 'BEGIN{for (i=1;i<=10000000;i++) print (i%5?"miss":"hit"),i," t...

Hope I wrote it clear :)
@Tensibai It looks good to me, but I'm not the best at catching issues in the Sandbox. I'm sure Peter will go through every detail with a fine-toothed comb, though.
@Tensibai From what I can tell, it seems like I can just not read anything except every tenth line, since those are the only even hits. Is that intended?
@Tensibai Just one thing: you should specify how you are going to do timing (your machine, a server, whatever).
Actually, I should just be able to output "fourth hit third" 1000000 times without reading it at all.
4:10 PM
@Geobits I believe the intention is, your program should work with any file in that format given those rules. The script given is specifically what will be used for timing.
I assume you're right, but it would be better to have the script actually generate an example that isn't static.
@Tensibai You should clarify that if that is correct
Randomize the numbers, and vary the column contents.
Apparently Javascript isn't JavaScript:
Javascript xsot 205
JavaScript Stefnotch 208
JavaScript (v?) qumonio 214
JavaScript ES6 Cᴏɴᴏʀ O'Bʀɪᴇɴ 305
4:11 PM
@Tensibai You need a timing server or a place to test this where the results will all be comparable. Maybe a c9 workspace?
Somebody should post a question on meta to decide what name should be used for Javascript...
@Stefnotch That's what happens with versionings and misspellings. The snippet isn't that smart.
@Stefnotch Better to just ban Javascript in all its forms :P
^^ Should be caps insensitive.
@Mego Awkward when JavaScript is longer than C#
4:13 PM
I think that's a sign something went terribly wrong.
import random;map(lambda x:print('%s %d third\t \tfourth'%(random.choice('hit','miss'),x)),range(10**6))
That'll give random hits, and for bonus points it's Python 3
import calculus
I still think randomized third and fourth column data would be better also.
4:15 PM
import random;map(lambda x:print('%s %d %s\t \t%s'%(random.choice('hit','miss'),x,random.choice('first','second','third','fou‌​rth'),random.choice('first','second','third','fourth'))),range(10**6))
It may not make much sense, but hey, it's random
Ugh it won't work, stupid Python 3 maps
@Mego 1) Will that run? 2) map(lambda:..., ) whyyy
@Sp3000 Because lazy
But list comp :(
4:18 PM
No, the point is map lambda is poorly golfed.
And is un-lazy, creating extra typing work.
^^ that
@CᴏɴᴏʀO'Bʀɪᴇɴ C'mon, starring your own repo? :D
You've discovered my secret
I'm not very good at python golfing
4:19 PM
A: Sandbox for Proposed Challenges

Cᴏɴᴏʀ O'Bʀɪᴇɴcode-challenge string Auto BATCH golfer. I love BATCH, despite it's shocking lack of functional commands, despite even due to its lack of non-integer support. Why? Because this works: SET var=SET var i=0 This would evaluate to: SET var=SET SET i=0 Fantastic, isn't it? I've used this techn...

#!/usr/bin/env python3
import random
while n <= 10**6:
    print("%s %d %s %s"%(random.choice(["hit","miss"]),n,random.choice(["first","second","third","fourth"]),random.choice(["first","second","third","fourth"])))
There, ungolfed and not stupid
Nicer format now too, no evil tabs
Line 5 too long, -1 :P
@Sp3000 damns given critically low, try again later :P
4:24 PM
For some reason I read that as "300 damns given. Critically low. Try again later :P"
@Rainbolt I have a minimum operating capacity of 10501 damns
@Rainbolt That is weird. It should definitely be 3000 damns given.
@mınxomaτ shhh because stars
Man, > 100 rep already today, and I haven't even had my first cup of coffee
@Geobits Actually yes, as there's a hit every 5 entry and the filter is on the word hit followed by even number, so it's exactly each 10th line
4:27 PM
Wait, so it's intentional that I don't need to read the file?
Or not?
@Mego I will integrate into github to time within travis
@VoteToClose Same answer as above :)
@NewSandboxedPosts Oh, look, what an interesting challenge. ;P
Nothing like shameless advertising, amirite?
@CᴏɴᴏʀO'Bʀɪᴇɴ Looks boring, -1
Even if you have read the file, doesn't seem like a very good fastest-code challenge.
There's no computational content, so it boils down to figuring out which linux syscalls give the fastest I/O.
4:30 PM
@Mego and @Geobits I'll see how I can make others test cases and make 3 tests instead.
Heads up people, my bounty on this question expires tomorrow:
Q: Golf Me An OOP!

MegoGolf Me An OOP! Two important components of object-oriented programming are inheritance and composition. Together, they allow for creating simple yet powerful class hierarchies to solve problems. Your task is to parse a series of statements about a class hierarchy, and answer questions about the...

@Geobits No, not intentional, the idea is to read the file.
It will be awarded to the shortest answer posted after the creation of the bounty
@feersum you can see it this way yes. Still ahve to filter and split
4:34 PM
However you do that within reason, the I/O is going to consume the vast majority of the time taken by the program.
But if it sounds useless, nevermind, seems no one wish to try building a C answer to compete anyway
I would do a C answer, strtok and atoi aren't hard to use :P
@Mego never said the challenge is hard, it's a kind of simple task done with awk, getting down to 1s on a t1.micro (used by travis) with mawk sounds the fastest gun to me
After the 10M lines can become a problem on low memory systems, streaming is the way to go and is where there's the most time lost
Java would suck at this, but I'll post one anyways.
Well, generally speaking, our [fastest-code] challenges are usually based on computation or algorithm differences. If it's wholly/mostly IO-bound and runs within a second anyway, timing is iffy.
4:38 PM
If the speed depends a lot on some hardware that most users won't have access to, that's another reason not to make this challenge.
That's dumb... Why is <b ... > getting interpreted as a bold tag inside a <pre> block?
Isn't that the default behavior?
I thought <pre> blocks prevented tags from being interpreted
4:54 PM
Oh well, a simple regex will solve the issue
^ famous last words
Or so I thought
@Geobits I love that song
Best quote from an MCR member:
> I think emo’s a pile of shit.
5:07 PM
There, fixed finally
Gtg, I'll see if I can improve the wording on the rules tomorow
@Mego and now you have 2
Have there been any code golf challenges where the goal is to create a standalone portable executable, and the size of that file is how you are judged?
@MartinBüttner we were in sync there for a second
it was a beautiful thing
Q: Separate a list into even-indexed and odd-indexed parts

anatolygInspired by this question: Make a function (or a full program) that receives a list of numbers and outputs the list rearranged, so that even-indexed numbers appear first, and odd-indexed numbers follow. The values of the numbers themselves don't affect ordering - only their indices do. All indic...

Q: Make America(n Maps) Great Again

geokavelThe cartography team of U.S. Republican presidential hopeful Ben Carson is having some trouble with their maps (image via Washington Post): The problem is they don't have the Right Tool For The Job™. They need the most compact and reliable program possible, so they never have to worry about ma...

5:14 PM
@quintopia If the size of the output is the scoring criterion, then that is not a code golf. It's a code challenge.
@quintopia No, but there's a meta question about it
@undergroundmonorail it was
@Rainbolt more specifically, this sounds a bit like (@quintopia)
Q: Are Sizecoding Questions On Topic?

VoteToCloseThis conversation popped up in chat at one point. There is a subtle (yet important) distinction between code golfing and sizecoding: code golfing is an attempt to reduce the human readable source code, while sizecoding is an attempt to reduce the machine code. Is sizecoding under the general he...

i didn't see feersum's message
@quintopia's question is not like metagolf at all.
It is a code golf with a language restriction, basically.
How is it not? You produce an output (a portable executable), and the size of the output is your score. That sounds exactly like metagolf if I am reading this tag wiki correctly. "A metaprogram produces a program which solves a given task, and the length of that output determines the score of the original program."
The given task is "produce a portable exe"
Ooooh... there's another layer in there
5:18 PM
it's weird because usually when you say "this C program solves a task" but that's just shorthand for "this C program tells a compiler how to create a program that solves a task"
I think the tag wiki is just worded a bit badly.
I think "that output" refers to the size of the generated code
At least that's how we've been using metagolf
(because the output of the generated program is usually fixed)
Okay so in this case the generated program is an exe, and the task it solves is "do nothing"?
@Rainbolt the goal is to make a program that does something else... And the size is judged as the full size of a portable executable that includes that program
The description is getting more vague by the second
5:20 PM
You should just sandbox it and see what happens
Would an answer to the challenge be (a) a portable executable, (b) a program that generates portable executables, or (c) a C (or whatever) program that is then compiled to an executable?
i think what's being asked is "can i ask a question where the only language allowed is x86 machine code" in which case i think the answer would be "yes"
but i don't know how well it would go over
@undergroundmonorail That would be , aka
@feersum the first
That's what I thought originally. So it's not metagolf.
Is it for any arch/OS or only a specific one?
5:28 PM
Any. Hence portable.
uh what
The Portable Executable (PE) format is a file format for executables, object code, DLLs, FON Font files, and others used in 32-bit and 64-bit versions of Windows operating systems. The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. This includes dynamic library references for linking, API export and import tables, resource management data and thread-local storage (TLS) data. On NT operating systems, the PE format is used for EXE, DLL, SYS (device driver), and other file types. The Extensible Firmware Interface...
Is that what you mean @quintopia?
You can't create an executable that will run on every operating system.
PE is a bad joke if P is supposed to mean 'portable'.
5:30 PM
I was just thinking about how very concise languages like Pyth and CJam have complex interpreters behind them, while languages like brain fuck with very small compilers are not very concise. And what the happiest medium you could get when adding the size of the two together could be.
@feersum But you can create some that run on several, as long as you don't need to lean too heavily on the system
What do you mean by "portable executable"? PE format or something else?
Is the challenge to create a polyglot that runs in the most operating systems?
I didn't mean something specific by it. I haven't thought it through that much. I just meant it should stand alone and run on more than one OS
Not gonna happen
Windows, OS X, and Unix/Linux all have their own formats (PE, MACH-O, and ELF, respectively)
Modern OSes do header checks, so you won't be able to do that between them.
5:35 PM
You could probably find some old stuff from the 80s that wouldn't.
Then maybe it could be a family of executables, all compiled from the same code, size measured as the max size over them.
One problem with that might be that not everyone has all three/however many to easily compile on.
Now it's more like actual sizecoding. Which is not really any good for PPCG.
If a challenge requires me to compile something on a Mac, I'll just skip it.
5:38 PM
Results are not reproducible, etc.
Picking a specific OS and creating an executable for it seems most doable.
Does anybody here know codeforces? If yes, what are the contests like?
Same as any other algorithmic programming contest.
Are you participating?
@Mego Your python answer is only one byte bigger than my answer. o-o
5:47 PM
It's also the obvious python thing to do. Basically "did you get here first"? :p
Wow, two answers, two accepted answers in one day on SO. I'm two for two.
And I got that oh so satisfying comment that I wanted.
Thankyou Rainbolt worked this worked perfectly! — Duncarn 1 min ago
Ooh: challenge idea. Make a code that outputs a truthy. However, the score is based on the lowest time required to brute force the source code.
^ Given a certain method.
Isn't that the same as shortest code?
Seems like it would just go to whatever language has the shortest "output truthy", since brute forcing would almost certainly depend mostly on length.
@Geobits How dare you edit the code in my SO answer to be correct after it has already been accepted and OP said it worked?
5:53 PM
(plus lexicographic ordering)
Plenty of languages support 1 as a valid program and also have 1 as truthy
@Rainbolt I know, right? :D
Snails (my 2d pattern matching language) prints 1 on empty input + empty program.
I'm sure there's probably a language where the empty program outputs a truthy (like a success code, etc).
Ninja'd :(
@feersum as does Retina
6:10 PM
Seriously why does Calvin post his challenges at 1 AM
Now all the golfing languages I know have been done
I'm actually planning on posting the Black and White Rainbows one very soon.
@quartata Are you asking the language to figure it out for you?
Just gotta fix up a few things.
@El'endiaStarman black and white rainbow? what next? "Correct and Wise AlexA."?
6:14 PM
uggh, these are not my last words
neither are they famous
Except if Alex sees them. c;
oh, what is he gonna do? peck me to death? I have thick fur layer just for that.
And Rotor can't do it due to how evaluation works
I need to add a "no evaluate" flag
@CᴏɴᴏʀO'Bʀɪᴇɴ Vitsy kinda does this by default. XD
@VoteToClose Took me a minute to get that
6:15 PM
@VoteToClose Shhh
@CᴏɴᴏʀO'Bʀɪᴇɴ esolangs.org/wiki/Enema
Feast your eyes. :P
Q: Reverse Boustrophedon Text

DendrobiumBoustrophedon is a type of bi-directional text where successive lines alternate between reading left-to-right and right-to-left. Character direction was also mirrored with respect to reading direction. In reverse boustrophedon writing systems, characters were rotated 180 instead of mirrored. Cha...

@CᴏɴᴏʀO'Bʀɪᴇɴ See: m syntax
@Optimizer Bird vs. Dragon vs. GOL glider vs. Llama vs. Impossible Triangle vs. a flower vs. a penguin vs. a mystical floating downvote.
@VoteToClose Cool? What about it?
6:17 PM
The only thinkg mystical about that downvote are is non-existant downvoting powers
they are still a mystery.
Isn't that what the language is doing? Basically tying methods to certain letters? (for me, it's numbers).
@VoteToClose Ah, no. Any user can open an issue on the REPO for a command suggestion.
OH. Right.
Don't be shy, feel free to take some commands.
@NewMainPosts Too bad my system doesn't support any of these characters
6:22 PM
Who is f?
@CᴏɴᴏʀO'Bʀɪᴇɴ f is the issue I just opened.
Remove all you like, I still wonder who f is :/
@feersum Oh, XD
@Geobits you already have an answer
6:24 PM
@feersum <3 thanks
Neither of those replies seems like a definitive answer, though.
then you can go find f yourself.
Is f you?
no, f is you
I'm sure as f it is not.
6:29 PM
that does not make any sense at all
It makes sense both ways...
only one ways
not the other
I'm (as) sure (as the person named) f (is sure that) it is not (me).
I'm sure as f(uck) it is not (me).
I am not as observant as f in english.
f is fun.
6:32 PM
@Mego To do that, I'd have to learn elliptic curves. :P
f sure is
What was the last time you were f?
Q: Black and White Rainbows

El'endia StarmanGiven an image that has only black and white pixels and an (x,y) location that's a white pixel, color the white pixels based on their minimal Manhattan distance from (x,y) in a path that only involves traversing other white pixels. The hue of the colored pixels must be proportional to their dist...

-1 Rainbows cannot be black and white
6:35 PM
@@feersum Added
from STDOUT on line 1: strange
@xnor Excellent, thanks! Another -6 bytes! :)
@Geobits Blame @Calvin'sHobbies, he's the one who titled it! :P
I blame nobody, only pass judgement from on high.
Wow, sneaky @Calvin'sHobbies. Since when did your name have an i in it?
6:42 PM
o_O Since he's been here, I thought.
Two of them, in fact ;)
Whoa @feersum is the only person without an i
Wow, never noticed that before.
I always thought he was "Calvin's Hobbes". Not "Hobbies".
Jul 21 '14 at 13:14, by Martin Büttner
this guy http://codegolf.stackexchange.com/users/26997/calvins-hobbies ... member for 14 days and he asked 12 pretty decent questions without ever sandboxing one of them... what on earth...
6:43 PM
@VoteToClose doesn't have an i.
* talking at the moment.
@Geobits So he was a master challenge writer practically from day 1. Figures. :P
Yea, @Calvin is pretty much a freak :P
@Geobits I started with a terrible challenge. Then I had a meh challenge. Then I had my best challenge :P
I've a pretty decent record for challenges, but nothing like CH.
6:54 PM
@El'endiaStarman The "algorithm outline" in your question is totally unclear to me.
@feersum You seem to have a strong tendency to criticize or disagree and then offer no more explanation. That said, how would you (and Conor) do the Euclidean algorithm?
I wanna be the very best / Like no code ever was / To not crash is my test / To debug is my cause! / I will travel across the LAN / Scripting far and wide / Trying hard to understand / Why my BIOS fried! / Codémon, it's you and me / Golfing all the eye can see / Codémon, you're my best friend / After the program ends! / Codémon, a lang so true / No segfaults will pull us through / You teach me and I'll teach you / Codémon, gotta golf em all! — Mew Feb 3 at 4:58
^ Awesome. I sang it.
@El'endiaStarman I wanted to get your attention before asking mroe questions.
Ask away. :)
Is the algorithm supposed to describe both Manhattan and Euclidean or only the latter?
6:58 PM
@El'endiaStarman Ping me next time ;) And I'm just confused and tired. Not a problem from me.
@feersum Only Euclidean.
What is it that you're trying to calculate with this algorithm?
The flood-fill component is central in my program to both, but I calculate distance differently.
Basically, I go to every pixel reachable by a straight line from the origin. Then any edges there are, I inch around (and also cover line-of-sight pixels from any new pixels).
E.g., one way of considering Euclidean distance would be to consider each pixel as a unit square, and calculate the shortest distance in the white region from the center of the start square to the center of the destination square.
And to calculate that shortest distance, you have to "cling" to edges of black regions.
7:02 PM
What is "significantly higher"??
@Geobits Since always..
Does your "int()" function round or truncate?
@feersum I implemented that as 10 units higher. It's intended to remove discontinuities while keeping the algorithm fast enough.
Mini-challenge count the number of is in a string input
darn edits
7:04 PM
This algorithm outline is hard to understand and possibly non-deterministic.
Maybe you should remove the Euclidean option.
@Geobits Yeah I miss the good old days when I could impress Martin
I only used 2 stars today and I'm out of stars
@feersum There is no randomness. I want to keep the Euclidean option because it's a challenge.
Look, I'm open to loosening up the Euclidean algorithm requirement, but I need to be able to keep it specific enough and understandable enough. It would be helpful if you tried to implement any Euclidean algorithm and tell me how you did it.
But you have this "minimum" that gives a different answer depending on what order the numbers are supplied to it.
The difference in the final result will barely be noticeable.
7:07 PM
e.g. min(21, 14, 10) = 14 but min(21, 10, 14) = 10
I already described a way to define Euclidean distance.
9 mins ago, by feersum
E.g., one way of considering Euclidean distance would be to consider each pixel as a unit square, and calculate the shortest distance in the white region from the center of the start square to the center of the destination square.
Yeah, but I don't really understand that.
How does one "calculate the shortest distance"?
The connected white pixels form an orthogonal polygon.
The distance is the shortest path within that polygon.
And there are existing algorithms for this?
@feersum I think it's ok. It doesn't matter if the output Euclidean images aren't exactly pixel perfect. It will be easy enough to tell visually whether the algorithm is correct.
7:12 PM
I don't think my definition should be used. It would be very slow and difficult.
Would it be alright if I said "Honestly, it doesn't really matter too much what algorithm you use, it just has to look like this:"?
@El'endiaStarman You don't have to worry about hard-coding, so you should be fine.
The existing description would be OK if it was clarified.
Should I terminate script on error in Comm?
Or (silently) proceed
> All these answers under 30 bytes and PowerShell be like "Hey, at least I'm beating F#"...
7:21 PM
@TimmyD What's F#? o_O
A musical note.
Just like C.
Hah. I read the # sometimes as hashbang or merely bang. So when I read F#... e_e
@TimmyD Ooo sounds cool!
Except that it's .NET and all ;)
7:25 PM
@Geobits Is .NET bad?
@Geobits It's OSI under Apache licensing -- fsharp.github.io
It's .NET, but that page weirdly mentions emacs and vim?
This still sounds better IMO.
@CᴏɴᴏʀO'Bʀɪᴇɴ I assume so. I haven't played with it much since the very early versions. I was using VB until that point for some stuff, but then got active with a big C project and haven't messed with it since.
I'm just going to assume it's still not fun until I learn otherwise.
It was quite a change coming from VB6, though :P
Yeah, .NET is ... quirky.
There's a lot of really cool things, and there's a lot of really boneheaded things.
I really like JScript 10. Basically like C# (or VB), but the syntax is JavaScript. Sad that MS dropped it.
Full .NET support though. And everyone who has .NET installed already has the compiler.
7:32 PM
My biggest complaint is the platform. After switching my home PCs over to linux, I just didn't see the point continuing with .NET at all.
So ... try F#
Isn't it still .NET based, though? There are too many languages to learn that are more easily compatible across platforms IMO.
> F# runs on Linux, Mac OS X, Android, iOS, Windows, GPUs, and browsers. It is free to use and is open source under an OSI-approved license.
The latest F# from MS is .NET. The last native x86 F# was shipped with VS6.
Okay, let me put it another way: What advantages would it give me over the Java/C I'd usually use? Or what advantages over python/ruby/haskell if I wanted to learn something new?
7:37 PM
Well try it. If you benefit in any way, you'll know.
If not, well, you learned something new. I guess.
@El'endiaStarman Nice challenge=) Now I am waiting for the results of the big maze, this does take a while=) Funnily I have already done something similar a few months a go, so I could just adjust and golf that code somewhat=)
^ not encouraging
@flawr Yeah, mine takes a while too and it's somewhat efficient. :P
The big difference between F# and C/Java, is that it's a hybrid-functional language rather than strictly object-oriented. It's also very (very) strongly typed.
@Geobits Oh I see
7:40 PM
@TimmyD How is C "strictly object-oriented"?
They seem to imply that some one's system does support execution of F# in the browser..
Though tbh once ES7 is out my life is complete
@mınxomaτ Durr ... that's what I get for editing my post halfway through
@TimmyD I've thought about picking up a functional language (I've toyed with it, but never seriously), but I was looking at haskell more than anything else.
@Geobits Same here=)
7:42 PM
Haskell is probably a better choice than F#.
I figured with a hybrid, I'd probably lean too much on my OO tendencies.
get your microscopes ready!
such cruel world
7:46 PM
The other big thing with F#, especially if you're coming from C, is that values in F# are immutable. So, yeah. A+ for predictable code, D- for pulling off neat tricks with it.
I like the primates being social one best, I think=)
I liked the panda one. Particularly because I have seen a coulpe more similar videos
"Pretend nothing happened."
like why do you think pandas are going extinct , and then a panda will be trying to climb up a tree and failing miserably, eventually falling down
...awww dangit! I should've implemented $m as the reverse of m (merge)! That would've made this so easy!
@CᴏɴᴏʀO'Bʀɪᴇɴ *without an error you've found.
@MartinBüttner Without an error. I tested it >:D
@CᴏɴᴏʀO'Bʀɪᴇɴ Enter enter enter enter enter...
7:55 PM
Tests are no formal proof of correctness :P (unless the number of possible inputs is finite).
@MartinBüttner They are if systematic, testing each general class of inputs.
@MartinBüttner As I learn in number theory over and over again: finite can still be darn big.
Today in a seminar one of the doctorands showed his new proof to a bound (something related to elliptic curves)
@flawr g_(g_64)
and it was like N^(N^((10^26 N)^(N^2 * (log N)^2)))
Where was an integer, but it was unknown wheter N=11 or 13
Still smaller than Graham's Number! :P
But yeah, that's preeeetty big. :P
7:59 PM
Yeah but still more than the number of electrons of the universe=)
Planck volumes in the (observable) universe, even.
Arrow notation is mind-boggling
8:12 PM
8:28 PM
I started brainstorming TI-ACIDIC last night in bed before I fell asleep. I really need to hurry up and finish Minkolang. :P
@El'endiaStarman TI-AC/DC?
@TimmyD No, it's a reference to TI-BASIC. :P
Ah, pH levels. Clever.
Someone else came up with it.
Oh yeah, @flawr!
Nov 15 at 18:36, by flawr
How about TI-ACIDIC?
Nov 15 at 18:37, by El'endia Starman
.....maybe I'll call my next language that. :P
...woah. (Watch part 1 first.)
8:49 PM
Hey all!
Nobody here?
Q: Get happy and mad

BlakethepattonRequirements You need to make a smiley face go from smiling to frowning and back. There needs to be at least three different faces in the code: Smiling, no expression and frowning. The new face needs to replace the old face flipbook style so that there's only one face on the screen at a time. N...

Did my first review!
On this website, that is

« first day (1755 days earlier)      last day (2137 days later) »