« first day (2297 days earlier)      last day (1615 days later) » 

12:10 AM
Q: Why is reading lines from stdin much slower in C++ than Python?

JJCI wanted to compare reading lines of string input from stdin using Python and C++ and was shocked to see my C++ code run an order of magnitude slower than the equivalent Python code. Since my C++ is rusty and I'm not yet an expert Pythonista, please tell me if I'm doing something wrong or if I'm...

nice even number on the votes
@Phoenix cc @SimplyBeautifulArt
golfing edits aren't allowed
@Riker Aw, my bad
it's ok
no harm done, and now you know :p
@Riker shit brb fixing cheddar
just me or does cheddar need to be fixed a lot :p
@Riker Bleh, I just want to give everyone bigger numbers xD
@Riker I like cheddar
And cheese
12:12 AM
@SimplyBeautifulArt cheddar.vihan.org
Well of course that's a thing.
@Riker I mean it doesn't really because no one use cheddar ;_; but better wording is "cheddar should be fixed a lot"
@SimplyBeautifulArt yes, it's @Downgoat's WIP language
well it's kinda finished
lol, nice @Downgoat
12:14 AM
I'm moving onto VSL since cheddar turned out an absolute POS
Question: is it bad idea to leave magnet on comptuer
@Downgoat Depends how you want the computer
 Cheddar v1.0.1 (interactive)
 run `help` to get started

cheddar> help

 Welcome to Cheddar!

 If you are using Cheddar for the first time, we reccomend following
 the getting started guide at: cheddar.vihan.org/quickstart

 The following commands are available:
    help  - outputs this
    clear - clears the screen

cheddar> 1+1
 Chedz is not defined
^ @Downgoat
12:18 AM
@Downgoat Then why don't you link to that on the main site?
good question
@Downgoat The parts that would be affected by the magnet (mainly the hard drive(s)) should be protected well enough that the magnet wouldn't affect it. Still, it's not a good idea.
does this link scroll weird for anyone else?
@Riker Looks fine to me
try scrolling right
12:22 AM
I'm on desktop
does it have roughly a page width of blank space?
*2 pages
@LegionMammal978 does that still for me
on my laptop
... no?
@LegionMammal978 No repro on that
I thought you meant half the horizontal width was empty?
12:24 AM
o_O it's not?
oh, no not that
1 sec
@Riker 404
whoops, fixed
@Mego yes, that
12:26 AM
If I'm storing a key-value dict in a file that I need to look things up in, what's the best way to do that?
@LegionMammal978 Middle-click and scroll right
@Phoenix Database?
JSON is all the rage
I'm not storing anything too huge, and it should be editable by hand easily.
Oh wait, CSV is a thing.
@Mego Just goes vertically
12:30 AM
user image
@Riker Maia* (not Man)
not clickbaity enough
ok how'd this get 2 stars here but 0 in the scifi and fantasy chat
@HelkaHomba also, I recently read watership down (since your name is supposed to be from it): the book is so dark
I thought it was a cheerful book, judging from the bunnies on the cover
Heh, well it ends
@HelkaHomba spoilers!
12:37 AM
he's just saying the book has an ending
it's not that big of a spoiler /s
but seriously it's not :p
oops, that's sorta a spoiler
@Riker actually it was a spoiler until he edited it
@HelkaHomba you should probably delete that
BRB reading watership down
I just won't say any more (and that wasn't much of a spoiler)
Watership Down... I'm guessing there's a watership, and it doesn't go up.
12:46 AM
What's the max upload image size?
Only one way to find out starts uploading 1GB image
@numbermaniac Formatting only works on one-line messages
Of course stackexchange would do that
@Mego guess again
@LegionMammal978 2MB :P
12:48 AM
1:19 AM
I'm guessing the title is an attempt to throw us off and it's actually a spaceship.
1:34 AM
@feersum note that most of the characters are bunnies
@HelkaHomba Are you implying that bunnies are undeserving or incapable of space travel?
Wow, that book was awful, probably one of the worst books I've read
One of our english teachers called it "wacky wabbits in the woods" (this was an honors brit lit class in 11th grade)
I mean most people assume ships are in the water by default. So explicitly saying "water ship" seems like a suspicious attempt to trick us.
1:40 AM
It's the name of a hill.
It's where there final goal is (I don't want to say too much more based on where you are in the book)
A spaceship disguised as a hill.
My location in the book can't be expressed as a real number.
@feersum probably the best comment I have seen in tnb
Which one?
"A spaceship disguised as a hill"
codegolf.meta.stackexchange says: this question [the Sandbox] has more than 30 answers already. Did you read through all the existing answers first to make sure your answer will be contributing something new?
all 4179 of them?
1:53 AM
Yes, and since this is the Sandbox, you should also read through the 7626 questions on main as well.
there are occasions in the past in which I've read through every question in a tag
in order to ensure that the question has no correctly tagged duplicates
@JanDvorak Pyth kind of has that with =>TZ meaning T = T>Z
in Jelly, that means Z((input = input) > T(input)), in monadic context
hmm, I wonder if it's ever useful to use = to create an array of 1s the same length as the input
totally cool programming language: alpha.trycarbide.com
2:15 AM
Need some help : People are commenting here asking me to accept both the Truthy/Falsey values for ""(empty string). What should I do?
(PS: It's been 9 hours since posting the challenge, and 28 answers are already there!)
you should probably have allowed either answer, or even a crash, in that case
the logically correct thing to do in that circumstance is to crash
@Arjun hm. either both, or true imo
however, if many existing answers have already special-cased an empty string, then you should probably just leave it
Plus, people are complaining about the consistency of the Truthy/Falsey values. They are saying that multiple values for Truthy/Falsey should be allowed.
@Arjun oh god, not this again
Q: Keep your golfing in your code, not in inputs and outputs

FatalizeI am becoming more and more annoyed at the ever-increasing number of rules about what is deemed acceptable as inputs and outputs to programs Here is a compilation of such rules that I found: Interpretation of Truthy/Falsy Empty string as a truthy value Can numeric input/output be in unary? Sho...

please refer anyone who complains about that there ^
2:24 AM
Hey I have more rep than Mego on SO :D
@Downgoat thanks!
Question : Does Turing equivalent mean Turing complete?
@HyperNeutrino Congratulations!
Thanks :)
lol :P
CMC : Given input, output input.
2:30 AM
@Arjun pretty much yes in practice; there might or might not be a semantic difference in the case of "uncomputable"/"superTuring" languages
@Arjun Jelly, 0 bytes:
@Arjun Bash, 3 bytes: cat
A: Sandbox for Proposed Challenges

Stephen SInfinitely Print 1/(2^n) code-golf kolmogorov-complexity An infinite number of mathematicians walk into a bar. The first one orders a beer. The second one orders half a beer. The third one orders a fourth of a beer. The bartender stops them, pours two beers and says, "You're all a bunch of i...

@Arjun _=>_ 4 bytes, JavaScript
actually there are a ton of languages where cat is zero bytes long
2:31 AM
it's probably the second-most common interpretation of the empty program (after a no-op)
Every language with implicit input and output, 0 bytes:
@Arjun cat is the "copy input to output" operation
@Arjun cat = concatenate ~= output the input
ninja'd :(
2:32 AM
it's named after a UNIX command (which can actually do a few other things, but concatentating a list of one thing is a fairly vacuous operation)
poll: do you like ice cream with chunks in it
i.e. chocolate chips, cookie dough chunks, etc.
there are some languages where cat is much harder
e.g. Malbolge
@Riker Yup
@Riker Yes
2:33 AM
if you do
haha "cool"
@Riker that's an interesting question: yes in theory, but I'm not sure I like any of the foods that are commonly used as chunks in ice cream
do you ever try to get all the little chunks out?
Er, no.
from the surface of the ice cream
2:33 AM
without getting the ice cream itself
I eat the chunks first
Then swallow the ice cream
2:34 AM
i'm feeling quite fulfilled, as I was able to spoon out all the little chunks of cookie dough from my ice cream
and then I ate them separately :D
Congrats! :D
@Arjun Were you Dobby at one point?
Yes, Master
2:35 AM
huh, cool
@Arjun "Dobby is a free elf Arjun!"
Ah I see. :P
You were also HyperNeutrino at one point >___>
2:36 AM
Hey my rep divided by 100 is the answer to life.
Thus my rep is the answer to having 100 lives
@HyperNeutrino logic
@HyperNeutrino Not anymore!
Yay :D
Ooo thanks :D now my question has a score of 50 :D
2:38 AM
Got any badge?
Nope, there's no badge for that.
For 50
Am I the only one who plays Clash of Clans in this chatroom?
2:40 AM
And TH?
Eh that was my brother I think he just went offline for a bit, I'll ping him
@TauNeutrino See Arjun's questions.
Also there's a badge for question score 10, 25, and 100.
And 1k, 2.5k, and 10k views.
2:42 AM
I haven't gotten gold on either of those categories.
Portugal won Eurovision
@TauNeutrino are you a sock of somebody
I must say, I disapprove.
i.e. an alt account
No, that is my brother.
2:44 AM
Really? Don't think so.
Your brother or You?
That is my brother.
I am a sock
I will unupvote that one answer of yours if necessary to get you out of here. It was a nice answer but I can do that. jk lol that's not acceptable behavior
2:45 AM
> I'm convinced that mattress/furniture stores exist in a quantum superposition of grand opening and going out of business sale.
It is both and neither at once until an observer records the state at which point it becomes one or the other.
But because you know exactly where the store is located, you cannot know how fast it is going out of business because of your uncertainty about its business momentum.
All around us, all the time pairs of anti-discount mattress stores and discount mattress stores are popping into existence, forming the quantum memory foam that is the basis for the universe
this is scarily accurate
<img src="http://www.wigwam.com/products/images/Product/large/F7215_1_.jpg" alt="Image result for sock"/>
Ehhhh. Sure. Well that is very accurate. Scarily so I would say.
Nope dang it it didn't copy
@TauNeutrino no html needed
just post the image link
2:46 AM
Yup that is a selfie of me
"A selfie of me"
Dobby loves Socks!
No, it's a selfie I took, except it's of someone else.
@HyperNeutrino Exactly
Yes you do.
2:47 AM
You can edit your messages.
Press "up arrow" to edit your messages.
Or...you can do that...
smek the snek in the neck
I wish you could do s/foo/bar like in Discord
2:49 AM
You can do that in Discord?
and skype for mac
It edits your last message
not skype for windows
2:49 AM
Doesn't take regex tho
you can use trailing slash or not on discord, need it on skype
@Phoenix skype does
supports full sed
Right, but Skype is shite, so it isn't worth mentioning.
If you use trailing slash on discord, it will edit the slash into your message
2:50 AM
not for me idt
huh, it does
@Phoenix I like it <shrug>
why tho.
It's worse than discord in nearly every way.
And we're promised screensharing soon, too.
You called?


Where you can play with chat features (except flagging) and ch...
2:52 AM
You should go here and fiddle around with SE chat.
Question : To be Turing complete does a program need to have all the characteristics of Turing Machine (ie infinite tape and conditionals)?
You should go here and fiddle around with SE chat.
@Arjun You have to be able to emulate a turing machine, so yes.
@Arjun it doesn't need to be able to implement everything a Turing machine can do directly, but it needs some way to simulate it
perhaps through many levels of abstraction
2:56 AM
Well, you do need infinite memory, or you have at most an FSM.
there are some languages which don't look at all like normal programming languages but are nonetheless Turing-complete, such as Fractran and But Is It Art?
/// is I think the best example
however, there are some hard limits that all Turing-complete languages must have: the two most frequently violated are that the language must have some way to store an unbounded amount of data, and (assuming the Church-Turing thesis) must have some way to write an infinite loop
(that said, someone came up with an esolang that's Turing-complete but in which you can't prove that any specific program has an infinite loop; it is, however, known that at least one program must, we just can't prove it)
I think needing to be able to have an infinite loop is pretty easy to assume.
Otherwise the halting problem stops making sense.
right, both those requirements should be obvious when they're pointed out
2:59 AM
@ais523 What lang?
they're insufficient by themselves, but necessary
@Phoenix onoz; sorry for the slow answer, I was stalling trying to search for it
oh, hmm, it hasn't been proven TC, just computable
I'm pretty sure it's TC though
@ais523 There's an example of a truth machine, which is an infinite loop.
How do I enter Image?
@Phoenix you can't prove it, though
3:03 AM
I see.
Well, bye everyone
\o/ > Help, I'm sinking!
Help granted.
I don't think Onoz is TC. It has to be able to interpret BF for that, and it's possible to make a proovable infinite loop in BF.
3:05 AM
Question : Is there any good Computer Science YouTube channel worth watching (like ComputerPhile)?
TomScott, but he does a lot of things other than CS.
(Also does non-cs things)
A: Sandbox for Proposed Challenges

ais523Elastic tab expansion Background The tabs versus spaces war in programming has been going on a long time, basically because spaces are too low-level to have all the properties you'd want for alignment and indentation, but tabs can't be relied upon to work in all contexts (with some programs opt...

I guess he's got a PHD in Linguistics.
I like the way he explains things.
I have seen few videos of him both on CP and his own channel
@Phoenix Any channel other than these two?
Techquicke, sometimes.
It's usually more basic stuff
@Phoenix the thing is, my guess is you can compile BF into it, but you can't prove the compilation works
perhaps it's TC but not provably TC?
3:11 AM
Everything about that feels wrong, but it makes sense in a way.
3:22 AM
How exactly does the unanswered queue work
codegolf.stackexchange.com/q/98821/65532 this question has an answer from november 2016
but it shows up at the bottom of the unanswered list
@numbermaniac sorted by votes, requires questions to have no upvoted answers IIRC
that question has a negative score (so it's going to appear near the bottom of the unanswered list), and its answer is not upvoted
SE assumes that if a question has no upvoted answers, probably none of its answers are useful; it makes a lot of assumptions that don't make sense on this site
(given that we typically ask questions not to find out the answer, but to give people something to compete over)
user image
Mego IRL
3:37 AM
I found you at last, Mego! :D
noot noot
Is there an easy way to make a tuple that contains itself in Python?
Um, does that even work?
OCaml has a builtin for creating structures that contain themselves, but it doesn't work on tuples because it can't infer a type for the resulting tuple
@ais523 What if you use the -rectypes switch?
3:49 AM
# let rec x = (x, 1) ;;
val x : 'a * int as 'a = (<cycle>, 1)
looks like it works then!
come to think of it, I'm not quite sure why OCaml has that builtin; I've never found a use for it
-rectypes is pretty neat, actually
it lets me implement SKI combinator calculus without complaining
That flag really came in handy when testing my own HM implementation.
# s i i ;;
- : ('a -> '_b as 'a) -> '_b = <fun>
seeing the mockingbird in a strongly typed language fills me with fear and dread for some reason
that's just so wrong
Uh oh, the dreaded weakly polymorphic types.
that's just because I'm trying to create a mockingbird value
I don't think that'd have happened if I gave it an argument
# let m () = (s i i) ;;
val m : unit -> ('a -> 'b as 'a) -> 'b = <fun>
right, if I create a mockingbird generator it's fully polymorphic
# let l () = (s i i) (s i i) ;;
val l : unit -> 'a = <fun>
and there's proof that you can use recursive types to escape the type system
if we try to use Curry-Howard on OCaml -rectypes, we can get it to prove anything
How is that different from let rec f () = f ()
3:56 AM
no recursion
It's an infinite loop either way, no?
your suggestion is the more common way to break out of OCaml's type system, though
and yes, it's an infinite loop; I think you can prove that all type system breaks either go into an infinite loop, or throw an exception, or run unsafe code
Can you evaluate it without an infinite loop in Haskell?
what do you mean by "evaluate"?
(interestingly, Haskell's spec treats exceptions and infinite loops as semantically equivalent; either can be optimized into the other)
Like l ()
Or maybe 2 + (l ()) would be more fun.
4:00 AM
the dummy argument in OCaml is a trick to prevent the thing running as soon as it's defined
Haskell doesn't need that; that sort of dummy argument is just ignored
however it'll go into an infinite loop when it's forced (e.g. by adding 2 to it)
4:14 AM
Q: Gilbreath's Conjecture

isaacgSuppose we start with the infinite list of prime numbers: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, ... Then, we take the absolute differences between each pair of numbers, repeatedly: [1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, ... [1, 0, 2, 2...

o0 what is it with the infinite lists
4:33 AM
How can I check my Generalist Badge progress (if it were available)?
@Arjun Please don't leave +1 comments on answers. They're not considered constructive and will be deleted at sight.
@HyperNeutrino I have a stuffed penguin that looks very similar
Interesting! Yeah I don't know how I was never reminded of you when I saw my stuffed penguin :P
I see a lot of "+1 for <something>" comments on PPCG answers; presumably those must be allowed, then?
After eating dinner I feel like a stuffed penguin
4:43 AM
@numbermaniac If it's actually +1 for this good reason, that's fine. +1 because your code contains this emoji, not so much. +1 without any reason, definitely not.
Also, just because some things slip through the grid doesn't make them good practice.
^-^ it looks like a very happy penguin
You want a space before the ^ or it will do caret reply
well there's a slight issue to the caretreply script
4:51 AM
5:51 AM
> +1 because your code contains this emoji
unfortunately usually considered a better reason than it actually is, empirically
@Phoenix we have such a script?
@EriktheOutgolfer yes
Playing Rainbow Six Siege someone else link
:37385645 that's cool!
huh? it's just a ping? (continuing trying in the sandbox)

« first day (2297 days earlier)      last day (1615 days later) »