« first day (355 days earlier)      last day (4575 days later) » 

1:25 AM
hi all
is GCC 4.7's std::initializer_list support horribly broken? It seems I need to always use -fno-deduce-init-list
 
 
4 hours later…
5:06 AM
Hey guys... do you guys know why you shouldn't return a reference to a local variable?
 
Als
You shouldn't return a reference to the local variable because the variables lifetime is only till the function exists.
 
@Als So that is wrong why???
oh
 
Als
Once the function returns the variable does not exist anymore and what you are left is a reference to something which does not(rather should not) exist
 
becasuse the memory eventually doesn't belong to it?
ok
 
5:11 AM
@Als Thanks for that answer. Do you understand this? "operator overloading (method vs. function)" Is this talking about the types of operator overloading whether it's inside the class and whether or not it's a friend method?
 
Als
@oorosco: Hard tell from that, need more context
@AlfPSteinbach: Hola
 
Yeah that's all the context i have lol. It was a little over view i was passed. One of the questions that mad elittle sense ot me haha
 
Als
@AlfPSteinbach: Steve Jobs is no more!
 
@Potatoswatter No, it's fine. Are you using list initializer syntax with deduction?
 
Als
@oorosco: On second thought, Yes method= member function, function= free function, So it talks about what you are thinking
 
5:15 AM
okay. The difference being that the non-member function can be formatted e.g. +E
instead of E+...
@Als
 
@oorosco That doesn't sound right. What do you mean by formatting?
 
like if it's amember function, doesn't that require for the class_object to preceed the overloaded operator?
@LucDanton
 
Als
@oorosco: With free functions you can say support both formats, obj + 10 or say 10 + obj
 
Well, remember that there is in an implicit *this parameter.
 
Als
Member operator overload will fail to work for 10 + obj
ofcourse obj refers to object of your class
 
5:19 AM
So if a class T has a R operator+(T); member, then you still write that lhs + rhs, which is equivalent to lhs.operator+(rhs)
On the other hand, if there is a freestanding R operator+(T, T) then lhs + rhs is equivalent to operator+(lhs, rhs)
 
Yeah that's what i figured.
So does the non-member function need to be a friend function for easier access to its parameter's data members?
 
Als
@oorosco: Yes, If it needs to access non public members of the class object.
 
Okay, sick.
 
Als
There is no other way it could access those members could it?
 
Would
!T
need to be a free function?
 
5:22 AM
Technically it doesn't need to be in that you can still write the function. But usually yes you want access to the innards :)
@oorosco It can be either.
!t can be equivalent to operator!(t) for a freestanding operator or t.operator!() for a member operator.
 
Als
@oorosco: This should be a very good read for you:
87
Q: Operator overloading

sbiWhat are the basic rules and idioms for operator overloading in C++? Index of answers: The General Syntax of operator overloading in C++ The Three Basic Rules of Operator Overloading in C++ The Decision between Member and Non-member Common operators to overload Assignment Operator Input and O...

 
Ok.
Btw @LucDanton why did you add the (member) after an empty parameter field
 
Sorry, that's not code. Let me reformat.
 
@Als The few cells that wanted to live forever, killed the entire organism and thus also themselves -- and robbed us of Steve Jobs. I think with him disappears the long range vision. Apple will go on, and one must hope for Somone to take up the Job of being far-sighted visionary.
 
Als
@AlfPSteinbach: Ahem, He was the vision for Apple.
I wonder if Apple is going to be that big or that innovative post him.
I was a little shocked, didn't knew he was keeping so unwell
 
5:27 AM
I'm surprised you guys liked Steve being programmers and all, i heard his strict rule over his market place limited a lot of innovation and made programmers jump through hoops
 
Als
It is that kind of an attitude that makes things happen @oorosco
Or we won't reall have tablets or ipods or even an iphone
 
@oorosco there's a price to pay for anything. in the case of apple, they had to and have to fight using pretty dirty means, such as vendor lock-in. but i have always thought they could have earned a lot by simply selling their OS, adapted to run on ordinary PC (perhaps with some special card or something). alas, they see themselves as a purely hardware company. when they're at least equally good on software.
 
Not a fan of Ipads xD I prefer laptop tablets haha. As for the iphone/ipod I appreciate the fact that thought it wasn't per say the greatest innovations i do like the fact that they instigated competition forcing others to fight to survive
Steve jobs was an allright dude but i didn't like the brutality nor the fan boys it created, oh well, nothing against him though, RIP
 
Als
room topic changed to Lounge<C++>: RIP Steve Jobs [1955-2011] [c++] [c++11] [c++-faq]
4
 
@als So when people haave the numbers after C++ does that show version numbers?
 
Als
5:37 AM
If you mean C++03 -----> C++ Standard released in 2003
C++11 ------> C++ Standard released in 2011
 
sbi
@Als Yeah, I just heard it in the news. To think that only on Tuesday many had expected him to at least make a short appearance, while he was already almost dead. I suppose all of you have seen youtube.com/watch?v=Hd_ptbiPoXM?
 
Als
Yes, Very popular speech that
Uhm I got a flurry of downvotes again
@sbi: Do you cite anything wrong in the 3 downvoted entries here:
 
Steve Jobs is dead? Wtf?
 
sbi
@Als No. I gave you an upvote for each. Interesting. Three consecute downvotes yesterday, another three today. It looks like someone who knows exactly what he's doing is out there to get you. Fortunately, against your 25k this is only mosquito bites.
Any of you had a look at apple.com right now?
 
Als
@sbi: Someone who knows that more downvotes would trigger the fraud detection.
And interestingly i know who the A-Hole is
@sbi: hehe, not you!
 
sbi
5:48 AM
@Als How come?
@Als (You wrote "you" instead of "who".)
 
Als
Ahh, corrected, typo!
 
sbi
So how come you think you know who is doing this?
Steve Jobs is now joking with Douglas Adams about putting WIkipedia on an iPad and writing "Don't Panic" on the case.
Ugh, I gotta get going. Need to leave the house in 25mins.
@Als Please explain why you know who does this in a reply, so I can see it later.
 
Als
Ah I will
 
sbi
@Als Note that I didn't ask who, but why. I wouldn't want someone pointed out unless I'm sure, too, it's the asshole.
 
Als
@sbi: I know who and why, I will let you know
 
6:03 AM
I have a feeling I'll get really really extremely tired of hearing about Steve Jobs before the day is over...
 
Xeo
6:13 AM
Guys, any idea what to do if all you have handy is an ipod touch, but it's really itching you to write some code?
 
Out of curiosity how do you have access to the chat?
 
user457812
Sharpen the corner of the iPod touch and begin carving code into your very being
2
 
user457812
Or I guess you could use something like ideone to code/test thingies
 
Xeo
@Luc: wlan
 
I mean what device :)
 
Xeo
6:16 AM
ipod touch, like said
And there are no compiler on the appstore for free...
 
user457812
Like I said, try ideone.
 
Xeo
Damn, I should really get a laptop soon
@nil the problem is that if I dare switch to another open window in safari, I have to fear that the ideone page simply gets reloaded once I tab back :(
 
user457812
So save your code before leaving the window?
 
Xeo
:/
Anyone willing to buy me a laptop to get me out of this misery?
 
user457812
I'd rather buy me a laptop.
 
user457812
6:22 AM
Actually, I could code on my touchpad using vim...
 
user457812
That would be a really weird experience
 
Xeo
Try it! Though i think the missing haptic feedback from pressing the keys can be really irritating.
 
Als
@sbi: It started on a particular Q, Wherein, I had a rub-in with a particular user over one of my answer. Immediately,within seconds, there was surge of downvotes(>10) on me,I queried this user in the comments about it & this user agreed it was him who downvoted and bragged it was within his rights to do so & that SO policy allows him, We had an heated argument over it, following which the user deleted his comment.
@sbi: On that ocassion the Fraud detection algorithm detected and reversed the downvotes.
After the incident I have been on the receiving end of regular serial revenge downvoting but that user seems to have wisened up & learned to game the system, The downvotes happen but just enough to not trigger the Fraud detection.
@sbi: Few noticable ones:

Oct 6: 3 Downvotes
Oct 5: 3 Downvotes
Sep 21: 5 Downvotes
Sep 22: 2 Downvotes
@sbi: All anonymous, with no real reasoning.

Every time I see the downvotes happening, I can see this user is active and on almost all occassions I could match his vote casting pattern with the downvoting against me.
@sbi: Even yesterday,He posted a wrong answer & I just pointed the incorrectness(without even downvoting) & the response is a quick 3 downvotes(which you upvoted) where in there was no reason for any.
@sbi: I have flagged for moderator attention & the mod said there is nothing they can do to write to team@stackoverflow.com. I haven't written them there yet, but this whole situation is rather disturbing.
@sbi: So that's the story, without the who part in it, but i sure know who the Ass hole is.
 
user457812
How strangely immature
 
Als
@nil: For sure, and I suspect this user of being a nuisance to other users too.
His usual voting count is like 40votes per day
 
user457812
6:37 AM
I still kind of wonder who went off on my answers once, but the serial downvote detector majigger picked up on it, so eh
 
Als
@nil: The algorithm is good but not so good as the above demonstrates.
 
user457812
Yeah, well, maybe bring it up on meta or what have you
 
user457812
More the algorithm's deficiencies than the downvoting itself - i.e., it could check multiple days to see if there is consistent downvoting going on
 
user457812
Might already be up there too, since I haven't checked meta
 
Als
@nil: The Fraud detection algo is all under wraps
 
user457812
6:41 AM
That's probably a good idea
 
Als
No info is released about it since it might help people game the system
 
Does anyone see problem with this query?

SELECT *
FROM (((allMaterialCategories AS A INNER JOIN tblMMMaterials AS M ON M.MaterialNumber = A.materialNumber) INNER JOIN tblMMMaterialCategories AS C ON C.CategoryCode = A.cat4) LEFT JOIN tblMMMaterialCategoryMatrix AS matrix ON matrix.materialid = M.MaterialID AND matrix.categoryID = C.CategoryID)
WHERE matrix.categoryID IS NULL;

I'm trying to run it in MS ACCES 2002 and I'm getting a "Join expression not supported" error..
 
Als
@Shawn: You need to read this: loungecpp.wikidot.com/owners%3Anewbie-hints
 
user457812
A MS Access question in a C++ room..
 
Als
@nil: The problem is not releasing the info didn't stop users from learning to game it based on experiences gained over period of time.
 
user457812
6:42 AM
That is bizarre
 
it's an sql question...what makes it specifically access?
 
user457812
The part that says "I'm trying to run it in MS ACCES 2002"
 
user457812
Not to mention the error looks to be pretty obvious: join isn't supported.
 
That's why I thought I would slip it in. I'm also convinced it's obvious, but I can't see it :(
Anyways, I shouldn't have, sorry for the spam guys
gals
 
user457812
I'm an it
 
6:46 AM
oops...didn't see the access part.. :P but anyway, yeah. the error's kinda obvious. access doesn't want to join stuff the way you're trying to do it
i thought for sure it supported joins, though
 
it's supposed to support joins. I've use inner joins and left joins before.
 
it might not like the compound expression for the left join. see office.microsoft.com/en-us/access-help/…
it looks like it specifically expects to check one field from each table
 
Hmm, looks like you're right
damn it, I needed that
Thanks for the debug though!
 
Als
@Shawn: Your Q might get more audience if you post it as an Q in the forums.
 
This quick fix was all I needed to get me going again. Thanks for the suggestion though.
I ended up putting the other join criteria in the WHERE clause and it stopped complaining
 
user457812
6:56 AM
I want a new monitor.
 
user457812
If I can't have three source files open in split view on the same screen, I am not happy.
 
Why aren't 2 screens good enough?
oops, gtg, thanks again for you help cHao
 
7:17 AM
Steve :(
 
7:47 AM
yeah :(
 
8:15 AM
argh
as if there aren't enough taglines all over the internets?
even the SO main page has Steve Jobs on it
don't suppose it's possible to get something that isn't Steve Jobs
 
i just tune it out :P
 
hi all
 
like...yeah. he's dead. wow. ok, on with my life
 
harsh
 
well, I don't necessarily feel that way
but I already know Steve Jobs is dead and telling me again sure isn't gonna change how I feel
 
8:17 AM
exactly
 
@DeadMG what SO main page? Can't see any SJ pic on it
 
not pic
just a quote
 
how can i clean screen in c++?
 
clrscr()
 
platform independently?
 
8:18 AM
i think or system("cls") although
but that's bad
 
what libraty?
what library?
 
you don't need one I think
just include iostream
 
clrscr() is in conio.h (which, i think, is a dos/windows thing)
 
yeah...but if he includes iostream shouldn't it have that
 
8:20 AM
no
conio isn't even Standard, nor is it C++
 
i highly doubt it. why would streams know how to clear a screen?
 
oh I see it now
 
c++ hasnt this library
 
int main() {} doesn't have a notion of a screen, nor does it need one.
 
right...there's no one universal clear-the-screen function in c++
hold on...though sure i found a link about this very thing somewhere...lol
eh...see 15.20
 
8:25 AM
for windows it will be system("cls") no idea about linux
 
system("clear") should do the same thing
ie: it'd be linux's equivalent, if you resort to system
which, frankly, is about the only semi-portable way to do it
 
Why would you want to clear the screen? Were you watching ASCII porn when your boss showed up?
 
i test them all but when i run the exe file i see this in screen "cls not found"
 
lol...ascii porn
 
i want to showing the percentage of doing the work on my program
 
8:30 AM
come again?
 
we see this 12% 13% 14% ....... but i want write this 1% and in screen in the same place just change the digit
 
what os?
 
What platform do you want?
ncurses is nice.
 
windows
with g++ compiler i installed it on my pc
 
if you're actually going to use ncurses, it's nice. it's a bit too much work to start it up just to clear the screen though
 
8:33 AM
Turns out he doesn't actually want to clear the screen.
 
and how ?
 
He just wants to write over something in it.
 
ncurses? wtf
 
exactly
 
can you do that in ncurses without taking over the whole screen?
i'm thinking no
 
8:34 AM
Is conio still non-obsolete in Windows?
 
either way, ncurses sounds like it's not an option anyway, unless gcc includes a library for it
for windows-native compilers, it's still semi common...dunno if gcc would have it though
 
There's also the WinAPI.,
 
im new in c++ and use it for physics simulation (FDTD alghoritm)and the program has long runtime i just want to show the percentage of the process
 
SetConsoleCursorPosition and such.
May be too much work though.
 
might be. i'm thinking you have to grab console handles and all kinds of stuff
 
8:37 AM
percenet shows the percentage in my program and i want to write in same place at every time not in new lines
 
you can just write backspace characters to the console
if you want to erase the last few charactres
 
so, umm...wondering...why can't you just backspace?
 
That works?
Wow.
 
as long as you don't print a CR/LF, yeah
should
 
I believe it does
 
8:38 AM
char bs = 8; std::cout << bs;
Like that?
 
yeah, except a bunch of them :)
 
well, as many as you need, 1 per character to clear
and it's expressed as \b I believe
 
apparently so
 
thats not work
 
I always thought you'd end up with something like blah blah^Hblah blah.
 
8:44 AM
thanks all
bye
 
see ya
if \b doesn't work, you might be able to print a CR (without LF) to end up back at the beginning of the line
 
works fine on Windows
 
and you can reprint it (plus a couple of spaces for padding)
 
\b moves the cursor back, it doesn't erase, so I printed additional spaces, and then backed it up again to erase the text
std::cout << "Ohai!!!";
std::cout << "\b\b\b";
std::cout << "   ";
std::cout << "\b\b\b";
erases "!!!" from the console
and leaves the caret in a position as if it were never output
 
maybe it's some gcc/cygwin/mingw/whatever boneheadedness?
 
8:47 AM
I believe that, just like \n, the operating system is supposed to implement it
maybe previous versions of Windows don't? I am on the Win8 DP
but then, it doesn't make sense to add console features now
 
afaik all versions of windows act like you saw it act
even dos acted like that iirc
 
yeah
so unless, for some reason, the implementation cleaned them out
implementation of cout, I mean
then there's no reason at all it shouldn't work on Windows
 
but cygwin, for example, is kinda a whole other system sitting on top of windows...and it does some wackiness with the console window as well
 
in fact, I believe that by the ASCII Standard, it should work on all ASCII systems
and, by extension, Unicode
 
@DeadMG But ASCII doesn't dictate console behaviour.
It's perfectly fine to output blah^H^H^H^H.
 
8:50 AM
I believe that if you give an implementation an ASCII character, then the behaviour is mandated
 
As a standard it's an encoding and no more.
 
including for the control characters
 
If I send something over the wire, ASCII encoded, I may want to preserve info like backspace characters. ASCII doesn't require the information to be destroyed.
Same applies to a console.
Because ASCII has no business beyond the representation of the characters.
 
it's a control character, the purpose of the control character is to control the output
all output devices should behave the same
with regards to the defined ones, anyway
what mess would we be in if consoles decided that they could just ignore \n and have it a space instead?
 
> Except for the control characters that prescribe elementary line-oriented formatting, ASCII does not define any mechanism for describing the structure or appearance of text within a document.
And from the horse's mouth:
> the use of US-ASCII control characters (values 1 through 8, 11, 12, and 14 through 31) is discouraged since their interpretation by receivers for display is not guaranteed.
 
8:57 AM
so I see
 
Only Tab, CR and LF are specified.
 
Well, that Ietf RFC doesn't apply to ASCII as a standard, does it?
 
I don't have the ASCII standard.
 
i.e. if a device is documented as being specified by "ASCII + the Internet Message Format as specified by RFC so-and-so and so-and-so", that's not the same as simply an "ASCII-conformant" device.
 
Fair enough.
And, hmm, that document forgets Delete.
 
9:00 AM
Standards are srs bsns.
 
Everyone always forgets Delete.
 
morning creeps :P
 
hypocrite
 
lol
so what's been going on in here?
since I last creeped you all out
 
still badgering the university
now it turns out they might have lost some coursework of mine, and I got 0 for it, and if it turns out they have it and/or it's their fault, I might not have to resit at all
 
9:09 AM
Here when that happens you get an automatic 14 out of 20 grade.
Which is even better than the minimum 10 out of 20 you needed to pass.
 
So I discovered in vim how CTRL-W CTRL-F is like gf but in a new split. Except it's an horizontal split and I like vertical splits better. Any suggestion to do the same with a vertsplit/convert to a vertsplit? Can't find anything relevant within :help :split.
 
oh wow
 
@LucDanton Hmm. Maybe you can remap it to something. Lemme give it a try.
 
To :vertical {cmd} then?
CTRL-W + H to move a split to the left, which does make it change to a vertical split.
 
:vsplit +normal\ gf
This works.
 
9:14 AM
What's the `+normal` about?
 
The + is because there's an optional param before that is omitted. Think of it like a parameter name.
 
This has the effect of opening a split even if gf fails.
 
The normal is the : command for running normal mode commands.
@LucDanton Oh.
Never payed much attention to "error handling" in vim :)
 
Ah well, :vertical +normal\ gf doesn't seem to have an effect.
 
:vertical doesn't work for :normal :(
 
9:17 AM
What's the way to represent CTRL-W F as a command?
Arguably that's what :vertical expects, a window command, unlike gf.
 
Can't find it.
 
No matter, thanks for the help. I'll learn that another day, moving the split about will do for now.
(I take pleasure in making 'about will do for' a valid English string.)
 
:vertical split +normal\ gf splits on error too :( I really have no idea how error handling works.
 
I guess that's worth asking some Vim gurus but I fear I'm approaching my daily dose of learning vim :p
 
Help says, C-W f is like :split gf but doesn't split if the file does not exist.
Which means it uses :split gf and magic.
Damn.
 
9:24 AM
gotta love magic
 
Well for me the commands that work in two stages (e.g. C-W for all the window related stuff) are magic.
 
sbi
0
Q: Shouldn't serial downvoters be banned from SO?

sbiThere was a discussion about unexplained serial down-voting in the C++ room this morning (starting here). The user affected by it explained it to me thus: It started on a particular Q, Wherein, I had a rub-in with a particular user over one of my answer. Immediately,within seconds, there was...

 
@LucDanton You can map key chord sequences too!
 
sbi
@Als: Let's see what happens to this. I hope it's not closed as a dupe right away.
 
@RMartinhoFernandes Okay, but don't tell me how (today)!
 
9:29 AM
:noremap ^W^W^W^W^W :wqa!
Mwhahahaha! I'll make your brain overflow!
 
:(
Decided to have a better Vim for Haskell-related stuff, but that means learning to use all the goodies I installed at once.
@RMartinhoFernandes Do you use tags for C++? I don't even know if you use vim for C++ though.
 
Currently I've been using Code::Blocks, because I've been too lazy to set up tags. I don't know how well that works for C++.
I had a good experience using them for C, though.
C++ is not very amenable to tooling :(
 
sbi
@CatPlusPlus Actually it is you who stole my rep. I answered first, but yours got accepted, thus to the top, and now your upvotes have almost caught up with mine.
 
I only upvoted the bonobo. The cat is a thief.
 
@RMartinhoFernandes Yeah, I've ignored tags so far for C++, too much of a hassle. Seems fun with Haskell though.
 
9:38 AM
UI design pro-tip: if your interface has scrollbars, don't make the mouse wheel zoom, and Ctrl+mouse wheel scroll. It's the other way around, asshole.
 
@RMartinhoFernandes does one need to do ui design for a living (being professional) to know that?
 
Apparently, someone at Microsoft doesn't know that.
 
@sbi Who is the guy that's downvoting you all the time?
or sorry, was it Als who got downvoted?
 
sbi
@ManofOneWay It's not me. I had this happen to me once, but it was detected by the voting fraud algorithm and reverted.
 
DOWNVOTE ALL THE THINGS!!!
 
9:46 AM
Yupee! At least the stupid mouse wheel behaviour is configurable.
 
sbi
@RMartinhoFernandes You know, given that many here didn't know my avatar is a gorilla, let alone there's things like bonobos, this "bonobo in disguise" story might not have been the best of my ideas. (The other day @Dead referred to me as "the bonobo" in a comment to an answer.)
 
Feels so good to scroll the wheel and not end up with a single gigantic letter on the screen.
> Bonobo is the component object model of the GNOME (Gnu Network Object Model Environments) project (it is also a monkey -- see Resources).
 
sbi
@RMartinhoFernandes Sigh. If the librarian was here, he'd unscrew their collective heads.
 
> Components have an implicit document/view abstraction, and are suitable for embedding in productivity applications.
 
sbi
(For the rest of you uneducated bunch: Bonobos aren't monkeys, they are apes.)
 
9:52 AM
@LucDanton No idea what that means.
 
@RMartinhoFernandes Honestly parsing the phrase goes well until I hit 'productivity applications'. Then I have no idea.
 
Same here.
 

« first day (355 days earlier)      last day (4575 days later) »