« first day (326 days earlier)      last day (4623 days later) » 

11:11 AM
> By the time you have explained what your application does, you will have made your PM into a programmer and you will both be 5 years older.
 
hahah. it is a rediculous request by the boss
I mean c'mon
 
I had to explain what my code does to my boss before. Difference is, my boss is a programmer, and I didn't have to explain line-by-line anything, only a rough and superficial explanation.
Explain code line-by-line to a programmer is already ridiculous by itself. Doing it for a non-programmer is...
 
0
Q: Want to teach C++ for students but I want to learn the basics first

JonnyI want to teach some students the fundamentals of C++ but I have to learn it first. I need an excellent book to start learning C++ programming. Any recommendations?

 
@TonyTheTiger had to, sorry. i have now posted my answer. should clear things up, i hope.
 
here we go again
 
11:21 AM
@TonyTheTiger he he :-)
 
@AlfPSteinbach oh thx
 
how could i think "makes available" and write "removes available"? huh.
 
I don't know, you tell us?
 
What's all that about fucking me? You ain't female. :(
 
11:31 AM
how do you know?
perhaps he really is a female and merely pretended to be a male
 
Hum, what is that rule of four ? Or five, or four and a half, or whichever it is ?
 
@DeadMG Tony met him in meatspace. He should know.
@kbok It's the rule of three plus move semantics.
 
oh, didnt know that
 
@RMartinhoFernandes I don't get it.
 
@kbok Copy ctor, copy assignment, dtor, move ctor, move assignment.
The doubt between 4, 4.5, or 5 is because you can implement both assignments with a single function.
 
11:33 AM
Oh, I see.
 
If you have a copy constructor, you don't need a move constructor; it would be an optimization but won't enable new semantics.
 
11:47 AM
0
Q: Operator Overloading in C++

TimI need to overload the * operator in c++. So I have made a class called Element which must overload this opperator to work on a double value stored within it. This is what I have done in the implementation file: #include "Element.h" #include <iostream> using namespace std; // Other code ...

Should we close this as a dupe of the FAQ?
It's not quite exact, and there's a lot to read through there to find the answer to this question.
 
This is a RTFAQ question.
 
You just ruined my pun.
 
No, I fixed it.
 
Yours is not that punny.
 
11:50 AM
You are puny.
Every time I use any other chat system, I realize how much awesome this is.
3
 
what other chat system are you using?
 
sbi
@RMartinhoFernandes But I sealed his lips, so he wouldn't reveal me. :)
 
3. Obsolete
Uh
 
@TonyTheTiger Microsoft Office Communicator.
 
my lips are sealed :)
 
11:51 AM
Not bad, except this one exists.
 
@RMartinhoFernandes didn't even know it existed
 
I use gmail sometimes, and I always want to press up to correct my typos.
 
It's what we use for internal communications.
 
sbi
@RMartinhoFernandes Oh, perhaps I was to hasty then, voting to close?
 
Pressing up does nothing.
 
11:53 AM
@RMartinhoFernandes What ?
 
@RMartinhoFernandes we used Gmail chat in my first job for internal "communiations"
 
@kbok Not here, on MSO Communicator.
 
Yeah, only the SO chat does that AFAIK. I'm surprised that even the Google guys didn't do anything to fix the gmail chat. It seems prehistoric now.
i.e. I get the same feeling that I have when I use the cmd command prompt.
 
shudder
@kbok Stupid MS decided to have PowerShell run on the same crappy console host by default.
 
11:57 AM
Hey, let's use the C escape char to separate directories in path. That way you can type "C:\\\\Documents\\ And\\ Settings\\\\" in some scripts.
@RMartinhoFernandes Oh BTW, do you know any replacement for that ?
 
@kbok Run PS on Console2.
 
for a vim user, some free rep :)
 
@kbok you need to configure cmd. the most important part of that, setting default console codepage to ANSI, involves an undocumented registry key. after proper configuration it's usable (like handling Norwegian characters, auto-complete, etc.).
 
@AlfPSteinbach I generally use MSYS and bash (Please don't hit me.) My biggest issue is that the built-in console is ugly.
 
12:00 PM
@kbok I find Bash on Windows to look horrible
 
@TonyTheTiger Argh! I'm going to lunch right now, no time to work out an answer (I'm guessing some vimscript will be needed).
 
@RMartinhoFernandes perhaps after your lunch it will still be unanswered :P
and it rains yet again here...
 
@kbok configure -- it's the general win console
 
@AlfPSteinbach What ?
 
@kbok at least in the old days, msys ran in an ordinary windows console window. as does e.g. powershell now. just configure console windows and look&feel fixed.
 
12:05 PM
@AlfPSteinbach I still think the console window is ugly.
 
@kbok you can start with [Alt Space] ["Defaults"]. set TrueType font, proper colors, reasonable text buffer size, enable auto-complete, enable quick-edit
@kbok but keep in mind that in Vista and Windows 7 the "defaults" are probably overridden by settings associated with the way you created the window (stored in shortcut file or in special registry key for exe). so might have to deal with that.
 
This is weird, I only have "Lucida Console" and "Raster Fonts"
 
@kbok "Lucida Console" is a TrueType font. you need it not just for looks but also for character translation. i don't feel like using time on looking up registry key for you, so to fix codepage, just use chcp in each command interpreter window, like, chcp 1252 (for Windows ANSI Western, compatible with rest of Windows).
 
@kbok I wonder why the Windows command line is so horrible. Gnome Terminal and Mac OS X Terminal both do a much better job. Why can't MS do this?
 
@StackedCrooked Because (I think) the programmers at Microsoft use Linux, so no pressure to fix the Windows tools.
 
12:11 PM
lol
 
@TonyTheTiger Jav devs don't read books, they only read Javadoc API comments.
 
@StackedCrooked Because CLI sucks.
 
Programming books are boring.
@StackedCrooked What do you mean, exactly?
 
@CatPlusPlus Au contraire, I find reading programming books quite enjoyable.
 
I have looked at two questions today. All answers were incorrect. I don't feel like answering this latest one.
1
Q: Inheritance and destructors - theoretical question - C++

macolourclass A { public: virtual void f(){ printf("A.f "); } ~A(){ f(); } }; class B : public A { A a; public: void f(){ printf("B.f "); } B(){ throw -1; } ~B(){ f(); } }; int main() { try{ B b; } catch(...){ printf("Exc");} } So here'...

But I added comments to the questions, and upvoted DeadMG's comment on Q itself.
Should I downvote each answer also?
 
12:34 PM
Oh, I didn't see the A a;.
This is a perfid question.
 
oh, I missed the exception throw
 
sbi
Oh, I failed to even see the question...
(Just to stick with the surprise theme.)
 
is there a FAQ question somewhere that gives a good explanation on why upcasting isn't a good idea?
 
Why would upcasting be not a good idea?
 
I doubt it, the reasons are pretty situational
 
12:48 PM
but creating a Derived *d = &base; isn't correct, or it depends?
 
or it won't compile
 
It's downcasting, not upcasting.
 
you would have to static_cast it
and then it's wrong, but situationally, you might know that your Base* refers to a Derived really
 
assume that base refers to a base
not a derived
 
then it's obviously wron
but that assumption doesn't hold true in many situations
 
12:49 PM
Or use RTTI and dynamic_cast and get null at runtime if the cast is invalid.
 
I was wondering why this template def is illegal
template <class T> func(T x) {}
template <class T> func<T*>(T* x) {}
 
You can't partially specialise functions.
 
you can just overload instead
 
aah , thanks
another thing -> templated member function cause violations of encapsulation , how?
 
it doesn't
no more than a normal member function does
 
12:52 PM
and using templates causes increased executable size in comparison to the code base?
 
not necessarily
there are code folding techniques that can remove any increase in executable size- for some templates
 
Executable size hardly matters.
 
besides, executable size is quite irrelevant.
 
Thanks you monsieurs
i had attempted template quiz and scored 60% but found via your answers that two of the answers on website are even wrong :)
 
@CatPlusPlus Copy & pasting is very awkward. Resizing the window doesn't work (unless you change the number of columns or something).
 
12:55 PM
cprogramming.com. I have a bad feeling about this.
 
@kbok : i never use it to learn but was just taking quiz
 
I just wrote "awkward", looked at the word, and thought "This can't be right, can it?"
 
I rarely need to copy anything from console windows. Even then, you can just redirect to file. It could be better, but meh.
 
It never occured to me that the spelling of "awkward" is very awkward indeed.
 
@kbok I never had a problem with cprogramming.com
but then, when I followed their tutorials, it was like, my first day writing C++
 
12:57 PM
@CatPlusPlus Yeah, copy/paste is done by squares, as in an image. You can't select the command you just typed, for example, without taking the prompt with it. When you paste it somewhere, you have to manyally remove the newlines.
 
You can always use Console2 or PuTTy.
 
@kbok Copy & paste works much more intuitively on Gnome/Mac terminal.
 
Console2 looks nice. Until now I used a console app I wrote myself.
 
Isn't the Putty console in the same style as the windows console?
 
I don't copy from console often enough to worry about that.
 
12:58 PM
@CatPlusPlus but i can explicit fully specialize function template , right?
 
sbi
@CatPlusPlus Actually that's wrong. You can specialize function templates. You only cannot partially specialize them. Full specializations are alright.
 
Yeah, and what did I say.
12 mins ago, by Cat Plus Plus
You can't partially specialise functions.
 
@DeadMG This is a bit outdated, and the code is not very pretty
 
@CatPlusPlus "Oh hai, I'm a cat?"
@kbok True, but there's much worse out there. I think. I don't really remember it that much.
 
1:04 PM
#include <iostream>

using namespace std;

int main()
{
int thisisanumber;

cout<<"Please enter a number: ";
cin>> thisisanumber;
cin.ignore();
cout<<"You entered: "<< thisisanumber <<"\n";
cin.get();
}
 
you know
 
@DeadMG Sure. I think learning C++ on the internet is a very difficult task in fact.
 
I actually think I discovered templates before pointers
 
That 'pause the program at the end' always amused me.
 
@CatPlusPlus This is for Dev-C++ users.
 
1:06 PM
and Visual Studio, because it also closes the command prompt right away when your program finishes
 
If you want to pause from an IDE, just set a breakpoint.
 
I mean the tutorial advises using Dev-C++. Also I prefer putting a breakpoint at the end, but I guess that's a matter of taste.
 
Otherwise, run from CLI like you're supposed to.
 
never occurred to me to use a breakpoint for that
ugh CLI, I'd rather run from my puppy
 
1:20 PM
@kbok "please drop dead" is the only message I think should be conveyed to Dev-C++ users
3
 
@jalf You know, it's still the #1 IDE for freshmen at my university.
 
@kbok I blame you
just standing by watching people commit crimes against humanity ;)
 
@CatPlusPlus You can't specialize functions at all. You can only (fully) specialize function templates.
 
I've given up on helping other people with code. It's been five years now. I lost all hope.
 
@Als just confused me with this comment:
> Upcasting is implicitly allowed, A pointer to Base class can always point an object of Derived class, publically derived from it. That is Upcasting, This is opposite of that, Derived class pointer pointing to object of Base class, Thats Downcasting
is that correct what he's saying?
 
1:26 PM
Basically, yes.
a = b is allowed if b is a subtype of a.
 
"Fine, use PHP and LAMP Server. I won't browse you crappy site anyway" / "Yes, technically it's possible to write a reservation system in C with GTK" / "Store you password in IE ? Oh yeah, the only risk is that other students have read access to them. Not a big deal"
 
@FredOverflow that's a downcast right?
from my knowledge, and upcast is from Derived to Base
 
Depends on how you're looking at it -- either it's the tree of inheritance (A -> B means A inherits-from B) or it's the tree of parents (A -> B means A is a parent of B, thus B inherits-from A). Plus there's always the orientation of CS trees: root at the bottom or root at the top?
So it's not so much that's he correct or incorrect, it's whether you're using the same conventions.
 
ohhh I see
 
@TonyTheTiger No, I would need an explicit cast if it were a downcast. Maybe you got confused about the term "subtype"? Is base = derived more readable?
 
sbi
1:29 PM
@DeadMG Either you are debugging, and will need breakpoints (or single-stepping), or you are not debugging, in which case you can run without the debugger (from the IDE), which makes the shell wait for an additional keypress before closing it.
 
Hasn't testing deprecated debugging? :)
 
@TonyTheTiger yes
@FredOverflow no
@sbi maybe
 
@FredOverflow That was implied.
 
@AlfPSteinbach I would say yes.
In fact, let me say it: yes!
 
You still need a way to tell why test fails. :P
 
1:34 PM
@FredOverflow no. testing is no substitute for debugging. for example, testing can't shed much further light on a logic error. testing can't tell you more about half-documented thing. testing can't give you insights about what's going on. and so on.
@FredOverflow you can look at this way: when you know what should be happening, testing tells you if that is so or not. when you want to know what is happening, debugging can help to tell you that. debugging cannot tell you what should be happening, testing cannot (much) help tell you what is happening.
 
Some of my unit tests have been broken by GCC but the rest of my code still works where I'm using the same functionality, go figure. Not that it's related to the discussion.
 
In your case it's because GCC doesn't like you.
 
But why does it still work then :p
 
It developed a split personality from all those ICEs.
 
Sounds plausible actually...
 
@CodeMonkey I don't see why there should be no ban if a message is flagged until removal.
The problem is not the ban, it's the flagging.
 
@RMartinhoFernandes Well, does not make sense if the message is from months ago
kinda defeats the purpose
 
@CodeMonkey You broke meta.
 
@CodeMonkey your suggested option 1 solves that particular issue, without removing the penalty for legitimate flags.
 
@CatPlusPlus lol I see that
 
1:49 PM
@CodeMonkey Also, have you seen this?
8
Q: More information is needed in chat Flagged Posts

AlsToday while I was in one of the chatrooms, I noticed a lot of posts being flagged in some other chatroom(I have the necessary 10K rep to vote on flagged posts) but the flagged post just shows the particular post that is flagged and no information or way to seek the information in the context in w...

 
@RMartinhoFernandes Yes, I agree we need more context
@RMartinhoFernandes My option #1 just prevents you from flagging past 24 hrs period
ah here we go, balpha says it is only the C++ room
 
24h is better than nothing, but it's still forever ago.
If a message cannot be acted upon in real time, then why bother.
 
it's just an arbitrary time I made up, but seemed reasonable. It could be 1 hr
 
@CodeMonkey He is right. It is only the C++ room. Just as it was only the Android room before (and they eventually sharded into several Android rooms because of that). Or as it was only the PHP room before.
 
It's a conspiracy to quash the resistance!
 
1:54 PM
8
Q: goto and object destruction

Tomalak Geret'kalIs it true that goto jumps across bits of code without calling destructors and things? e.g. void f() { int x = 0; goto lol; } int main() { f(); lol: return 0; } Won't x be leaked?

 
@RMartinhoFernandes Why not add this a commentary (although not too inflammatory to desescalate the situation)
 
I like the way IRC was ran.. never had these problems
 
Also what's a real word for 'desescalate'
 
Mumbo-jumbo.
Neither TFD nor Fx UK dictionary know desescalate.
 
desescalate is what happens when those silica gel packs are put in the shoes you buy
 
1:58 PM
Desiccation.
 
Oh, it might be de-escalation.
Silly English language.
 
There are five Android rooms now.
Aug 5 at 20:32, by sbi
If you wonder why we have so many room owners: This room was originally created by some user(s) who later disappeared, orphaning it, so that other users set up a new C++ room. A moderator objected against two C++ rooms, and transferred ownership of the older C++ room to those who had created the new room (which was left to die).
 
The only rational course is for Western society and Russia to launch a pre-emptive (speling corection suggests "per-emptive", "ore-emptive", "pee-emptive", "pr-emptive" or "re-emptive") all out nuclear attack on China, right now. Otherwise the situation might escalate more slowly, with heavy losses on both sides.
 
pee-emptive sounds...
 
If there are preemptive scheduling models, do we need de-escalating scheduling?
 
2:06 PM
BTW, wouldn't it be easier to keep those hints on a wiki or something?
 
"Better not give a timeshare to that process, that other one might blow up"
 
@RMartinhoFernandes Think at the height of the madness there was 8, plus one migrated to SuperUser.
 
Hi all
 
@Mahesh Shall we play another round of rice chess?
 
@FredOverflow - Sure, let me try. Give me a question :)
 
2:20 PM
What's "rice chess"?
 
@RMartinhoFernandes solving problems involving a chess board and rice grains with clever recursive algorithms
 
Ah, that thing.
 
0
Q: Singleton Connection changes config. Best way to do

Mark ComixI have a Singleton Class to connect to http server. But the user can change the connection Host and Port. What is the best (most correct) way to update my singleton class? My code: public class ServletConnectionManager{ private static ServletConnectionManager INSTANCE = new ServletConnecti...

time to bash, Java & Singleton in same question
 
sbi
I object to that being an FAQ entry.
 
Oh me too.
 
2:24 PM
I cleared initial 2 technical telephonic rounds. Today I have another. Interviewer is a senior developer in OOD. So, probably he is going to tear me to pieces ;)
 
It doesn't seem F, but I might be wrong, and it's a crappy question.
 
@sbi yea seems unsuitable for FAQ, it's not like goto is something we use all the time
and I haven't seen many questions with goto and C++ in the same Q either
 
@TonyTheTiger And it's a very buggy singleton.
 
@RMartinhoFernandes hahah, what singleton isn't buggy?
 
@sbi Yeah... how often do you see someone ask about goto in C++?
 
sbi
2:32 PM
Now that I have GreaseMonkey, how do I link to a comment, @RMartinho?
@TonyTheTiger Alexandrescu's?
 
Jan 31 at 9:59, by sbi
@FredNurk You can link to comments??
Follow the trail :P
 
sbi
@RMartinhoFernandes You never forget anything, do you? Let's call you Brutha.
Thanks, I'll try to follow that trail. I'll cry for help again should I get lost. :)
 
Who will be the Great God Om?
 
@sbi I'd love to buy "Modern C++ Design", but I simply cannot put a book on my shelf that has Singletons inside :(
 
@FredOverflow If you weren't that far away from here, I'd lend you my copy :P
 
sbi
2:41 PM
Can you guys give this comment some visibility, please. Thanks.
 
@TonyTheTiger Thanks, but I wouldn't read it. It contains Singletons.
 
@sbi Doesn't work with invisible comments because they're not in the DOM of the originally loaded page.
 
sbi
@RMartinhoFernandes Nobody. Who would want to be bullied by you?
 
@FredOverflow oh lol
 
@TonyTheTiger Where exactly did you live again?
 
2:42 PM
@FredOverflow In Belgien
 
sbi
@RMartinhoFernandes Oh. Seemed to work for me.
 
@sbi Did you click the link? If it opens a new page, it won't jump to the comment, because it only gets loaded when you click "show more comments".
 
@RMartinhoFernandes confirmed
 
sbi
@RMartinhoFernandes Yes, I clicked it, and it works for me.
 
Now the comment is visible.
 
2:44 PM
@RMartinhoFernandes :)
 
sbi
@RMartinhoFernandes Thanks everybody.
 
@sbi Is he Everybody?
 
Yes!
You are all figments of my imagination.
 
sbi
@FredOverflow You might have to bite the bullet and overcome your prejudices. The book is quite old by now, so you could make some allowances. That was the time when the GoF had published their book, after all, and patterns were the latest and greatest. And it's a good read. Well, it was for me, back then. It could be that you already know too much to enjoy it as much as I did.
 
@RMartinhoFernandes oh thx, nice to be part of your imagination :P
 
2:50 PM
Isn't the singleton thingy just an excuse to show policy-based design?
Unless I'm mistaking that for another book.
 
@sbi Well, I guess I could just tear out the Singleton chapter, should I ever buy it... but anyway, I have enough C++ books as it is.
 
Learned a lot from "Modern C++ Design".
 
Maybe the book should be renamed "Baroque C++ Design" after all those years?
 
sbi
@FredOverflow "Having enough books" is not a state I've ever been in.
 
Me neither, but I definitely have enough C++ books. It would be unfair to the other languages if I bought yet another C++ book.
 
sbi
2:52 PM
@FredOverflow I don't think I ever will.
 
But that doesn't imply you would buy any C++ book, right? :)
What are the good C++ books that are still left for you to acquire?
 
sbi
@FredOverflow No, but then I didn't recommend just any book either.
@FredOverflow I'd rather have it named, um, Excellent C++, to be on par with all the other EC++ books.
 
I think we already had the E-word discussion some time ago...
 
And then we'd need a Party on C++ too.
 
Errotic C++
as opposed to
 
2:55 PM
Erratic C++
 
Aug 17 at 20:14, by Jerry Coffin
I nominate "Erotic C++".
We did this already.
 
Jery missed an r
 
Who is Jey?
 
A man in yellow.
 
@CatPlusPlus Good memory for colours...
 
2:57 PM
Well, it's not a problem when you only know 16.
 
sbi
@FredOverflow That's a hard one. For one, I haven't had to code in C++ for a living for two years now. Given that, it's hard to justify spending money on C++ books. (Also, I have somewhat lost track of good new books.) But also, AW once sent me a dozen C++ books to add to the stack I already had, so I have quite a stack now.
 
Oh wait, I almost forgot: I'm definitely going to buy that Concurrency book on C++ when it comes out.
 
When is that?
Does it cover the C++11 model?
 
@RMartinhoFernandes Is there any other model? :)
 
@FredOverflow there's female models :P
 

« first day (326 days earlier)      last day (4623 days later) »