« first day (202 days earlier)      last day (4764 days later) » 

9:00 AM
I still don't see it, but I won't belabor the point
people can vote as they see fit
 
sbi
@FredNurk Have you considered glasses? :)
 
@sbi I have, cause I don't see very well
 
that's not as funny as you think it is, here in this context :)
 
sbi
@FredNurk Well, even though my avatar suggests otherwise, I am wearing glasses, so I think I'm allowed to make fun of the subject. :)
 
that's not what I mean; I really have considered the questions and they appear equivalent to me, I suggested merging because all 4 answers seem to apply equally well on either of the two questions; whereas joking I haven't looked closely enough comes across as crass
 
sbi
9:04 AM
@Als Aren't you about 4hrs ahead of GMT? Wouldn't that make it about 2pm at your place? What work are you going to, the programmer's night shift?
 
@sbi lol :p
 
sbi
@FredNurk I'm sorry, I didn't mean to offend. The one you linked to explains the difference between the STL and the whole of the std lib. The one you wanted to close explains the differences between the original STL and the parts of it that ended up in the std lib.
 
I knew you didn't, hence the smilie when I pointed it out :P
 
@FredNurk You mean delete[] answers, right? ;-)
2
That "you haven't voted on questions in a while; questions need votes too!" pop-up is really starting to piss me off.
Is that a recent addition to StackOverflow?
 
@FredOverflow I've never seen it
 
Xeo
9:11 AM
@FredOverflow Seems like it
 
LOL
It's a deleted answer that says:
> Your mom wears army boots. Momma grad
 
Xeo
Ewww, I want mod tools :|
 
To be honest, I only read questions in detail if there is no answer yet. If there is at least one answer, I just skim the question to get the gist of it, and then I read the answers.
(Unless Johannes asked the question.)
 
sbi
@FredOverflow I think so. I saw it first the other day when I went for a downvoting spree on meta (in support of this answer).
 
@sbi So, did you vote everything except C++0x down or what? ;-)
 
9:13 AM
@sbi how apropos to link an answer using "STL" like that...
 
Xeo
Geh, that damn pop-up shows everytime I upvote an answer -.-
 
sbi
@FredOverflow You bastard! Now I will never be able to say "delete <plural_noun>" without thinking "that ought to be delete[], really"! That considerably raises my jerk factor, and considerably lowers my ability to get along with the rest of society...
@FredOverflow Well, until I ran out of votes, that is. :)
@FredNurk What do you mean? :)
 
@sbi wow, you have a "jerk factor", sounds awesome! :)
 
@Xeo That's why it pisses me off.
 
@Xeo I wonder what triggers it
 
Xeo
9:17 AM
@TonyTheTiger Not voting on questions, obviously
 
sbi
@TonyTheTiger Maybe if you haven't voted on questions for a while? Just a thought...
 
@Xeo ugh, but I vote all the time
 
@sbi we were just talking here about stackoverflow.com/questions/5908581/is-hash-map-part-of-the-stl and related
 
@sbi yea, sorry, am slow today
 
sbi
@Xeo So where's the problem? Go to the list of FAQ entries, and upvote a few of those questions. They all deserve to be upcoted.
 
9:18 AM
@FredOverflow vector<answer> *answers = new vector<answer>(); !-)
 
Will StackOverflow also warn me if I only answer questions without asking my own?
> You haven't asked a question in a while! How come?
@FredNurk I was about to say the same thing, but nobody in their right mind allocates containers dynamically.
 
@FredOverflow cause I'm smart enough to answer my own questions
 
unless you need to move them between objects
 
sbi
@FredNurk Yeah, but what's that got to do with this answer, which asks about the std lib? :)
 
cheater
 
9:20 AM
@FredNurk Then wrap it in a smart-pointer and don't call delete.
Also, we have move semantics for that now.
 
sbi
@FredNurk IS THAT A NEW TAG? OMG, what do I have to do to get it?
 
@TonyTheTiger StackOverflow encourages you to ask questions and answer them immediately! Come on, where's the repwhore in you?
 
@sbi, ask Jeff?
 
@FredOverflow seems it's not present today :p
@sbi ask on meta
we should have a repwhore badge!
 
And what would be the criterion for getting it?
 
9:22 AM
@TonyTheTiger I'd upvote that question.
 
@AProgrammer me too :)
 
Xeo
@TonyTheTiger Well, we already got the "Legendary" thing, I think that comes pretty close
@FredOverflow Maybe for repcap on 300 days, it's over legendary. Should be platin then
 
@Xeo no, repwhore is more specific then Legendary
 
Xeo
@TonyTheTiger RepCap on 150 consecutive days?
 
@Xeo something like that
 
Xeo
9:25 AM
Is that even possible without sacrificing eat/sleep/work and family?
 
@Xeo SO is all about sacrifice
 
@Xeo Is that the successor to "eat/pray/love"?
 
@FredOverflow what if I don't want to, or can't, move each item? moving can still be expensive: std::array<int, 100000>
@FredOverflow or maybe I have iterators out that point inside this vector, and I must keep them valid
 
Xeo
@FredNurk memmove!
 
@FredNurk Why would you use a std::array<int, 100000>* over a std::vector<int>?
 
9:28 AM
@sbi it's a secret badge, takes js userscript to add to your profile page, and even then only you can see it
@FredOverflow vector<array<int, 100000>> is what I meant, and just as an example of when moving each item in a vector was problematic
 
@FredNurk Iterators are usually short-lived objects. You aren't supposed to keep them around for long.
@FredNurk Then use a std::vector<std::vector<int> >.
 
@FredOverflow aren't supposed to? I disagree. it's essential for cross-indexed containers
@FredOverflow but I also want contiguous access across each std::array, which vector<array> gives me
 
@FredNurk The purpose of an iterator is to iterate. Iterators are not replacements of pointers or references.
 
yes, they are
and you need to keep an iterator instead of a pointer if you want to update the other container, such as erase() (but now the example moves into containers like map, set, list instead of vector)
 
sbi
@FredNurk Yeah, right. Plus I'd have to install a script you provide for me, and if I look at its code it's not gonna work.
 
9:31 AM
@FredOverflow however, change "iterator" to "pointer" in my above example and nothing changes: you can't use move semantics
"or maybe I have [pointers] out that point inside this vector, and I must keep them valid"
 
Xeo
Oh no, the robot from the future is here again.
 
sbi
Well, I gotta take these kids outside, or they'll murder each other out of sheer boredom. At least that's what the noises from their room seem to indicate.
 
Xeo
Yo @Johannes, flew in with your roflcopter? :)
 
sbi
See you tonight.
 
Xeo
9:33 AM
Hf @sbi
 
sbi
Hf?
 
what do you mean
 
@sbi: have fun
 
wahts teh roflcopter
 
sbi
@Xeo Usually its the mhmm-copter or the ohhhhhh-copter.
 
9:33 AM
lulz
 
@sbi or lol-copter or lulz-copter
 
sbi
@FredNurk Ah, thanks. Sorry for being so dense. Yes I will. What else can you do with a bunch of kids about to murder each other out of boredom? :)
afk
 
@sbi feed them. they tend to get sluggish for a bit after that
 
@FredNurk lol
@JohannesSchaublitb any interesting template adventures you care to enlighten us on?
 
@FredNurk Then use a smart pointer, done.
 
9:38 AM
"I'm writing a smart pointer" :P
 
When I point I'm always aware of what I point to, so technically I'm a smart pointer... hmm
 
@TonyTheTiger dunno what you mean
what's the question/problem?
 
@JohannesSchaublitb point as in point with one's finger to something
@JohannesSchaublitb it's a statement, not a question
 
@TonyTheTiger refering to this
 
@JohannesSchaublitb just maybe you learned something or did something interesting, and you want to share it on here
 
9:43 AM
ohh
ohhhh i see now!
:P
 
Look at the moon, not the finger...
 
9:58 AM
silence is golden
 
So, I was just having sex and wondered: is there a Singleton base class in the STL?
(That should get the discussions going.)
 
@FredOverflow wow so you think about C++ while having sex? damn...
 
first I imagine someone trolling "No, It'S not STL!"
 
@JohannesSchaublitb are you being that troll?
 
he thinks "ohh god please make my pointer leak late!"
 
10:02 AM
@JohannesSchaublitb lulz :P
 
@TonyTheTiger Actually, most of the time it's the other way around: I think about sex while programming in C++ ;-)
...or I just lie in bed and think about both ;-)
 
@FredOverflow yea, and then you start naming your variables appropriately: double penetration or some such...
 
@TonyTheTiger only COMMONCONTROLSEX
 
hypothetically, would it not be better to copy only pointers to data and then if you really need a copy have an explicit way to invoke a copy? I mean, I'm thinking purely from a perf viewpoint.
CPU's are far happier dealing with pointers then having to move data around
 
@TonyTheTiger Yes, that's why C++0x introduced move semantics.
Except it's mostly implicit :)
 
10:09 AM
@FredOverflow oh yea, I hadn't thought that far
 
how to inplement a log(e) in c++/..
 
float log_e()
{
    return 1;
}
Also, what is C++/..?
 
hmm
 
If you want a function that calculates a log, just read up on log at Wikipedia. I'm sure it's an infinite series or something.
 
and if i have e^-2.2685
how to implement that
 
10:12 AM
Do you want log(x) or e^x?
 
hmm
i want both ...
 
And why not simply use std::log from <cmath>?
 
hmm i see
ok what about e^x.. how to use that ...
ah exp(x) ..right?
 
@Miss Yes.
Hm, the infinite series to compute the logarithm by hand seem rather complicated. So just use the standard functions.
Unless you're doing homework that requires you to write them by hand, of course.
 
ah thanks @fredoverflow..:)
 
10:19 AM
@FredOverflow to me it looks like you're talking to yourself....
 
@fredoverflow: really did you feel like that? i mean @tonythetiger whatelse he is saying .. do you agree with him... is he right about you that "it looks like you're talking to yourself....
"
 
anyways thanks @fredoverflow
 
@Miss You're welcome.
 
@JohannesSchaublitb robot mode
 
10:23 AM
@TonyTheTiger Good programmers constantly talk to themselves!
Rubber duck debugging, Rubber Ducking, or the Rubber Duckie Test is an informal term used in software engineering to refer to a method of debugging code. The name is a reference to an apocryphal story in which an unnamed expert programmer would keep a rubber duck by his desk at all times, and debug his code by forcing himself to explain it, line-by-line, to the duck. The process is to meticulously explain code to an inanimate object, such as a rubber duck. It is expected that when the programmer comes across a piece of code that is incorrect, they will realize this Similar terms *Cardbo...
 
@TonyTheTiger i dont know what youre talking about
why are you saying random things in the channel
 
@JohannesSchaublitb I could say the same about you
lulz
 
@JohannesSchaublitb Maybe he thinks he's lucid dreaming.
 
robots can't laugh
 
But they can make you laugh, see FunnyBot.
 
10:26 AM
 
that's why it's a funny bot, and not a ro bot
 
@JohannesSchaublitb is that english?
vielleicht auf Deutsch?
 
vielleicht is already Deutsch.
 
I think he means that funnybots are not robots :(
 
@FredOverflow true, they're funnybots
 
10:29 AM
So what does the ro in robot stand for?
 
so what's this business about robots suddenly
i don't have robots in my room
 
Isn't that some chemical element?
 
also my emacs has no robot mode installed
 
nobot mode?
 
10:31 AM
yes
 
Als
Hola...Im Happy!
 
@Als good :)
whats creating the happiness?
 
Als
@TonyTheTiger: I got the digital audio playing :)
 
10:42 AM
@Als nice one :) :)
 
Als
@TonyTheTiger: Still need to kill 2 hrs of office time.........
feels like reaching the rep cap for the day
lol
 
@Als I need to kill another 4hrs
and I'm not in the mood
 
Als
@TonyTheTiger: Ahh..whats with the mood? Weekend mood already i guess..
 
@Als ugh, long story I don't fancy going into it on here
 
Als
@TonyTheTiger: Hmm...let me say something deep to sum it up
"Life is not measured by the number of breaths we take but by the moments that take our breath away..."
 
10:51 AM
@Als yea, that is true, but if that breath taking moment is a good one :p
 
Hey Guys Can I use the same Mutex twice ?
I am using QMutex here
e.g.
 
Als
@TonyTheTiger: Hell yeah! :) ..Dont worry though..sit tight in there.Wekend lurking just around the corner
 
@NeelBasu in what way ?
@Als :)
 
mutex.lock()
some code
mutex.unlock()

mutex.lock()
some Other Code
mutex.unlock()
 
@NeelBasu do those two pieces of code protect a variable that is the same?
 
Als
10:54 AM
@NeelBasu: That would make sense ..yes
 
Nope
some code and some Other Code are different variables
 
@NeelBasu so why use the same mutex?
 
Als
@TonyTheTiger: Would it matter if same code or not?
 
that means that if one thread enters your first piece of code, some other thread will have to wait to enter the second piece, though there's no reason for it
 
No actually I wrongly did it on some place and fixed it too. But I never ran into a problem with it
 
10:56 AM
@Als yes, if it protects the same variable, obviously you need to protect it with the same mutex, else some other thread might change it
 
I thought I'll run into a Deadlock
But I wondered there was no deadlock at all
 
@NeelBasu no I don't see how this could cause a deadlock
if the mutex is taken by a thread, all other threads will have to wait
and if no other mutexes are taken inside that first mutex, then I don't see a possible deadlock scenario here
 
if thread1 locks the mutex for region1 and then thread2 enters region2 and tries to lock teh same mutex
the*
wouldn't it lead to a deadlock ?
 
Als
@TonyTheTiger: True...but why would one do it tht way...acquire-->change-->release-->acquire--->
I would acquire it once and release it only when done modifying
 
@NeelBasu thread2 will have to wait on the mutex as it's already taken by thread1, cause it's the same mutex
@Als true that too, but perhaps this code is not located in the same place
 
10:59 AM
So what could be the problem If I use the same mutex for two different variables one after another ?
 
Als
@TonyTheTiger: hmm...i didnt see any mention of that so was wondering...darn this place is making me pedantic
 
@Als this is where you learn the true skill of being pedantic ;)
 
@TonyTheTiger So what could be the problem If I use the same mutex for two different variables one after another ?
 
@NeelBasu well, then you are making all threads wait on the second variable if the first one is taken, so then you are serializing where you don't really need to
 
Hmmm Okay I see
 
11:03 AM
@NeelBasu cause the variables have no relation, there's no danger in two threads modifying them at the same time, therefore they don't require the same mutex to be used
 
Als
@NeelBasu: Basically you would be stalling your second thread for no reason...since it is not dependent on fisrst variable
 
@Als @TonyThe
@Als @TonyTheTiger I QMutex Source there is a Warning like qWarning("QMutex::lock: Deadlock detected in thread %ld"
Line 163
Once I got this One and Dont know How I fixed it.
What was the case ?
It has d->owner == self
So I was fearing whether its due to the same mutex used twice problem ?
 
@NeelBasu its a non-recursive mutex
by default
so acquiring it twice, is a deadlock
 
nither my function were recursive then
 
Als
@TonyTheTiger: The tiger nails it :)
 
11:07 AM
Then how it was locked twice by the same thread. If it was a non-recursive function
 
@NeelBasu you should make us a test case that shows exactly what the problem is, and even better post it on stackoverflow.com
with all the data in it
@NeelBasu I don't know, I haven't seen your code
 
Hmm
 
Hi All,
 
@Als lol :p
 
anyone for WIN32 core programming
I use VC++
 
Als
11:09 AM
@TonyTheTiger: You always beat me to it!
 
@Als lol
@TheAmitKumar not me
 
Als
@NeelBasu: You should track where you are calling your mutex locks from
 
@Tony got that from ur posts
 
@NeelBasu threading is a fairly complex subject and to understand it you need to read about it, it takes lots of understanding of its workings to do it right.
 
Als
@Neel: The Tiger nailed it gracefully
@TheAmitKumar: Huh?!
 
11:11 AM
@TheAmitKumar if you're here to offend people I suggest you go away now
 
@Als: Yaah. I can see the broken Nail Here
 
@Tony... So buddy u r programmer great
sorry 4 misbehavin
 
@TheAmitKumar What the hell you changed your voice ?
LOL
 
act ur last posts were nt saying
that u r a programmer
Nyways
do u know WIN32
 
Who else will stay in this chat room ? musicians ?
 
Als
11:12 AM
@TheAmitKumar: @TonyTheTiger has 6k+ reps compared to your 20 so you owe him some respect
He is a well respected member in here
 
I said sorry
I came here 4 the first time,.....
curious to know
more about C++
 
Als
@TheAmitKumar: You should be...As for the learning C++, you are in the right place, you will learn loads if you maintain the right attitude.
 
I will...
So buddy.... any one here working on WIN32
i am developing my first program in VC++ using WIN32
 
What is your problem ?
 
@Tony.... as you are a respected member here , wont you help me ?
 
Als
11:17 AM
@TheAmitKumar: Not an expert in WIN32. But if you have a specific Q you can ask out..its C++ room or even better you can post a Q in SO, because it reaches a bigger audience and better chance of getting answered
 
thanks buddy....
my question was :
Why the picture I display in my window disappears whenever I minimize the window
I have handled WM_PAINT method
sometimes it works ....
sometimes the window becomes blank
 
@TheAmitKumar: this sounds like something you should post as a question, with lots of details and a test case, on stack overflow
 
@TheAmitKumar When you minimize the window, you can't see it.
 
Not only minimized. even if you move your window out of the screen it gets blank
@TheAmitKumar: Not only minimized. even if you move your window out of the screen it gets blank. right ?
 
ya...
though I have handled the WM_PAINT method
NyWays ....
thanks to all
 
11:20 AM
When you handle WM_PAINT - you need to call BeginPaint and EndPaint exactly once, and do NOT call DefWindowProc
 
and sorry to @TonyTheTiger
I will better post this as a question
@Chris
I have done that
i will post the link here...
 
@Als @TonyTheTiger I am runnign a for loop inside a function. as there is an assignment of iterator should the whole loop also be mutex locked ?
I am running a for loop inside a function. as there is an assignment of iterator should the whole loop also be mutex locked ?
e.g. for the it++
 
11:54 AM
Are you sure you want to start learning C++ with Win32?
It will teach you loads of bad practices.
 
@FredOverflow: Right.
@FredOverflow: I am doing Windows for last 1 month. It am totally frustated with the documentations
They use the terms lke may, should, sometimes LOL
 
@FredOverflow There's nothing wrong with learning bad practices. As long you as learn that they're bad and why.
 
learning what is bad is not bad unless you kow that that is bad
 
Now, learning bad practices as "standard" practices...
 
@MartinhoFernandes Okay, but starting your C++ journey with Win32 will give you a very warped view of C++.
 
Als
12:09 PM
Can anyone comment if this is correct ot incorrect?
3
Q: overloading vs overidding

AlsI am a little confused over the two terminologies and would be glad to get some doubts clarified. As I understand function overloading means having multiple methods in the same class with same name but either with different number of arguments, different types of arguments or sequence of argument...

 
sbi
@FredNurk You wish.
 
Als
@sbi: Uncle Faq!! Could you Help on that!
I thought I had got to know it and now looks like it was wrong!
 
wow, was nice to have lunch :)
 
@Als, SpaceCowBoy answer is correct AFAIK.
 
Als
@TonyTheTiger: Special Friday Lunch eh.
@AProgrammer: I thought so, any thoughts about @Nawaz comments?
 
12:19 PM
Then you have also the possibility to replace some functions of the standard library (operator new and delete)
 
@Als no just ordinary, garden-variety, run-of-the-mill lunch really
just I was rather hungry
 
hide is when a function with the same name and signature prevent to access a function in an englobing scope.
override is when you replace a virtual function
overload is when you have the same name and different signature.
 
what's the easiest way to convert a string to a DWORD?
 
You can consider that overriding is a form of overloading which is dynamically dispatched on this.
 
where string would be a number
 
Als
12:22 PM
@AProgrammer: Exactly my thoughts and then i got flaked here..
2
Q: questions about virtual function in c++

ratzipHi guys, I am a beginner of C++, I am studying virtual functions these days. There are some questions confuse me a lot. for example: class A { public: virtual void f() { //do something; } } class B: public A { public: virtual void f() { //do something; } } class A contai...

 
@Als, you get a +1 from me + a standard citation.
 
hi everyone
i have a question
i use a map<string, string> in c++
 
Als
@AProgrammer: Thats some definite information quoting the bible itself, Thanks!
 
What happens when I log on, and none systolic key elements with that key?
 
@Als, I've answered you question + given references but not citations... I'm supposed to work.
 
sbi
12:40 PM
@Als Um. I thought it was already answered? I saw that someone explained that what you asked was hiding. I didn't look closely at the question, though. Is there anything left to be explained?
 
Als
@AProgrammer: Thanks!
 
@TonyTheTiger Boost lexical cast?
@TonyTheTiger boost::lexical_cast<DWORD>(myString);
 
Als
@sbi: Another q triggered some confusion. This quote was the one that got me thinking..casting doubts "This surely isn't function hiding, since if it is, then you can unhide it in the derived class, and then both function will be available. But that is not the case. Its overriding! "
 
If you have no boost, then you can use:
std::istringstream iss(myString);
iss >> mydword;
 
Als
@sbi: Heres the other Q where it started..stackoverflow.com/questions/5910578/…
 
12:43 PM
@StackedCrooked wow, I hadn't thought that far
 
@Als, the aim of the using directive isn't to unhide but to import declarations.
 
@StackedCrooked thx :)
 
No problem!
 
Als
@AProgrammer: True, but it does happen to unhide if base class has function with different argument types than derived class it just won't unhide if the base class and derived class functions have same arguments.
 
{
    int a;
   {
       int a;
   }
}
The second a hide the first and the first can't be unhidden.
 
Als
12:47 PM
That is what linked using directive to unhiding..and..further on..
 
Xeo
0
Q: how to declare template of template class

deepak4binHow can declare template of a template class?? see below code: File: A.h class A { ... ... }; File: B.h template <typename U> class B { ... ... }; File C.h template <class T> class C { ... ... }; File C.cpp //In this file I am able to write template declara...

something is wrong with that code... template C<A>;, how does that even compile?
 
@Xeo seems Nawaz is using a similar syntax in his answer... not sure why that is so though
 
Xeo
Hm, could be old-style template specialization where the <> wasn't needed
 
The template C<A>; is explicit instantiation, is it not?
 
Als
@sbi: Your comment that it is overidding has created some confusion again :( But I need to get going in about few minutes to catch a bus...I think I will have to get back on to this once I reach home. Hope you wont mind
 
12:58 PM
Hi there!
 

« first day (202 days earlier)      last day (4764 days later) »