« first day (2322 days earlier)      last day (1511 days later) » 

12:03 AM
lambda s:max(map(len,re.findall('a+',s))or[0])
import re
12:14 AM
CMC: Longest run of identical characters.
do we have a question that asks for a program that does nothing?
I can't find one, and I'm fairly shocked that it hasn't been posted yet (despite being clearly terrible)
also, how mad would people get if it were asked?
@ais523 I think we do, but there would be an awful lot of 0 byte solutions.
@Adám 4 bytes in Brachylog 2, although I don't have an appropriate keyboard for typing it offhand :-P
wait, no, 5
@ais523 Yeah yeah, the margin is too small and all that :-)
take blocks of consecutive characters, take length of each, sort, take last
that's five builtins
in Jelly, it's run-length-encode, tail each, maximum; that's four builtins but also five characters because the first is two bytes long
when I program I don't even think of the actual representation of the code on disk much at all
just the algorithm
but for golfing languages I also tend to memorize how long each builtin is because that lets me work out what algorithm is shortest
12:25 AM
@ais523 I can't find one either. Maybe better as CMC?
possibly could work as a CMC with the stipulation that you can't choose a language where it's the shortest possible program?
@ais523 Sounds good.
to be honest, I kind-of want to post it to the main site just to make a stupid point about HNQ, but I'm not sure I'm that vindictive
@ais523 Are trailing newlines allowed?
Q: What is happening to PPCG?

ElPedroHi Guys & Gals and fellow golfers. I just want to ask a question and hopefully get some meaningful answers. I am a relative newbie on PPCG with a rep of only around 2.5k. That suits me but I am continually seeing questions closed for newcommers as dupes and unclears and get very little chance ...

12:27 AM
I guess to make it not 100% trivial: must work for arbitrary input and print no bytes of output
normally I/O formatting isn't a major part of a challenge
but when there's literally nothing to the challenge itself, all the peripheral stuff becomes important
@ais523 I'd kind-of like a null challenge so that we could close trivial challenges as duplicates of it because its answers can be trivially adapted to the new challenge
haha :-)
@ais523 So it must take input?
@Adám no, it's OK if it doesn't read it, but if it does read it it mustn't let it interfere with its operation
which I guess, to avoid ambiguity, means "must work regardless of the byte sequence on STDIN"
(fun fact: this actually makes the task impossible in some languages, such as Brachylog)
@ais523 AND not be the shortest possible program in that language. Sounds good.
12:31 AM
tell you what, I'll Sandbox it
@ais523 Yeah, probably a lot of golfing languages. Hey, maybe a pretty good challenge after all.
sandbox votes might correlate to main votes? possibly?
@ais523 may we throw an error? output on stderr? quit?
no, yes, yes as I'm currently writing it
do you agree with those choices?
@Adám Haha, I was thinking about posting exactly that to main
12:32 AM
(the leading "no" is purely based on preventing syntax-error-based solutions)
@ais523 i think no stderr output is more interesting.
@Adám i'm off for now, feel free to edit my changes to the cartesian product challenge
@ais523 i agree
@xnor ok
I can do no stderr
@ais523 yeah, it has to do truly nothing.
@ais523 also, no preventable side effects allowed.
@ais523 May base on the specs from here?
12:46 AM
please tell me it's titled 'do nothing'
it is
I originally gave it a more complex title then realised that "do nothing" was clearly the only acceptable title, and edited it down before posting it
ooh is there a challenge about punnett squares?
there's none
imma make one
1:02 AM
@ais523 I'm trying to make sure I understand the challenge. By default, the empty V program prints all input. It would require dG if I want to print nothing regardless of input. So is dG a valid program because it prints nothing? Or is it Invalid because it does something (deleting input from the buffer)
Another question. Can I use brain-flak, which always prints a Newline by default?
@DJMcMayhem If you're using V on TIO, it's valid; the program is self-contained, it's taking input from the input stream, producing (no) output on the output stream, there isn't a buffer that outlives the program
@DJMcMayhem no, suppressing the final newline is part of the challenge, and if that's impossible, so be it
@ais523 Why? unless they're an unavoidable consequence of running a program
The empty program in Japt prints undefined; the shortest program that prints nothing is P, which simply introduces the empty string as the result of the final expression. Is this a legal entry?
(It's approximately equivalent to eval("''") in JS)
A: Sandbox for Proposed Challenges

ais523Do nothing Write a program which terminates normally (not in an error), producing no output on the standard output stream (or the language's closest equivalent), nor on the standard error stream, regardless of what content is present on the standard input stream. (Note that this is intentionally...

@ETHproductions Doesn't that print a newline?
1:06 AM
@ais523 Ok, sounds good (on both points). Maybe clarify that doing nothing is defined in terms of IO, rather than actually not doing anything
@Adám No, Japt's never heard of the mythical "trailing newline"
@ETHproductions IMO yes
@Adám I interpreted that as "running a program on the OS", and said so on the sandbox post
do you disagree? "running a program in the language" seems unfair because it gives an advantage to languages which can't suppress implicit newlines
...I just realized how dumb I am lol
@ais523 Not really. If it cannot be suppressed, then it has nothing to do with the program, but rather the system around. The point of the challenge is to suppress everything that CAN be suppressed.
right, but we're arguing about what "can" means here
"can" for the language? or "can" for the OS
in most challenges, we don't ask "do as much as possible in the language you're using", because then you can pick a low-powered language and do less
why should this be different?
1:11 AM
Unrelated to the ongoing discussion, but an example of what constitutes a valid submission: In APL, the shortest valid program is empty, and would fulfill the specs, except that there are no shorter programs which DO do something. So {} is a valid solution because it takes any input(s) and does nothing at all. (Don't worry, I didn't give away my shortest solution.)
have you read the post?
I'm disallowing languages altogether if the shortest non-erroring program does nothing
@ais523 Really? I think you can lessen that requirement to be that there must be a shorter program which does something. This will allow more answers.
@ais523 Yes, and made a comment about that.
I don't think "post the second-shortest program that does nothing if the shortest program is empty" is interesting
you could just fill it with a comment
Why not just "no zero byte programs"? because too many one bytes that do nothing?
@ais523 good point.
1:15 AM
@nmjcman101 also for languages with unavoidable boilerplate
(INTERCALL, two Ls, is the most ridiculous demonstration of that, but there are plenty of others)
@nmjcman101 As ais523 said, a single comment symbol would circumvent the 0-byte ban.
A: Sandbox for Proposed Challenges

totallyhumanGolf a Punnett square solver! Very incomplete, any feedback on what to add is appreciated. Punnett squares are diagrams used in biology to predict an outcome of a particular cross of [find a word]. [add more detailed punnett square description] Your task is to write a program or a function th...

that's fast for NSP
I believe NSP checks once every n minutes, so it can be fast if it happened to check just after you posted
@Doorknob can you clean these comments?
1:39 AM
Q: Diagonal Alphabet

Stephen SGiven no input, your task is to generate the following: a b c d e f g h i j k l m n o p q r s t ...

A: Sandbox for Proposed Challenges

Aidan F. PierceIs this number a repdigit? code-golf math number Challenge Create a function or complete program that takes a single integer as input and returns or outputs to STDOUT a truthy value if the input number is a repdigit in base 10 and falsy otherwise. Winning The shortest code in bytes wins. Tha...

Anyone know where to find the default cursor file (.cur) in Windows 10? I't doesn't seem to be in C:\Windows\Cursors
I don't know, but at a guess, it'd be tied into the system theme somehow
and may be part of a DLL
Windows resources are probably more commonly packaged into DLLs than existing "loose", because they can be loaded in either form, and the DLL version is normally more convenient
Yeah. This is the annoying stuff that should be easy with computers. I just want to make the same shape cursor with in a different color
2:06 AM
Oh well. I can copy the "(none)" scheme one easy enough since there is no transparency
Thanks microsoft
@LuisMendo how about this one
0~: %1

{P}gk %3

3|3.333333333333333* %10

`@QQQQQQQQQQQQQQQQQQQQQQ@@< %23 with ]D to display
2:37 AM
How do I generate a random integer in a range in C++?
@Mego sorted(iterable[, key][, reverse])
@Phoenix rand() % MAX_NUMBER+1
make sure you srand(time(NULL)) first
I like ^ more
Wait, that's C. It should work in C++
@Phoenix Mine or Leaky Nun's?
2:43 AM
std::mt19937 rng(rd()); makes no sense
I can at least see what yours is doing.
And that's reason 512 why I hate C++
@DJMcMayhem Jelly, 8 bytes: Œgf€”aṀL
std::random_device rd; how does this even work?
It's just declaring a variable
There's nothing being assigned to it
I don't really understand why C chose to use namespace::something-or-other anyway. It completely goes against all other syntax.
I mean, : is used for: a) bit integers, okay b) switch loops, makes sense c) inline if-else statements, I see how that can works d) but when there are two of them together they magically make a namespace function
Oh-kay, C++. Thanks for that.
Quetion: if I am going to do this with a fancy GPU, should I just go for an i7?
2:50 AM
@LeakyNun cplusplus is the w3schools of c++; usually the information on cppreference is both more accurate and easier to navigate through
@Doorknob I know nothing about C++
@Phoenix Yeah, too bad it's biased towards lower numbers if RAND_MAX isn't a multiple of MAX_NUMBER+1
but thanks anyway
@Phoenix It calls the default constructor in C++.
2:52 AM
#undef RAND_MAX
#define RAND_MAX MAX_NUMBER*rand()
@Doorknob I use msdn.microsoft.com
@MDXF Can't you redefine it without undefining it first?
@Phoenix IIRC nope
I mean, I know it's that way in C
I've never really used C++. I've golfed people's C++ submissions, and probably written a C++ quine or eight, but other than that, no use
Q: Is this number a repdigit?

Aidan F. PierceChallenge Create a function or complete program that takes a single integer as input and outputs a truthy value if the input number is a repdigit in base 10 and falsy otherwise. If taking input from STDIN, the input MUST be converted to an integer data type, if meaningful, before operating on i...

3:02 AM
Out of curiosity isn't Wikipedia generally considered a reliable source by programmers?
Especially in PPCG, I've noticed that we always link to Wikipedia for references
A: Sandbox for Proposed Challenges

MD XFLongest run of characters in a string code-golf string Your challenge: Write a function that takes a string s, a character a, and finds the length of the longest run of a in s. The length of the run will be l. Rules: If s is of length 0, l should be 0. You may either print l or return it. No ...

@MDXF Reliable? Nope, absolutely not.
@Dennis Well not reliable per se but accurate enough that we can generally trust its definitions of various programming topics
12 messages moved to Jelly
3:18 AM
@DJMcMayhem It's also strictly speaking not invalid because it's a constant-output challenge.
@DJMcMayhem That's terrible on so many levels
@NewSandboxedPosts feedback pls
3:46 AM
> TIO is now what was previously called Try It Online v2; TIO will use a rolling release model from now on. At this point, TIO isn't very different from TIO Nexus.
TIO nexus retired?
@LeakyNun Yes, last week.
I see
4:10 AM
I tried looking for a Python chat room but apparently there isn't one yet...
Hope it doesn't become obsolete or frozen ¯\_(ツ)_/¯
4:25 AM
How do you change what a room's parent site is?
You don't
Then how do I freeze a room that I'm an RO of?
You don't
So, the charging port on my laptop is screwed. Still manages to charge though. Pic to come.
The cable keeps falling out
4:34 AM
Electrical tape
@Phoenix And that's why downvotes were invented.
@MDXF You can put a room in timeout as a RO, but only mods can freeze
@Mego Ah okay
@Mego Are you suggesting taping my cord to my laptop?
I just re-created the room

 The C Programming Language

General discussion about the C programming language, usage, sy...
4:35 AM
@LeakyNun Please discuss commits and PRs in the comments on the commit/PR.
@Phoenix Yes
@MDXF You ask a friendly neighborhood mod.
If you wouldn't mind...
I'd say that's a bad idea, but the battery was screwed long before the port. I dropped 5% in the time it took to take the photo.
@MDXF Eek, that's chat SO, not chat SE.
4:37 AM
@Dennis That was the problem
I tried to make it a PPCG chat but it somehow became SO
Actually, I have another ThinkPad I'm not using.
I think it's because your parent user is SO.
I could transplant the hard drive.
@HyperNeutrino Not anymore...
Oh hm.
4:37 AM
Wait, is parent user the one you joined first?
My parent is PPCG, but I joined SO first.
Yeah then me too
Unfortunately, those are entirely different beasts. Chat SO has is own message and user ids, so just moving the room isn't an option.
I passed SO last week
4:38 AM
I don't remember how parent user is set, but you can change it in your chat profile
Wait Chat SO != Chat SE?
@MDXF Your chat parent user is still SO.
@HyperNeutrino Yep. Different set of mods and 10k users.
I think SO is there just to mess with all of us...
4:38 AM
I think Meta.SE has its own chat also.
@HyperNeutrino Accurate
Then again PPCG is a branch off of SO. But we're still better :D (no offense to SO users or SO :))
@Phoenix Nope, Mother Meta's chat is the same as chat.SE.
It has different ping notification sounds though.
@Mego Sort of. I still have mod powers on chat SO, but I don't get notifications for flags etc.
4:39 AM
Wait mods > ROs right? (I would presume so)
@HyperNeutrino In every way, shape and form
Not in all cases, but generally.
There are two different chat servers: chat.SE and chat.SO. chat.SE is the server that every site except SO uses. chat.SO is the server that only SO uses, and it has chat permissions based solely on your SO rep, not your network rep.
General SE rule of thumb: Mods are gods
4:41 AM
To make matters more confusion, the foreign language SO sites have chat on chat.SE, not chat.SO, which means us 10k users get to try to handle flags in languages that we usually don't speak.
So Riker > Mego in terms of power? Or am I completely screwing up everything
@HyperNeutrino That is basically correct
Hm. Interesting.
For example, a hidden PPCG room will be visible and writable to its ROs, but non-PPCG chat mods won't be able to see it.
Ah okay.
4:41 AM
@Dennis Oh hm how do you hide it
I could just hide the unused C chat
You don't. That's a mod privilege.
I already deleted your C room on SO though.
@Dennis Huh. Here I thought the room's parent site affected only categorization when searching rooms.
@Dennis Ohh okay
Thank you
@HyperNeutrino Basically. I can't kick Riker (or any other mod).
Question: Why can't I move PPCG chat messages to Sandbox?
4:43 AM
@Mego :o interesting, but then again you should hopefully never need to
@Mego Can Riker kick you?
Answer: Why do you want to? Isn't trash good enough?
@HyperNeutrino You have to be a RO to move them. I can move them if you need.
I am an RO of said room though.
@Phoenix I believe so. I'm not 100% sure that non-RO mods can kick - they might only be able to suspend.
4:43 AM
Wait kick > suspend?
It's weird
@Phoenix And for Public and Gallery rooms, that's pretty much true. Private rooms are a different matter though.
@HyperNeutrino Nope. Kicks prevent users from chatting or accessing the room from which they were kicked. Suspensions prevent users from chatting network-wide (though they can still be in the room).
@Mego Join the sandbox and find out. ;)
@Dennis I'll take that as a yes :P
4:45 AM
I honestly don't know.
Well let's do science!
@Mego Then why do you say "they can't kick, they can only suspend"? It sounds like suspensions are less significant than kicks.
@Mego That worked just fine. Unsurprisingly, as I just could make myself a RO.
lol that works too
What's the golfiest way to get x && y using only bitwise operators? (Zero if both are zero, nonzero otherwise.) Does (x&y)|(x^y) work?
4:46 AM
@HyperNeutrino Suspensions are much more significant than kicks. A suspension prevents you from chatting in any room. Kicks just prevent you from chatting in a single room.
Ah okay.
Also suspensions can be for any number of minutes from 1 through 9999. Kicks are 1, 5, and 30 minutes (escalating automatically based on the number of recent kicks).
@Mego have you actually tested those before saying that they are not equivalent?
@HyperNeutrino Not that simple. Multiple kicks in a short timespan have permanent consequences that suspension don't.
@Doorknob (x&1)&(y&1) also works if I understand your question correctly.
4:47 AM
Also 3 kicks in a short timespan automatically raises a moderator flag, and usually results in a moderator applying a suspension.
Oh hm. Interesting.
@HyperNeutrino That won't work if x = y = 2.
@Dennis If you're referring to the permanent consequences I think you are, don't suspensions do that also?
(2&1)&(2&1) = (0)&(0) = 0?
Afaik no.
@HyperNeutrino Yet 2 in non-zero.
4:49 AM
@Doorknob why does x|y not work?
Oh wait I'm dumb
@Downgoat 2 | 0 = 2
@Dennis Are you talking about something other than this?
@Dennis 2 | 0 = 2?
@Downgoat Yes, sorry. So the result is 2, but y = 0.
4:50 AM
@Doorknob you can't.
@Doorknob Yes, multiple kicks take away the ability to create rooms.
Oh I figured out why my message moving attempt was failing.
@Dennis Oh, I wasn't aware of that.
I was trying to move a "moved n messages to trash" message for science
@HyperNeutrino I've done that more times than I'd like to admit
4:52 AM
oh rip :P
Also Sandbox now looks like I'm a TNB RO from a quick glance :D
@Doorknob Why not just x&y? Am I missing something obvious?
Because 2 & 2 == 2 but 2 && 2 == 1.
I think
@Mego x and y could both have bits set, but no bits in common. Like 0xf0 and 0x0f.
4:53 AM
0/10 talking about bits and then proceeding to use hex
Are the values fixed-width?
Is popcount (or the equivalent in whatever lang) allowed? If so: popcount(a)&popcount(b)
Regardless, I think (x&y)|(x^y) (your original solution) is the shortest
4:57 AM
What's popcount?
@Phoenix nothing what's popcount with you Returns the number of set bits
aka the Hamming weight
@Mego Wouldn't that still fail for e.g. 0xf and 0x1?
So, log_2(x)?
@Phoenix No, popcount(0b11) == 2
4:58 AM
@Phoenix Not quite. It's the number of 1s, so popcount(5)==popcount(3).
@Doorknob No, because popcount(0xf) == popcount(0x1) == 1
@Mego false
popcount(0xf) = 4 = 0b100
4:59 AM
No... popcount is the number of 1s in the binary representation.
0xf == 0b1111
And there are 4 ones in the binary representation of 0xf = 0b1111.
Durr. Too much scotch.
So yeah, (x&y)|(x^y) is the best solution (and only solution so far)
I think the brackets around x&y are unnecessary since & has higher precedence over | normally.
5:01 AM
The question, then, is "why?"
@Phoenix why not?
@Phoenix Low-level circuits?
That actually makes more sense than I was expecting.
When all you have is a pile of NAND gates...
Well, anyway, the reason I ask (aside from curiosity) was to see if I can get away with not including && and || in my esolang without making it significantly more painful, to which the answer is a resounding yes.
5:02 AM
@Doorknob You can just use * and + instead if the lang has them
+ would fail if x = -y, but * would work also, yeah.
@Doorknob I was assuming unsigned
Usually the only advantage of && and || (and their analogs) is the short-circuiting behavior in most langs
Well, OR is really easy with bitwise operators: |
Well, I guess both + and * could overflow to 0...
@Dennis Yeah, no issues there.
5:05 AM
Btw, (x&y)|(x^y) is OR, not AND.
CMC that I may make into a proper challenge: given N, output the number of distinct pairs a, b of N-bit integers such that a * b overflows an N-bit integer
@Dennis oops
@Dennis Oh, wait, I'm an idiot.
CMC: Write a Wolfram|Alpha query that programatically determines which country has the highest density of goats, that is, goat population/area.
Of the 16 logic gates, how many of them enable you to construct all 15 others using only that one gate?
5:08 AM
@HyperNeutrino NAND and NOR, I think.
OR, AND, NOT, XOR, XNOR, NOR, NAND, I can't think of any others.
Also both versions of ANDNOTs
Can you make anything with NOT?
5:09 AM
Then what's your list?
Seeing as how there's no way to convert two inputs to one output with just NOTs
@Phoenix Well, there's four possible inputs to a binary logical operator (TT TF FT FF), and each gate specifies either T or F for each pair, so that's 2⁴ = 16 total.
@HyperNeutrino Functional completeness is that property. Only NAND and NOR are sufficient by themselves.
Ooh interesting. Thanks!
@Doorknob It bothers me that TF and FT aren't the same.
Even though I know it makes sense.
5:10 AM
T->F is false but F->T is true
@Mego Actually, 13 bytes: ╙;r;∙♂S╔♂π♀<Σ
and with that onebox, I leave
IIRC, the 16 gates are contradiction, nor, not(l)and(r), not(l), not(r)and(l), not(r), xor, nand, and, iff, (r), not(l)or(r), (l), not(r)or(l), tautology
also contradiction implies everything and everything implies tautology
5:15 AM
Oh yeah i remember that
And then there's my answer which is just a complete mess but kinda makes sense? almost
Userscript-request: Set regular font in SE Chat + Main to the Ubuntu one.
@Riker D: why did you change name from Downcat
When was it ever Downcat
5:25 AM
@Phoenix sure, right after I set my system font to comic sans
Ubuntu font is good
yes and so are sheep
Have you seen it
It's excellent
It's pretty nice. I don't really miss anything else, but I took the Ubuntu font with me when I changed distros.
So did I. (Back when my Fedora install was functional)
5:29 AM
@Phoenix You can alter fonts wherever you want with the right extension. For Chrome, there's Stylish. I'm using it mainly to style the ugly Telegram web app.
* {
	font-family: Ubuntu !important;

code {
	font-family: DejaVu Sans Mono !important;
Chat is weird.
Cool, thanks!
It would be pretty easy to convert that into a Tampermonkey/Greasemonkey userscript
@Phoenix yes it's #2 reason I don't use ubuntu
A shitty reason indeed. (sorry)
@Dennis I'm tempted to start a pun train but I'm afraid the jokes will rapidly deteriorate past an acceptable level
5:34 AM
@Dennis opls you have goat to be kidding me
@Mego ;)
@Downgoat No, seriously. There are so many good reasons not to use Ubuntu, and you chose something that can be tweaked to your taste with a few mouse clicks.
Restarts computer because DE fails for no reason at all -> Opens chrome -> Offers to restore browsing session -> opens new tab page
And I apparantly have 1.1 GB of disk space left.
@Dennis Best reason not to use Ubuntu (or Debian) is the slow updating of the default repos
@Phoenix Which DE are you using?
@Dennis okay well the font is meh, but the kerning, leading, etc. is really badly done
Though to be fair design is not something that open source projects are exactly known for >_<
5:38 AM
@Dennis Unity. Everything went black, the only thing that worked was ctrl+alt+del and start key, no windows visible
@Phoenix There's your reason.
"Unity crashed my computer!" "Working as intended."
compiz is just an unstable piece of garbage.
My reason is the same as the one Mego gave, but I'm still on it because I got my steam wine working just how it want it and I don't want to go through the mess of configuring it again.
As in the windows version of steam working with wine
Couldn't you just save the config files and drop them in on a new installation?
5:40 AM
@Mego I canned Ubuntu after hardware-accelerated video stopped working for three consecutive dist upgrades.
I mean, that's half the reason config files exist
@Dennis I canned Ubuntu after it stopped running on my 7-year-old server. Fedora runs great.
@Mego There's a bunch of them, and they also link to various fonts and icons that didn't come with Ubuntu.
@Phoenix Fonts and icons should also be transferrable
Getting fluid 1080p with mplayer required release-specific black magic. With openSUSE, it simply works out of the box.
5:42 AM
Sure, but it's a PITA
And Intel's video drivers are open-source, so there really is no excuse for this.
@Phoenix So is using Ubuntu as a dev environment. You can put up with a PITA now, or deal with a larger cumulative PITA later.
Doesn't matter anymore, everything broke recently and the one game now fails to start entirely.
I'll probably do it some time soon.
You know, if someone was installing Linux for the first time, I'd probably tell them to install Kubuntu.
Q: Counting N-bit integer multiplication overflows

MegoGiven a positive integer N, output the number of pairs of integers 0 <= a <= b < 2**N such that a*b >= 2**N. Rules You may assume that N is less than or equal to the maximum bit width for integers in your language (e.g. for C, N will not exceed 32 or 64, depending on the architecture of the ma...


« first day (2322 days earlier)      last day (1511 days later) »