« first day (330 days earlier)      last day (4620 days later) » 

5:08 PM
a = ++a is undefined behavior?
 
yes, in C++98
 
but prefix operator has higher precedence than assignment , so why it is undefined ?
 
no sequence point
 
@AlfPSteinbach : yes if you think with sequence point its undefined , but think via my perspective?
 
.
this is purportedly a "bacon burger with LOTS of cheese":
 
5:11 PM
prefix operator has higher precedence than assignment , so ++a then assign the value back to a which no-op
 
@MrAnubis the Holy Standard is all you have. what it says is the FINAL WORD. on everything.
 
0_o
 
but if you're asking "why", then the first thing to focus on is "undefined behavior" as opposed to just "unspecified behavior"
 
hey guys.. @RMartinhoFernandes can I talk to you in the room? I just wanna ask a quick question
thanks
@AlfPSteinbach there is a difference between the two?
:S
 
with the latter there would be some definite behavior that the implementation would have to document
 
5:14 PM
don't really understand..
 
@LewsTherin Unspecified behaviour means 'the program is not incorrect, but not all results or outcomes are guaranteed to be the same across all implementation'. UB means the program is incorrect.
 
@LucDanton thanks
 
@AlfPSteinbach I don't think unspecified has to be documented at all. Do you mean in practicality?
 
Oh yes I see
 
@LucDanton it's the standard's requirement
 
5:16 PM
@AlfPSteinbach : so mine is Unspecified behaviour, right?
 
@AlfPSteinbach I thought that was suggested/hinted/recommended but not mandated, and that 'implementation specified' was the one for documented stuff.
 
@LucDanton sorry, yor're right, it doesn't have to be documented
 
From a correctness point of view they're equivalent AFAICT.
 
@LucDanton : can you full form your abbreviation ?
 
no. for unspecified behavior "The range of possible
behaviors is usually delineated by this International Standard"
that is non-normative text but it captures the essence
 
5:19 PM
hmm
 
@MrAnubis 'as far as I can tell'.
 
aah
so it is not UB -> a = ++a ?
prefix operator has higher precedence than assignment , so ++a then assign the value back to a which no-op
 
@MrAnubis It has always been UB.
Precedence is irrelevant because it only happens at the syntax level.
What matters is semantics; the semantics of your expression are broken in C++.
 
aah
got it , thanks
 
@MrAnubis we were at the point of discussing the difference between Undefined and Unspecified behavior. "UB" refers to the former.
The most important consequence of this being UB rather than merely unspecified, is that anything can happen.
Like, a crash.
 
5:21 PM
@AlfPSteinbach Thanks sir
have already read prasoon's article on UB but precedence was confusing me
 
UB permits absolutely anything or nothing to happen. The usual example in the old days was that it could case Nasal Daemons to start flying out of your nose.
However, for you particular UB I suspect that it was merely a matter of convenience for the committee, that it was labeled UB and not unspecified behavior.
 
Woohoo! I managed to build the barebones of my TCP server-client section of the IM stuff
 
Also UB affects the whole program. As soon as a program exhibits UB, you can't reason on it in terms of C++. Whereas unspecified behaviour is restricted to e.g. the result of an expression. (I say 'also' but really I'm rephrasing what Alf said :)
 
and I've got a system ready for every other part
 
In fact, the examples in C++98 and C++03 state that it's "unspecified behavior", which is wrong, but I think it reflects the thinking at the time: it smelled like unspecified, but in order to label it unspecified, the range of possible valid behavior would have to be specified
what you can do to understand it is to translate by hand to machine code
then you see that the leeway that is granted to the compiler allows results that are not what you'd expect based on operator precedence
there are lots of people on google+, but I see very little traffic (except spam-like postings)
 
5:38 PM
 
is that tasty?
 
@AlfPSteinbach While you post pictures of food, that doesn't mean everyone else also does!
 
People eat weird things
 
@LewsTherin Hmm...does that mean most (all?) programmers are in danger of being eaten?
 
@JerryCoffin....holds chin thoughtfully...we are weird...so I can conclude we are in serious peril :(
some of us anyways
guys I am using clock() to get the number of milliseconds elapsed
but I am getting units of 100..on subtraction end-start
if i divide by 1000 frame rate would be too slow
is it ok if i divide by 10?
it moves better though
@FredOverflow hi
 
5:55 PM
What did I miss?
 
random shit
 
I am trying to calculate the elapsed time after draw and update in a loop
the thing is I don't know which is better to use, GetTickCount() or Clock()
 
please be accurate: do you mean Clock or clock
 
clock()
clock_t
 
oh. then, in Windows, GetTickCount has millisecond resolution or therabouts (I think it's 2 msec), while clock has about 1/17th sec or thereabouts, as I recall.
check TICKS_PER_SEC or whatever it's called
 
6:01 PM
I hear timeGetTime is pretty accurate.
 
of course, it might be that it lies, Microsoft has a history of doing that (for no reason at all, it's like they have hired some programmers who are pathological liars)
 
wait?? wut?
 
oh, i checked the docs, and MS states that GetTickCount resolution is typically 10 to 16 msecs
 
ok thanks
what does it mean resolution?
As in time difference?
or lapse?
when I subtract end-start I always get 0 when I use GetTickCount...my pc must be fast lol
and I don't think it is
 
@AlfPSteinbach more than enough for a game, right?
 
6:06 PM
Ok I managed to control speed of bullets and player movement
Now I want to add light effects...like some sort of I dunno "glow"
but I don't understand this blending stuff
 
What have you read so far?
 
the source and destination colors would be combined
somehow mixed to create a new color
but i think that is blending
maybe not what I want
did I just kill the mood or something? :(
 
hi
 
hey
something like this:
http://forums.create.msdn.com/forums/p/78078/473765.aspx
look at the pipes..but I want maybe the glow moving up and down
i would figure the logic for that one..but I want to know how the glow works :(
 
6:25 PM
hi
 
WIMP - Windows, Icons, Mouse and ... P?
 
@AlfPSteinbach Windows, Icons, Menus, and Pointing Device
 
cpx
What is the relation between GUI and WIMP?
 
All WIMPs are GUIs but not all GUIs are WIMPs
 
6:37 PM
all wimps are gooeys
 
cpx
hm
For example?
 
Window is a GUI element, so is an Icon, and a Menu, and a Pointing Device (I guess the arrow on the screen) is also GUI
so WIMP is subset of GUI
 
6:51 PM
hello all
 
hi
 
Sometimes life is hard to live that it's like suicide is only option left
 
7:06 PM
wtf?
 
yes the same word is in my life right now
 
euh, are you ok?
 
i feel like so crying that i can't explain
but due to my family , i am unable to even suicide
 
suicide doesn't solve anything, it's an escape, and you leave a lot of people with a lot of pain
 
i just wanted to speak to someone , so that i can get rid of the big pain in my heart
 
7:11 PM
what's going on?
relationship issues?
body problems?
 
my brother is with a girl , and he keeps fighting to us only due to that girl , i can't see my parents like that
 
fighting in what way?
 
i don't talk to anyone about this , but today i am so feeling to suicide
not physically but its argue and my father takes tension about all this
 
so why are you posting this here?
 
just wanted to speak to anyone , don't have any friends
 
7:14 PM
you need to talk to someone, so they can help you resolve your issues
don't sit on it, talk about it
 
i am talking to you, do you have any resolution to my problem
 
I don't really know what your problem is, you just told me your brother is fighting your parents over a gf
 
don't let it get to you. People fight, then they get over it. People fall in love, then they break up.
 
but how is that affecting you, to get so depressed?
sometimes you need to let go, as @jalf said
 
If you're going to commit suicide every time two people in your family have a fight, you're not going to have time for anything else
 
7:17 PM
can you see your parents upset?
taking too much tension
 
@MrAnubis Of course. It happens from time to time
 
it happens, you can talk to them
 
If you have never seen your parents be upset before ,then you have led an extremely sheltered life
 
but suicide isn't gonna make them less upset, on the contrary, that will make it much worse
 
and it only means that they've so far hidden it from you when they've been upset. It certainly doesn't mean that their lives have been happy and idyllic so far
Everyone are upset about things from time to time
 
7:18 PM
yup
even a Lion is upset sometimes :P
 
Seriously, I hate to tell you this, but if you're talking about suicide because your dad had an argument with someone, that makes you the universe's biggest drama queen.
If you want your dad to feel better, talk to him
Don't try to make it about you
 
truly speaking i'm 22 and i never saw my parent that much upset , they keep taking the tension about this issue , up in late night to 1 am ,
i tried to speak to them but they persistently taking the tension
 
@MrAnubis And? Is it worth it for anyone to die over that?
 
upset is part of life, it's gonna happen, you just have to talk and resolve the issue using your communication skills
 
what do you mean by "taking the tension", btw? You keep saying it
It's not an english phrase I've ever heard before
 
7:21 PM
mind tension , I swear to you i wouldn't have been chatting here , if wouldn't be worried about my family , i'd have already did it
 
ooh, just talk to your parents
 
woah whats going on
 
@MrAnubis And again, how would that help anyone? Do you think your parents would feel any better if they're fighting with one son, and the other one kills himself?
 
a little request for help
 
A friend of mine used to say, when I had a hard time: "man up and grow some balls"
 
7:23 PM
i think more points of view and insights required here:
3
A: Why isn't my assignment operator getting called?

Alf P. Steinbachmybase::operator= is hidden by the automatically generated copy assignment operator myderived::operator=. You can use a using declaration to make the base class operator visible in the derived class. EDIT: added example per request: template<typename This> struct mybase { This& o...

 
don't kill yourself man
 
sorry, I'm not geek enough yet to be able to give more info
 
Sit down, take a deep breath, and look at this realistically. Two grown-up people disagree over something. So f'ing what? What's the worst it can lead to? Are they going to kill each others over it? Probably not. Are they going to never ever talk to each others again? That's pretty damn unlikely as well. You can be 99.9% sure that one of two things will happen: either your brother breaks up with the girl, or your father and brother end their argument.
 
user457812
In addition to what @jalf said, I doubt it's your problem.
 
If you don't want to see them fight, then close your eyes. That's fair, they're the ones fighting, not you, you don't have to be involved, unless you 1) want to, and 2) can help
if you can't help them, then leave them alone and go live your own life
even just talking about suicide is just going to make both of them more upset.
 
7:26 PM
yep, sound advice
 
Do you want them to calm down, or do you just want to focus the drama on you?
 
who are we talking about?
 
user457812
If you can't do anything about it and the argument is bothering you, just go take a walk and chill out.
 
Suicides in the family rarely makes people calm down, but it's a damn good way to make them upset about you instead of each others. If your goal is just to be a drama queen, that's the way to do it. But otherwise, it's about the dumbest thing you can do, for yourself and for your family
 
it's true
 
7:27 PM
@alf - What you said seems to make sense
 
yeah, attacking the guy talking about suicide is a gerat idea
great*
 
@mr anubis: it sounds like you care deeply about something, otherwise wouldn't be so sad. when u care deeply, that's reason to be alive. :-)
 
@StephenGranet I'm not attacking anyone, I'm saying that suicide won't help his family, and there are easier ways to protect himself from their fight
 
ah, apologies then, i misunderstood
 
If you want to help your family, stay alive. If you want to avoid their fight, stay alive and go somewhere else where you don't have to listen to them
 
7:28 PM
@StephenGranet Trying to tell him that suicide isn't going to resolve his parents issues
 
i dont know who it is, but know this. you feel like crap now, and you might feel like crap tomorrow, but it wont always be like that, you will have good days. you need to hold on in the hopes that the good days will outweigh the bad days
 
i think, if one can hold one's breath until one dies, then one has proven that one really desires an end to it all, and one is then free to commit suicide. :-)
 
@MrAnubis go do something you enjoy, so you can take your mind of things.
@AlfPSteinbach holding one's breath until one dies, sounds horrendously painful
 
uh oh i discovered fatal flaw in my argument
 
once you're dead, it's hard to go commit suicide
 
7:31 PM
yes, that was logical error in argument
 
i can't take my mind off from my family's pain , i love them more than life
 
Well, you can always rollback.
I could use a VCS for life.
 
@MrAnubis do you mean that?
 
yes
 
user457812
@MrAnubis That's an odd point of view to me, but I suppose it's good that you care about them. Either way, your family isn't going away over a silly little argument.
 
7:32 PM
@MrAnubis introverting on the problem is definitely not going to help you, you have to either take action and talk to them, or go to a place where the arguments don't distract you, so you can do things you enjoy. Like writing code for example :)
 
@MrAnubis then think about what you're saying. Because what you are saying is "I don't care if my family gets upset, as long as I get to end my life". In other words, suicide means "my life is more important than my family's feelings"
If you think your family is more important, then do what makes them happiest. And that is staying alive
 
@CatPlusPlus now that would be cool
 
killing yourself is the biggest "screw you" you can possibly send to your family. Is that what you want for them?
 
no its not
 
no
 
7:34 PM
then don't do it :)
 
Good lord, why is it so serious in here.
 
in other news, I really really hate IE
 
Who doesn't?
 
i am feeling better , thank you all, let me go out of home for walk , i just hoping tomorrow i don't see fight in home
 
user457812
Old people.
 
7:36 PM
I've been away for ~2 days and you broke the room!
3
 
Hi guys I have a math problem ... I can't figure it out :(
 
Good it's not a meth problem.
2
 
@MrAnubis yeah, that's the best you can do.
 
user457812
Still working on that?
 
They can't keep fighting forever. Remember that :)
 
7:36 PM
@CatPlusPlusha ha
em... I am trying to make the shooting work
 
but...?
 
My stomach is disagreeing with my choice of food today.
 
It is working, but the point at which the bullet comes out is wrong
 
It's easy. You pull the trigger and it goes bang!
 
7:37 PM
Is half of ice cream pack really that bad for a breakfast?
 
@RMartinhoFernandes at this stage I might just do that :(
Hi btw
 
i drank a beer for breakfast, i think ice cream is alright ;)
 
Well, the thing is that if I rotate the cannon
 
@CatPlusPlus no!
 
I am still at the same position
 
7:38 PM
Good, I think I'll eat some more.
Just because why not.
 
what I need to figure out is the position of the cannon .. I can get the direction vector ..but no idea how to figure the position from there
 
user457812
Isn't the position just wherever the player thingy is?
 
What do you mean? How can you not know where the cannon is?
 
The tip of the cannon
or the mouth
 
Encode the firing point into the thingy.
Rotate it along with the cannon if you do that.
 
7:40 PM
Just add the length of the thing to the center, along the desired direction.
 
And load it with potaaaatoes.
 
tip = center + length * direction;
Assuming the direction is a unit vector.
 
mmn
OK, I will try that...not sure though
 
TortoiseHg is refusing to push stuff for some stupid reason.
 
of course..so direction is the scalar
wait should it not be center + direction * length ?? Can you explain your formula
 
7:43 PM
What reason?
 
@LewsTherin Multiplication is commutative.
@CatPlusPlus How can I convince it to tell me?
 
It should be in the log.
If there weren't any dialogs.
 
Ah, creating new branches.
I guess I'll have to use good ole command-line for that.
Let's see if I can manage to paste my password into the stupid Windows console host.
 
Paste is right mouse click.
 
It worked!
 
7:50 PM
Hi all
 
Woo - I have the basic communication system sorted :D I just have to separate status messages for the system from messages for the recipient
Should I have the system strings start with
SYS:
and messages
MSG:
 
shed bicycle colour
 
But what is the most efficient of separation?
 
blue!
 
What?
The SYS strings shouldn't be displayed
 
7:53 PM
@sbi - Have you listened to the Aqua songs?
 
Dang, it didn't work
I know where the canon is looking..but I can't figure out the position of the tip
the formula didn't work :(
 
what in the poop?
@CatPlusPlus did you see you have an imitator on SO?
Tom, San Francisco, CA
1.1k 5 18
 
@RMartinhoFernandes it didn't work
was way of course...
 
Haha just looked at an old programming notebook I had
There are things like
"Null reference exception @ line 226" < like 4 of them with various line numbers
I ended up scrapping that whole program because of bad interface design
 
8:13 PM
 
single sane
 
lmao wow
that describes my life
im definitely attractive and single, and absolutely insane ;)
 
lol :P
@StephenGranet this is bout women though?
 
I misunderstood the title too
 
shit
i should have read the title lol
 
8:16 PM
@KianMayne if the boyfriend is like hulk hogan you are screwed
 
attractive single
who gives a f if she is sane? you are just dating her
 
Anyone knows how to copy rich text from gedit into open office? I'm trying to retain the syntax highlighting
 
but more on topic: can something like this = newObject can be done in c++?
 
it can't
and why would you ever want to?
 
its complicated to explain
 
8:21 PM
I'm a genius
2
 
user457812
The puppy is an expert.
 
and anyone with a lot of C++ experience is probably more than capable of dealing with it
 
ok here it goes
 
why can't it be done? you are changing the this pointer to point to something else
at most seg error
 
@nil Luckily for us, he's fairly humble about his expertise, and never claims so openly to be an expert :P
 
8:24 PM
ahh nm, i am just going to
 
@LewsTherin the this pointer is const so trying to reassign is UB
 
@LewsTherin Because, one, this is const. Two, it makes no sense whatsoever. You can't change the memory location of an object.
 
oh it is a const
 
do the inefficient solution
 
this isn't exactly const. It's just not even a variable. It's a keyword which evaluates to an rvalue expression.
 
cpx
8:26 PM
does the const here similar to the keyword const?
 
Think of it more like a nullary operator.
 
more importantly
why would you even want to? in a member function you can change all the data members however you like
so it's not like not being able to assign to this is suddenly crippling what you can do
 
@DeadMG not sure what you're discussing, but the this pointer itself isn't const. it's just an rvalue.
 
You can also call a member function on another object to "change this", or set your own pointer to equal this and then maybe change it later.
The language just won't allow you to entirely forget which object was used in the member call syntax.
 
@AlfPSteinbach Really? I swear, it was T* const
 
8:30 PM
@JavierIEH in early C++ you could assign this = 0 in order to communicate construction failure to the calling code. it is not supported in standard C++.
 
5 mins ago, by Potatoswatter
Think of it more like a nullary operator.
 
Isn't this only const inside a const function?
or maybe you call it method in C++ , I don't know
 
@AlfPSteinbach ...and something like this = some_allocator(size) to get roughly the equivalent of overloading new for the class (with assignment of a null pointer on failure as an almost accidental side-effect).
 
N3290 "§9.3.2/1 In the body of a non-static (9.3) member function, the keyword this is a prvalue expression whose value is the address of the object for which the function is called. The type of this in a member function of a class X is X*. If the member function is declared const, the type of this is const X*, if the member function is declared volatile, the type of this is volatile X*, and if the member function is declared const volatile, the type of this is const volatile X*.
 
@ManofOneWay In a const member function, its type is (roughly) T const *const this;. In a non-const member function, it's (again, roughly) T *const this;
In other words, you can't assign to this, regardless of the constness of the member function. In a const member function, you also can't assign to anything that this points at.
 
8:38 PM
Except it's not const, it's an rvalue. decltype( this ) x; yields a pointer which can be changed to nullptr. foo *const p; decltype( p ) x; is illegal because you must initialize a const.
 
@Potatoswatter Right -- thus the "roughly", in both cases.
 
Excuse me for asking, but what is a rvalue?
 
this is more like a macro which expands to the expression (&current_object) where current_object is the reference we really should have in the first place.
@ManofOneWay An rvalue is a value whose address cannot be taken, like 42 or &current_object — the result of taking an address with the unary & operator cannot be fed to unary & again.
 
Can you create anonymous functions in C++? And if so, they should also be rvalues?
 
Now, you cannot take the address of an lvalue ref, so are they then rvalues too? Or is that a special case?
 
8:45 PM
@ManofOneWay You can use constructor-call notation or lambda functions, which both result in rvalues.
However, if you assign such a thing to a name, then it's address can be taken. All named objects have addresses in C++.
 
Yes, that sounds logical
 
MyClass& mc = myclass; you can't do MyClass * p = &mc, so what is mc then an Rvalue?
 
@TonyTheLion Sure you can. Why not?
 
@Potatoswatter oh, I thought I heard someone once say that you can't, but maybe they were wrong
 
@TonyTheLion That takes the address of the referred object.
 
cpx
8:48 PM
an rvalue is an expression that appears on the right hand side.
 
If you swap things around and try to perform & mc = p, then it doesn't work because & mc is an rvalue.
 
@cpx Not quite correct.
 
cpx
but cannot on the left hand side.
 
No, it's no longer about right or left hand side.
 
cpx
C++11?
 
8:49 PM
I'm not sure about C++03 either.
 
@Potatoswatter it's more like "all objects have addresses". if it has address then it's object, and vice versa. but all named values don't have addresses; to wit, enum{ blah = 666 };.
 
cpx
I have read that statement from C++ Primer book :/
 
The terminology "lvalue" goes back to C89, right? Then C++ invented "rvalue" to fill the gap.
 
an "object" is by definition a "region of storage" (with a type).
 
@Potatoswatter not sure I follow what & mc means in this case?
 
8:51 PM
@TonyTheLion The address of the object that mc is a reference to.
 
the problem for formal discussions is that a C++ standard's "region" is not necessarily contiguous
 
@AlfPSteinbach blah isn't an object, then, right?
 
@RMartinhoFernandes so assigning p to that address won't work then?
 
it's just a named value
 
8:52 PM
@TonyTheLion No, because that address is an rvalue.
 
I realize my logic was circular, but all objects have a storage location, by definition, so their names evaluate to lvalues.
 
@RMartinhoFernandes oh ok
 
Ah bloody hell...I always looked forward to September..but seriously part of me wish I did have some friends...looks like there'll be nothing good on TV any longer
from bad to worse!
 
Phew, for a moment there it seemed I could not find something I know someone said in this room.
 
8:56 PM
don't worry, potatowatter is my only friend, he just doesn't know it ;)
 
Who saw falling skies? That show is a disgrace to anything called sci fi
 
not me
 
I rarely watch science fiction.
 
i like sci fi
 
What! Why not? Fantasy then?
 
8:57 PM
Me too, I just don't watch it.
 
so why is a dynamic_cast called dynamic? Is that because it can only be done on polymorphic types?
 
Blimey Martinho!
you need to
 
Because most of the science fiction that is watched, I don't like.
 
@TonyTheLion yeah I think so
but the cast is safer
@RMartinhoFernandes like?
 
8:59 PM
@LewsTherin Well, so far, on TV I think I only really enjoyed Babylon 5.
 
now, and up cast can be done statically, why is that safe to do statically, whereas a down cast, isn't?
is that because of slicing?
 

« first day (330 days earlier)      last day (4620 days later) »