« first day (2613 days earlier)      last day (2213 days later) » 
00:00 - 20:0020:00 - 00:00

12:49 AM
hmm what would be the best way in perl to golf (1,5,10,50,100,500,1000)
 
1:38 AM
I love how the top 2 [git] SO questions are "how do I burn this thing to the ground" and "how do I fix git's messes"
 
@ASCII-only relevant oeis
 
 
1 hour later…
2:58 AM
@Pavel :| not golfy
 
3:18 AM
the best i can do is equally ungolfy
 
3:30 AM
side note: i'm probably doing this the worst way possible but i'm too bad at perl to figure out another way
 
4:04 AM
0
Q: unRSA: solve the private key

l4m2Given positive integer n and e, knowing that e<n and that n is the product of two different primes, find such a positive integer d smaller than n that, for each integer m, (me)d ≡ m (mod n). Your program should handle n up to 24096 in reasonable space, but not necessary reasonable time. You can...

 
4:21 AM
0
Q: Ten-pin bowling score - World Bowling edition

MakotosanWorld Bowling scoring Many people have gone to their local bowling center to play a few games of bowling, and many people continue to struggle to calculate their scores. World Bowling has introduced a simplified scoring system in order to attract more people to the sport. This scoring system is...

 
 
3 hours later…
7:37 AM
Hi. I want to make a challenge for code which opens a new window which you can move around using keys
is that too hard?
I mean using the keyboard
 
 
1 hour later…
9:07 AM
0
A: Sandbox for Proposed Challenges

Manfred Radlwimmer Note: I published this question on another site a while ago and could use some guidance on how to make it suitable for SE. I've seen very similar challenges here that have slightly different input/output conditions, I hope that's okay. Things I could use feedback on: I have a ...

 
9:53 AM
@Lembik No, I don't see why it would be to hard. There have been some challenges involving windows, e.g. this and this. A tag like might actually be useful for those.
 
 
3 hours later…
12:46 PM
0
A: Sandbox for Proposed Challenges

LembikMove a window around the screen Your code should open a new window that is at least 100 by 100 pixels in size. Once the window is open you should be able to move the window around the screen using the keyboard. The window should move smoothly but it doesn't matter how fast it moves. gui code...

 
sees Mego's chat bio
:|
 
1:06 PM
0
Q: Two steps forward and one step back

AJFaradayLet's say I'm ten steps away from my destination. I walk there following the old saying, "Two steps forward and one step back". I take two steps forward, one back, until I'm standing exactly on my destination. (This might involve stepping past my destination, and returning to it). How many steps ...

 
@ASCII-only noot noot
 
2:04 PM
I was looking through IOCCC entries for 2015, and then i saw this.
http://www.ioccc.org/2015/muth/hint.html
It looks like C preprocessor abuse can be 10x worse
 
@moonheart08 Damn those computer scientists!
 
But yea, who knew #define was turing.
 
2:21 PM
> was turing
 
err
is
lol
i can no use english correct
 
I think you mean "Turing-complete"
 
This is PPCG so we say "TC"
 
Yes, there is a language called "Preproc" on TIO.
 
I have no idea if it's TC
 
2:29 PM
I wrote a reverse-a-list with it.
 
That's hardly proof of TC-ness
 
Well if C's preprocessing is TC and Preproc uses C's preprocessing...
 
@Pavel Of course it isn't...
 
@J.Sallé Who knows, maybe Preproc only uses a subset of the preprocessor functionality :P
 
@J.Sallé Is it TC?
 
@Pavel according to moonheart's link above, yes. (ioccc.org/2015/muth/hint.html)
@ASCII-only that's true
 
Looks like it actually uses full C preprocessor.
 
It literally creates a cpp process
It's a really thin wrapper
Actually I was wondering if you can use it to output any arbitrary text
So you can quine in it
 
Arbitrary text... no. The text must be present in the program. About quine... probably yes.
 
@user202729 I meant that there are certain things that are rather difficult with the preproccesor. For example, starting a line with a #.
Not sure if it's possible.
Although for quining purposes, you could just start every directive with a space before it.
 
2:36 PM
... ok, prepend a space.
Yes, doesn't look possible.
 
@user202729 In case you're intrested, here's the closest we've gotten to a quine (by ATaco): tio.run/##KyhKLSjKT/7/…
 
2:51 PM
Hm. Vue is pretty awesome.
 
What's awesome about it?
 
3:17 PM
cppreference.com is my savior.
Seriously, i forget how something works, and it's the only ad free site that has help >_>
 
@moonheart08 I find that MSDN is super nice (if you aren't looking for something UNIX-specific)
 
I work on UNIX(like) machines (Linux is my main OS) so it helps to not have to see their fluffy windows only replacement recommendations for various std functions :p
 
Are there really a lot of those?
 
There are enough it can get annoying to see the top half of the doc just be a pointer to a windows only replacement
 
I can't say I've run into anything like that, but I don't use C++ all that much either.
 
3:23 PM
Plus, i'm generally looking for syntax info
 
Hmm where's the best place to ask math questions
 
@ASCII-only math.SE or mathoverflow or LeakyNun.
10
 
> LeakyNun
+1
 
Or Dennis
Or Wheat Wizard
 
@Pavel until C++11 creating a thread required conditional compilation
 
3:28 PM
wat
 
Exactly what quartata said. C++11 (and higher) is the best
 
pthread == POSIX threads
 
C++17 especially.
 
Windows has CreateThread instead
C++17 got std::filesystem too if I'm not mistaken
 
Yup
std::filesystem was added in C++17
 
3:30 PM
Good thing we don't have to use anything from earlier than C++ 11
 
0
A: Sandbox for Proposed Challenges

BMOMake me some curry Tags: code-golf, function, functional-programming Related: Arbitrary-length currying Having a function f that takes arguments x1, x2, …, xn                                                        – ie.  f : X1 × X2 × … × Xn → Y – currying redefines f as a function taking ...

 
Because like everything supports 17
 
@Pavel Microsoft's C++ compiler only has partial support
everything else (GCC and Clang) has full support
 
I would also point out that there will never be a cross platform way of forking
Windows is trash
 
agreed
 
3:32 PM
I guess conversely.... uh..... hm.... Windows has APC? oh wait you can do signals
 
And yet, I can't get rid of it, for it plays my games.
 
@Pavel Wine's support for various games is amazing these days
what games do you play?
 
Rainbow Six: Siege
Which doesn't start in Wine
 
RIP
No support yet
 
Also, Windows doesn't have SIGPIPE, and I don't know what the equivalent mechanic is.
 
3:34 PM
@Pavel a very cruddy virtual filesystem for pipes
that's it's "equivalent mechanic"
 
You can get an EPIPE
 
> in practice, everything's O(1) anyway.
 
you just don't get a signal, instead the syscall fails
 
What about infinite loops, for say a game loop
or a event loop
 
that's O(1)
 
3:38 PM
huh
Really depends on the timescale of O doesnt it? :P
 
in that the upper bound on it is about 10^100 years
 
Everything dies eventually
 
@Pavel even my imaginary indestructable unkillable object?
 
Yep. Imaginary things die once you stop thinking about them :P
 
I wonder. is this chat room imaginary? I should stop thinking about it, it's distracting.
2
I obviously enjoy my own messages, because i just tried to star it without looking at the name. >_>
 
3:44 PM
Clearly the entirety of PPCG is just a figment of your imagination designed to make you abandon your (school)work every day for the rest of your life
 
Obviously, because i'm getting behind in schoolwork due to this chat room. i really should stop talking now
At least they don't block stackexchange entirely.
 
related: it's ~2AM here and I'm still working on my math assignment (well I only have one question I'm not sure of the working on, but still)
 
RIP. Get some sleep, it'll save you so many troubles. Source: am currently sleep deprived
 
Sleep is for WEAKLINGS, drink coffee instead.
 
well for me 2AM is early if anything (not that I'm normally allowed to sleep this late)
protip: don't drink coffee, you'll get addicted
stay awake via TNB, it's far better than any drug out there
5
 
3:49 PM
I only drink coffee as a last resort (like this morning) anyways
 
:| last resort is clearly not a good enough excuse
 
@ASCII-only I'd say factorio is better at that, unless you count factorio as a drug too
 
There's no such thing as tired; only blood-caffeine deficiency.
11
 
@ASCII-only pffff no one ever gets addicted to coffee, that's just a myth health organizations spread around
(I'm joking, caffeine is delicious addicting af)
 
(Yeah, I should add that I use caffeine very rarely, maybe once in a few months. It is addictive, and the effect diminishes quickly. However, for that rare event when sleep isn't an option, it is useful. Definitely a drug, though.)
 
3:58 PM
We all know (or rather, anyone in ppcg-gaming knows) that Factorio is the best drug
On that note, i need to go update the server again
 
Even thought caffeine is addictive, is there any reason to not be addicted to caffeine
It doesn't cause harm
 
@Pavel I myself enjoy a hearty dose of coffee every now and then. Good coffee is really pleasing to drink.
Also I'm fortunate(?) to live in a place where good coffee is easy to come by
 
@Pavel kinda. you might suffer from caffeine withdrawal on like a holiday or something
 
Where I live the average street block contains multiple Starbucks. IDK if you consider that good coffee
@ASCII-only just keep drinking coffee while on holiday ez
 
@Pavel well i mean it would be bad in exceptional circumstances
 
4:05 PM
@Pavel Once thoroughly addicted it doesn't do good. Why bother?
@ASCII-only That.
 
e.g. you're somehow caught in a traffic jam for 10 hours straight
 
@Pavel american coffee is basically water, so not good :p
 
My way of coffee is basically caffeinated milk with sugar in it anyway.
 
My mother only drinks coffee with milk. I don't really care for it that much
 
I don't dislike just coffee, but I think milk and sugar improve it.
Actually on the rare occasion I make coffee at home I put honey in it instead of sugar.
 
4:11 PM
I've a friend who does that, but I'm not much of a honey fan either. I usually drink coffee with a bit of sugar, unless it's an espresso. Then, no sugar required.
 
I am disgusted by coffee and everything coffee-flavoured. Caffeine pills ftw.
 
:| how do you do proofs with gcd
 
If you go to Starbucks it's very easy to get something caffeinated that tastes nothing like coffee. Probably not good for you though.
 
I don't care about caffeine.
But I really like coffee
 
@DJMcMayhem Decaf?
 
4:15 PM
Not usually
 
@Pavel this is how you OD on caffeine.
 
I'm pretty sure no one has ever OD'd on caffeine by drinking coffee
 
@ThomasWard You can't OD on caffeinated drinks, that'd require the equivalent of 80 cups of black coffee on a regular basis (not just once). However popping 40 caffeine pills is doable…
 
You'd probably die of water intoxication first
 
ODing on caffeine sounds horrible. Your heart pounding, hands shaking, sweating a ton... Ugh
Then again, I'm sure ODing on anything else is terrible too
 
4:21 PM
The only people to have died of caffeine od were injecting pure caffeine through syringes.
 
@DJMcMayhem At least one would be awake while dying.
 
@Adám *awake
 
@Adám IMHO decaf doesn't taste like coffee at all
 
CMP: Iced coffee y/n?
 
yes because sugar
 
4:23 PM
@Pavel Iced regular coffee? Nah. Iced sweet coffee drinks? mmmmhhhhmmmm
 
@Pavel This page disagrees. (about one quarter way down)
 
Note to self: don't drink 25 red bulls in one day
 
@Pavel or 7 double espressos. which is a lot more realistic.
 
random math question: how can you show y + x z and z are coprime given y and z are coprime
 
4:27 PM
y + x z?
 
what is x?
 
yes
@Cowsquack it could be any integer
 
what is y + x z? y + x*z?
 
yeah, bad LaTeX copypasta
 
z is coprime because z is coprime.
 
4:34 PM
you can't factor out any of z's prime factors from $y+x*z$
because $y$ doesn't not share any prime factors from $z$
does that work?
 
@ASCII-only If they were not coprime, there would be an Integer n which divides both y + xz and z. Since, if n divides z, it divides xz, it would also divide y. A contridiction
 
:| i already have n. should I rename the existing one to m?
 
@Pavel good god no it's hideous
 
@ASCII-only No rename this one to d (or m)
 
I love making my C++ code concise.

float distance_nsqrt(const Point &a, const Point &b) {
auto tmp = pow(a - b, 2);
return tmp.x + tmp.y;
}
 
4:43 PM
@moonheart08 no idea what any of that means, but nice? >.>
 
Wait. This was the wrong window
lol
well, too late now. Cant delete it.
 
CMC: What answer that isn't on PPCG are you most proud of?
 
@ASCII-only let d divide y+xz and z, i.e. dm=y+xz and dn=z. Then, d(m-xn) = y and dn = z, so d is a common divisor of y and z, so d=1
 
@DJMcMayhem either this one or this one, not sure. (I'm assuming you're talking about SE questions)
 
Yes, answers to SE questions
 
4:51 PM
@DJMcMayhem this one :D I learnt a lot about vimscript in that answer
 
:D
I remember that one, I forgot that it was you who answered it though
 
now that I look at it, it's really hacky
 
Is this ok or is my working completely terrible:
 
what is the inverted epsilon?
 
@Cowsquack I remember when you first posted that, it worked fine, but now I'm getting this error:
Error detected while processing function MouseScroll:
line    5:
E20: Mark not set
 
4:54 PM
@Cowsquack I'm using it basically as shorthand for "such that" (it's just in but goes the other way)
 
(No pressure if you don't feel like fixing it atm)
 
@ASCII-only not that, the other one (mirrored )
 
My proudest answer would have to be this one
 
ngn
@Cowsquack it's exactly that, a mirrored "is in" :)
 
@ASCII-only Be careful, my working was pretty bad. You really want to end with m|y => m=1
 
4:56 PM
@DJMcMayhem I take it you are using the same mapping? imap <LeftDrag> <ESC>ma<LeftMouse>:call MouseScroll()<cr>:norm gi<cr>
 
@H.PWiz wait wat
 
I was using the map from normal mode
 
@ASCII-only See Leaky Nun's proof
 
ngn
@ASCII-only do you really need to allow negative numbers? if not, you should use N instead of Z
 
@ngn The question says Z, it's probably supposed to be N but idk if I should
 
4:59 PM
@ASCII-only You have m|z => m⍭y, but if m=1 this implication doesn't hold
 
then I will have to look into it sometime later
 
Oh yeah >_>
 
I wonder if C++20's spaceship (<=>) operator will be useful for golfing in any way
 
What does it do?
 
Three way comparison
It's described a bit farther down the page on en.cppreference.com/w/cpp/language/operator_comparison
 
5:03 PM
@moonheart08 Not three way, just comparison yielding smaller/equal/bigger.
 
0
Q: Integer in set theory

l4m2In set theory, we define integers as 0 = {} 1 = {0} = {{}} 2 = {0,1} = {{},{{}}} 3 = {0,1,2} = {{},{{}},{{},{{}}}} 4 = {0,1,2,3} = {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}} ... Given a non-negative integer, output its set theory expression. Order in sets doesn't matter. E.g. outputting 4 as {...

 
0
A: Sandbox for Proposed Challenges

apsillersTidy up my bit string I have a series of binary switches, which I can represent as a bit string. The last person that used my switches left them in some arbitrary messy state, and it bugs me. I always keep the switches in one of four possible "tidy" configurations: All 1: 111111111 All 0: 0000...

 
@moonheart08 I wonder if the result of a<=>b is defined for cases when a≠b.
 
Really the <=> operator actually is useful for devs that otherwise don't need it, too, due to something it brings along with it: all the other operators can be implicitly implemented by the compiler if you define <=>
 
Defining == should be able to implicitely define != but iirc that doesn't happen
 
5:06 PM
agreed
 
@Pavel because of things like NaN maybe
 
^ maybe
 
The point being, defining <=> probably won't define any other operators.
 
@Pavel It does in a lot of languages
 
No, it will. It's part of the standard :)
 
5:07 PM
Ah
 
IIRC Python used to do that too when cmp was still a thing
 
@moonheart08 Does defining < and == define <=?
 
I don
't think so
it's a <=> operator thing apparently
yea
default comparisons are C++20
only <=> does it
but C++20 is looking promising already, with things like a potential fix for how convoulted #include can be. (a compiletime module system)
 
Near as I can tell, C++ 20 modules are basically C#/Java imports.
 
@moonheart08 Wouldn't - always be shorter than <=>?
 
5:15 PM
Well, even that is better than the include system lol
@Adám Hmm, good point.
 
@moonheart08 C# imports are good. I don't know how I'd improve on them really.
 
@Pavel never used C#
i have used java tho, and java is just awful.
 
@moonheart08 Howabout java?
Yeah but the import system isn't bad.
Although you have to tag on an extra .* at the end that's implicit in C#
 
Yea, java imports are actually fairly nice
 
@moonheart08 don't you dare! Java has type inference!
 
5:17 PM
lol
@J.Sallé so does C and C++
auto
 
that_was_the_joke.jpeg
 
Doing imports by package/namespace rather than by file is a really neat idea.
 
well_moony_doesnt_understand_jokes.jpeg
 
rofl fair enough
 
is _Generic in C type inference
 
5:18 PM
I think the joke is specifically referencing that there wasn't type inference in Java until this week
 
lol
 
They copied C#'s var.
 
java 10 is going to give the Minecraft Forge devs such a hard time
i feel bad for them
 
@moonheart08 Why's that?
They'll probably just keep on using Java 8
 
True, but what happens if MC 1.13 is released using java 10?
 
5:20 PM
It probably won't be, and so what if it is?
 
Well, for one, i bet there's probably been some changes to the JVM bytecode format
and that's just one possible issue
 
It's still backwards compatible. Java 10 can load libraries compiled under way earlier Java versions.
And anyway, C# 10 doesn't really have breaking changes.
Except var became an illegal type name
 
@Pavel They should have copied Kotlin's val/var
 
@mınxomaτ That was the original proposal but it got rejected.
 
shame the C++ std doesn't have a function to compute a value to a arbitrary root (i.e. like to the fourth or fifth root)
 
5:24 PM
Apparantly Java doesn't like immutable state.
@moonheart08 Can you #define root(b, x) pow(x, 1/b)
 
Java is probably going to get val, but like this: final protected sealed missile-defended var
14
 
@mınxomaτ Well considering it's only for local variables, the most you can stick on it is final.
C# has readonly var
 
It has readonly T
 
@Pavel yes
 
@Pavel why do you say this
 
5:33 PM
C#'s var == C++'s auto?
 
Not quite
You can't use it as a function return type
But other than that yeah
 
@Pavel the same as Java if I interpreted the release notes correctly?
 
Yes
 
Can you declare a function that returns a String and return that var instead? as in String foo() {var s="bar"; return s;}?
 
Yes
 
5:38 PM
jdk 10 has val i'm pretty sure. it seems like you guys are talking about it "eventually getting" it
jdk 10 is released
 
It does not have val
 
Well that'll probably be useful somewhat.
 
@Poke JDK 10 is TIO: tio.run/##y0osS9TNSsn@/…
 
@Poke if I understand correctly val ≠ var
 
JDK 10 var/val discussion: news.ycombinator.com/item?id=16636646
 
5:40 PM
sorry that's a typo
meant var
 
@mınxomaτ Reasoning for not including val: mail.openjdk.java.net/pipermail/platform-jep-discuss/…
@Poke Oh yeah, we all know that. That's not the point though.
 
did someone ping me?
 
@Pavel maybe i misread what someone typed. my bad
 
> The written comments had more of a negative bias, but this shouldn't be
surprising; people generally have more to say in disagreement than in
agreement.
ain't that the truth
 
@mınxomaτ I mean, why write something positive when you can just leave your upvote? Downvotes are the ones that usually come with a justification.
 
5:46 PM
Heh, tell that to StackOverflow.
 
↑↑ that was supposed to sound sarcastic btw.
 
5:56 PM
-1
Q: Colliding balls

l4m2Two balls on an axis collide with no energy loss. Given the mass and velocity of two balls before they collide, what are their velocities after the collision? Hint: Before and after the collision, m1v1+m2v2 and m1v12+m2v22 both remain unchanged. Samples m1 m2 v1in v2in v1out v2out 1.0 ...

 
6:10 PM
@DLosc It looks like Brain-flak is going to end up being the language of the month for April. Can I help write part of that post? Assuming you use the same format as you did for Brachylog, I mean specifically the Information about Brain-Flak part?
@Pavel You helped with Brain-flak challenges last year. Do you have any more?
in The Third Stack, 1 min ago, by DJMcMayhem
@user56656 @Riley @Pavel Since you three helped out last year, we could use your help again this year. So dust off your brain-flak-themed-challenge-writing-hats, and try to see if you can come up with any more brain-flak themed challenges for the second birthday!
(The first ping didn't work because you haven't been in TTS in a while)
 
Would be cool to learn some brain-flak
Although I don't know if I have the required amount of masochistic tendencies.
 
@J.Sallé I'm always happy to help if you have questions.
And there are a bunch of people in TTS too
 
@DJMcMayhem at least you didn't abuse superpings...
 
That's why I pinged him in here
 
@DJMcMayhem I don't even know where to begin though. I've never even messed with brainfuck.
 
6:23 PM
They're actually pretty different. Brain-fuck is tape-based and flak is stack based
The only similarity is in the name and the turing tarpitness (both have 8 commands)
 
Still, no idea where to begin.
 
@J.Sallé If you're interested, start with the README. Then try some simple programs: 1) Add two numbers 2) Subtract two numbers 3) Shortest code to push 60 4) Reverse the input 5) given at least 2 inputs, output the first input minus the last input. Those 5 are all good starting points. And ask question in TTS
Then, if you want a bigger challenge, try to write a snippet to multiply two numbers without looking at existing snippets
Oh, also 6) Given N, print the n'th triangular number. That's a good beginners task. Plus it has a really cool more advanced technique to do it in 16 chars.
 
@DJMcMayhem sounds good, will do.
 
6:41 PM
at the demands of <<The Haters>>) i have changed my chat bio. don't expect me to do this ever again. thank.
(@ASCII-only)
 
@quartata What's Chaitin's constant?
 
In the computer science subfield of algorithmic information theory, a Chaitin constant (Chaitin omega number) or halting probability is a real number that, informally speaking, represents the probability that a randomly constructed program will halt. These numbers are formed from a construction due to Gregory Chaitin. Although there are infinitely many halting probabilities, it is common to use the letter Ω to refer to them as if there were only one. Because Ω depends on the program encoding used, it is sometimes called Chaitin's construction instead of Chaitin's constant when not referring to...
forgot to mention not to @ me on this
 
@DJMcMayhem Honestly superping would have been more convenient
 
Oh sorry. I'll remember that next time lol
 
7:03 PM
Hi
 
10/10 will try
 
@Riker sounds great:) just don't know whether oreos actually have any value
(and I don't know anything about D&D)
does this mean that I'm not a true nerd?
 
ive played D&D once
am i nerd
 
@betseg You're on TNB, the answer must be yes :P
 
7:19 PM
if (user.is_on_tnb == true) {
user.is_nerd = true;
}
 
@moonheart08 was this written by a non-tnb user? it seems golfable :P
 
user.is_nerd=user.is_on_tnb;
 
aww you beat me lol
but
that wont work
what if they're a nerd and not on TNB
if(user.is_on_tnb){user.is_nerd=1;}
 
bool User::isNerd(User user) {
    if(user.groups.includes(Group.TNB))
        return true;
    else { /...
 
public static void main...
 
7:23 PM
@flawr no it means you should find a d&d group tho
 
@moonheart08 TNB membership is a sufficient but not necessary condition
 
public class UserFactory...
 
@Giuseppe dont tell me that, i had it right. tell that to DJ
public class UserFactoryFactory
// used by factories that produce internet routers.
public class UserFactoryFactoryFactory
And finally
public class FactoryFactory
 
public class FactoryOutsourcingSubcontractor
 
How do i format a tag into a post?
nvm
figured it out.
 
7:58 PM
CMC: Find a sufficient and necessary condition for being a nerd
 
being in TNB obviously
 
Sufficient but not necessary
 
not sufficient either
ex: any bot somebody puts in here
the bot is 'in TNB' but not sentient/sapient (either) so it can't be a nerd
 
oh, i didn't read the 'sufficient' part
lol
being sentient
 
Necessary but not sufficient
 
7:59 PM
hum
 
00:00 - 20:0020:00 - 00:00

« first day (2613 days earlier)      last day (2213 days later) »