« first day (352 days earlier)      last day (4588 days later) » 

Als
4:00 PM
hmm...I think its fair enough @RMartinhoFernandes
 
@als: instead you should just tell your readers that when the destructor code executes, the dynamic type is that class
 
@Als es noch alles so einfach war...
err
 
@RMartinhoFernandes not me. in C++ it works as one would normally expect. in C# and Java it does not.
 
4:01 PM
Er, now I don't get what other languages have to do with it.
 
that is, in C++ it's type safe. in C# and Java it's not type safe. it's one of the most common bug causes in Java.
 
'Normally' is a word that I distrust, unless doing geometry.
 
Als
@AlfPSteinbach: I guess so
 
does "it works as one would normally expect" mean "if you are normal you would expect it to work this way" ?
 
@JohannesSchaublitb yes
 
4:02 PM
i see
 
Als
@JohannesSchaublitb: English please, the sentence @me
 
you don't expect dead people to wander around, or dead parts of an object doing things
 
@Als im sorry it was a paren failure
 
@AlfPSteinbach They're not dead in the constructor, they're prealive!
 
4:03 PM
Gestating.
 
the sentence was "Als es noch alles so einfach war..." and I wanted to put at before it. but I forgot parens around it. "@(Als es noch alles so einfach war...)".
 
Als
what does it mean anyway?
 
That doesn't make much sense.
Why would you want to put an @ there?
Today I learned the verb "to bitwise".
Or something.
1
Q: Is there a mor Elegant way of bitwising (java or C/C++) in this example:

OrochiI built this program that bitwise three numbers: 2, 4 and 20: public static void main(String[] args) { int mask = 63; int id = 2; id = (id << 6) | 4; id = (id << 6) | 20; int v3 = id & mask; int v2 = (id >> 6) & mask; int v1 = (id >> 6*...

 
Obligatory 'Verbing weirds language'.
2
 
that's fail
 
4:07 PM
Ugh, I hate the "pending edits" feature.
 
Argh I have no OpenGL acceleration, Vista doesn't support my 5 year old ATI card :(
 
I need to use a backdoor to edit something that has a one-character pending edit on it...
 
Als
"Virtual dispatch in ctors and dtors doesn't work as you would normally expect. The type of the object in constructor/destructor is always the same as that of the class(whose constructor or destructor is called), hence any function call results in call to the function of the same Class"
Does that make everyone happy?
 
@Als Als means "when" or "than" depending on context :)
 
I'm always happy.
 
4:08 PM
@JohannesSchaublitb So when exactly was it so simple?
 
good for some people
I'm currently trying to work out if I can sneak out of the house without having to meet any parents
 
@LucDanton back when we just had c89 :(
 
Als
@AlfPSteinbach: Do you agree to that definition?
@DeadMG: Plan on Stealing the results!
 
@Als i would normally expect what C++ does. the code effect is the same as if the object was instantiated from this class. it's that simple.
 
4:10 PM
there is no difference between code effect in some member function foo(), and the destructor
 
Als
grrr...now we are debating what is normal
are you still unhappy with that definition?
 
it's exactly the same rules at play, which makes it (1) safe and (2) predictable and (3) what any normal person would expect. :-)
 
@AlfPSteinbach Clearly the asker (presumably the you in the sentence) didn't expect that.
 
@DeadMG any parents, or your parents?
 
Als
@FredOverflow: lol
@AlfPSteinbach: Lets just separate out Alf the very normal thinker and consider the general users of C++
would you then agree to the definition?
 
4:12 PM
"during the execution of a constructor or destructor, virtual calls on the object for which the constructor or destructor is run behave as if the dynamic type of the object expression used in the call is equal to the class of the constructor or destructor."
 
no. it gives the impression of different rules for a destructor. but the rules are the same.
 
dood, what do you say to TAHT!
 
Als
@JohannesSchaublitb: Complicated Is what I can say
lol
 
Als
4:13 PM
It is @JohannesSchaublitb, for a new user that would set one off
 
I think, by trying to find an agreeable 'rule of thumb', you're making a big deal of a fairly innocuous thing.
 
quick, I changed it
 
Just leave it at "It doesn't work as you expected". Nuke the "normally".
 
The crucial thing is to ask 'what do you want the dynamic type of the object to be during construction and destruction?', and then everything about virtual dispatch falls into place.
 
Als
@JohannesSchaublitb: I would buy that
 
4:15 PM
and also everything about typeid and dynamic_cast
lol
 
@JohannesSchaublitb how come i didn't think of that now? but very good point. it belongs together.
 
s,on the object,on the object or one of its base-class subobects,
@AlfPSteinbach ohh
 
Als
@LucDanton: I agree, Though Me and Alf discussed this on a Q in the morning and I have had an itch since morning to get to the bottom of it. I couldn't get in chat during the day because network at work hates this chat.
 
Well, that's my bottom right there.
 
Als
yadda
 
4:18 PM
I didn't ask for anyone's bottom.
 
Als
Oh, today I saw a code that used std::new not the nothrow version and which checked for NULL return type
:)
 
There's no std::new, right?
 
@Als I think you can find such in Microsoft's MFC
 
Als
uhm grrr
@RMartinhoFernandes: Got me! no not std::new
 
There was a time when ::new didn't throw on failure.
 
4:21 PM
new::std.
 
MSVC kept that behaviour for a long time (until VC7, I think).
 
Als
its not defined there, I always trip on that, for some reason i always tend to say everything is in std
 
You can legitimately qualify the word new in a new-expression, like ::new. That prevents use of the class' custom allocator and (for exception in new-expression) deallocator. Should be used for ordinary placement new.
 
room topic changed to Lounge<C++>: Colour-coded for your convenience. [c++] [c++11] [c++-faq]
 
@cat: can i change that, please?
or you. I mean, Francis Glassborow once said, "The great thing about colour-coded source code is that you can set comments as white on white"
So, "where comments are white on white"
?
- "for your convenience"
 
Als
4:26 PM
@AlfPSteinbach: What do you want to set it as?
room topic changed to Lounge<C++>: The great thing about colour-coded source code is that you can set comments as white on white [c++] [c++11] [c++-faq]
 
"where comments are white on white ‒ for your convenience"?
 
Als
room topic changed to Lounge<C++>: The great thing about colour-coded source code is that you can set comments as white on white..where comments are white on white ‒ for your convenience [c++] [c++11] [c++-faq]
hope i got that right
off for dinner...
 
thx
room topic changed to Lounge<C++>: where comments are white on white ‒ for your convenience [c++] [c++11] [c++-faq]
 
Is that an em-dash? I think it is!
 
i think an en-dash?
em-dash is like a bit longer
 
4:32 PM
* - * vs -
 
‒ v —
 
en-dash em-dash.
 
sorry apparently i used a "figure dash"
 
Silly English typography is hardly readable.
 
4:34 PM
room topic changed to Lounge<C++>: where comments are white on white — for your convenience [c++] [c++11] [c++-faq]
 
holy mother of Jesus... I've forgotten I was even in this room...
damnit
 
i tried to change topic but it doesn't work
is it a bug in SO?
 
oh what did you want to change it to, I'll try it
@jalf hi!
 
Als
@JohannesSchaublitb: Are you a room owner? I distinctly remember you being relieved of your duties
@AlfPSteinbach & @All: Thanks for the discussion, it was let's say more enlightening
 
can't change topic if not owner
 
4:49 PM
Speaking of enlightenment, I ran out of spare lightbulbs.
 
Als
Spare light bulbs eh...you work in a dungeon or something
 
I'm still enlightening myself in regards to variadic templates
interesting stuff
but rather abstract in places
just realized on of my favoriete bands has a new album
time to get out the credit card I think :P
 
Als
I just realized my rear needs a scratch.
 
Als
time to get out the swatter i think :P
 
4:54 PM
I just realized I've been sitting in front of my computer all day
oh wait, I do that all the time
 
Als
lulz
I just realized, I worked for 9 hrs at work in front of a computer and now I am at it again from home
 
hahah
the life of a geek,
lulz
been karma whoring on reddit today
 
@Als This house has a shitty electrical installation that keeps blowing up the lightbulbs every now and then.
 
Als
Interesting
 
trippled my karma, that's an achievement and a half :P
 
Als
4:56 PM
I just realized, My rear will be on fire tomm at work
 
@TonyTheLion in the future, the computers will work for us
 
No, we won't.
 
Als
lol
 
@AlfPSteinbach oh wow, that means I'll be jobless? Damn you for ruining my job security feeling :P
 
Asimov wrote a lot about that.
Robots taking over the jobs of people.
 
4:59 PM
it's interesting, that subject is
 
Als
Imagine Robots reproducing!
 
@Als Ever heard of factories?
Robots building robots.
 
4
Q: C++ Interview: vtable for a class with a pure virtual function

user7I was asked this interview question today!! (it was a really awkward telephonic interview..): What is the difference between the vtable for a class with virtual functions and a class with pure virtual functions? Now, I know the C++ standard doesn't specify anything about vtables, or even ...

 
Als
@RMartinhoFernandes: Err...You mean asexually, wheres the fun in that? :P
 
5:01 PM
what does this line supposed to mean : In the case of non-pure virtual functions, each entry in the vtable will refer to the final-overrider or a thunk that adapts the this pointer if needed
 
WTF
"you have already edited 15 of your own posts today. edits are allowed tomorrow again."
would someone please be so kind and add to this:
4
A: Implicitly-declared Move-Operations do not fallback to Copy?

Johannes Schaub - litbYou read it incorrectly. This would break lots of C++03 classes in cases such as the following Question getQuestion(); Question q(getQuestion()); // use of deleted move constructor! Instead, the FDIS says that a move constructor will be declared iff {there is no user declared {copy constructor...

that part:
 
Als
What do you want to add?
 
? thanks xD
 
there is really difference between vtable of class having virtual function and other class having pure virtual function?
 
Als
@JohannesSchaublitb: Done oh wait i will add a note saying its on bhealf
 
5:06 PM
Maybe, maybe not. Vtables are implementation detail.
 
@Als ohh thanks I will remember this mercy act of love!
 
Als
@JohannesSchaublitb: Oh we all need a lil bit of love, your welcome :P
 
@MrAnubis it simply means that each entry in the vtable is a pointer to a suitable function
 
5:17 PM
@Als You humans have the nasty habit of mixing sex, love, reproduction, and business. You break SRP.
3
 
@RMartinhoFernandes hahah :)
 
@AlfPSteinbach: C++ is close to that :-)
std::piecewise_construct :-)
 
why not std::pcct
 
@JohannesSchaublitb: for a second i thought that std::pcct was really something in the standard. Things are so sad with C++ syntax that it wouldn't have been totally impossible that something like that was there...
it's not there, right ?
right?
/me is searching C++0x pdf
no it's not :-)
(for now)
 
ohh
@6502 yeah it's not there
i meant PieCewise_ConstrucT xD but failed
 
5:48 PM
@JohannesSchaublitb WTF?
 
yeah, i understand. but it woldn't be that impossible for that being an approved abbreviation for the same thing :-)
 
Now you have a daily limit on edits?
 
Anyone know the hex value of "control"
 
hmm
@RMartinhoFernandes apparently
 
Gosh, that's ridiculous.
 
5:50 PM
I'll try to make a screenshot
 
Specially after you get into "trusted user" territory.
WTF does "trusted" mean anyway?
 
@KianMayne ?
 
@AlfPSteinbach You know the "control" System colour I've got it though #F0F0F0
 
@KianMayne: you mean on a browser keydown event?
 
Right, everytime I hear "Control" I think system colour. I never think key, and I never think brand of condoms either.
 
5:51 PM
@6502 No
 
@KianMayne depends. in html use the color name. in windows programming, use GetSystemColor (if I recall the name correctly).
 
@AlfPSteinbach I just needed the colour so I can set a background of an animation
 
@RMartinhoFernandes ^^
 
I'll add frehand circles and go to meta!
Oh wait, "excluding very recent posts".
 
5:54 PM
I think it is because of my tag edits.
 
That sounds a bit more reasonable.
 
and Windows API, but you really need to learn to look up documentation
it's the most important skill
 
I certainly didn't edit 15 of my own old posts
 
after thinking, of course :-)
 
so I'm unsure what happened
 
5:55 PM
@JohannesSchaublitb Changing tags counts as edits.
 
but I can still edit tags I think
 
So, that's probably what happened. You retagged many of your old questions, and BAM.
 
yes, editing tags still works fine
 
@AlfPSteinbach: In some cases thinking is dangerous and reading is more important. Thinking is more important if the subject is logical
 
@JohannesSchaublitb Oh well...
 
5:56 PM
so why will too much tag editing disable post editing but not tag editing!?
 
@AlfPSteinbach: with C++ for example too much thinking is dangerous :-)
 
Not more dangerous than not thinking.
OMG it's not only C/C++! Now there's a C#/C++ language!
 
@RMartinhoFernandes: I mean reading is more important. Thinking will sometimes put you on the wrong track... ever wondered why "std::string s; s = 3.141592654;" compiles?
 
-3
Q: Trouble with translating fortran source code to c#/c++

stukselbaxI have fortran-77 source code from book of COMPUTATION OF SPECIAL FUNCTIONS, Shanjie Zhang, Jianming Jin. Routine I'm interested is calculates gamma function of complex argue. Here it is: SUBROUTINE CGAMA(X,Y,KF,GR,GI) C C ========================================================= C Purpose: ...

 
hahaha
C#/C++
 
5:59 PM
Stupid hybrids. I prefer to code only in languages with pedigree.
 
@6502 i think, it's a design level bug.
 
I'll ask a meta Q
 
Ask for at least 640 edits per day. That should be enough.
 
@JohannesSchaublitb Don't forget the freehand circles.
@AlfPSteinbach 640K!
 
I'll have to open gimp xD
alright Ill draw some art
is there not a freehandcircle uploading website out there?
 
6:02 PM
dinner time l8r
 
@JohannesSchaublitb SO does that automagically now.
Uploads your stuff to imgur or something.
 
oh
can i draw circles with imgur?
 
Not that I know of.
 
@TonyTheLion hi
 
0
Q: Message about already having edited 15 messages, despite having only retagged them

Johannes Schaub - litbI get this message right now The edits it refers to were only retaggings, as far as I can tell. However, I can still retag my posts. Two questions Does retagging count towards the "At most 15 edits to old posts" limits? Why can I still retag?

 
6:16 PM
@jalf oh hai
what's new?
ok, a new form of geekness
using your laptop while shopping
I'd say that brings us all down in the ranks of geekiness :P
 
@TonyTheLion nothing much. Busy with life and work, tired, just been sick for a couple of days
 
Anything serious?
 
and a friend is staying here for a while until she can find an affordable apartment
nah, just flu
 
@jalf oh damn :( Sick is no bueno
 
6:21 PM
how about you? Any luck with the job hunt?
 
@jalf got a second interview in the place in Brussels last thursday :)
waiting for their decision
hopefully I may get lucky :)
 
Als
@TonyTheLion: You seem to be all over the Europe with your job hunt eh
 
I'm good otherwise, been on the job hunt in the UK for a few weeks
@Als yea, I like to travel, have I mentioned that?
 
Als
@TonyTheLion: Love UK I remember that bit.
 
it is an advantage to be able to go within Europe anywhere and go work there, without needing a visa
@Als lol
 
Als
6:22 PM
Doesn't UK need a special visa, doesn't fall under schengen countries if i remember correctly
 
The Old World rocks.
 
@Als no need for a visa if you're an EU resident, I looked it up
 
Als
UK and the Swiss are not schengen countries AFAIK
 
@Als Schengen is open borders, not sure how far that goes with Visa and all that
some EU countries may have treaties on visa matters perhaps, that are not part of Schengen
 
Als
@TonyTheLion: Ah okay, maybe I had a schengen and as i remember includes 17 countries, definitely not UK and Swiss
 
6:24 PM
@Als oh right
is it hard for you to get a work visa for Europe?
 
The Schengen area includes 25 countries.
UK does not implement Schengen, but it's close.
 
Als
@TonyTheLion: I don't know I didn't try as such to be frank.
 
If I could, I'd go work in the US, but visa is too damn hard to get
 
Als
@TonyTheLion: Yup, its hard to get the US visa these days
If fate had it I would have been in US now.
 
@Als oh I guess it used to be easier?
@Als oh wow
 
Als
6:27 PM
@TonyTheLion: Yup it used to be very easy, getting B1, L1 and H1 visas to US used to be easy, it is now that L1 visas are almost never approved.
I was working for a client project in Georgia, Atlanta and was supposed to work there for a couple of years that is when i left my previous job.
 
@Als oh what happened? The visa was rejected or they didn't want you in the end to work there?
 
Als
hmm..I had the visa stamped and ready, they wanted me there as well, but I didn't get along very well with some of the peeps our co had already sent there.
they were numero uno idiots
basically managers who didn't know any shitt about programing but were calling the shots
 
Sounds typical :(
 
@Als ohh i see
 
Als
Basically, all they used to do was prepare ass lick schedules to make the client happy, knowing the feasibility of getting it done was very less, and even if the targets were not acheived they used to sell it off to the client doing some treacherous trickery. The scrum burn down chart used to show everything done, in actual it was nothing.
 
6:34 PM
I like my comment here:
-5
Q: can I know which Keyboard Key has been pressed before hitting Enter

aj8080can I know which Keyboard Key has been pressed before hitting Enter.is there any way to capture such key pressed event in c++ ??Please provide a short example of it. i'm using VC++ on Windows 32bit.

 
Als
@AlfPSteinbach: I ain't touching such Q's, I dont know shit about that. I think your comment holds good. It got my upvote.
 
oh, now the OP is begging for an answer, from me. ouch.
 
Als
@AlfPSteinbach: If you know the answer, do post it as an comment, If the Q is reopened, You can then add that as an answer.
oh er wait. Just 1 vote to reopen
 
well it's difficult to post code in a comment
 
Als
1 vote to go. Hold on.
@AlfPSteinbach: And you are on!
Its reopened.
 
6:51 PM
hello...
is it possible to initialize List or ArrayList in c++/cli, with some elements (int, strings, etc) ?
 
You can use List<T>.Add.
> You can't fool us by agreeing with us. — Roy Neary
 
nothing like c++, for example, int array[]={1, ... } :D ?
 
Think not.
 
painfull :D
 
C# has that, if you're really desperate for it.
 
6:55 PM
ok done
 
C++/CLI has that syntax for managed and native arrays, but not for other stuff.
 
you think on "pure" array from c++, to use int array[] ?
 
@RMartinhoFernandes i watched the "close encounters of 3rd degree" last night. i think, those spaceships did not look very realistic! but also, i think the aliens will have at least as good a sense of aesthetics as we do, and would make themselves beautiful rather than ugly.
 
@AlfPSteinbach It's a movie from 1977. Give the SFX a break.
 
lol. someone asks "Is it dangerous to sleep with a scarf?"
 
7:00 PM
@Srle array<int> a = {1,2,3}; works too (that's a managed array).
 
and someone else answers "Just try it whether it's better or not to sleep with a scarf."
 
Hmm, is there some neat "What's this debugging thing? How do I do it?" article somewhere I can use as a go-to link for newbies?
 
WinDbg manual. (Not really.)
 
@Als was that OK answer?
 
7:04 PM
I did try to make a newbie intro to WinDbg one day, but it got lost in the depths of the Internet.
Well, no, I deleted it, but that sounds more poetic.
 
@R.Martinho, (im new to c++/cli), array<int> a; or array<int> ^a ?
 
I don't think I ever read anything about debugging. I found that menu once in good ole Turbo Pascal 7 and the following week my stupid Lunar Landing game had a lot less bugs :)
 
@Srle the latter is not standard C++ but possibly a Microsoft extension called C++/CLI
 
@Srle Oh, right, that.
@AlfPSteinbach Yes, C++/CLI is what he's talking about.
 
Hang on, quick question.
Is it true that good style dictates only to use void as the return type when using reference parameters?
 
Als
7:11 PM
@AlfPSteinbach: Looks good to me.
 
@Moshe What? No.
 
Als
@Moshe: Use void as return type when you have nothing to return.
 
What @Als said.
 
Right, but is it bad practice to use reference parameters when returning something?
 
Als
7:12 PM
Returning reference to variables local to a function is a sin
Don't do that
 
It's bad to have functions doing too much.
 
Als
Other than that You should be fine.
 
Wait, your function returns a reference?
 
@RMartinhoFernandes Dunno, the teacher just said not to "do damage from both sides".
 
I don't get that.
 
7:14 PM
@RMartinhoFernandes Is that bad? (Sounds like it to me.)
 
Als
@Moshe: Your teacher meant this:
1 min ago, by Als
Returning reference to variables local to a function is a sin
 
@Moshe Not bad. But something you must be careful when doing.
 
@Als Explain please.
 
If you return a reference to a local variable, the reference will be invalid the moment the function returns.
Which makes it rather pointless.
And then nasty things happen if you use the now invalid reference.
 
@RMartinhoFernandes What's an example for a function that does that please?
 
Als
7:15 PM
Calls for the link to Lippert guy's famous answer
 
@Moshe int& f() { int x = 42; return x; }
 
if the local is an input parameter then it's not a sin (standard output stream operator << does that)
 
exceptions in c++/cli works on the same way like in c++ ?
 
@6502 But then it must already be a reference.
 
also it's not a sin if the local is a static (very common implementation for singletons)
 
7:16 PM
@RMartinhoFernandes Oh, we're not doing that with int& as the return type.
I see what you're saying though.
Ouch.
 
So, what are you doing?
 
@RMartinhoFernandes int (int &a){ int x=42; return x;}
The Instructor said that it should be:
 
Ok, I understand that's a contrived example, but why are you not using a?
 
void returnAVoidValue(int &a){int x=42; return; }
@RMartinhoFernandes I'll try something else then:
int incrementA(int &a){a++; return a;}
 
Ok, that looks better (except for the lack of a function name :).
 
cpx
7:19 PM
The Hitchhiker's Guide to the Galaxy is a comic science fiction series created by Douglas Adams that has become popular among fans of the genre(s) as well as members of the scientific community. Certain phrases from it are widely recognised and often used in reference to, but outside the context of, the source material. Many writers on popular science, such as Fred Alan Wolf, Paul Davies, Richard Dawkins and Michio Kaku, have used quotations from Adams' work in their books to illustrate facts about cosmology or philosophy. Answer to the Ultimate Question of Life, the Universe, and Everyth...
 
@RMartinhoFernandes Named the functions. :-)
 
@Moshe I don't see much wrong in that example. In fact, it's mimicking an existing language feature.
Like I said, as long as the function is not doing too much...
 
Ok, thank you.
 
An example mentioned above is istream& operator>>(istream&, T&). This takes two reference parameters and returns something.
What does it do? Something simple: extract a value from a stream.
If you describe your function as "do X and return Y", then it might be a good idea to reconsider it.
Write a code?
Gosh, when will people learn that "code" is not countable?
16
Q: Is it wrong to use the word "codes" in a programming context?

ShrinathIs it wrong to use the word "codes" in programming context? I shall use these codes.

 
7:28 PM
@RMartinhoFernandes valid point
 
7:48 PM
> You know, Burke, I don't know which species is worse. You don't see them fucking each other over for a goddamn percentage. — Ellen Ripley
 
Hello to all!
@RMartinhoFernandes I see this a lot on a French-speaking programmer community I'm part of. The problem transcends language.
 
hi
 
rargh university rargh
 
7:57 PM
rargh Python rargh
 
rargh Lion rargh
 
@TonyTheLion You mean OS X 10.7?
 

« first day (352 days earlier)      last day (4588 days later) »