« first day (1051 days earlier)      last day (3892 days later) » 

12:03 AM
Whoa. Trying to find that library now:
Chilling Effects, damn sure!
 
@sehe lol
 
C# in a Nutshell --> Paperback: 1060 pages
kind of a misleading title eh?
 
@Borgleader That's a rather large nut.
 
It turned out to be a bombshell.
Then it exploded
 
Hm.. Python doesn't have intersperse.
 
12:09 AM
I really want some Coke.
 
Coke's illegal man.
 
Meth is better anyway.
 
Java's lambdas aren't bad lol
They even got a syntax for Xeo's proposal called method references.
 
43 mins ago, by sehe
> x::toString (as a capturing method reference lambda)
 
@Rapptz :o Xeo is secretely on the Java committee
 
12:12 AM
@Rapptz No captures, unless they're (implicitely) final hurts a lot, though
 
Ah yeah, no closures would suck.
"A lambda expression can only access local variables and parameters of the enclosing block that are final or effectively final."
 
Something seems wrong with the 'Share' button on cppreference.
 
44 mins ago, by sehe
^ won't compile. That's ... impotent
 
So no access to member variables?
 
@Borgleader Readonly, and iff they're final. So it's basically like [=] in immutable c++11 lambdas
 
12:15 AM
@Borgleader You'd need to pass them as arguments to the lambda I presume.
 
That sucks ballz
 
@StackedCrooked Yup. And no updating (because AFAIR java has no [ref] or [out] params. (In contrast, C# even allows capturing of ValueTypes and shared updating (of course, this (surprisingly) auto-boxes them)
 
Well Java isn't particularly reputed for making good design choices.
 
Not entirely true. They're reputed for being old now (10+ years older than .NET) and it shows.
 
C++ isn't and they got good lambdas.
 
12:17 AM
Also, they can be called "reputed for failing to keep up"
 
@sehe That means you'd be stuck with writing your own wrapper class, instantiating one as final, and passing that to the lambda.
Unnecessary boilerplate in Java code? Sounds about right.
 
wtf... A child class can't access a parent's member even if it's declared protected?
class Parent{
protected:
    int a;
};

class Child : public Parent{
    void func(const Parent &x){
        a = x.a;
    }
};
^^ that errors
 
@Mysticial In C++? Oh yes. Lemme see
 
C++
VS2012
 
@Mysticial Exactly.
 
12:18 AM
Oh wait, yeah, a derived class != a friend
@Mysticial You're not actually accessing the base's member. You're accessing a member in totally unrelated object
 
I thought protected allows all child classes access.
 
Cast as child and access :P :P :P </troll>
 
@Mysticial You have a but you can't access another Parent's a.
 
Who are you and what have you done with Mr. Yee?
 
12:20 AM
Lol. He's done C++ before
 
I can see why you think it's silly tbh
 
^ this
 
So I have to friend the child class. lol
 
@Mysticial or make protected accessors i think
not sure about that though
 
@Mysticial To save yourself trouble of doing "let's friend every class possible" you can use a form of CRTP to template your friendship
not sure if you'd want to though
 
12:21 AM
@Rapptz It's just this one instance.
That parent is an abstract class.
 
gotcha
 
This child is special in that it's instantiated from the parent class, but it aliases the fields and takes no ownership of anything.
 
1
A: Algorithm to unify contiguous chunks in a collection of chunks

Dieter LückingI think you can not do better then N log(N) - the naive approach. The idea using an unordered associative container I dislike - the hashing will degenerate performance. An improvement might be: keep the chunks sorted at each insert, making 'unify' O(N). It seems you are writing some allocator, h...

Whoa, talk about wall of code.
 
> // Copyright (c) 1999, Dieter Lucking.
Guy dug out some of his old stuff.
 
1999 with <chrono>?
 
12:25 AM
It uses <chrono> and <mutex> so "old" has to be taken with a grain or two
 
and <thread>, <mutex>, auto, etc.. I think he needs to update the year there
 
@sehe Wait... he was able to code all that and still gets a bunch of answers wrong?
 
Goddammit. I wishC++ had C#'s properties with access specifiers.
 
Someone had written a template to emulate C# properties in C++
 
12:33 AM
Then I can just: public type field {get; private set;} everything.
 
there we go, i had it bookmarked
 
That seems overkill.
 
meow.. was it STL?
 
It was @ThePhD
 
well at least that explains the weird interface
he was never really good at those
 
12:35 AM
Hey, since you're always bored. Make it better ;)
 
Is friendship an indicator of bad design?
 
I talked to him today and he said he left for no good reason
@Pawnguy7 No
 
@Pawnguy7 Not necessarily.
 
@Borgleader I'm making a bootstrap.py
 
Granted, I tend to abuse it a bit too much.
 
12:37 AM
I feel that idiot-proof code is good, but I don't know what magnitude we are protecting against.
 
@Pawnguy7 In my case, this is all internal code. So it doesn't need to be 100% idiot-proof.
 
@Mysticial s/doesn't need/needs/ ;)
 
It's impossible to be 100% idiot-proof in C++.
 
For example, with my rooms (now screens), I had passed the eh, "overseer". It knows things better than anything else, and would be very convenient to pass.
Problem is when you call update on the overseer, it calls update on the first thing on the stack.
 
@Borgleader No, its grammatically correct. "does not need to be"
 
12:38 AM
So if the first thing on the stack can call its update, things blow up.
So, I didn't want to do that.
 
@Mysticial I was implying it needed to be 100% idiot proof because it was internal code and only you would be using it...
 
@Borgleader fuck you :)
 
<3 u too
besides we all know most of the lounge is way higher than me on the smartness scale
 
@Borgleader In fairness, I've upvoted more of his answers now than I've downvoted. Only the last few days were very erratic indeed.
@Borgleader meow reminds me of a derpstorm
 
Feb 3 at 20:45, by ThePhD
@Borgleader Here you go. I fixed it up and made it nice JUST FOR YOU: http://stacked-crooked.com/view?id=783a2dc77bab3f21789d98c467b18c40 /cc @DeadMG I only did some of the type magic necessary.
 
12:46 AM
@EtiennedeMartel Geez. That was a painful find again /cc @Borgleader :
Whoa, this exists: "Comparers - he last comparison library you'll ever need!" (by Stephen Cleary) http://comparers.codeplex.com/ Why wasn't I told?
 
People keep telling me that the default Coliru program is invalid because main doesn't have a return statement.
The latest one even complains about main taking no arguments.
 
user1804599
lol
 
@StackedCrooked Put up a pacifier link in the FAQ
<username> pts/3        xx.xxx.xxx.98    Sat Aug 31 23:53 - 23:53  (00:00)
<username> pts/0        xx.xxx.xxx.98    Sat Aug 31 22:41 - 23:53  (01:11)
<username> pts/0        xx.xxx.xxx.98    Sat Aug 31 22:32 - 22:41  (00:09)
<username> pts/0        xx.xxx.xxx.98    Sat Aug 31 22:31 - 22:32  (00:00)
<username> pts/0        xx.xxx.xxx.98    Sat Aug 31 19:33 - 19:43  (00:09)
<username> pts/3        xx.xxx.xxx.98    Sat Aug 31 19:26 - 19:33  (00:07)
<username> pts/0        xx.xxx.xxx.98    Sat Aug 31 19:09 - 19:33  (00:24)
@StackedCrooked ^ I see you've spent some more time. Any thing needed?
 
I forgot what I did.
 
@StackedCrooked Prolly just logged on :)
 
12:51 AM
Ah, right, I couldn't do apt-get install.
 
@StackedCrooked Oh - shute. I didn't even set one, methinks, but yeah, that makes sense. Lemme kill that
 
asks for a password
 
user1804599
Bored, I am.
 
How poetic.
 
@StackedCrooked Fixed. Sorry for that. That was a bit amateurish, wasn't it. Now have:
<username> ALL = NOPASSWD: ALL
webserver ALL = (ALL) NOPASSWD: /usr/sbin/chroot, /bin/chmod, /usr/bin/find
^ The latter is so that the webserver user can fix the chroot :/
 
12:55 AM
Coliru is an amateur project after all :)
 
Oh, I didn't know I was on the project :/
 
I must say that the low latency makes your vps much more pleasant to work with than my us based one.
 
My us based one has no noticeable latency (AFAIR). I'm using linode, you?
 
user1804599
I have a VPS based in Amsterdam.
 
user1804599
Me too.
 
12:57 AM
# Is this OK?
apt-get install -y subversion vim aptitude software-properties-common python-software-properties
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update -y
apt-get upgrade -y
 
user1804599
Ik ga slapen; ik ben moe als een hond.
 
I might mess up your VPS.
 
@StackedCrooked Try it :D
@StackedCrooked Not an issue, I don't keep anything of value there (the last thing of value was in fact that, currently non-workey, coliru instance.
@not-rightfold You've been working like a log? (It's a hard day's night)
 
A machine is a disposable thing :)
 
Some are. Well, in fact, all mine are.
 
user1804599
12:59 AM
@sehe Ja.
 
Beatles FTW. Good idea btw,
I'm going to sleep too (even though I'm not too tired, but I was a bit "grieperig" (~under the wheather~) earlier)
 
shit, I'm so sick.
perhaps tomorrow I should consume absolutely nothing
 
Imagine you want a constructor to accept a reference to a base class. Which, this would be fine, but you don't want it to go out of scope, so you make a copy. How do you make the copy?
 
1:16 AM
man
stupid boost
 
@Pawnguy7 You don't.
if you want it to not go out of scope, use an owning pointer and take ownership of it.
 
@Borgleader Upset at linking all the dependencies
 
It might be declared on the stack, though, that is my problem.
 
if it's on the stack...how will it go out of scope?
 
1:18 AM
When it goes out of scope?
 
@Pawnguy7 Clearly, then, it cannot be declared on the stack.
 
If I had a guarantee it would be on the heap, this would work great, but I don't know how I would do that.
This is the room/screen thing.
 
@Pawnguy7 Take an owning pointer to it.
then the caller cannot fulfill the interface without allocating it somewhere it can be owned.
 
Ah.
Which pointer?
std::shared_ptr?
 
what ownership semantics do you need?
pro tip: the answer is almost always unique ownership.
 
1:24 AM
Wouldn't it destroy the object when it goes out of scope though? (a unique_ptr)?
 
that is it's purpose.
 
It would be on the stack, though. Doesn't this have the same problems as before? I feel I am missing something.
 
@Pawnguy7 If you still need it, move it to another scope.
 
That is what I am trying to figure out how to do.
 
std::move.
 
1:29 AM
@Pawnguy7 there better be some pennies dropping now :p
 
I feel I may not have expressed this correctly. I have an IScreen. I want to store these for an undetermined amount of time. Now, the thing which stores these screens, calls, say, update() on them. In update(), they need to be able to change rooms - by, for example, making a new one, and passing it.
I just need to figure out how to receive it, and not get in trouble due to scoping issues.
 
IInterface- eww.
 
Say, is this a good time to discuss good names (yup, as usual)?
 
more like Ewwnterface
 
First time I ever used it, actually :D
 
1:32 AM
lol
 
Is something specifically bad about it?
 
@LucDanton I'm sick as shit.
so prepare for hideous sarcasm
 
@DeadMG Hey, it's cool.
 
@Pawnguy7 if you have a thing that keeps track of the screens...why are you worrying about scoping? will that thing go and delete screens while it's in the middle of an update()?
 
How this python script taking up 2 GB of RAM is beyond me
 
1:33 AM
No. The question is, how to switch screens.
 
So far I have a range::size(r) operation to, well, get the size of range (i.e. how many things are in there). I fear that the name is a bit misleading though because e.g. Boost.Range has a boost::size thing which is for the distance (as in, std::distance) of a random-access iterator range. Meaning that it would have a constant-time complexity.
 
@EtiennedeMartel If by "cool" you mean "what the fuck terrible", then I am forced to agree.
 
Also I uncreatively named the associated concept RangeWithSize, which is funny stupid but still stupid.
 
@Pawnguy7 switch screens when, where, why?
 
It occurs to me, the caller being able to construct the rooms could work well in terms of ease of use. For example, let's imagine you have a setting rooms - say, generation settings, or how many players. Then, you can construct the gameplay room with these settings, because I don't know a better way to pass such information.
@melak47 Imagine you are in the menu screen. You click a button, and go to the options screen.
 
1:36 AM
I thought that the associated concept should be more accurately named something like FiniteRange or BoundRange, but I'm not so sure: some ranges you can know in advance will terminate, yet you can't count how many things are in there.
 
@DeadMG No, I mean its temperature is relatively low.
 
@LucDanton Like what?
it seems to me that most input ranges you could not guarantee will terminate, and all forward ranges and above you could simply use the O(N) algorithm for size.
 
@Pawnguy7 so you push a new screen onto your stack or where ever you are keeping them around
 
@DeadMG take(6, r) will take at most 6 out of r.
 
@melak47 Basically. Or pop off everything then pop it on.
 
1:39 AM
so where's the scope issue :D
 
All of this is synchronous so I don't think operations that block indefinitely are a concern (i.e., range writer beware).
 
@melak47 If I create a room on the stack in the update function, it dies as soon as it is over. So all I have in the stack is soon to be undefined behavior.
 
so... globalSingletonScreenStorageManagerFactory.getInstance().push_back(screen());
 
So far I'm leaning towards concepts::CountableRange+range::count and concepts::FiniteRange+range::size. Which means I'll need to rename my preexisting range::count consumer, heh.
 
@melak47 I suppose that works if I make an overload for every type
Should I just do that?
 
1:45 AM
@LucDanton Logically, if r has a size then take(6, r) has a size; else it can't have a size.
 
What? You wanted an example of a range that terminates yet doesn't have a size, didn't you?
 
yeah true
 
'Ranges that you can know the count of elements of without consuming them', is what I'm looking for. Or the converse I suppose.
 
Any good way to have a set of ids for subclasses of something?
 
Eh, Countable still seems okay. Let's save this for later then.
 
1:53 AM
@LucDanton You can't know the count of take(6, r) if r is an unknown-count range without consuming it.
 
0
Q: Why is Stack overflow run by morons?

user232912On multiple occasions, the moron administrators of this s[h]ite have decided that they would delete a post that points out that the question being asked is for a person trying to cheat on an online programming competition. Bill the Lizard (which presumably explains his sense of community), explai...

 
@DeadMG Yup. Hence why Bounded is the wrong name for the concept: take(6, r) is bounded.
 
I might go for Countable, perhaps.
 
@Pawnguy7 One a scope has ended then everything in that scope is cleaned up. There is no reason this would cause UB unless you somehow still try to access the variables used to live in that scope.
 
Informally (i.e. not all of those will have a reified concept in code) that gives unbounded (never empty), bounded (eventually empty), bounded with a known bound (e.g. take(n, r)), countable and finite. I'm okay with that.
@R.MartinhoFernandes @Xeo ^reflecting about stuff
 
1:57 AM
@Mysticial ooooh free meta flag
 
I can't tell if the OP is ranting for or against the "It's not our job to police the intentions of the askers".
 
@StackedCrooked I am pretty sure it would be doing exactly that.
 
[tag:i'm-interested-in-your-opinion]
Fuck you morkdown :v
 
@Mysticial i thought it was clearly against, maybe i missed something
 
@Borgleader The first sentence seems to contradict it.
 
2:00 AM
he seems to think it's stupid that posts pointing out somehow is trying to get their homework/competition exercises done are removed
 
@Mysticial MoronOverflow :D
 
so. this is probably more a math question than anything. But how do you know which direction your mouse is pointing relative to another point (I want to rotate something based on where the mouse is)? I'm assuming something about vectors? I remember this kinda from 8th grade math
 
The first sentence bitches about mods deleting a question where the OP is clearly cheating for a competition. But then he bitches about the "It's not our job to police the intentions of the askers.".
They're exactly opposite.
 
@Pawnguy7 This is pretty basic.
 
@Mysticial No no, read it again. "they would delete a post that points out that the question being asked is for a person trying to cheat on an online" --> delete a post that points out
hes talking about a response of some kind not the original question intended to cheat.
 
2:04 AM
wait...
So what exactly is be bitching about?
The mods deleting things? Or the "It's not our job to police the intentions of the askers."?
 
The latter I think. The former seems to just be an example of this "policy"
 
I'm tempted to comment:
> If you're gonna rant about something, can you at least make it conherent and interesting? I mean, I can't tell if you're bitching about mods deleting things (1st sentence), or if you're bitching about not deleting things. (2nd sentence)
 
@StackedCrooked Care to explain it to me?
 
@Pawnguy7 Define the data in the surrounding scope and pass it by ref to the inner scope.
 
I am trying to pass from inner to outer.
 
2:09 AM
@Pawnguy7 You can use return for that.
Assuming that we're talking about function scopes here.
 
I think that has the same issues as before.
Also, most of the time it wouldn't return anything.
This is for a game "screen manager". The issue in question is how to change screens whilst in a screen.
 
couldn't you just...not do that?
 
Right.
 
push the new screen on top, and next frame it gets drawn because it's on top?
 
So let me get this straight, because SO mods apparently disagree on a certain policy it automatically makes them morons? — Borgleader 35 secs ago
s/disagree/disagree with you/
I forgot how to english -.-;
 
2:14 AM
@melak47 Not sure what you mean.
 
You could be fancy and implement that screen system as a finite state machine.
 
Oh, I suppose I could rename the range::count consumer to range::length.
 
length gives the length, count counts the elements to get the count/length? :)
 
@StackedCrooked I thought it already was.
 
@Borgleader Oh I get it. He's complaining that mods will delete comments that call out the OP for cheating rather than deleting the questions themselves.
 
2:16 AM
@Pawnguy7 your screen manager manages screens...so give him the screen. screen lives in screen manager, and doesn't go out of scope..
 
@Pawnguy7 Very well then.
 
@Mysticial Yes
 
Maybe I should just go with overloads :\
 
what overloads? I thought you already have an IScreen interface
 
I do.
That is why I didn't want to use overloads.
 
2:19 AM
so what overloads do you need?
one for IScreen
 
It would have to be one for every type of screen, if I cannot get it working any other way.
 
huh
 
None of the standard libraries are included with VS2012... how do I get them? (at least on my isntallation...)
 
why do you have an interface to begin with then
@CCInc wat
 
Because screens need to fulfill things.
 
2:20 AM
@Pawnguy7 so just take an IScreen* or whatever
 
@melak47 VS12 can't find files like #include <string> or #include<algorithm>
 
@CCInc Your installation failed
 
@melak47 That was the origional plan, but they could pass something on the stack.
 
I have to reinstall the entire VS suite?
 
@Pawnguy7 so, don't
@CCInc you can try a repair
 
2:22 AM
@melak47 To much idiotproofing, you think?
 
Sigh. The original isntallation took so long...
 
@Pawnguy7 oh, you're trying to forbid anyone from passing a pointer to something on the stack?
 
It certainly would not end well.
 
Checking for stack vs heap allocation is a pain and not portable
 
2:24 AM
Write idiomatic code instead of inventing your own systems.
 
Perhaps with shared_ptr, I have a guarantee it will not die, but I also don't have unique ownership. In practice, I probably do, but no guarantee.
 
@melak47 Mmmh, is that a serious question? :)
 
@LucDanton I've only been half-reading your range stuff, so you tell me :p
 
k. Given any kind of range, you can always know how many elements there were if you pop them all (+1 for each one you find). range::length does that (which is why it's a range consumer, and in this case it's a fold at that). Some ranges you can know how many elements there are without removing anything though.
 
ok..
 
2:29 AM
That's about it really :p
 
so length...counts, and count gives the length? :p
 
Count and length meet, yeah :p
 
Getting the length of the range is a destructive operation?
Or does "pop" not mean removal here?
 
I'd call it a digestive operation
 
I realise this is annoyingly confusing but I can have concepts::CountableRange but not concepts::LengthableRange.
 
2:31 AM
RangeThatHasLength:D
 
And then there's going to be range::size :p
 
Would this happen to be you, Harry: stackoverflow.com/a/18545790/19679 ? Those answers you left weren't really answers to the question asked, and were flagged as such by normal members of the community. This wasn't any particular "attitude of the administrators", you weren't following the rules of the site, and normal members of the community pointed this out. — Brad Larson 1 min ago
^^ ahahaha pwned
 
Flexo'd, too.
 
LengthiscientRange - a range that knows its length? :)
 
Mods and their ability to see deleted comments from a user's profile...
 
2:34 AM
@melak47 You're lengthiscient if you know some topics at great lengths.
 
@Mysticial dont you wish you could do that
 
huh
it's 4am but I'm actually kinda cold.
 
why is that weird
 
@DeadMG lol who gets cold at 4am?
 
2:40 AM
@melak47 Summer's been pretty warm here
 
@user232912, you teach programming? You not so good in this field, are you? Else it should be trivial for you to earn the meager 50 reps you need to leave comments. Or don't you like to help other for free? No community kind of guy? — Greenflow 13 secs ago
^^ burn :)
 
I had to
 
@Borgleader No, you didn't. Nobody ever needs to post a (link to a) picture of him.
 
who is that
 
it's burn
It says on the picture moron.
 
2:48 AM
@melak47 A moron. Aka Ashton Kutcher.
 
so does he run SO? :)
 
@JerryCoffin You mean Steve Jobs?
Hihihi.
 
@JerryCoffin Yes Kelso is a moron dumbass
 
@EtiennedeMartel No. Kutcher's an idiot. Jobs was an asshole.
 
@JerryCoffin I see.
 
2:52 AM
If I have T a and T & b = a, is &b == &a ?
 
@Pawnguy7 depends
 
@EtiennedeMartel Actually, I don't know much about Kutcher -- just that part he played was of an idiot. Jobs was definitely an asshole though.
 
@Mysticial On?
 
This user232912 person on Meta sure has some fantastic dispute resolution skills.
 
is T::operator& overloaded? :D
 
2:53 AM
@Pawnguy7 == could be overloaded to do something stupid.
 
@Pawnguy7 yes, unless T has operator& defined.
@Mysticial operator== works on T* here
 
@Pawnguy7 It's possible to overload operator& so they're different, but rarely a good idea.
 
@StackedCrooked unless operator& doesn't return T* :p
 
Right :P
 
@user232912 Yes it is possible. waiwai933 earned 50 rep from answering your question alone. — apaul34208 26 secs ago
^^ double burn
 
I imagine pouring cold water anywhere will work :p
 

« first day (1051 days earlier)      last day (3892 days later) »