« first day (2466 days earlier)      last day (2369 days later) » 

8:01 PM
Whoever came up with if/fi, case/esac, while do/done deserves to be shot.
14
 
harsh
 
but true
 
@cairdcoinheringaahing here's an 8 byte solution for pokemon: w\x817F~_+.o Try it here!
 
You mean why isn't it od to end a do block? :) — Wildcard Jan 18 '16 at 22:37
 
@Pavel endif/endwhile is much nicer if you have to use keywords, however I much prefer either braces (C-style) or indenting (python-style)
Keyword control flow just doesn't feel as nice
 
8:05 PM
@DJMcMayhem Or eve ruby/perl end
 
I prefer indentation. It's pretty
 
Indentation is fine up to about four indents
 
@DJMcMayhem that can prove golfier under certain circumstances ;-p
like python's return/break/continue/etc.
 
Vimscript is even worse. It has endfunction
And endfor
And endtry
 
> YOU HAVE BEEN TERMINATED
 
8:08 PM
Yep. That's definitely worse.
Both of those.
 
Probably also on Programming Puzzles and Code Golf site — 707 Mar 3 '14 at 13:35
Do we have plain obfuscation challenges? Not very objective, so probably not...
 
@VoteToReopen Used to,
 
Fair point.
 
Also maybe useful for
 
@Pavel Oh, durr, I forgot about Select-String. You can do something like sls bar foo and get something like foo:33:blah blah bar blah back.
 
8:23 PM
@AdmBorkBork Ah. That's cool, is there also an equivalent to the sed s/foo/bar/ command?
 
Anonymous
@AdmBorkBork Haha no :P
 
Not that I can think of, you'd need to gc file |%{$_-replace'foo','bar'}
 
That's not so bad.
I guess
:O Just had a brilliant idea
MinGW has windows executables
 
Direct text manipulation isn't really PowerShell strong suit, so it's a little clunky
 
I can add MinGW's /usr/bin/ to path
 
8:26 PM
Is there a way to get the feeds of this room exclusively? Without the other messages, that is.
 
And use PowerShell and grep/sed/whatever
 
lol, you could be sneaky and do something like
 
@Mego I'm genuinely interested how you found that, given it was said 4 hours ago. Do you just read through the transcript before joininin chat?
 
filter sed($before,$after) { %{$_ -replace $before,$after} }
in your profile
 
Anonymous
@cairdcoinheringaahing A bit. Chat was scrolled up to just above that from leaving the tab open overnight, and the mention of QFT caught my eye.
 
8:30 PM
@AdmBorkBork Too late, already did the MinGW thing
 
Well, that works too.
 
:P
This was an excellent idea.
 
Anonymous
@FlipTack Heresy
 
I don't have any languages installed on my machine except for those that came with Windows -- PowerShell and BATCH
and I suppose VBScript, but who even uses that anymore?
 
C:\Users\Pavel
λ  "bar
>> foo
>> baz" | set-content test
C:\Users\Pavel
λ  if ( $(grep foo test) -eq 'foo' ) { echo 'ye' }
ye
Am I doing powershell right
 
8:36 PM
lol
 
Anonymous
@AdmBorkBork I think Windows still has a JScript engine
 
Anonymous
Though I don't know if that's installed/enabled by default
 
@AdmBorkBork How do I run a command as admin in powershell
 
CMC: sample a multiset of size n from the integers 1...n uniformly at random
 
@Lembik Pyth, 3 bytes O^S
S takes the range [1, input], ^ is Cartesian Power with the input, O takes a random elements.
 
8:53 PM
Hmm, has anyone else read through the moderator election page? I think it's a fascinating read :P
 
@Mr.Xcoder Wow. Is each multiset really equally likely?
 
Yes.
A Python equivalent would be:
lambda k:r.choice([*i.product(range(1,k+1),repeat=k)])
import itertools as i,random as r
 
what does that header do?
f=\
 
Assigns the lambda to a function called f
 
it's very impressive
 
8:56 PM
@cairdcoinheringaahing I did. Could you link me to that again, I can't find it for some reason.
 
normally you have to worry about stars and bars
 
@Lembik Thanks :D
 
Thanks!
 
I think it's very interesting to see the community's reaction to Mego's nomination
 
8:56 PM
how did you avoid having worry about stars and bars?
or is this equivalent?
 
What stars and bars...?
Sry I am dumb :D
 
@cairdcoinheringaahing If there was an election now, Mego would totally win.
 
@Pavel Yeah, I have a feeling that Alex might lose his place to someone else, most likely Mego
 
@Lembik Oh right... No, random.choice handles that very well :)
 
8:58 PM
@cairdcoinheringaahing RIP Alex
 
@Mr.Xcoder nice
 
anyway gtg o/
 
How do you see the list of diamond mods of a site?
 
@Pavel Users -> Moderators
 
8:59 PM
thanks
 
Does anybody know at what amount of reputation one can create a chatroom?
 
Oh, huh.
Must've missed it. Thanks!
 
@VoteToReopen O_o what did you to to VTC?
 
They said they don't know them (and that VTC was their inspiration)
 
9:02 PM
Heh. I did intend to change my name but I haven't come up with anything.
I'm not incredibly creative...
 
@VoteToReopen Yeah, I had that problem. I changed my username 6~8 times in a month
 
@Mr.Xcoder I don't know them, but my name was inspired by theirs. Is that a problem? EDIT: Never mind, might as well change my name. — VoteToReopen yesterday
Hehe
 
Also, sorry for the late reply. :P
 
now I really have to go :D
 
@Mr.Xcoder cu!
 
9:04 PM
Bye.
 
@Mr.Xcoder every sock says exactly that
 
Who you calling a sock? :P
 
CMP: How many 0 voted answers do you have?
22/94 for me
 
0/1.
 
@cairdcoinheringaahing 79/426
 
9:12 PM
@cairdcoinheringaahing ~82/531
 
20/314
 
@Lembik Dyalog APL, 3 bytes: ?⍴⍨
 
ಠ_ಠ I just saw this challenge, and got annoyed because its basically the first challenge I posted in the Sandbox, before abandoning it because it was poorly made.
 
Anonymous
@cairdcoinheringaahing 68/442
 
CMC: Random int in range [1,∞). You may chose distribution, but all values should be possible (at least in principle; only limited by implementation and/or hardware).
 
9:22 PM
import sys,random:print random.randint(1,sys.maxint)?
 
@Adám SOGL, 4 bytes - while random(9) {inc()}
 
@VoteToReopen No, that has an upper limit.
@dzaima Ah, I think I get it.
 
0
A: Sandbox for Proposed Challenges

mschauerSquare-free Rock-Paper-Scissors tournament On the day of the Codegolf Rock-Paper-Scissors tournament you hear through the grapevine that everybody else is going to play a fix square-free sequence (a sequence made of the letters R, P, S is square-free if it does not contain a subsequence that rep...

 
@Adám is this possible in APL?
 
@Adám Pyke, 7 bytes, ohHIr)o Try it here!
 
9:26 PM
@Uriel Translation of dzaima's SOGL answer: 1+⍣{1=?9}0
@Uriel … but I can do it in 4 too.
 
@Adám oh, I didn't see the "You may chose distribution"
 
@Uriel If not for a non-linear distribution it would be impossible in every language.
 
@Adám fix(1/rand) should work in MATLAB, up to the floating point limits.
 
@flawr fix is floor?
 
Right, but it rounds towards zero.
 
9:32 PM
@flawr That's the solution I had in mind in APL.
 
Would you guys mind giving me a bit of feedback about a challenge idea I have?
 
@Adám so ⌊÷?0?
 
@Uriel Yup. Nicely done.
 
import random
f=lambda:random.randint(0,1)
s='1'
while f():s+=str(f())
print(int(s,2))
@Adám Python ^
Heavily heavily weighted towards 0 1
But in theory, any number is possible
Oh wait
Yeah, just noticed
Fixed
Also, not very golfy
 
Nice solution though
You could make it a recursive lambda for a nice golf
 
9:36 PM
Basically, the cops have to modify their language to make addition non-commutative, but their program has to be able to be changed so that multiplication is non-commutative instead. The multiplication program has to be a levenstein distance of to be decided from the addition program, and is trying to be found by the robbers.
 
@DJMcMayhem OK, so same principle as dzaima's SOGL answer, i.e. your Python code is 1+⍣{?2}0 in Dyalog APL, assuming ⎕IO←0.
 
@FlipTack Actually, There's a much more obvious golf though.
from random import*
f=lambda:randint(0,1)
s=''
while f():s+='0'
print(len(s))
Not as big, but way more obvious
 
`import random
f=lambda n=0:random.randint(0,1)and f(n+1)or n`
damn how does formatting work here
 
@DJMcMayhem Why can't you do while randint(0,1): ?
 
@FlipTack single backtick
 
9:38 PM
Duh
 
@Uriel that has a limit due to floating point presision
 
@Uriel is random.random() never zero?
 
@FlipTack Just paste it in multiline, then hit the fixed font button
 
import random
f=lambda n=0:random.randint(0,1)and f(n+1)or n
thanks!
 
@DJMcMayhem why not just an integer counter?
 
9:38 PM
@dzaima Because I'm an idiot
 
@FlipTack Your name is ⊖⊢ in APL.
 
interesting.
What do Flip and Tack actually do?
Flip is probably as it sounds, but Tack...
 
I'm guessing flip is reverse, and tack is append?
 
@FlipTack Flip flips tables (matrixes) upside down. Tack is the identity function.
 
I'm about as useless as a reversed identity function
 
9:41 PM
Anyone else want to do a bounty on the Tetris in CGOL question? This answer only got 500 rep and the others got 1000.
Crowdfund rep for muddyfish
 
:P
I thought it would be rude to mention it
 
@mbomb007 Yeah, sure
 
@FlipTack Not useless at all, f←⊖⊢ returns the flipped right argument. Try it!
 
you learn something new every day
 
@FlipTack Wait, really?
 
9:44 PM
@mbomb007 Done
@FlipTack TIL
3
 
@HyperNeutrino Am I my language's keeper?
 
Underrated comment:
Oh you avoid politics, Star Wars, and religion, you say?! Well let me get you started on the politics of the Star Wars religion! — corsiKa 2 hours ago
 
@dzaima Yeah. It is being worked on. Meanwhile, using an incognito tab should fix it until the server resets your session.
@dzaima I just fixed another bug last week which cause the server to hang with certain input…
Luckily it is running in Docker and is being polled for availability, so Docker will kill it and restart it whenever that happens. Anyway, I've fixed that bug – just need to commit.
 
@Adám wow :)
 
9:57 PM
@Lembik Well, it is a pretty odd edgecase of various factors clashing, so nobody thought of it during the last 5 years.
 
10:20 PM
I have no idea how to grasp just how incomprehensibly massive TREE(3) is.
 
@ATaco there are easier hard to grasp numbers
Now I remember scottaaronson.com/writings/bignumbers.html, but there's a similar article by someone else that I can't think of
 
0
A: Sandbox for Proposed Challenges

eaglgenes101Self-compiler/interpreter code-golf quine string classification Create a language validator, which takes a string/file that might or might not be syntactically in the language of your choice, and returns a value corresponding to whether or not it is a valid program in the implementing language....

 
Maybe I'm thinking of the Strong Law of Small Numbers (maa.org/sites/default/files/pdf/upload_library/22/Ford/…)
 
@ATaco The problem with TREE(3) is that I've never seen any lower bound for it or estimate of how big it is. At least with Graham's number, I understand the steps to get to it, even though it's still too big to comprehend
Actually now that I think about it, I know the size it Graham's number, but not what it answers. And I know what TREE(3) answers but I don't know how big it is lol
 
10:40 PM
I don't actually understand why TREE(3) is big
 
Oh, You've got a Ph.D?
Consider me rather impressed!
 
@ATaco Yeah, but that wasn't what I was trying to show DJMcMayhem; Ron Graham was my advisor.
 
Wait, as in Graham's number Graham?
 
o.O
 
10:46 PM
@EricTressler woah
 
I worked on the lower bound for the problem related to Graham's number while I was grad school, but this paper (arxiv.org/abs/0811.1055) came out while I was working on it
3
For showing lower bounds to those things, a lot of times you just need to write a better program to find an example. And every 5-10 years, thanks to computing power going up, that can sometimes be easy.
 
My knowledge of large numbers ends with Graham's number's definition and the feeling of "Crikey that's large!"
Wait, if you've worked as a student of Graham, does that mean you have a Graham number of 1?
 
I have never heard anyone refer to that, but I have an Erdős number of 2
 
(It was a bad joke regarding Erdös numbers)
And that's pretty incredible, you should be proud of where you are academically.
 
I agree it was bad.
 
10:57 PM
Random question: what is 1/3 + 1/5 + 1/7 + 1/9... to infinity?
 
@DJMcMayhem diverges
 
I think it's supposed to work out to something nice if I remember correctly, but I don't remember what
 
I thought it was pi but I doubt my memory.
 
it diverges for the same reason 1/2 + 1/3 + 1/4 diverges. The alternating sum is nice, though
I think 1/3 - 1/5 + 1/7 - ... is pi/4 or something
 
@EricTressler Ah, that sounds right
It was a typo in my program that they were all positive, I think it was supposed to be alternating
 
10:58 PM
See List of things named after Gottfried Leibniz for other formulas known under the same name. In mathematics, the Leibniz formula for π, named after Gottfried Leibniz , states that 1 − 1 3 + 1 5 − 1 7 + 1 9 ...
 
series: sum(cos(x)/x) is really hard to figure out if it diverges or not
 
The series diverges.
 
I constructed it specifically to break all the tests in the book and run off the end of the decision ladder.
 
(I only just realised Eric answered it first)
@Joshua I'm going to guess it converges.
 
@Joshua It depends on n being sufficiently far from a multiple of pi often enough, right?
 
11:01 PM
Someone sent me this picture, and I was trying to figure out what it works out to:
 
I think it diverges, it's just a mess to prove it
 
Desmos makes it look like it converges, but that's Desmos.
 
oh, you're probably right, I was thinking of |cos(x)|
but I don't know how you'd prove it, maybe by expanding cos(x) to a few terms and finding a way to throw out the end of the taylor series
 
It still looks like a pain to prove.
And just as hard is to prove where it converges to.
 
What is the sin() doing there?
 
11:08 PM
Oh, that's sum, not sin...
I am the fool.
 
I've never seen this site, it looks nice
 
Wolfram alpha has a little too much random information sometimes to use it as a plotting tool
 
I'm pretty hopeless without it, it's a fairly powerful graphing calculator.
(Plus the code is Valid MathJax)
Taken straight from Desmos code.
 
well I think my school board's email servers died
or nvm works now :P
 
11:15 PM
I was looking to see if desmos uses D3, but I don't see it there, so maybe not
 
I'm not sure what D3 is.
 
how to handle git conflicts: 1) sudo rm -rf repo/ 2) git clone https://github.com/username-here/repo.git
 
10/10.
 
> -rf
You madlad
 
Why?
 
11:17 PM
well ok fine to be fair when I just did that I didn't do the -f part
 
(If you need to sudo to remove a git, you might have something set up wrong)
 
well there are write-protected files in it
 
Eh, a-ta.co is stored on root without source control.
 
I would type up a clever means of putting "hello world" here, but "hello world" is surprisingly kologmorov complex
 
11:20 PM
$ mkdir git-test/
$ cd git-test/
$ git init
Initialized empty Git repository in ...
$ cd ..
$ rm -rf git-test/
$
Huh.
 
Don't forget my favourite mistake sudo mv / /www
 
(That's how I screwed A-ta.co once)
 
...How did you type that (even accidentally)?
 
I was trying to move my current folder into /www with ./ /www, and must have missed the ..
 
11:24 PM
Ah, that's not as worrisome.
 
lol
huh for whatever reason I can't open my GH wiki pages locally
Atom just doesn't do anything when I try to open it
and atom . doesn't do anything
 
Have you cloned the wiki as a separate repository?
 
yes
time for my favorite trick
 
(Also, may I mention that having two repositories for a wiki is a PITA?)
 
(I should probably set up some Source Control for a-ta.co)
 
11:28 PM
(That's usually a good thing.)
 
lol I just tried to do sudo rm -rf ./ (which didn't work anyway) and almost missed the dot
 
Do you like to live on the edge?
 
Gnu coreutils rm already stops you if you try to delete root
 
@VoteToReopen yes. also, I just crashed my computer
 
--no-preserve-root
 
11:33 PM
I wonder when they are going to put in other safeguards to make sure you don't delete every directory in root or anything like that
 
@HyperNeutrino How?
 
atom stopped working so I ps-ef | grep atom its PID and then killed the wrong process :P
 
There really should be a license to operate a Bash shell.
 
haha yes
 
Or any kind of shell to be honest.
 
11:38 PM
yes
 
Bash is full of subtleties, which is what you get when you try to have a construct for everything under the sun
 
CMC: Given N, return 4 × N terms of 1 - 1/3 + 1/5 - 1/7 + ...
E.g. N=3: 3.466666667
 
@HyperNeutrino 0/10 should have used pkill atom
 
@Adám oh
 
@HyperNeutrino "oh" on the N=3 case‽
 
11:44 PM
pkill means pgrep kill, which bothers me since it's not the p part of pgrep that makes pkill different from kill.
 
...Are you guys trying to make up language names that can be made puns on easily?
 
Funky's name is an accident. I couldn't think of a name at the time so I used it as a placeholder..
 
@ATaco I predicted this happening months ago
Aug 18 at 6:58, by Pavel
@ATaco Nope, you've named the repo 'funky' and you're stuck with it now.
@ATaco did you roll your own stdlib for the server stuff or did you hijack an existing one
Also, are there docs?
 

« first day (2466 days earlier)      last day (2369 days later) »