« first day (205 days earlier)      last day (4742 days later) » 
00:00 - 20:0020:00 - 00:00

Xeo
12:14 AM
3
Q: Aren't the arguments of function<> part of its type?

GhostlyGhostGiven the following code, what is the reason behind the ambiguity? Can I circumvent it or will I have to keep the (annoying) explicit casts? #include <functional> using namespace std; int a(const function<int ()>& f) { return f(); } int a(const function<int (int)>&am...

 
Xeo
12:27 AM
Bleh, forget that. :)
0
A: Aren't the arguments of function<> part of its type?

XeoThe problem is that both function<int()> and function<int(int)> are constructible from the same function. This is what the constructor declaration of std::function looks like in VS2010: template<class _Fx> function(_Fx _Func, typename _Not_integral<!_Is_integral<ty>::v...

Anybody here? If yes, one quick closing vote on this one wouldn't hurt.
 
1:15 AM
hi all good morning..!!
 
 
4 hours later…
5:03 AM
0
Q: Painting without PaintEvent and QGraphicsItem s Management

Neel BasuThe Scenario is I am getting Rects of Images over the socket and I need to draw it in a Scrollable Canvas. at the moment I am using a QGraphicsScene and drawing using QGraphicsPixmapItem but after few times when one pixmap overlaps another there is no need to keep the bottom one. and I dont know ...

 
Als
5:13 AM
Good Morning
 
Morning ?
 
It's always morning somewhere
 
LOL
My morning starts long after morning ends in our place
 
Als
Its the global time space..so its goingto be morning somewhere
 
But you cannot say something like Absolute time !!
 
Als
5:23 AM
@NeelBasu: Pedantic detail...We have had so much of that over here
:)
 
@Als: Sorry But I cant understand
 
Als
@NeelBasu: thats because you havent been in around here before
nevermind it just meant that is all a detail, we shouldnt even bother about
 
@Als: We have had so much of whatover here ?
did I miss something ?
 
Als
@NeelBasu: No...just regulars discuss lot of stuff here, which is pedantic..
You been in SO for long i see 1+ yrs
Didn't see you around in here bfore untill few days ago i think
 
5:43 AM
morning
 
Als
@TonyTheTiger: Morning, Precious ;)
 
@Als hello! How are you today?
 
Als
@TonyTheTiger: trying to survive the monday morning!
 
@Als ugh :( I hate monday mornings
 
Als
@TonyTheTiger: Me too...On Friday eve I feel like heaven..On Monday mornings i feel like i won't last the week...
 
5:51 AM
@Als lol
 
Als
@TonyTheTiger: Eventually, I survive the week and the viscious cycle keeps repeating itself!!
3
Geez I loved the college days....
 
@Als hahaha :P
yes college was easy compared to work...
3
 
 
2 hours later…
7:39 AM
morning
I'm wondering if next time I have to use raw arrays i should just use a struct which contains the array and it's size for every array
 
@Nils Have you considered using boost::array?
also hello!
 
aaargh
I'm not using them for pleasure
 
@Nils I don't understand
 
sometimes you have to use c arrays, for example if you use an api such as cuda or opencl
 
@Nils boost::array is C compatible
much like std::string can be used with C-style APIs
 
7:44 AM
so it's just a wrapper around a c array?
 
Yes; that's why I suggested it to you since that was essentially what you were doing
They also offer a begin()-end() stl style interface
Where std::vector is the C++ alternative to C-style dynamic arrays, boost::array is the alternative to static arrays
also std::array is coming with C++11
 
ok cool, might have to consider that
so you write boost::array<double,size> myArray;
and how can u get then a pointer to the first element?
 
@Nils myArray.data()
 
will return an pointer to float?
thx for the hint
 
An advantage over raw arrays is that you can pass them by value
and no troublesome decay to pointer
 
7:51 AM
Hm, does anybody here know whether VS 2010 and VS 2010 SP1 are binary compatible? Or have they introduced yet another MSVCR100 assembly/version?
 
sry no idea
actually I was looking for something like boost::array, but nobody told me :( .. thx @LucDanton
 
 
4 hours later…
12:17 PM
Can you use std::list to simulate a stack datastructure?
 
@TonyTheTiger Sure. Just push and pop from a single side.
 
@CatPlusPlus oh cool
 
sbi
@CatPlusPlus Can't even std::stack be wrapping a list?
 
@sbi Yeah, I think so.
 
wow, I had no idea... interesting :)
 
sbi
12:23 PM
@TonyTheTiger Yeah, it's template<class T, class Container = deque<T> > class stack, and you can provide a different underlying container.
 
@sbi cool :)
 
Als
12:42 PM
bwah.....
 
sbi
@Als I'm impressed by that intellectual expression.
 
@sbi extremely intellectual :P
 
Als
@sbi: ;) I got the outspoken badge so being so
;)
lol
 
sbi
Mhmm. FF just wiped out all starred postings on the right. Is anybody else seeing this?
 
@sbi same on chrome
 
Als
12:44 PM
Yes..wiped off...I thought my IE playing up
 
sbi
@TonyTheTiger And it just happened? Then it's probably a server thing.
 
@sbi yea I think so, they were there earlier
and reloading doesn't seem to help
 
Als
Yes they were there...not anymore
 
sbi
Now they're there for you, too?
 
@Als oh mine are back now :)
 
cpx
12:45 PM
ohh the starred list is back
 
sbi
And now they disappeared?
 
and they are gone again now
yep
 
cpx
yes
 
what are they playing at?
 
sbi
Well, at least I know what _triggers: this: I starred @Als' intellectual spillover.
When I undid the star, they came back. When I re-starred, they disappeared.
 
12:47 PM
@sbi so it can't handle that much intellect at once?
 
sbi
LOL, @Als, we broke the server!
Whoever tried to star my posting: That certainly won't work for everyone. It takes a grumpy old man to break the server. :)
 
@sbi back again
now gone again
 
Now you see it, now you don't!
 
sbi
@TonyTheTiger Yep, it still works for me, I just tried it again. :)
 
@sbi why do you get this privilege?
 
sbi
12:49 PM
@TonyTheTiger That I explained in the very messages yours is referring to!
 
StarOverflow
 
@sbi not fair
 
sbi
@TonyTheTiger Yeah, still works for me. (I wonder how long until my star is locked?)
 
@sbi are you still playing around with @Als intellect?
 
sbi
@TonyTheTiger Yeah, I just did.
 
12:50 PM
@sbi I can't see any starred msg's anymore, give them back pls
 
Als
Darn they are back!
 
sbi
@TonyTheTiger because you asked so nicely. :)
 
@sbi oh thx
but now they are gone again
 
sbi
@TonyTheTiger Ha! Starring others has the same effect!
Now one of you guys try it.
 
Als
@TonyTheTiger: The grumpy old man is just playing he has no control over it ;)
 
12:51 PM
@sbi it's a mind trick you're playing on us or something
 
sbi
@TonyTheTiger No, someone just did the same starring my posting.
 
Huge success!
 
@sbi that was me
 
Als
Makes me happy to say I have been a part of a historic moment:)
 
@Als lulz
the system is broke, time to report to meta?
 
12:53 PM
They'll say it's our fault, again.
 
Als
@TonyTheTiger: I gotta run catch the bus....You guys play around..
 
I wonder if other rooms suffer the same fate
 
I tell you, server gone into star overflow.
 
Als
will catch up from home
 
hmm there's 1984 starred messages, I wonder if that has something to do with it?
 
12:54 PM
Hm, what if we remove one of the earlier stars, and then star a new message.
 
Nineteen Eighty-Four (sometimes written 1984) is a 1948 dystopian novel written by George Orwell, about an oligarchical, collectivist society. Life in the Oceanian province of Airstrip One is a world of perpetual war, pervasive government surveillance, and incessant public mind control. The individual is always subordinated to the state, and it is in part this philosophy which allows the Party to manipulate and control humanity. In the Ministry of Truth, protagonist Winston Smith is a civil servant responsible for perpetuating the Party's propaganda by revising historical records to ren...
 
We know what 1984 is. :P
 
cpx
oh i think i got it too
 
@CatPlusPlus lulz just making sure :p
 
Now it's totally borked.
 
12:56 PM
it's back!!!
no more star wars
 
sbi
0
Q: Starring any message in the C++ room makes list of starred and pinned messages disappear

sbiJust now, whenever someone stars any message in the C++ room, the list of starred and pinned messages disappears. This seems to happen across all browsers for all currently active participants in the C++ room.

 
It's doubleplusbroken.
 
stop starring
lol
 
this is fun :-)
 
Yeah, staring is rude.
 
sbi
12:57 PM
@TonyTheTiger Stop staring at the list of starred postings!
 
@sbi but they are fun to stare at :)
 
sbi
I wonder what happens when someone tries to... Aw. I guess I'd rather keep that to myself.
 
@balpha http://meta.stackoverflow.com/questions/90497/starring-any-message-in-the-c-room-makes-list-of-starred-and-pinned-messages-di
I'm here already :)
 
@balpha quick to respond eh
 
sbi
@balpha Ah, didn't know you're that fast!
 
1:00 PM
starring already starred msg's don't produce that
 
sbi
@TonyTheTiger And I was deliberately holding back that idea, for fear of the list disappearing because of a star that we then wouldn't be able to find anymore...
 
The stars are rebelling.
 
cpx
i locked it, maybe i can bring it back :P
 
sbi
FWIW, the list of all starred messages still works.
See, this is what's needed to get programmers to interact socially: an interesting bug. (Normally this would get a lot of stars, but now nobody would dare, i guess.)
2
@balpha: Pinning has the same effect.
 
SQL Server is throwing a floating point error
digging...
 
1:09 PM
would anyone like to tell me how can i calculate the intermidiate control points of a beizer curve
 
sbi
16 mins ago, by Tony The Tiger
hmm there's 1984 starred messages, I wonder if that has something to do with it?
:)
 
Problem found. Anybody want to venture a guess? :)
 
@balpha star overflow?
 
Divide by zero
 
sbi
Mhmm, what could have changed besides the number of stars? The date. But it's not like May, 9th would be an odd floating point number. Like platform 9 3/4, we now have May, 9.75?
 
1:14 PM
@sbi lol
 
sbi
@balpha Oh come one, put us out of our misery and tell!
 
@sbi yes please!
 
sbi
@TonyTheTiger Why are you referring to me? I'm not the DB messiah here!
 
@sbi just thought it'd be fun :p
 
The clock on the database server is off. And the star hotness algorithm raises the message age to a fractional power
2
so if the message has a negative age, that's a problem...
 
sbi
1:17 PM
@balpha Bahnhof.
 
May of year 2011 problem.
 
@sbi I don't get it?
 
sbi
@CatPlusPlus Yeah, right, that's why we've seen it all May already. Oh, wait...
 
interesting algo name star hotness algorithm, mmh
 
sbi
@TonyTheTiger You couldn't possible. That was one for @balpha.
 
1:18 PM
@sbi lol
 
sbi
@TonyTheTiger Yeah, they copied the star hotness algorithm straight off Hollywood!
 
@sbi hahah probably yeah :) I wonder if you could use that for women too?
 
sbi
@TonyTheTiger (FYI: It's a nonsense reply you give in German when you don't understand something.)
 
@sbi oh I see, hmmmm, I learned something new in German today, nice :)
 
there we go.
 
1:21 PM
THE STARS ARE BACK!
 
Stellar response!
Now let's star everything before withdrawal symptoms start to kick in.
4
 
sbi
So that leaves three questions for me, @balpha: 1) What does it mean to "raise a message to a fractional power"? 2) Why's your DB clock off? 3) Why is the name tag on your avatar blue, while ours are all black?
 
@sbi heh, intersesting, thx for that :)
@CatPlusPlus lol
 
@sbi 3 is because he's the Chat Overlord.
 
1:25 PM
1) I'm writing an explaining answer to your meta question right now, 2) I don't know yet, 3) because I'm a moderator
 
@sbi Message age; like age^k where 0 < k < 1 I assume
 
cpx
Maybe because hes moderator
 
It's in FAQ, even. I know I read about that somewhere.
 
sbi
@LucDanton So by "raising a message" he means "raising a message's age"?
 
He said age. :P
 
1:26 PM
@sbi He did
 
@CatPlusPlus what's so special about saying "age"?
 
cpx
@balpha Do you know about the @Feeds guy that comes into this room?
 
what, me?
3
 
sbi
@CatPlusPlus Oh, damn. I overlooked that. <hides_in_shame/>
 
@Feeds didn't know bots could answer messages?
 
sbi
1:27 PM
@Feeds Yeah, he sometimes appears without posting a message.
 
cpx
@Feeds haha yes
 
Witch!
 
I'm still confused to this day if @Feeds is a human or a bot?!!
 
sbi
@balpha: There's two feeds setup to be posted by the @Feed guy. However, in the last week (or so) we've seen the @Feed guy appear several times here without posting. How does that happen?
 
I can't really talk. But @balpha has the power to impersonate system users :)
 
sbi
1:29 PM
@TonyTheTiger @Feed is a bot, but @balpha is the puppet master. :)
 
@sbi oh I see, now that really did boggle my mind for a bit there :)
 
@sbi He appears whenever he does something; that includes (for example) deleting messages that were flagged as spam often enough
 
sbi
@balpha Oh, that he does, too? I didn't know. What else does he do? Because I don't think there was anything flagged here when that happened.
 
@sbi I flagged something last week
 
sbi
1:32 PM
@TonyTheTiger Yeah, we can always count on you conservative bastard to be offended by this room's free talk! :)
 
@sbi that was the first time I ever flagged anything, but yea I'm proud for my conservatism :) lol
 
sbi
@balpha Yeah, so something was flagged. But I don't think this has happened every time we've seen the guy. ICBWT.
 
I can't think of anything else he would do right now... ICBWAWT
 
sbi
@balpha Ok. Thanks for the explanations.
 
didn't know this existed
1
Q: Increase the limit of 6 questions in 24 hours

MEMIs there a way to augment the limit of 6 questions in 24 hours ?

meta seems offline
 
1:41 PM
Nick just triggered a build
should only be a few seconds
 
@balpha oh ok
 
 
1 hour later…
2:49 PM
If I write doubles to a file what precision should i choose (in digitis) in order to use them for later verification?
 
@Nils depends on what you want to use them for
and what the precision of your original data is
 
the original data is double
 
@Nils that's not what I meant
you're talking about storing a decimal number from a double - so how precise is the data in the double?
 
@Nils At most 53 decimal digits according to James Kanze on clc++
 
what's the unit?
 
2:51 PM
do you want me to dig a link on google groups?
 
no units
 
it only makes sense to store 53 decimal digits if they all actually mean something
 
ok
 
@Ronald "at most" ;)
 
let's see if it works better if I set precision to 53
 
2:52 PM
Don't need to store 1.000...0 for 1 you are correct
 
don't need to store 0.009999999999999999999999... either if what you're looking at is 1%
0.01 will do just fine :)
 
Well not really... you're assuming you already normalized the data somehow
 
@LucDanton no: I'm assuming the data is normalized either before or while it's stored. I'm assuming the data means something and it is that meaning you intend to capture
 
ah it really makes a difference, more results match, but still not all
 
otherwise, you should store it as a binary
(so those silly humans won't muck around with it)
 
2:57 PM
I increased precision it from 20 to 53.
@RonaldLandheerCieslak So binary would mean no loss of precision and therefore I get the exact same bits back when reading it again?
 
@Nils that's the idea
 
sbi
@RonaldLandheerCieslak Storing binary also has the advantage that it throws off silly humans who want to have their programs reading it on machines with a different floating point representation.
 
@sbi exactly - I just love messing with silly human brains :)
 
Als
Bwaah....
 
but they have a standard for floating-point data interchange that they use...
 
3:00 PM
@sbi like?
 
@Nils Reading a bit from the clc++ archive apparently the 53 figure works with scientific notation
 
a machine which does not support double precision?
 
@Als good morning to you too :-)
 
which clc++ archive?
so what the way to write floats as binary in C++?
 
The one that comes with my newsreader :)
 
sbi
3:01 PM
@Nils As I understand @Ronald's question: If it's millimeters which represent coordinates of this sun system's celestial bodies, chopping off 1,000 or even 1,000,000 won't make much of a difference. Now, if it's AUs representing the same data, you need much more precision. (Is that right, @Ronald?)
 
Als
@RonaldLandheerCieslak: Good morning to you.....almost good night for me :)
 
@Nils discussion is archived by google here groups.google.com/group/comp.lang.c++/browse_thread/thread/…
 
@Als your "Bwaah" sounded like a morning yawn :)
 
Als
@s: Hey grumpy pa.....you got the admin guy to bring back the stars eh
 
sbi
3:03 PM
@Nils I dunno. Floating point number representations might differ between platforms. While a C++ program should be able to read such a number as a string, one platform's binary representation might be garbage to the next.
 
@sbi exactly, but as I said: there are standards for floating point interchange, including binaries
 
sbi
@Als Yeah, he found a real silly error. :) (BTW, @attributions need at least three letters to work.)
 
Als
@RonaldLandheerCieslak: That was an intellectual expression..ask @sbi
 
sbi
@RonaldLandheerCieslak I'm sure there are. Which is why I kept a back door open by saying "might". :)
 
3:04 PM
@sbi en.wikipedia.org/wiki/Double_precision_floating-point_format It says exactly which bits belong where or did I not properly understand something?
@LucDanton can you repost the link it's somehow broken
 
@Nils which exact floating-point representation is used is implementation-defined, but IEEE 754 is one of those standards I've been talking about
 
sbi
@Nils Works for me.
 
Als
@sbi: hacker news hotness algorithm sounds fun :P
 
is there a C++ thing for fwrite or shall I just use the C lib?
 
@Nils you mean fstreams ?
 
3:07 PM
Er, ostream.write?
 
yes
 
sbi
1 hour ago, by sbi
@TonyTheTiger Yeah, they copied the star hotness algorithm straight off Hollywood!
 
@Nils I'm sorry about the link but I can't find a 'link' button, how does this one work: groups.google.com/group/comp.lang.c++/browse_thread/thread/…
 
sbi
Anyway. gotta go feed the kids. See you!
 
Als
@sbi: Big boasts small roasts ;) hotness algos
 
3:08 PM
@Nils in any case if you search for 'double to string retain "precision"' on groups.google.com you find the thread right away
 
@LucDanton thx
 
if you intend to interchange your floats (or doubles, or whatnot) between machines, I'd advise you to put it in binary, and read up on IEEE-754
 
I don't want to :P
big endian or little endian or what else could differ?
 
@Nils in that case, if you don't want to lose precision, just dump the double into a buffer and save that as you would any other binary data
 
@Nils the format altogether
@Nils double doesn't have to follow IEEE-754 or anything
 
3:14 PM
@Nils lots of things can differ, from the number of bits allocated for the base or the exponent, to the entire format
but you only need to worry about that if you want your binary file to be portable
which you don't appear to want
 
ok
thx for the info
 
FYI n3290 p 3.9.1/8 defines how floating point types work
 
That's funny, I wrote up a small example to show the quick and dirty way to do binary serialization and I can't get it working
 
There are three floating point types: float, double, and long double. The type double provides at least as much precision as float, and the type long double provides at least as much precision as double. The set of values of the type float is a subset of the set of values of the type double; the set of values of the type double is a subset of the set of values of the type long double. **The value representation of floating-point types is implementation-defined**. Integral and floating types are collectively called arithmetic
 
n3290?
 
3:33 PM
@Nils right here's an example ideone.com/DPOiY
notice it fails here because the executable don't have the permissions to make a file and I do no error checking
if you want to do something like this please understand how it works so that you're not surprised when it doesn't :p
 
thx, but why casting it in a char first?
 
it's what std::ostream::write wants
ditto for std::istream::read
 
ok
@LucDanton seems to work fine here I tested it by writing M_PI in to the file
 
@Nils So did it on my machine
 
 
2 hours later…
Als
5:18 PM
Entire room for myself!! bwah this is scary!
 
Als
5:33 PM
Boooo....ooo...oo..o
 
@Als awwwww... don't cry..!
 
no I'm here
 
see @Als, you're not alone!
 
we're all here, but we like to give the illusion that we aren't
 
cpx
count+=1
 
5:54 PM
ugh
 
0
Q: Constructor? or something else?

SauronSo I was looking through some samples in a Direct X 10 book, when I came across this PeaksAndValleys::PeaksAndValleys() : mNumRows(0), mNumCols(0), mNumVertices(0), mNumFaces(0), md3dDevice(0), mVB(0), mIB(0) { } I understand this is probably supposed to be a constructor......but i've never ...

vote to close as exact duplicate, please
Do we have a FAQ on why Singletons are bad? Do we need one? Is StackOverflow even the right site for that?
 
6:35 PM
@FredOverflow lots of questions on Singletons I'm sure
hmmm
0
Q: transfering object ownership on std::allocator rebind

PaulHI have a Visual Studio 2008 C++ application where I am implementing a replacement for the standard allocator used in containers like std::vector. But, I've run in to an issue. My implementation relies on the allocator owning a handle to a resource. In the case where the rebind feature is used, I ...

 
sbi
7:24 PM
@cpx ++count
@FredOverflow ++close_votes
@FredOverflow ++pro_voices
 
Interesting... I got notifications on comments on the following question, even though they were not addressed specifically to me with the @User syntax:
3
Q: Vector of object pointers, initialisation

MCXXIIII'm not very experienced with C++ yet, so bear with me if this is basic stuff. I have some code like that below. L is an abstract class (it has a number of pure virtual functions), and A, B and C are regular classes all derived from L. There may be any number of these, and they are all different...

Is that a recent SO feature?
Also, what is your opinion on the following matter?
> The point is, if the destructors don't do anything special (like writing to a log file or something), you may get away without calling delete on the [global] pointers at all, because the memory will be reclaimed when the program exits, anyway.
 
sbi
@FredOverflow Yep. I saw it mentioned that, if there's a single comment to some question/answer, and the user who provided the question/answer adds another comment, then the original comment author gets notified. I'm too lazy to search meta.stackoverflow.com/questions/59445/…, though.
@FredOverflow Is reclaiming indeed required by the standard? DOS didn't use to reclaim such memory. Would that make it a platform not supported by the C++ standard?
 
7:42 PM
@sbi That's why I'm asking -- I'm not sure :)
 
sbi
@FredOverflow Actually, I somewhat doubt it. But since I tend to avoid reading the standard, I'll have to leave that for others to decide...
 
hello all
so @sbi you've done 20 years of C++and never needed a custom allocater?
wow
 
@sbi So C++ programs can cause "permanent" memory leaks, even after they shut down?
 
@FredOverflow I don't think so, at least in Windows the OS cleans up all process resources on process exit
so nothing remains
 
10
Q: When you exit a C application, is the malloc-ed memory automatically freed?

Andreas GrechLet's say I have the following C code: int main () { int *p = malloc(10 * sizeof *p); *p = 42; return 0; //Exiting without freeing the allocated memory } When I compile and execute that C program, ie after allocating some space in memory, will that memory I allocated be still allocated ...

 
7:55 PM
@FredOverflow thats what I thought
 
00:00 - 20:0020:00 - 00:00

« first day (205 days earlier)      last day (4742 days later) »