« first day (1686 days earlier)      last day (3149 days later) » 

8:00 PM
@PeterTaylor He changed it to a code golf.
 
I don't think it should be open in general, but the close reason at the time was no longer accurate.
 
@Sp3000 ??
 
Sp had a question for you a couple lines up from that
 
I'm #402 overall
#36 this month
 
8:05 PM
Did he? I'm either not seeing it or not able to work out from the context what it is.
 
2 hours ago, by Sp3000
I feel like there should be a difference between if(!1) and if("!1") here... (confused)
 
Where?
 
Two lines up from what you replied to
 
No, there should be a difference between if(!1) and if("!1") where?
 
If you sift through the crap in that area, Sp and Mauris were talking about one of Mauris' solutions to Dennis' primes where he linked to something you said.
 
8:11 PM
I'd gotten so used to my default blue avatar, I can't find any of my messages on here while skimming through :P
 
This answer prints the string !1 as a falsy value:
1
A: Is this number a prime?

MaurisC, 63 bytes i,n;main(p){for(scanf("%d",&i),n=i;--i;p*=i*i);puts("!1"+p%n);} Prints !1 (a falsey value, by Peter Taylor's definition) if (n-1)!^2 == 0 (mod n), and 1 otherwise.

@PeterTaylor ^^
 
There's someone who's earned -76 rep this year: stackexchange.com/leagues/88/year/codegolf/…
 
Ah, I see. Then I agree with Sp3000: I don't think it's a falsy value by my definition.
 
@Mauris ^^
 
I also don't think it's as golfed as it could be. Wouldn't putch(48+p%n) save a char?
(Or putch(49-p%n), whichever gives the correct output)
 
8:13 PM
putch is nonstandard conio.h stuff
 
putch is Windows-only
 
I'd need putchar, which is 1 longer
 
I don't understand why it wouldn't count if printed as a string. The question says "output the string representation of a truthy/falsy value".
It's not printing the literal " marks.
 
!1 is an expression, not a value
 
You could argue that 1 is an expression, too ><
 
8:15 PM
it is, and it's a value
 
The definition as written says nothing about expressions or values
 
It clearly fits the if(!1) test either way.
 
^ All Peter's definition says is "If this construct doesn't compile or error, it's the final judge".
I'm okay with changing it to putchar, but then I feel like the definition should be expanded/clarified.
 
The wording of my question seems a bit unfortunate. My intention was to allow truthy/falsy values as well as string representations thereof. So there's really no point in arguing, since putchar(p%n) is already shorter.
 
That would print a raw 0x00 byte for false and 0x01 for true, which feels iffy
 
8:20 PM
@Dennis How can there be a difference between these two, when a full program is required?
 
Not pretty, but I'd allow it in brainfuck.
 
Sure, I'd agree, but in C I dunno...
I think I will change it to putchar(48+p%n)
 
@feersum For numbers, no difference. But empty output is an empty string, as well as "".
At least that was the intention.
 
OK, string representations of strings aren't involved here though.
 
I was originally hoping that I could finally use an exit code for output, but noooo, Dennis wants it printed :P
 
8:22 PM
Hmm. What if I print 1 for true and nothing for false?
 
The empty string isn't falsy in C
Unless you want to say it's a string representation of a null pointer :P
 
Hah: I could say puts(p%n*"1") printing either 1 (a true value) or (null) (or whatever your compiler's string representation of a null pointer is).
That is probably hella UB.
 
won't you need -fpermissive?
 
do i sense a doorknob
 
no
 
8:26 PM
doorknob senses u
 
Ah, can't do int * char*.
 
If a Russian tells a Russian meme joke, does it come out in the proper order?
 
@Rainbolt I doubt people who were alive for the whole Soviet deal are young enough to meme
 
I could also say:
main(){puts("0");}
 
@cjfaure Oh, is the meme specific to Soviet Russia?
 
8:28 PM
For primes, it outputs the string representation of the string "0", a truthy value.
For non-primes, it outputs 0, a falsey value.
 
@Rainbolt I believe so
 
That doesn't print any quotation marks
 
(I'm joking)
 
@Rainbolt In Soviet Russia, joke incorrectly orders YOU!
 
The truthy char* "0" or a string representation of the int 0, I think you mean
 
8:33 PM
"0"==false returns true in JS.
Oddly enough, !!"0" returns true...
 
@cjfaure Who are you calling old? Get off my lawn!
 
@ETHproductions And that is why you never use == in JS.
(For values of never meaning only if you have a really good reason.)
 
Like golfing one byte?
 
s/ == in//
 
@feersum Yeah that works too
 
8:36 PM
JS is full of weirdness, I love doing things in JS
 
@Mauris I wish I had noticed it earlier, but you cannot use Wilson's theorem in C because it won't work for all possible inputs.
 
oops, that's not the google search bar
5
 
Also, Python unary regex solution is way suboptimal for the prime golfing challenge
I can't get below 58 chars
 
@Dennis Because of overflow?
 
Did you test it for 1-255?
 
8:38 PM
Hey look, you can star removed messages
 
No you can't
 
@Dennis Can't you insert the modulo into the factorial, to avoid overflow?
 
Oh, right
 
aw damn, i figured the button being there meant that it worked
 
Yes, I was thinking something like that might work @Mateon1
 
8:38 PM
as I did earlier cough @Geobits
 
@Mateon1 That should work, yes.
 
@cjfaure The button isn't there.
Wait that's my own message.
I'm an idiot
14
 
@Mauris Yes, the rules allow breakage because of overflow, as long as input 1 to 255 is supported.
 
Does it actually fail though? I thought you might be lucky and not have it go to 0 for any primes
even numbers tho
 
i,n;main(p){for(scanf("%d",&i),n=i;--i;p=p*i*i%n);putchar(48+p);}
 
8:40 PM
Factorial of 255 is muuuch more than int can store. 255*254*253*252 is on the edge, and multiplying by 251 overflows (assuming 4 byte int)
 
That might work. Do you know the inputs it failed on, @Dennis?
 
@Doorknob No you're not. You're one of the smartest people I've ever met on the Internet. <3
 
Why do you have to square i?
 
even smart people post their google searches sometimes
 
I'm using Xnor's Corollary to Wilson's Theorem.
 
8:42 PM
You should be using Beyoncé's Theorem for Singleton Sets: If you like it then you should have defined a ring on it.
 
int(isprime(p)) == fact(p-1)^2 mod p
 
@MartinBüttner Does your language quiz challenge specifically say Dennis won in a comment I can link to or something?
 
no it didn't, I can edit the challenge though
 
@Mauris It prints * for input 10.
 
Oh. Hm.
 
8:44 PM
The original, not the modified version.
 
OK, my new one gives 0, here, at least
 
Suggestion for Stuck v2: Identical to v1, but the blank program is a primality test.
 
@Calvin'sHobbies done. will edit again if there's a challenge to link to
 
Wooo beating Java
even though Snails doesn't have numeric types or variables of any kind hehe
 
8:51 PM
I'm working on a feature selection problem. How do you identify pairs of variables that are important? (Aka, Variable A and B are only important if both of them are high, otherwise they are both irrelevant)
 
High as in both exceed some threshold value?
 
Are they correlated?
 
unknown
 
Random idea of the day: JSolang - Just like JS, but the syntax is as short as possible while still retaining all of its data.
 
8:55 PM
I'm working on a game-playing AI that is able to (hopefully) play a human-designed game. I need to identify things that are important within the game
sometimes, those things come in pairs
 
ooh yes, AI
the field I pretend to know stuff in
 
for example, if I'm playing poker
 
@feersum Actually, tying, once Geobits edits in my corrections.
 
Can't wait to see it when you're done :)
 
and there is a King on the board, and King in my hand
that's important
 
8:55 PM
@AlexA. The ngn/apl online demo is the only interpreter I'm aware of that prints automatically in APL, and it doesn't work with . :(
 
:P
 
but if there isn't a King on the board, then its much less important
 
guys what's a good tool for drawing squares
 
excel
 
8:56 PM
maybe with soem arrows
 
it does it automatically
 
Random AI question of the day: In deterministic 2048, shouldn't it be possible to get to the 65536 tile?
 
don't think it does arrows though
 
probably not :P
 
even getting h = w is a PITA for Excel
 
8:58 PM
turtle graphics
in all seriousness, I'd probably use paint
 
^ Me too
I actually got this:
define six as 1+5;
define nine as 8+1;
return six * nine;
To run as JS, using a custom regex before eval()
It returns 42, as expected ;)
 
well yeah, 1+5*8+1 == 42
 
@cjfaure Here's where that came from: codegolf.stackexchange.com/a/21887/42545
 
@ETHproductions ah yes~
 
@Dennis I wrote and tested it in the desktop version of Dyalog APL (but TryAPL doesn't support input)
 
9:09 PM
@AlexA. If it works in Dyalog, sweet. The GNU APL online interpreter is a REPL though.
 
Oh right
 
And GNU APL is pretty much unusable for golfing otherwise. :P
 
Haha
 
I'm serious. It refuses to interpret EOF as the end of the file. You have to write )OFF.
And I still couldn't figure out how to print.
 
Oof. I'm never used GNU APL on desktop. Seems unnecessary when I have the desktop version of Dyalog.
(Which you can get for free, btw. Just claim you're a student.)
 
9:13 PM
You also have to choices: script mode, where everything goes to STDOUT (including error messages) and normal mode, where only the banner goes to STDOUT (the rest to STDERR).
 
Who... who thought of that
 
Well, that's dumb
 
Can someone link me to the What counts as a programming language? thingy?
 
Saw !!SuperPrime?
 
I can't find it on Meta (I suck at finding things.)
 
9:14 PM
17
Q: What are programming languages?

Ingo BürkOften, answers to questions asking for "programs" or talking about "programming languages" utilize things like sed, awk, … in order to get around having to write an actual shell script. Therefore, a question comes to my mind: What qualifies as a programming language? Sure, ultimately the OP ca...

I think that's it
 
No, writing up something silly.
The sequel to Help, WarDoq!, you might say.
 
Haha.
 
Help, WarDoq! 2: Help, WarDoq Harder
The WarDoqening
 
Hmm, does Help, WarDoq! satisfy the first constraint, there?
 
Well, it has a primality test and can add two numbers
I think that's what he was going with
 
9:17 PM
It feels like it can add two numbers without supporting a representation of them.
 
IMHO, HWD isn't a valid programming language for challenges on this site.
 
It supports them in the input, which is something. :P
 
@ETHproductions Why not?
 
Well, even if it's valid, it unuseful for all but 2, AFAIK.
 
Yes, but it's still valid.
 
9:20 PM
valid != useful
 
I know, but...
 
Something like "Java, except every program that fails to compile prints Hello World" is also valid.
 
>
Support a representation of natural numbers and of tuples.
Does it support tuples?
(from the top answer on that meta post)
 
I'm sort of siding with ETHproductions, but at the same time, I realize that there is nothing stopping a new version from fixing this issue in what is still a very useless way.
 
The easy solution is "don't use Hello, World!—be more creative."
 
9:23 PM
Like, add in a stack, on which you can push, pop and print integers; and pack/unpack them into tuples.
 
@Mauris Or this:
3 mins ago, by Doorknob
Something like "Java, except every program that fails to compile prints Hello World" is also valid.
 
The string "Hello, World!" is a tuple, isn't it?
 
That moment when your favorite anime starts playing traditional Indian music in the background o.O
 
I dunno... There are no projections (X1, X2, ... Xn) → Xi
 
I would add as a requirement "contains at least one memory cell that can be written to and outputted from" or something similar.
 
9:26 PM
Arguing that "Hello, World!" is a tuple of characters feels a little like arguing that 12 is a tuple of bits
 
I have a Python question, if someone could help. I'm trying to trim a floating point number to a certain number of decimals for printing. When I try this method, it works with the small example, but not in my program, which prints letter frequencies by position in the word.
 
If there's no way to access the individual elements, I mean
 
@Doorknob Rust question for you
 
(From a category theory perspective, those projections are all that defines a tuple!)
 
@ETHproductions What's the point? You could still create "Java unless it fails to compile in which case interpret as Help, WarDoq."
 
9:27 PM
It's just printing zero, instead of the floating pt values.
 
(Cause, ya know, Java.)
 
@Mauris I should have taken your original suggestion and implemented a interpret-source-code-as-CJam built-in.
Help, WarDoqs! is on its way. :P
 
@mbomb007 You are probably running into Python's integer division thingy. Try adding float() around an expression on either side of /?
 
(That's what I get for reading only the executive summary.)
 
@Mauris It doesn't work in Python 3 either, so I don't think that's it.
 
9:29 PM
@Dennis Or you could do "CJam, except one-character programs print variations of HW, FizzBuzz, 99 bottles of beer, etc." :P
 
Or inflate, then interpret it as CJam. Bubblegum with steroids. I can already taste the downvotes.
 
@Mauris Python 3. It keeps the floating point decimals far out.
@Dennis To Beta Decay, downvotes taste like candy.
 
@mbomb007 I didn't know Beta Decay liked to eat Geobits...
3
@AlexA. I'm waiting... :P
 
@Doorknob Oh haha. How does read integer from STDIN? :/
 
@AlexA. Is the integer the only thing on its own line?
 
9:34 PM
Yes
 
@Doorknob Geobits sound like they could be some variety of cheesy snacks. That, or pet food.
 
And is this intended for golf, or actual code? :P
 
Haha golf
 
Oh. This might change the answer, then.
Hmmm. There's lots of ways to read from STDIN; I'm not sure which is shortest.
 
I don't know any ways, at least none that work in the Rust playground.
 
9:36 PM
The way that immediately comes to mind is with std::io::prelude, but that's lots and lots of chars.
 
@Mauris Example: print(float('0.500000001')), once I trim the value and wish to convert back into a decimal, it has inaccuracy due to precision.
So does Python, despite having arbitrary precision integers, still have limited precision floating point values?
The above prints 0.50000000099999997, btw.
 
@Doorknob Is that like use std::io::prelude::*; then BufRead or something?
 
You can import Decimal or something.
 
@AlexA. BufRead? I've never heard of that. But it's the super long use statement, yeah. I'm trying to figure out the shortest way now...
 
@ETHproductions please don't approve suggested edit which golf an answer
10
Q: Suggested Edits: Reject Golfing?

JustinEvery now and then, I see an edit where somebody does some golfing (most recent). From what I can tell, our standard is to reject those edits as invalid and post a comment saying what was suggested, because we feel that golfing tips should be comments. And I have always done so (after I learned)....

 
9:39 PM
^
@Doorknob Maybe just Read? I was looking at the docs for prelude.
 
Ugh. I'm trying to test stuff, so I made a file called asdf.rs. Turns out the file called asdf already exists, so the compile failed. :/
 
Haha
 
Anyway. Baseline is this:
    use std::io;let mut s:String=String::new();std::io::stdin().read_line(&mut s);
(That avoids having to bring in prelude.)
 
There's no way to do a direct to i64 or something rather than starting with s: String?
 
1
Q: Disallow edits to answers that only golf code further

DankMemesThis answer had 2 suggested edits that only golf the code further, and the edits were both approved. I personally disagree with edits that only golf the code further. Here's why: It shouldn't be up to the reviewer to make sure a code edit works. That should be the job of the answerer. If an edi...

 
9:42 PM
Oh. Nope, I don't think so.
(I could be wrong though.)
 
But I could use s.parse() to get i64?
 
Uh. No, I'm not sure how that would work.
 
Hm, okay.
 
The normal way would be with from_str, not sure if there's anything shorter.
Where'd you find that parse method?
 
Internet
haha
 
9:45 PM
@MartinBüttner Oh, sorry, I didn't realize that was a bad thing (although I guess I wouldn't do it, so I should have thought of that...)
 
Oh, is it this?
 
@ETHproductions no worries, not everyone can have read every meta post. that's why I'm telling you ;)
 
That's a generic method, which means you have to specify a type.
 
If anyone is curious about the PPCG Minecraft Server, I made a video tour:
 
Hello. I was about to ask about code golf Question, but some similar was rejected. Is raytracer with some constraints (and the same task for all) proper?
 
9:49 PM
@MartinBüttner Thanks! :)
 
@Calvin'sHobbies You have a very radio-friendly voice.
 
@AlexA. That's good to hear :)
 
@EvilJS Welcome to PPCG! If you post your challenge to the Challenge Sandbox, you can recieve feedback before you post it on the main site.
 
@Doorknob is.gd/SKVkTq
I get error
 
Huh? No error for me.
 
9:52 PM
@ETHproductions ok Thank you.
 
@Alex Is is.gd a generic link shortener, or some other shortener designed for that website?
 
@Doorknob Or warning, rather: warning: unused result which must be used, #[warn(unused_must_use)] on by default
 
Ah, nvm, I found it online
 
It's code golf who cares about warnings
 
@ETHproductions It was the automatically generated short link from the site I was on
 
9:53 PM
Oh, cool
 
@Doorknob :P I don't understand though because I am using the result. I'm printing it.
 
@AlexA. No you're not.
s isn't the result. It's a mutable argument.
 
...oh
 
The result of read_line is probably a Result<something, Error> of some sort.
 
@Calvin'sHobbies REGGIE, MY ASS CHILD!
 
9:54 PM
Sometimes I wish my siblings were mutable
 
@Dennis: ^ It's horrible. I feel guilty.
 
Yeah, I think the shortest you're gonna be able to get is:
pub use std::io::*;let mut s:String=String::new();stdin().read_line(&mut s);
 
@Mauris That's covered by out standard loopholes.
 
I always write my Rust entries as functions though. Does the challenge require something different?
 
Full programs
 
9:58 PM
:/
 
I'm (foolishly) trying to make my first ever Rust program the golfed primality test.
 
When you give up on that, try a "Goodbye, World" program
 
Who says I'm going to give up? :P
 
I guess MetaGolfScript is. I think I could get away with this if I get very lawyer-y about it. (Not that I want to.)
 
@AlexA. Anyway, you can use that code, and once you've got the String I think something like (&s).parse::<u64>() would work (not sure if first pair of parens are required or not).
 
10:01 PM
@AlexA. "Ass child" just sounds gross
 
Does Rust still take like five billion hours to compile and get to work?
I kind of want to give it a try.
 
@Mauris Assuming you're on a Unix OS, it's a single shell script that takes ~2 minutes to run.
Actually, you might be able to just grab the binary.
Rustup is convenient though.
 
@AlexA. But yes, Reggie makes a cameo :P
 
OK, that was fast.
 
@Calvin'sHobbies I know, I saw. :)
 
10:04 PM
I remember a friend telling me she needed to leave her laptop on overnight to compile the Rust compiler
 
D:
 
I guess not needing to do that helps!
 
The Rust compiler is written in Rust. How are you supposed to compile the compiler without a compiler?
 
Why does Rust take so long to compile?
 
I remember this was when Rust was still very young, so maybe you had to compile it with a slow, bad version of Rust?
I don't quite remember the history.
 
10:06 PM
@Doorknob That sentence hurts my brain
 
I can't write a JS function anymore without trying to golf on some level :P
 
@Calvin rofl your reaction on the elevator
 
P=n=1
exec"P*=n*n;n+=1;"*~-input()
print P%n
@Sp3000 I think this saves 2 chars
rather that saving the input to a var, you count up to it
@Mauris
 
10:24 PM
Ooh, neat.
 
hey guys whats up
 
Hi!
 
where do you guys learn such arbitrary languages
 
10:39 PM
Haha
It's true
 
Nice, someone submitted in ECMAScript 2015.
What a super-formal way to refer to that language.
 
> Brendan Eich reads up on every mistake ever made in designing a programming language, invents a few more, and creates LiveScript. Later, in an effort to cash in on the popularity of Java the language is renamed JavaScript. Later still, in an effort to cash in on the popularity of skin diseases the language is renamed ECMAScript.
 
Hahaha
@PhiNotPi You should watch Calvin's MC server video
 
10:55 PM
@AlexA. watching it right now
 
@PhiNotPi Ok
 
@Dennis @MartinBüttner The Dennis challenge is ready: codegolf.stackexchange.com/questions/57719/…
 
0
Q: Generate Dennis Numbers

Calvin's HobbiesThis challenge is a tribute to PPCG user Dennis for winning the robbers' part of The Programming Language Quiz. Looking at Dennis' PPCG profile page we can see some pretty impressive stuff: He currently has over thirty-seven thousand reputation, making him second in rep overall, surpassing th...

 
@Calvin'sHobbies It got auto-flagged as excessively long XD
 
Yeah, it's all the tabs that got turned into spaces
 
10:59 PM
Rightfully so.
 
@Calvin'sHobbies Great challenge!
It will never cease to amaze me how you come up with all these ideas.
 
^^^
 
It should be the next OEIS sequence
 
11:14 PM
I have a lot of sequences around PPCG that could go on OEIS
 
OECH: Online Encyclopedia of Calvin's Hobbies
 
0
Q: Generate ordered binary combinations without repetitions

fpg1503Challenge Write the shortest program that receives two signed integers n and i and for each i between 1 and 2^n - 1 returns the next ordered permutation based on the binary representation of the number. There is no specific order of the combinations but the number of 1s in the binary representa...

 
@Calvin'sHobbies 8908 is a Dennis number of order 1, right?
Because you swap the leading 8 with the invisible 0 before it?
 
@Mauris No
 
OK, it only works the other way around?
 
11:20 PM
@Mauris No, 8909 is though, since you can swap 0 and 8 to form 989.
 
The 'invisible zeroes' are not considered
 
OK, I'm seeing it.
 
Hmm. The 12012st Dennis number is 717919 which has its own curious symmetry
 
Perhaps it's in a class of Calvin Numbers.
 
^ for the Many Memes of PPCG post
 
11:27 PM
It's Dennis order 2 as well -> 917719, 719917
 
Wow, apparently stealth pings are not visible in chat transcripts.
 
Take a screenshot?
 
That's what I'll have to do.
 
@PhiNotPi Unless history somehow helps (chat.stackexchange.com/messages/24046726/history)
 
Should I reveal how stealth pinging works?
Since that image contains the raw text?
 
11:37 PM
NO
 
@PhiNotPi It's now forever in the revision history ;)
 
:(
 
Test test?
OK, that's not it.
What if you put :24046863 in the middle of a message...
Nice, it does nothing.
 
That should work just fine. :24046885 See?
 
My theory was hiding it in a link
Guess not.
My Haskell answer to this Dennis thing is long as heck.
 
11:56 PM
How much is that in bytes?
 
Let's seeee
Currently 225.
 
Wowza.
 
What's the general approach your solution takes?
 
For a n-digit integer, create the array [0,n)x[0,n) and filter it by the swaps that create palindromes.
Take the length, check if the original integer is a palindrome and try the next number if it isn't a Dennis number.
 

« first day (1686 days earlier)      last day (3149 days later) »