« first day (992 days earlier)      last day (3950 days later) » 

12:00 AM
those results are utterly unsurprising
 
@DeadMG and?
 
and congratulations for telling everybody sane what they already knew?
 
At discussion where I used it - not everybody knew it, so I showed them
 
user142019
> Indeed, Java sucks for people who don't have intellectual capacity for it.
 
user142019
Haha.
 
12:03 AM
@DeadMG Time difference of elements iteration over vector<char> versus vector<char*> is constant. And sometimes we do care about constants.
 
no
there's a difference between "constant time" and "The vtable pointer is a constant"
 
@rightfold Wow! There is a 'Java Sucks' room. Must keep on top of all the latest stuff. I presume there is a 'JavaScript sucks like a Trent XWB at 105%' room.
 
user142019
@MartinJames Guess who's room owner. ^_^
 
@DeadMG ok, you meant it is constant - and what?
 
@rightfold Couldn't possibly imagine :)
 
12:08 AM
so it is not a double indirection per access.
it is only a double indirection on first access.
 
user142019
OH NO DOUBLE INDIRECTION
 
@DeadMG Capitan mode: and if each access is "first", it is double indirection per each access.
 
user142019
It will make my program run so slowly on my 3.6GHz quadcore box with 16GB 1600MHz DDR3!
 
"in some cases it can be practical performance difference"
 
user142019
Time for some chocolate.
 
12:18 AM
@EvgenyPanasyuk Err.. how many cases? In my apps/systems, code efficiency is relatively unimportant compared with all the other factors that make a complete system deliverable and acceptable to customers.
 
user142019
OP: What can I use instead of select?
Me: epoll
OP: I don't want to use epoll! I want to use select!
Me: (thinks) GET THE FUCK OUT RIGHT NOW
 
@rightfold His bike wheels are stuck in the tram tracks.
 
user142019
And the moral is that you can't solve problems if you avoid solutions. *Control+W* — rightfold 7 secs ago
 
user142019
Scott+W!
 
user142019
poll method isn't fast as select. select can handle a operation in microseconds but poll can't. That is my reason to "why I don't want to use poll". — PiLaWYeR 20 secs ago
 
user142019
12:22 AM
Hahahaha.
 
Can anybody help me with a design?
 
@Pawnguy7 €46/hr, minimum 1 hr (OK, not for lounge regulars:).
 
haha
 
@Pawnguy7 Go on..
 
user142019
He's doing asynchronous I-fucking-/O and complains about a microsecond.
 
12:24 AM
Well, there was no hesitation when everybody says it sucks :D
 
@rightfold Fucking clueless.
 
user142019
Also
 
user142019
> I'm working on a MMO
 
user142019
It already goes wrong here.
 
Ok, so here is the situation.
 
12:25 AM
Try making a MOO first...
 
Man-Machine Orifice?
 
I have worlds composed of a bunch of colored blocks.
 
@Pawnguy7 Lego?
 
No :\
 
Logo?
 
12:26 AM
So, there are two different things I want to draw.
First is it normally, but scrolling.
And second is what I call blending.
Which is the transition between one world and the next.
 
I really ought to go to sleep, before I annoy anyone else. The Doombar was exceptionally tasty tonite. BFN.
 
@Ell That I don't know. Depends on how the callback is used.
 
And um...
 
For instance, the EnumX thingies from the WinAPI use the callbacks immediately before returning, so you can easily use temps with them.
 
Well, I don't know how to design it.
 
12:27 AM
But other things store the callbacks for calling later.
 
And the blending is... not instant.
 
For those you need to attach the callback lifetimes to whatever thing is going to call them later.
 
@MartinJames well, there are applications which do not do anything more than just adding two numbers, and yes performance is not always needed.
 
How to do that depends on more information you have, so I'll let you ponder on it. Feel free to probe my head some more if you want more help.
 
Any ideas, @ScottW?
 
12:31 AM
If the callback is going to happen later, then it's either going to be on a different thread or require constraints upon the originating thread, ie. need to wait for messages/APC's etc.
 
Anyway, I came here to say that The Place Beyond the Pines is a nice movie.
Now to sleep.
 
SLEEP!
 
hey guys, can I ask you one question regarding C, not C++? When i have a struct, say MyStruct, and allocate a MyStruct pointer on the stack: struct MyStruct *p = NULL. I then create a MyStruct, say p = { .a = 'hello' }, and then I allocate another struct again to p in the next line and say p = { .a = 'bye' }, is there a memory leak or where does the { .a = 'hello' } struct go?
 
@Gudbergur p = { .a = 'bye' } this is not allocation, you code has error - use compiler
 
@Gudbergur Generally can't even get away with asking a question about C++ here, let alone C. Ask on SO if you need real help.
 
12:38 AM
@EvgenyPanasyuk Ah sorry, you're right. :)
@EvgenyPanasyuk So I can't reuse the MyStruct *p pointer?
 
@Gudbergur you can reuse pointer
 
@Gudbergur You never allocated anything on the heap (i.e. you didn't use malloc or something like that). So I don't see how a memory leak would be possible.
 
user142019
@Gudbergur Easy way to find out: write a small program that demonstrates the problem in a main function, compile it and run it under Memcheck.
 
user142019
Or maybe clang's static analyser, but I don't know how well it performs on C code. Works great with Objective-C, though.
 
@rightfold static analyzer in my experience only finds C errors releveant to objective-C - Its much more ffocused on objective-C
 
user142019
12:45 AM
Ah, I see. (Pun not intended.)
 
and I can''t spell
 
user142019
@ScottW Goodbye motherfucker.
 
user142019
Y… y… you're my father?
 
user142019
I thought you were my *grand*father! Or are you both?
 
is there a word for "to make something emotionless"?
 
user142019
12:46 AM
@Crowz rightfoldize.
 
@rightfold memcheck this one
 
user142019
Sorry, I use OS X 10.8 and Memcheck is broken on OS X 10.8.
 
user142019
But no, that won't cause a leak since you don't dynamically allocate anything.
 
user142019
And Memcheck works with malloc and free.
 
@rightfold and the moral of the story is?
 
user142019
12:49 AM
There is none.
 
user142019
Anyway, it's time to sleep.
 
Good night, princess.
 
Niiight.
 
@EvgenyPanasyuk Oh neat. :)
 
@Mysticial Looks like the moral of the story is static or virtual.
And to _never_use a switch based on types...
 
12:58 AM
0
Q: C++ pointer to pointer to pointer multiplication not working

AncaThis might be quite a simple question but anyways: I'm using VS 2010 and what I want is to obtain the result of x****y at the end. This is my code: #include <iostream> using namespace std; void main() { int x = 5; int *** y= new int**; ***y = 5; cout << x****y << endl; syste...

triple star programmer!
 
TRIPLE STAAR.
Lol.
I think he's trying to exponentiate?
 
idk what the fuck hes trying to do all i know is this code makes no fucking sense
 
lol
 
Some people learn pointers and then they start to feel all clever so they use them in the worst way possible and before you know it they created a 3 star monster.
Use pointers for all the things!
 
I've never created a three-star monster.
 
1:10 AM
that's because you are not clever enough
 
Clearly.
 
A three-star monster is a 3d matrix/cube. I use those all the time.
 
Wrong. a 3d matrix is a single-pointer with width * height * depth.
int*** does not put it all in memory next to each other. It's a horrible idea to have int***
 
Like we mentioned earlier, any N-dimensional object can be represented in a single dimension.
 
> +110 21:32 11 events Should C++ programmers use std::flush frequently?
^ What the fuck
This is completely silly.
+110 for that single, shitty answer?
 
1:16 AM
0
Q: How would I make this really complicated inheritance tree

bathtubOkay. So I'm in a situation in which I have a very complicated inheritance tree, (I swear it's legitimate). I'm not going to go into the details of what the classes contain because that is irrelevant to my question. A /|\ / | \ B | D \ | | \| | C | \...

What the fuck
 
@Mysticial that is python's matplotlib
 
@EvgenyPanasyuk What exactly is "types count"
 
@Borgleader in case of "virtual" it is number of subclasses derived from some abstract base
there is ptr_vector<Base> filled randomly with subclasses
 
What's with the room title?
is someone complaining about LLVM API instability?
 
1:33 AM
D'you know what Wide is?
 
lol. It doesn't have a very Wide audience.
 
@MarkGarcia That was a good one. :)
 
Is something like this possible:
return done && blending = true;
The idea was to set blending to true when it was done, but I guess I might as well write it out.
 
@Pawnguy7 return done && true;
Or just return done; ;)
 
Sigh.
Never mind :D
Although,I am curious.
 
1:44 AM
In C++?
 
Is the return of the boolean assignment operator void?
Yes.
 
@Jeffrey @DeadMG is making his own programming language, it is called Wide.
 
@Borgleader yup, I know, I was asking Stephen
 
As in, Wi de ya bother? :P
 
1:46 AM
you can't write ba-dum-tssh without BAD :P
 
@ThePhD Yeah - I was gonna ask about that. Thanks for explaining :)
 
@Pawnguy7 You mean that if done == false it shouldn't return?
 
@Jeffrey I mean, when it is done, it should set blending to true.
 
@Pawnguy7 like this?
 
1:51 AM
Ah.
I forgot the... precedence.
 
Cool but buggy site...
 
Ok.
 
@MarkGarcia I like the design
 
@MarkGarcia that's old news :p
diff -r firefox/os  Android/os
main difference?
 
1:59 AM
@Telkitty猫咪咪 tabs v. spaces
 
& which one is space :p
 
Android, obv.
 
@Telkitty猫咪咪 Yeah...
 
Can anybody explain to me exactly what Coliru is?
 
2:03 AM
Coliru is your friend.
 
I just thought of something.
A class isn't friends with itself, right?
Or.. is it?
 
@Pawnguy7 Are you friends with yourself? ;)
 
@Pawnguy7 It can check it's own privates, what kind of friendship do you think that takes?
 
The definition of A is friend of B, IIRC, is that A is allowed to have access to private members of class B. Therefore yes, theoretically a class is friend with itself.
 
Um.
I was thinking in the context of the assignment operator.
 
2:07 AM
Yes, a class always have private access to other objects of the same class.
as in A& A::operator=(const A&)
 
I got some sweet sweet free rep in the last 10 min. FGITW ^.^
 
Ok. That makes most sense.
 
I realized the variable name was not width, but rather size.x;
 
Yeah. Fuck.
 
2:10 AM
@Pawnguy7 A's own name is visible inside its definition, but the word they normally use for that is that it's "injected", not "friend".
 
Ah.
 
@Pawnguy7 a class is always a friend with itself - because it can access all the private variables itself has - the way you are friend with yourself, you tell yourself everything (includes private issues) :p
 
@MarkGarcia I can't remember last time I came close to rep cap
 
@Borgleader With mine that close... :(
 
Is extra rep carried over?
 
2:12 AM
no. you lose whatever points you gain after rep cap
 
@Borgleader I had 198 one day. Worst part is that I'd already lost points to the rep cap, but at the very last minute, got a downvote, and (at least at that time) they didn't let the rep I'd already lost to the cap that day make up for the downvote.
 
o.O Damn
 
At least I'm 97.5% efficient on that one.
 
Me being fucking usless for months xD
 
ikr
 
2:20 AM
@Borgleader I dunno -- my rep score is generally inverse to how much I accomplish any given day. When I'm working hard, I don't have much chance to answer questions.
 
Same here
I have hardly coded anything today
 
Going to sleep lads, cya later
 
I am confused.
How do you have the assignment operator take a const, but access the private members?
 
@Pawnguy7 What is the type of the rhs in the assignment operator?
 
@Pawnguy7 Because it's part of the class interface. It's still a member function, remember.
 
2:28 AM
@RanjuV sorry, rhs?
 
right hand side, for example -> a * b (b is rhs)
 
Ah.
Same type as what it is a member function of?
 
@Pawnguy7 "right hand side". Scott Meyers is the culprit for the popularity of that term.
 
Error 2 error C3490: 'grid' cannot be modified because it is being accessed through a const object
^ that
 
Ok, if its the same type then you should be able to access private members.
 
2:31 AM
I can.
Just not due to the const.
 
@Pawnguy7 You do not modify the source object when copying, it is your own(this) object you're modifying.
 
Oh. Right. Not sure what I was doing there.
 
Right, and that's correct no? If its const then you shouldn't be trying to modify the source object.
 
I really wonder what I am doing sometimes...
I think something and type something else altogether.
 
Unless you're creating move constructors and operators where you modify the source object.
 
2:35 AM
It was sort of like that.
It compiles!
Aw.
Segfault :\
 
@RanjuV You can actually use T& and not const T& as the parameter type of a copy constructor or operator, but I still haven't found any useful uses for that.
 
@MarkGarcia You can, but you don't want to. A temporary can't bind to a non-const reference, so it won't work with a temporary as the source.
 
Yes. And the natural and logical semantics of copying never modifies the source object.
 
Good thing it isn't a temporary :D
 
@MarkGarcia True. But it'd be fun though if you wanted to drive somebody a little nuts. a = b ends up modifying b!
 
2:43 AM
@RanjuV std::auto_ptr? :D
 
My simplest answers seem to get the most votes xD
6
A: What does it mean to subtract from a type?

BorgleaderThis is -1 cast as an int, not a substraction. As Jerry Coffin nicely pointed out, the cast is pointless (no pun intended) because that litteral is of type int anyway.

 
return 10; //magic number. Oh yes.
 
@Borgleader Often the case. Quick often beats thorough (not that this isn't thorough, or anything like that).
 
That's what she said?
(Sorry I'm tired)
 
@Borgleader We'll let you by this time (or I will, anyway...)
 
2:48 AM
Welp.
The code doesn't work as it should.
But it didn't also catastrophically fail as I expected after the refactor.
 
Hm.
Can someone paste some poop and bananas here?
 
3:04 AM
💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌💩🍌‌​💩🍌
 
3:26 AM
Thanks. <3
 
3:53 AM
this is the most friendly time in the lounge nowadays: because Jerry Mark & PhD's presence ... sometimes scotts
 
@Telkitty猫咪咪 lol. You think the others are not that friendly?
 
Robot's pretty friendly. <3
 
you know the lounge is known as the 'toughest' room on SO chats right :p
@ThePhD I am talking about the time of the day
not about any person
 
True, I guess.
 
The toughest if don't tread well. :)
 
3:55 AM
But it's in the Berliner's time, I guess.
They're German -- just look at their language, what do you expect?
 
The language's beautiful.
 
Yeah, beautiful like a perfectly thrown Axe.
 
4:06 AM
@Telkitty猫咪咪 You're lucky you said that -- I would not put up with the implication that I might be friendly!
 
Hot diggity, 175/200 rep o.O
awwww yissssss, today was a good day
 
@JerryCoffin lol you are more newb friendly than any of the other regulars in this lounge, even more so than mark & phd :p
@Borgleader lol
 
@Borgleader Conga rats.
 
but he is not a newb :'(
 
@Telkitty猫咪咪 I'm sometimes rude. :p
@Borgleader Go for it!
 
4:11 AM
@JerryCoffin I'm laughing hysterically right now, I did not see that coming.
 
4:49 AM
I can't remember, does the +15 from accepted answer count towards rep cap or not?
 
Damnt
I need std::begin() and std::end() on regular arrays. =[
 
@Borgleader No. Accepts and bounties are immune to rep cap.
@ThePhD That's one of their advantages -- they work on regular arrays.
 
@JerryCoffin But apparently isn't implemented in MSVC. =[
I'll just fill it in myself.
 
@ThePhD Or use boost's, I think.
 
No, I'll just plop it in the std:: namespace.
 
4:55 AM
:p
Wow. You really have mastered the art of UB!
 
@ThePhD What version of VS? I just tested it with the VS 2013 Preview and it worked fine.
 
@JerryCoffin 2012. :3c
 
@ThePhD Just checked. Works fine with 2012 also.
 
can you open multiple windows in eclipse the way you can in VS, does anyone know?
 
@JerryCoffin With a char array like auto meow = "Arf arf arf!"; ?
 
5:00 AM
@ThePhD The problem is that you're defining meow as a pointer to char instead of an array of char. Use char meow[] = ... and it'll be fine.
 
auto resolves to a pointer?
 
@ThePhD When initialized from a pointer, yes.
 
Ah, it does resolve to a pointer. =[
How lame is that. It should resolve to the exact type. =/
 
@ThePhD auto does what template argument deduction would do.
@JerryCoffin "Arf arf arf!" is not a pointer, though.
@JerryCoffin Just out of curiosity, would auto meow[] work? :)
9
Q: auto with string literals

FredOverflow#include <iostream> #include <typeinfo> int main() { const char a[] = "hello world"; const char * p = "hello world"; auto x = "hello world"; if (typeid(x) == typeid(a)) std::cout << "It's an array!\n"; else if (typeid(x) == typeid(p)) std::cout << "It's a po...

 
@FredOverflow I've never tried it, but I don't think so.
@FredOverflow No, but unless you define a reference, it decays to one.
 
Just because girlfriends decay to wifes doesn't mean a girlfriend is a wife.
3
 
I like that theory: dates decay to boyfriends who decay to husbands
couldn't but asking, how long is the half life?
 
5:34 AM
It's very random.
 
Actually, doing a quick test, this is something VC++ (even in the 2013 Preview) still gets wrong (I think). g++ shows char [] for the first item, but VC++ 2013P shows char const * for all 4 items.
 
@FredOverflow I tried it, it exploded.
std::decay<fuck_buddy>::type = /* ???? */;
 
5:59 AM
I don't really understand this. Constness is captured implicitly only in the first case.
 
@StackedCrooked A temporary can only bind to a const reference, but it's not actually a const object, so const-ness won't be deduced for it. Strange and arguably stupid, but that's how it is.
 
@StackedCrooked I think it's because an r-value is not const. Though it can be passed to a parameter accepting a const T&, the r-value itself is not const.
 
Oh I see.
 
So no constness is deduced.
 
That's a hackish rule.
 
6:03 AM
It's not the formal explanation but that's what I find the most logical one.
 
If rvalues were const, move semantics wouldn't work.
 
int&& i = int(); // what is the lifetime of i?
 
The end of that expression.
 
No, the end of the scope.
 
Oh.
Or until it gets used?
 
6:06 AM
@StackedCrooked Extended with the lifetime of i, I think.
 
So, && extends the lifetime like const&?
 
Robot said that.
 
@StackedCrooked yes
 
Why are you asking?
 
6:08 AM
@StackedCrooked One difference is that you can modify it (the && one).
 
@FredOverflow I saw Widget&& widget = Widget(); in a slide by Scott Meyers.
And that made me wonder.
 
Why does Scott Meyers use Widgets all the time? :)
 
@FredOverflow Because he likes a word that rhymes with it, but doesn't want to be accused of bias against little people?
 
You have to use something I guess.
 
@Telkitty猫咪咪 hey hiii
 
6:12 AM
widget |ˈwɪdʒɪt| noun informal
a small gadget or mechanical device.
• (in some beer cans) a plastic device which introduces nitrogen into the beer, giving it a creamy head.
• Computing an application, or a component of an interface, that enables a user to perform a function or access a service.
ORIGIN 1930s: perhaps an alteration of gadget.
 
hows your knees condition ..???
 
struct Midget { short s; };
struct Giant { long long x; }
 
Use short instead of bool :)
 
@StackedCrooked good idea :)
 
midgikai means short in Japanese.
Coincidence? I think not.
Actually that was a joke.
It's probably coincidence.
 
6:20 AM
@StackedCrooked good but i didn't understand :)
 
mijikai sounds like midget
 
yup
 
so now you understand :D
 
excellent :P
today is a good day
 
6:23 AM
joke was excellent :)
where you from ??
 
Gent, Belgium.
 
@NipunGogia We're all so relieved you approve. :-)
 
I was breaking a sweat for a second.
 
Ell
I'm hot
 
6:26 AM
@JerryCoffin i didn't understand ?? approve regarding ??
 
@Ell Nice to hear, but you don't really need to brag about it -- especially to a fat old fart like me that nobody's thought of as "hot" in years (if they ever did).
 
@NipunGogia you suck at understanding :P
 
@NipunGogia Your "ok" could be read as saying it's okay that he's from Gent.
 
ya this is what i mean ... it just okay
:)
 
I'm a mere Belgian after all :(
 
Ell
6:29 AM
@jerry heh I'm sure you're still Hot to some :L ;)
 
@Ell I s'pose anything's possible. Some seem more likely than others though.
 
@JerryCoffin I heard women are attracted to older men.
 
@StackedCrooked I'm sure some are -- but they probably want them to be mature, not ancient children like me. :-)
I've certainly heard of women being attracted to mature gentlemen, but I can't quite imagine anybody applying either "mature" or "gentleman" to me.
 
@NipunGogia hello
 

« first day (992 days earlier)      last day (3950 days later) »