« first day (1708 days earlier)      last day (1477 days later) » 
00:00 - 23:0023:00 - 00:00

12:04 AM
How are the if statements in CJam formatted?
Well, I think it'd help if I didn't use normal brackets
A: Sandbox for Proposed Challenges

kirbyfan64sosLeave my Python alone! Some Linux distros are going to start replacing Python 2 with 3 as the default version. However, you have a heck of a lot of legacy scripts with hashbangs that are Python 2-only (e.g. #/usr/bin/env python). You need to change them all to say python2. The input A Python s...

1:12 AM

EridanWrite a program that takes an input to STDIN and makes all of the lowercase letters (ASCII 61-7A) in the 2k-1th word uppercase and all the uppercase letters (ASCII 41-5A) in the 2kth word lowercase (k is a positive integer). The program should not affect any other characters in any word. For exam...

1 hour later…
2:35 AM
I can't wait until 4,096
A: Sandbox for Proposed Challenges

The_Basset_HoundCookie Clicker Cookie Clicker: Simple, stupid, and yet strangely addictive. In it you must click a cookie (hence the title). Once you have enough cookies, you can spend them on items that will produce cookies for you. Eventually you will be getting hundreds, then thousands, then millions of cook...

2:59 AM
@NewSandboxedPosts Oh yes, that game. :D
3:26 AM
I think I ripped a tendon; maybe a muscle..
3:49 AM
Q: concisely provide a verbose description

user3276552you have a box, and it's coordinates, but only two pairs | left | | centerX | | | right | | | | | v v v | _____________ | ^ | | <---top | | | | | | | ...

Q: Write a medium-sized "Hello, world!" program

DuhHelloYou apply for a programming job. In many ways, it is like a typical programming job. Repetitive work, unreasonable demands, and clueless bosses that barely know how to print "Hello, world!" in any language. The difference with this job is that the boss is extremely fussy about code size. He hates...

4:02 AM
@NewMainPosts Seems like this should be a duplicate of something. codegolf.stackexchange.com/questions/10783/… was the closest I could find.
4:46 AM
Q: Python Golfing Suggestions

marshI have read: Tips for golfing in Python I would like to golf this code further. Any more tips? x,y,q,w=[int(i) for i in raw_input().split()] while 1: a=int(input()) s=d="" if q>x: s="W" q-=1 elif q<x: s="E" q+=1 if w>y: d="N" w-=1 elif w<y: d="S" w+=1 print d+s

It's nice being able to cast a close vote I'm not 100% sure on.
5:04 AM
@El'endiaStarman Questions like "golf this piece of code" are on-topic, AFAIK. Rather than "off-topic", I would have chosen "unclear what you're asking" because he hasn't explained what the code is supposed to do.
@PhiNotPi: Ah, thanks for the info. I have seen the "tips for golfing" questions, but none that are "golf this code".
Q: Let's decide what kind of non-challenge questions we want once and for all

Doorknob4 reopen votes and 1 delete vote is a strange thing to see. It's also slightly worrying that we have so little consensus on this matter. So let's bring the community together. What kind of non-challenge questions do we want? Each answer will contain one type of non-challenge question, some ex...

On a side note: Posting this question on Stack Overflow would have an abrupt (and possibly brutal) ending.
@Dennis Huh, second answer explicitly allows such questions. I'll go retract my close vote.
Like I said...
19 mins ago, by El'endia Starman
It's nice being able to cast a close vote I'm not 100% sure on.
I feel your pain.
5:34 AM
I've voted to close all of the 3 latest questions, lol
6:22 AM
A: Sandbox for Proposed Challenges

El'endia StarmanThree steps to the left: vipers. Three steps to the right: a cliff. Don't die! code-golf kolmogorov-complexity Introduction Suppose for a moment that the vipers and cliff are only two steps away, instead of three. o --- Hsss! | ';;' ___ /_\ ___ _ ...

@NewSandboxedPosts I'm honestly a little excited to see the solutions people come up with. I think this may be the biggest challenge.
Q: What's 9+10? 21

Albert RenshawYou know that 9+10 is 21, but someone challenges you saying that it isn't. You'll show them though, Have your program print "21" in the shortest length possible. The only numeral characters you can use are the one's found in the left side of this equation: 9+10=21. That is, "9", "1", and "0". B...

@El'endiaStarman you can't print any valid solution? only the one in the post?
@feersum Well, I suppose you could, but I think it's unlikely.
What do you mean?
6:25 AM
The 11 safe steps for the two-step version are unique up to swapping the characters.
That's not what you asked for.
Do you think it would be better to allow any valid solution? I'm inclined to agree. The difficulty would be checking it.
You want to discourage finding the answer by calculation?
Someone would have to write a code snippet to check the output.
How so? It seems very easy to check.
6:34 AM
> A purposely written computer program
had successfully found ±1 sequences of length 1124 having discrepancy 2; however, it
failed to produce a discrepancy 2 sequence of a larger length and it has been claimed
that “given how long a finite sequence can be, it seems unlikely that we could answer
this question just by a clever search of all possibilities on a computer”
> In this paper we settle the status of the EDP for C = 2. We show that by encoding
the problem into Boolean satisfiability and applying the state of the art SAT solvers, one
can obtain a sequence of length 1160 of discrepancy 2 and a proof of the Erd˝os discrepancy
conjecture for C = 2, claiming that no sequence of length 1161 and discrepancy
2 exists.
> By iteratively increasing the length of the sequence, we establish precisely that the
maximal length of a ±1 sequence of discrepancy 2 is 1160. On our system it took
Plingeling, the parallel version of the Lingeling solver, about 800 seconds1
to find a satisfying assignment. One of the sequences of length 1160 of discrepancy 2 can be found in Appendix A for reader’s amusement.
Sure, it's hard to prove what the upper bound is. But given a sequence, it's trivial to determine whether it survives or not.
Oh, the upper bound has been proven. It's 1160. Or 1161, depending on how you want to look at it.
But anyway, it looks like there are multiple satisfactory sequences. However, given the difficulty previous attempts had in getting beyond 1124, it would probably be easier to just encode the one given solution.
In that case it's a poor question. "Pack this binary string into 8-bit characters and then unpack it."
I like the setup though.
Perhaps I could make the "life bonus" the actual goal?
Input n, output a sequence of n safe steps.
"Print the first n characters of this hard-coded string"???
6:42 AM
Disallow hard-coding?
I hate questions that say "hard-coding is not allowed". Instead of having vague rules, the input parameters should be variable.
Well then, how would you improve the question?
Maybe there are some parameters instead of (2,3) that give a string that is feasible to calculate, but long enough to be worth calculating instead of hard-coding.
(2,4) probably could be one.
Wouldn't that be harder to calculate than (2,3)?
6:45 AM
The same guys that found the 1160 sequence also found a length 13,000 sequence (for four steps) with no guarantee that it's maximal.
I see, some non-maximal target
I'm pretty sure that 13,000-step sequence is available somewhere though.
Hmm I guess there is actually only one parameter.
But then again, it would probably be shorter to calculate it at that point than to hard-code it.
7:14 AM
@feersum: I edited the sandbox post. Let me know if you think it's better/acceptable.
7:55 AM
@El'endiaStarman Looks okay, except I don't understand the bonus
@Dennis that's smart.. but you took your sweet little time :P
@feersum The 11 step solution for the simplest case can be represented in binary thus: 100101100110, which is 2406 in decimal. Providing a similar decimal number for a 2000-step sequence allows for verification, presumably with a Javascript snippet.
But if code actually runs in a reasonable amount of time, shouldn't everyone be able to provide it?
That "reasonable" amount of time can be very large.
8:00 AM
1 month you said?
I put a very high time limit because I mostly just want to rule out really inefficient methods.
Yeah. No one will set their computer running for that long.
Well, almost no one.
@El'endiaStarman I did that multiple times.
Probably no one on PPCG.
@minxomat For PPCG problems?
well first of all, I think it will be impossible to estimate running time for many programs
@El'endiaStarman Yes, indirectly.
8:01 AM
@minxomat Huh, interesting.
If you do some heuristic-based search with backtracking, or whatever, then you can't prove any nice bound but maybe it finishes quickly for smaller n.
@feersum As long as it's not 4^n...
Actually, the brute-force complexity is worse because of the checking you have to do.
why 4^n rather than 2^n?
Sorry, yes, 2^n.
@The_Basset_Hound condition thenpart elsepart ?
8:04 AM
2^n solely to generate a sequence to check.
if the chosen part is a block, it gets executed
It ends up being a little worse than O(2^{n+1}), I think.
You can load raw JS from a repository blob on github-pages. That's really cool...
Verifying a sequence in the naive way is O(n log n) if that's what you mean.
The harmonic series is O(log n)?
8:07 AM
Ah, okay.
So it would be O(2^n * 2^n * log(2^n)) altogether.
Which is O(n log(2) * 4^n).
I'm getting 2^n n log n
if you generate all the sequences and check them at end.
I'm up more than an hour past my bedtime.
Brain is not working very well...
Yes. O(2^n n log n).
1 hour later…
9:28 AM
Q: Am I allowed to use my own invented languages to solve a code golf?

user1193112On the conditions that the language is general use (i.e., doesn't perform the task in 1 character) and follows the rule of having been invented before the question was asked. I've written languages before that were inadvertently good for code golfing, and I wasn't sure if those would be allowed a...

1 hour later…
10:44 AM
huh, apparently "All About That Bass" has over one biiiiillion views on youtube now :p
10:59 AM
more like a Bassillion views!
Oooops, while solving a problem on here, I found a gs2 bug.
It would be a bit unfair to fix it and then "win", though, so I won't.
You can always add it as a side note
A: Sandbox for Proposed Challenges

Albert Renshaw1,2,3,4,5,6,7,8,10,9 This may seem easy at first but there are so many neat math tricks to golf your code up even further. Your goal is to print the numbers 1-10 BUT the last two digits are flipped. The numbers must be CSV (Comma separated values) Obviously you can't just print any literal ...

11:18 AM
Q: Way to get the day of the year in Matlab

PedroI'm learning Matlab at school and we have to write a script that prompts the user for 2 numeric values. One for the month, and then, one for the day. And then, with those values we're supposed to express which day of the year (don't care about lap years) those values refer to. Example: The 5th ...

3 hours later…
2:03 PM
Q: Palindrome Hello, World

Hurricane996Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right to left the same as in left to right. Standard loopholes are NOT allowed.

2:16 PM
Isn't this a privacy breach when without my permission my comments get converted to a chat room message?
(when someone else clicks on continue this discussion in chat)
... why?
its something that i did not do
and is being portrayed as I did
You didn't type those comments?
only comments, not the chat messages.
2:18 PM
well, I forgot that mods forget the difference between chat messages and comments
It's made very clear that the chat room was an automatically created one.
(Not that I see why it matters, anyway.)
2:36 PM
@aditsu Alright, thanks.
@NewMainPosts wow, that's at -7 now, brutal
2:49 PM
I don't actually get why it's at -7
cause it's boring?
Well, I feel that there's a difference between "not worthy of any upvotes" and "worthy of being one of the most heavily downvoted questions on the site"
... did you upvote it? ಠ_ಠ
I installed LibreOffice last night.
Oof 7 downvotes...
Feel sorry for the guy.
Maybe someone should tell him that comments make palindrome challenges trivial and that he needs to ban them...
3:15 PM
his own sample answer uses comments
So, I'm trying to run Perl in a linux terminal.
And I've run into a problem where the arrow keys aren't working to move my cursor.
The arrow keys move my cursor when I'm typing into the actual prompt (like perl text.plx)
but then, then the Perl program itself is taking input from STDIN, they don't work.
It's capturing my arrow keys as part of the input.
Of course they don't. gets in Ruby doesn't support arrow keys. Neither does cin in C++, or input in Python, or... really any language at all.
If you ask to read from STDIN, that's exactly what you'll get: the byte sequence received from STDIN.
Well, in Windows command prompt, I can use my arrow keys to move my cursor and edit my input before I press enter.
I'd imagine Perl has a wrapper for readline.
And I could use the vertical arrow keys to autofill previous inputs.
3:24 PM
That's what readline does.
(It also gives you all the shortcuts that you could normally use in your terminal, of course, since that's what terminals use: Ctrl+A for beginning of line, Ctrl+E for end, Alt+B/F/everything, etc.)
$line = <STDIN>;
$line = readline(*STDIN);    # same thing
According to perldoc, those two lines do the same thing.
So, I've noticed no change.
Okay, so I think I need to use Term::ReadLine
nope, not working
3:45 PM
@PhiNotPi You need Term::ReadLine::Gnu.
Ehh... I haven't been able to get that to work.
Where are you stuck?
It said I need to install that module... which I tried to do... then it complains about "Could not find neither libtermcap.a, libncurses.a, or libcurses."
My command being sudo cpanm Term::Readline::Gnu
whereas the command sudo cpanm Term::ReadLine works perfectly but doesn't change anything.
It's missing dependencies. What distro are you using?
ElementaryOS, (basically a reskinned Ubuntu)
So I guess I track down those dependencies?
3:59 PM
libncurses5-dev and libreadline6-dev, probably.
Okay, the module's installed now.
The arrow keys are functioning the way I want now.
@Dennis Thanks for your help.
Glad I could help. :)
I was trying to get my language Element to work on Linux, since my interpreter simply reads the program from STDIN
And so not having arrow keys ruins the "Element development workflow"
Everything breaks somebody's workflow. :P
There are probably children out there holding down spacebar to stay warm in the winter! YOUR UPDATE MURDERS CHILDREN.
4:04 PM
your expectation of the arrow keys breaks my workflow!
This question would have gone down a lot differently if asked on SO.
Your question about the arrow keys?
in what way?
4:09 PM
closed as <random reason> within 3 minutes? ah, that works ^
Hmm... is there any "standard" software that I should put on a linux computer?
I got LibreOffice (which actually looks nice)
LO is the gold standard
oh wait, I thought you meant standard office software
well, depends what kind of user you're talking about
oops, gtg
LibreOffice 4.4 is a lot better than the older versions, but if somebody sends you a Word document, office.live.com is the way to go.
I just realized office.live.com comes free with my college tuition.
It's free for everybody...
4:19 PM
oh... okay
I thought it was a "comes with the desktop software" type thing
back; @Dennis there's LO 5 now
I'd say GIMP is pretty standard too
6:08 PM
I haven't seen Peter in 20 hours. Is he dead?
@Dennis I had never heard about that, that's neat! I worked at a place where my group ran Linux and everyone else was on Windows. We had LibreOffice (which IMO is a huge turd) but we had to remote desktop onto a Windows server to use email or open any document. It was annoying to say the least.
@PhiNotPi I like Apache OpenOffice. The last time I used LibreOffice I hated it a lot.
We should make a challenge to serve as Peter's eulogy.
Btw how are you liking ElementaryOS?
It seems okay so far.
Just okay? Not the most amazing OS ever to exist?
If you want to know what's it's like, you should try it.
6:17 PM
I could add it to my growing library of virtual machines.
do it
(Currently Windows 7, Ubuntu, and SAS University Edition)
What do you like about ElementaryOS? If there's a strong enough draw then I'll try it out.
I just thought it looked nice.
And seemed intuitive enough.
There's some things that I haven't figured out how to do like, like reorganize my "Applications" menu.
What do you see yourself primarily using it for? Shits and giggles? Or actual programming since Linux > Windows?
Probably the former.
6:28 PM
Ah, okay.
There's some software that I have which can't be put on Linux.
Like my music composition software
I wonder if there are any Linux-friendly equivalent programs.
@AlexA. Painful. I'm not a big fan of LO, but I don't know a better alternative. OO is even worse IMHO. Luckily, I do most of my work in LATEX.
I use LaTeX as well whenever possible.
Neither Finale nor Sibelius are supported on Linux, so almost certainly not.
6:30 PM
@Dennis What is better about LibreOffice than OpenOffice?
MS Office compatibility. LO got quite good at it recently.
Oh yeah? I haven't been following its development or improvements or anything. My last encounter with it was in 2012.
It was terrible back then.
I agree.
Maybe you should try it again.
6:42 PM
I don't have much of a reason to since AFAIK it's not available for Mac.
Maybe I will try it then
There would really be no reason for it not being available for OSX
Besides there being better Mac equivalents available? :P
As if that would bother an open source project.
6:47 PM
That's a completely different point.
Well, I'll withhold further judgement until I try it on Mac.
I know, it was a joke, hence ":P" :P
7:21 PM
Is there a non language specific version of this? codegolf.stackexchange.com/questions/1956/…
afaik no
Make sure you account for infinite error messages.
Are we allowed to re post challenges with no language restriction?
(And some different rules and scoring)
Just found this:
Q: Write the shortest program that generates the most compiler warnings and errors

user4234The challenge: Write a very short program that, when compiled, creates the most amount of compiler warnings and errors. It can be written in any programming language. Scoring: The score is determined by this equation: errors_and_warnings_length/code_length Example: The C# program class is 5 ...

Anyone know an online Foo interpreter?
7:37 PM
I don't think there is one. If it wasn't for the Programming Language Quiz, nobody would know about Foo...
Darn :/
Do you want me to test something?
That would be nice :)
"Greetings, Planet!"!tenalP, sgniteerG"
Does this work in Foo?
It does.
I swore I had the interpreter for it somewhere...
Does it output just Greetings, Planet!
7:39 PM
Yes, nothing more.
Thanks again :)
Happy to help.
asm.js is just awesome. How did I live without this....
I think you should google "Foo Interpreter".
Hey look Foo beat CJam :)
7:45 PM
A: Sandbox for Proposed Challenges

flawrMETA: I'd like to make a popularity contest out of this, but I am not sure whether that is a good idea. I just liked the idea and thougth I'd post it here. Any ideas what mode this challenge should be used in (and any other thoughts/suggestions) are appreciated. Home improvement for the Minotaur...

By the way, your code also works in Clip.
That's funny.
I just made this post in the sandbox and would love to hear your thoughts:
A: Sandbox for Proposed Challenges

flawrMETA: I'd like to make a popularity contest out of this, but I am not sure whether that is a good idea. I just liked the idea and thougth I'd post it here. Any ideas what mode this challenge should be used in (and any other thoughts/suggestions) are appreciated. Home improvement for the Minotaur...

8:17 PM
Metal. \m/
AND 3.14 in badges!
A: Sandbox for Proposed Challenges

eaglgenes101Pareto optimality challenge Write a class that maintains a pareto optimal set. This class must have these three methods: k(int n): Constructs the class. N is the array size that all of the other methods must use. boolean k.p(int[] n): Adds n if there exists no entry m in k such that each sing...

How am I the only one to have answered this?
8:30 PM
Yes it was! I finished it last night.
The book?
Oh I was talking about the film, but I guess that the book is great too
The film is out?
Have you read the book?
Nope, not yet
And the film came out on Wednesday
8:34 PM
Oh man, I have to see it now. (But I always have to be careful with movies based on books I liked.)
Definitely :D
Have you seen Interstellar?
Interstellar was a good film (in terms of production) but it had a really stupid premise.
Haha what was that premise?
I'm with Bill Nye on this: youtube.com/watch?v=urCbhRVLML8
His opinion on Intersteller that is.
Plus: The whole conflict with her brother artificially bloats the story. There is no point in it (and no basis). I really like the visuals though and I highly respect the science & vfx team.
I haven't seen Interstellar nor do I know much about it.
8:42 PM
Q: Interstellar: Shouldn't the food have run out?

Beta DecayEarly on in the film, Dr Bland says that the corn crop will die out in a years time, yet later on when Murph burns the crop, the corn is still growing despite being decades after the prediction. Have I misunderstood or is that a slip-up on the film-maker's part?

@AlexA. It's worth watching. (If you like science fiction that is)
> (If you like science fiction that is)
Or science in general.
@minxomat Have you read The Martian?
I saw it in W.H.Smiths but decided against as I'd just seen the film
And before you recommend it, I have about 2^63 more books on my to-read-list.
8:47 PM
Well, I recommend it. So you now have 2^63+1.
9:08 PM
Is it a HTML file or an HTML file. Google seems to be conflicted (there are equally many results).
I use "an."
Mozilla and most *.edu sources use "an". So I guess it's fine.
@Dennis @PhiNotPi I installed LibreOffice 5.0.2 for Mac and am exploring it now. It loads faster than I remember from 2012 (perhaps unsurprising) and it actually kind of supports Microsoft Word rendered math, which uses a nonstandard format. OpenOffice doesn't. Well that's neat.
Also, LO supports old MS Works files, OO doesn't. I recently upgraded my grandpa's (2009) PC to Win10. LO saved me a lot of converting.
I don't even know what MS Works is...
9:14 PM
An ancient office suite from MS that worked way better than Office at the time both co-existed.
Microsoft Works is a discontinued office suite developed by Microsoft. Works was smaller, was less expensive, and has fewer features than Microsoft Office or other major office suites. Its core functionality includes a word processor, a spreadsheet and a database management system. Later versions have a calendar application and a dictionary while older releases included a terminal emulator. Works was available as a standalone program, and as part of a namesake home productivity suite. Because of its low cost ($40 retail, as low as $2 OEM), companies frequently pre-installed Works on their consumer...
His license was from 1998. Still worked though.
What OS was he on?
Ah, okay.
Having issues?
9:18 PM
Try the german wiki article for works. That picture there shows a more recent version.
That's what I was trying to link.
That actually looks vaguely familiar.
Wasn't it that Works came preinstalled and Office was sold separately?
Could be, can't remember.
I remember my mom having Works on her XP laptop a millenium ago.
XP was the shit.
9:22 PM
And Vista wasn't really as bad as people always claim.
I did IT on XP a long time ago so I remember it rather fondly.
I didn't like Vista at all but it wasn't the scourge of the Earth.
I really hope more devs join the ReactOS project and we can have an open-source Windows XP -like OS in a year or so.
My favorite reaction to Microsoft releasing the DOS source code: "Maybe in 20 years they'll release the source code for XP. Thanks for nothing, Microsoft."
I told my girlfriend that there's an open source XP-like OS in the works and she said, "Why? XP is dead. Get over it."
I've been cleaning my basement today and found about 43 sticks of 256M DDR1 memory. They all work (I've tested them, because I still have about 10 PCs that support that memory).
That means nothing to me.
9:34 PM
That's my lab.
Either I'm too young (25 but didn't know anything about computers until about 2007) or I know too little about hardware.
:O Cool!
That's 1 third of the PCs. But the rest isn't currently running.
That is a truly impressive number of computers.
More under the desk ^^
Damn. And I thought I had a lot of computers.
9:36 PM
I spy a Mac! :D
What do you actually do with those many computers?
@PhiNotPi Mostly sandboxing software ideas (they essentially all runs different OSes)
You could make a computer cluster out of them.
I've also worked two years in genetic research and used them to crunch some genes.
They are a cluster. Controlled by the server on the right side of the picture.
9:39 PM
I've always wanted to get a bunch of really cheap computers and make a cluster out of them...
Welcome to PhiNotPi's server farm. How may I be of service to you today?
Just a salad today, thanks.
* has rack of computers in dorm room *
My reputation + number of badges is a palindrome.
9:42 PM
@AlexA. Since this is a cluster, you can have multiple salads in parallel.
Actually my reputation just by itself is also a palindrome.
That's funny.
@PhiNotPi COOL
@minxomat Can it handle multiple steaks in parallel?
@AlexA. Not really. I was part of the joke.
9:43 PM
@quartata The question is can you candle parallel steaks :)
@quartata And your user ID is 45151 too. Almost fits, except for the 4... :P
@PhiNotPi Oh.
So we could have Dennis Numbers but instead of swapping digits you remove digits and call them Quartata Numbers? :P
10:01 PM
Found on reddit, a horse breaking out of his pen: i.imgur.com/tnG51xp.gifv
10:31 PM
@minxomat Just read the last few chat messages, thats quite impressive whant you have there=)
@El'endiaStarman Reminds me of avalanche beacon search technique=)
@flawr ...that is both amusing and interesting.
In a training you had to do it blindfolded. As you can imagine it was not so effective anymore^^ Glad I never had to rely on it up to now=)
This one is impressive too, but doesn't involve a avalanche beacon neither:
PS: Sorry, no plane crashes today.
10:50 PM
@AlexA. I was working on some music earlier today: soundcloud.com/phinotpi/strings
Saw this on Facebook just now:
> This license plate says "ABBGTPOG". Sandra and I wracked our brains out trying to figure out what it stands for. Any guesses?
After bringing back gelatin, ten pandas obviously glare.
It's from there.
The song makes no sense, but "A B B G T P O G" is in the lyrics.
00:00 - 23:0023:00 - 00:00

« first day (1708 days earlier)      last day (1477 days later) »