« first day (573 days earlier)      last day (4360 days later) » 

9:00 AM
huh, well I never did a pure CS course. It was more practical then theoretical
 
-1
Q: can anyone explain this behaviour

johnI am getting confused in the below part of code. It give "equal" as an output, but when iam changing abcd to abcR like if("abcd" == "abcdR") o/p is coming as "not equal". Pls explain the comparisons here. #include<stdio.h> int main() { if ("abcd" == "abcd") printf...

Close votes (NARQ, not dupe) please.
 
@RMartinhoFernandes in our code
 
He expects "abcd" == "abcdR" to be true?
 
@jalf Ow, that's the worst kind of singleton.
 
@RMartinhoFernandes I think he's expecting the program to "say" what's correct.
 
9:02 AM
-1
A: can anyone explain this behaviour

VJovicYou are invoking an undefined behavior, since you are comparing string literals. Therefore the output is unspecified.

lol
 
Is it really UB?
 
@RMartinhoFernandes Actually, I don't know what the hell he's thinking.. close it.
 
Unspecified?
 
It's completely defined.
 
9:03 AM
To always be true?
 
if it wasn't because I had to fix a bug here and now, the list of hacks and workarounds already in place to ensure that all the singletons usually manage to terminate mostly correctly, would be hilarious
 
@Pubby "abcd" == "abcd" is always true and "abcd" == "abcdR" is always false.
 
@thecoshman cs light reading "Data structures and Algorithims in c++ 2nd ed - Michael T. Goodrich, Roberto Tamassia, David Mount" .. give it a go..
 
@RMartinhoFernandes UB to compare constants string literals? sounds very odd oh, it's a funny
 
The compiler can't optimize abcd to use the same memory as abcdR? :(
 
9:04 AM
@RMartinhoFernandes sure about that?
Pretty sure the second part isn't guaranteed to be false, and not too sure about the first part either
 
@Pubby No, because they don't have the same contents (hint: there are 0s at the end)
@jalf How can the second not be false?
 
Oh, I forgot the \0
 
I can understand asking for a quote for the first, but the second should be self-evident.
 
Why does it have warning then?
> comparison with string literal results in unspecified behaviour
 
@RMartinhoFernandes I'm interested in the first.
 
9:06 AM
hmm yeah, I might be mixing things up for the second part
the first part is unspecified, I think
 
I'm checking.
 
no guarantee that the compiler will merge together all references to "abcd"
 
-1
Q: Parse .h header files into c# data structures in runtime

drzoidbergI'm trying to write a C# library to manipulate my C/C++ header files.. I want to be able to read and parse the headers file and manipulate function prototypes and data structures in C#. I'm trying to avoid writing a C Parser, due to all code brances caused by #ifdefs and stuff like that. I've tr...

:))
 
Ah, implementation defined (§2.14.5p12).
 
I think we should make a compiler which says "abcd" == "abcdR". Who's with me?
 
9:08 AM
And all implementations do it!
whistles
 
in any case, it's certainly not undefined as that guy said :)
 
"I'm trying to write a C# library to manipulate my C/C++ header files".. Where do these people come from anyway?
 
mawnin
 
My implementation tells me to hit @RMartinhoFernandes with a hammer
 
because he's a nail?
 
9:09 AM
@Neil i can guess what the guys trying to do, he wants to do something simmilar to what the MFC does
 
nailed it!
 
as for the second one, I got myself confused. Was thinking about cases like`"bcd" == "abcd"+1`, which should be legal afaik
 
@Neil i mean it CAN be done ... but god would it just suck
 
@johnathon You mean, macros? Macros do something very different than what he's trying to do though.
 
@TonyTheLion It's a golden hammer so of course he's a nail
 
9:10 AM
lol
 
@Neil nah, the mfc not only adds the macros but also the function deceleration and implementation
 
@jalf Yeah, I commented on that.
 
what's with the Java praise?
this is VERY wrong!
 
@Neil what he's really a fail at, is the fact vs comes with a function wizard and a class wizard
@TonyTheLion LOL
 
@johnathon facepalm There's got to be a better way to do that...
@TonyTheLion We've been discovered Javalings! Hide!
 
9:12 AM
@Neil two letters, Qt
 
@TonyTheLion What? Where?
 
After too much leftover pizza and a couple beers, I came up with the idea of making a language which uses symbols.
 
18 mins ago, by ereOn
Anyway, I don't see why we argue here: we all agree on what matters: "Java is a better language than C++ in all regards."
here!
17 mins ago, by R. Martinho Fernandes
room topic changed to Lounge<C++>: Java is a better language than C++ in all regards. [c++] [c++11] [c++-faq]
and here
 
9:14 AM
dafuq?
 
Like LaTeX or something, replacing text with symbols for easy readability.
Except not just for math syntax but general programming syntax as well.
 
@Neil this is the point im going to tell you to find an old commodor 128, and and find it's programming manual, and read it... Then put down the beer
 
@RMartinhoFernandes so you think you're getting away with it?!! :P
ONE DOES NOT SIMPLY PRAISE JAVA IN THE C++ ROOM WITHOUT CONSEQUENCE
 
@johnathon Not to say there isn't a wrong way to do it.
 
lmao
 
9:16 AM
@TonyTheLion Your Shift key broke.
 
ohrly?
 
I think I pavlov that too often.
 
yea, i specifically just pointed that case out
 
yes you do :P
 
@johnathon Good example of what not to do. Those are always useful. Duely noted.
 
9:18 AM
@Neil np ;)
@Neil want to see a hilarious question?
 
Woah.
Someone just downvoted my three most voted answers.
I have no idea who I pissed off.
 
dafuq?
 
@Neil ya know, one of those that are just so misguided it's completely obvious the poster has no idea what their doing , and when other's chime in in the comments agreeing with the OP
if(isp.is_monitoring() == true)
 
while( Download.Porn() ) { Download.MorePorn(); }
 
9:23 AM
{ Fbi.PayVisit(); }
 
@RMartinhoFernandes not cool
 
@RMartinhoFernandes was not i sir
 
@johnathon would the FBI really give two fuck if you downloaded pron
 
@johnathon Oh, I'm not accusing anyone, especially not anyone in the Lounge.
Wait...
8 mins ago, by Tony The Lion
@RMartinhoFernandes so you think you're getting away with it?!! :P
 
I hate anonymous downvoters, they officially suck
 
9:24 AM
@RMartinhoFernandes Whoever it was definitely knows how to avoid the script.
 
@RMartinhoFernandes I did not downvote your questions
 
@TonyTheLion Sir, with me, as a certian phone company got rather pissed about a rather large amount of sms traffic on their network that just so innocently came from my particular ips, i had that visit... so .. yea , they might care
 
why the heck would I do that?
 
@TonyTheLion I was joking, don't worry.
 
lol
@johnathon woa
 
9:25 AM
Not too many people accuse me of downvoting. lol
Since I've only downvoted 3 posts ever on SO, lol
 
which were all deleted
 
Well, some good came out of it: This one stackoverflow.com/questions/8839943/… is now at an exact 200! Awesomez.
 
I generally dislike to downvote, but I do when the answer doesn't even answer the question or something of the like.
 
@RMartinhoFernandes I wish I could upvote you again to make it not 200. :(
 
9:27 AM
Nooooes.
Someone did.
 
lol
 
and. again not i
 
@RMartinhoFernandes @KonradRudolph has an answer locked at exactly 500.
 
travelling today :)
 
3
A: C++ Generating Key Combinations WINAPI (Without MFC)

johnathonAdd an accelerator map to your project resources,Load it into your application at runtime, and in your message loop add a call to TranslateAcellerator before TranslateMessage and DispatchMessage gets a chance to take a look at it. http://msdn.microsoft.com/en-us/library/windows/desktop/ms646373...

that is just.. completely halarious
:))
look at what their trying to do
 
9:29 AM
@TonyTheLion Oooh, where to? Someplace exotic?
 
@RMartinhoFernandes USA
exotic enough for me
 
Ah.
lol, the USA exotic.
 
@johnathon You'd cry if you learned what I've been made to do...
 
@Neil if it's anything resembling that probably not, id just feel completely sad for ya
@Neil if it's anything resembling that probably so 
blah
 
9:32 AM
@johnathon In truth, it was the continuation of a bad decision I didn't make regarding "terminal hopping" using a session of as400 from within another program.
 
sighs im already cringing
 
Since it's a web application now, I've had to deal with "browser hopping"... Don't judge me! *sobs into hands*
 
@ScottW Los Angeles
 
I have a question. But I'm not sharing it. It's mine and only mine.
7
 
@ScottW it's quite nice actually
 
9:34 AM
@Neil to point man, when i left that place they closed their doors a year later, and called me up and let me have that old as400 dude. Seriously.
 
@RMartinhoFernandes lol
 
@RMartinhoFernandes I see only one question as a possible source of those downvotes:
-3
Q: can anyone explain this behaviour

john Possible Duplicate: Address comparison and string storage I am getting confused in the below part of code. It give "equal" as an output, but when iam changing abcd to abcR like if("abcd" == "abcdR") o/p is coming as "not equal". Pls explain the comparisons here in terms of storage...

 
@Neil i had ALWAYS wanted to try to migrate it to use linux :))
 
If I had to guess, it was the the OP that downvoted you.
 
@Mysticial You mean the OP?
Sigh.
 
9:35 AM
@johnathon Why in God's name why!? I'd always like to ride a horse, but I'm not going to try to domesticate a bear to try to ride one.
 
@Neil well this one was pure risc ... i dunno, weird science experiemnt
@Neil kinda like why a kid is prone to stick their finger in light socket ya know
@Neil pretty much :)))
@Neil at least with posix on it it'd be manageable :|
 
@johnathon You know what you could do with a computer like that?
 
@Neil boat anchor ?
 
@Neil Ride a bear instead!
 
@johnathon Absolutely nothing!
 
9:38 AM
@Neil boat anchor :(
 
@johnathon It'd even fail to be a boat anchor
 
@Neil i did read some post a long time ago about someone actually doing it
 
@RMartinhoFernandes Yeah, looking at his network-wide reputation graph: He had 501 rep yesterday. He got -6 on that question. And he has cast exactly 4 votes today (4 downvotes most likely). So that brings him to the current 491 rep.
 
@Neil made it 100000 times more usable ... :-??
 
@johnathon Maybe it could be a paperweight, if you don't mind ugly and overly heavy paperweights.
 
9:39 AM
I suspect that 4th downvote is on the answer.
 
@Mysticial Oh well, thanks for taking the time to track him down :)
It's not like I'm going to bother.
 
@Neil and lets not forget, Red and black sir.. red and black
 
@johnathon Maybe you could turn it into a geeky urinal or something.
 
@RMartinhoFernandes Nah, I like tracking these things. :)
But yeah, I suspect that comment + the close vote probably ticked off the OP.
 
@Neil nah, that's just to befitting
 
9:42 AM
so what part of Java are we currently bad mouthing?
 
@thecoshman The part that's bad. Um... which is the whole thing?
 
@thecoshman The name Java.. it's got too many letters in the name.. gah!
 
A bit of fairness: Java beats C++ in one aspect... drumroll... packages are better than headers.
 
@RMartinhoFernandes yeah, packages are a very nice feature
 
I've never really liked separating the header from the source
I think it's counterintuitive
 
9:45 AM
@Neil That was also my original thought. But when the implementations started to get big... say thousands of lines... That's when headers started to actually make sense.
 
well, I like the idea of having a nice clean 'this file says what the class does and this files actually does the work' but in practice it's just a pain in the arse
 
@Mysticial Headers simplify things in this way, it's true, though I think it was a poor way of doing it
C# has added regions, which are smart
I wish Java had those
 
@Neil "Poor way" That is soooo true...
 
@Mysticial lots of reasons for it, breaking compiler firewalls, separation of the consumer of a class from the implementation ect.
 
are modules going to be the c++ equivalent of packages?
 
9:47 AM
@Neil you do know, C++ has (in VC) regions neil
 
@johnathon I code in Java, johnathon!
 
@Neil I think partial classes are even better.
@thecoshman The existing proposal intends for that.
With some differences. (no runtime loading comes to mind)
 
@RMartinhoFernandes there i agree with you, c++ could benefit a ton from partial classes
 
what are partial classes?
 
@RMartinhoFernandes partial classes can be extremely confusing, but if done right, can be smart
 
9:48 AM
@thecoshman Basically, you can split a class definition across many files. That gives you freedom to organize it as you desire.
 
@thecoshman the ability to split a class definition into more than just one h and ccp
 
Though if the class is too big, you may have other problems in hand.
 
@thecoshman Two classes with the same name define pieces of the same class, so you can separate aspects
 
@RMartinhoFernandes oh my god! the though of some of these developers getting that sort of power is scary as all shit!
 
@thecoshman the part it really helps out with is tooling
 
9:50 AM
Though it's my belief that if you have to divide a class using partial classes in order to divide functionality, you're probably better off writing a separate class altogether
C# did it mainly in order to have generated classes
 
@thecoshman The primary use case though, is for code generation tools. For example, the WinForms designer generates a class for you that you can then add stuff to. Instead of having both the generated code yours all together, it puts the generated code into another file and makes the class partial.
 
so, what are modules going to do? would you still write you .h and .cpp files? or does it combine them into one file?
 
@Neil which is why the purpose of them is for generated classes
 
@RMartinhoFernandes yeah that sounds real handy
 
@johnathon You can accomplish the same thing if you're clever enough using encapsulation or inheritance
 
9:52 AM
@Neil Yea, but it's just sooooo much prettier when a tool does it for you :))
 
@thecoshman Modules would basically add a declaration to the language with the semantics of "bring the things in this header module into scope".
 
@Neil the real issues stend from the need for tooling
 
@johnathon That's what I mean. Generating the class your implemented class inherits from.
 
We use #include for that, but what #include means is actually "copy-paste this file please".
 
@RMartinhoFernandes oh right, and more then one 'thing' can be in a module
 
9:53 AM
It also has the side-effects of allowing compilers to compile faster (no need to parse the same copy-pasted code all over the place).
 
@Neil but, that introduces a vtable potentially, where partial classes could eliminate that need
 
so would the modules be sort of like a staticly linked library?
 
I worked for a while in C# which used class generation. The idea was that with a mere xml file describing fields, their types, and so on, you could create a form which does everything for you, save for complicated validation
 
he he he, robots
 
Idea was good, but in practice we were heavily heavily dependent upon the framework which often broke..
 
9:55 AM
@Neil i am unfamiliar with that system, as that's not how winforms or wpf works
 
Worse still, the framework was so complicated that it often took a while to fix it, meaning any developers (me included) dependent upon the framework had to "get around" the problem.
 
@Mysticial need your help to corroborate or dismiss a claim :)
0
Q: Why swap don't use Xor operation in C++

MikeI've learned that Xor operation can be used to implement effective swap function. like this: template<class T> void swap(T& a, T& b) { a = a^b; b = a^b; a = a^b; } But the implementation of swap all i can found on the internet is essentially like this: template<cl...

Would the XOR thingy really be faster?
 
@johnathon There was a partial class generated windows form, with a partial class generated business logic, and a partial class generated dao.
 
@RMartinhoFernandes Um... that's interesting...
 
@johnathon Needless to say, it got.. complicated.
 
9:58 AM
Hey, I have a little question..
Does C++11 move constructors help with anything when returning large standard containers from a function, by value ?
 
@Mysticial it works, but quite litterialy on integral types
@manasij7479 yes, because under the hood it uses move semantics
 
@johnathon I was commenting on how the xor-swap is faster than the assignments.
 
I find the claim dubious, but I have no data or expertise to back up my intuition.
 

« first day (573 days earlier)      last day (4360 days later) »