« first day (104 days earlier)      last day (4829 days later) » 

12:02 AM
@Fred: if you change it from unsigned char a[8] to unsigned char a[sizeof(double)], you're pretty much home free -- as of C99, there's a special case made for unsigned char so you don't get UB when you use it to look at the bytes in other types.
 
@FredOverflow As Jerry mentions for C, there are special rules for the case of signed/unsigned char in the language, also in C++. §3.10/15 determines that you are ok (behavior is defined) when accessing through: — a char or unsigned char type.
 
12:47 AM
@DavidRodrĂ­guezdribeas It's interesting that signed char is missing from the list.
 
@FredOverflow i don't think that'S technically undefined. sizeof(double) is an implementation defined value
wow i'm late to the party. sorry missed that lol
 
litb: that's pretty much what he was saying, I think
 
1:34 AM
Fuck. Shoot me in the face now.
I failed a stupid stupid STOOPID easy stupid FIRST question in an interview.
Why did I hurry OH WHY!
 
1:47 AM
@wilhelmtell What was the question?
 
@wilhelmtell: automated test or in person? the former really suck :(
 
It was online, which is actually worse because in person they'd note it and i'd say "oh fuck you're right" and fix it. but online it's sent and gone. :-S
and you'd really shoot me if you were near me. it was that stupid.
define int median3(int a, int b, int c);
such that it returns the second largest value.
it was the first question and it's fucking stupid for kindergarten and breezed it through and i did it stupidly and i want to bury myself right now.
 
did you return the second smallest value by mistake? :P
 
<angry>
 
@wilhelmtell I think we've all been there
 
1:50 AM
return (a + b + c) / 3;?
 
i said std::min(std::max(a,b),c);
 
@JamesMcNellis median, not mean
 
@FredNurk I know. I was guessing perhaps he accidentally answered that. That's the sort of mistake I could see myself making.
 
ah
 
no no. i should have just place them in an array, sort that and return the middle element. for this function that'd do.
but naw, i'm de stooped tudey.
 
1:51 AM
yeah, the simplest is best
 
on the bright side i think i was ok with the rest of the questions. :-S
 
return ((long long)a + b + c) - min(a, b, c) - max(a, b, c);
 
min and max don't work that way.
for that you'd have to use min_element and it takes a container.
 
@FredNurk Nope. Then median3(INT_MAX, 1, 2) yields undefined behavior.
 
min(min(a, b), c) if you want to use std::min
 
1:54 AM
Good luck with the interviews!
 
@JamesMcNellis domain wasn't specified, so I get to make up my own :)
 
thanks. i think i have one offer, just need to wrap it up.
 
Awesome!
 
interviewing is the sux, hope you get through it unscathed to a place you like
 
awesome, except i mis-defined median3(). i'm not going to sleep tonight, and no dinner for me.
 
1:57 AM
@wilhelmtell I find that when I don't eat or sleep I make more stupid mistakes than when I do.
 
on the bright side the questions were easy and i got the others alright. and i'm proud i got all of solutions coded in loc comparable with ruby solutions. in C++. fuck yeah.
i had one meal today, after the exam, at 18h30. that may explain something.
 
I bet using c++0x interviewing tests would really be helpful in narrowing the field (but also fail to distinguish plenty of good talent); perhaps making it optional
 
maybe you can talk about it, but i wouldn't test it in code.
i am no confident with c++0x programming, honestly. but i am with c++03.
 
I'm thinking the programmers that understand 03's pitfalls and how 0x helps are likely to write better 03 code, rather than finding someone to write production 0x code
 
the important things of c++0x are imo the concurrency primitives, which i don't think there's a compiler supporting them yet.
lambda is nice but not something i'd fail anyone for not knowing.
do you have an example in mind?
 
2:05 AM
@wilhelmtell stdthread.co.uk
 
"Write me a move constructor, biatch!"
2
 
@wilhelmtell no, can't really think of something; but I know those that really care about their craft are much more likely to be watching 0x and I'd rather work with those that really care
 
@FredNurk yes, and this is something to talk about and look for enthusiasm and what you know. but i think that programming in c++0x is tricky. where do you practice? it's still evolving and so what you learn from your compiler might be wrong in a couple of months.
 
I'm not a believer in interpreting that kind of test severely and strictly
e.g. I wouldn't disqualify you "because that idiot can't even write median3!"
(frankly I don't see any value in asking to write median3)
 
@FredNurk why thank you. :)
for filtering candidates. :-S
 
3:07 AM
lol
 
 
1 hour later…
4:16 AM
How do you define std::swap() in C++0x?
 
What do you mean by "define"?
 
Write the code.
 
template <typename T, typename U> swap(T& t, U& u) { /* hard stuff goes here */ } Q.E.D.
 
lol
srsly though
is it still a 3-loc function?
 
Yes, if you remove all but two of the newlines.
 
4:20 AM
ok you're getting me confused now.
isn't there some magic move semantics?
 
I just checked: nope. There are still only two overloads of std::swap: one for scalar objects and one for arrays, and the scalar object one is still the three-liner.
        template<class _Ty> inline
	void swap(_Ty& _Left, _Ty& _Right)
	{	// exchange values stored at _Left and _Right
	_Ty _Tmp = _Move(_Left);
	_Left = _Move(_Right);
	_Right = _Move(_Tmp);
	}
That's the implementation from Visual C++ 2010. I can't see how you could do any better than that... you have to have two lvalue references as parameters and then inside of the function you can try and take advantage of move semantics, which just doesn't have any effect if the type is not moveable.
 
why would an array be different?
can't you move an array?
 
@wilhelmtell Arrays are not assignable, so you need a separate implementation to swap each element.
 
holy fuck. so swapping a primitive array is more expensive than swapping a vector!
 
Neo
can any of you guys help me with a mysql query?
 
4:30 AM
wrong forum?
 
shouldn't the last line in the function be _Right = _Tmp; ?
 
Yes. So too is swapping a std::array (it doesn't meet the O(1) swap requirement that (most of) the rest of the containers have).
@wilhelmtell Why?
 
Neo
yeah its the only one not empty
 
@Neo Maybe. What are you trying to write?
@Neo That's because we are AWESOME.
 
@JamesMcNellis because you still need to make ONE copy in the swap. right?
or is the move() function smart enough somehow magically to make a copy when necessary?
 
4:31 AM
@wilhelmtell No, you use a cycle of three moves.
 
Neo
I have a users table with latitude and longitude I want to sore a select query by location closest to the user I need to write a mathematical function for a circle or something but I've never seen a query like that
@James C programmers are always awesome
 
@Neo not here. this is a c++ room.
 
Neo
C++
 
First you move the contents of left to a temporary object then you move the contents of right into left then you move the contents of the temporary object into right.
@Neo Pretend the Earth is flat, query for points on the flat earth, then cull the list once you get the results from MySQL.
 
@JamesMcNellis sorry you're right.
 
4:33 AM
The only tricky part there is that you have to account for the fact that 180 == -180.
@wilhelmtell Yes, once in a while I am right. It's not a particularly common occurrence though.
 
@JamesMcNellis ok i'll tell you why i'm asking.
@JamesMcNellis i have a feeling that move semantics are not more than syntactic sugar, apart from what move() gives.
which is not a bad thing. just not as advertised.
in terms of efficiency, i don't see the difference between returning an rvalue reference and taking an lvalue reference as parameter.
 
Neo
I see @JamesMcNellis tnx.!
 
@Neo Sure thing. If you're trying to find points within a certain distance of another point, you can assume that one degree == 60 nautical miles; that is true at all points for latitude and is true at the equator for longitude, so it's a usable worst-case number.
@wilhelmtell You can write code in C++03 that is as efficient as any C++0x code, it's just ugly as sin and a bitch to write, read, and debug.
 
except for swap(). you can't implement swap() as efficiently.
 
@wilhelmtell I suppose it's fair to say rvalue references are just syntactic sugar if you're willing to say things like classes and templates are just syntactic sugar.
 
4:40 AM
templates aren't syntactic sugar. there's no way to mimic this feature in c.
as for classes, it's a bitch to do in c, but possible.
 
@wilhelmtell Why not? You could define swap such that any type that has a member function named "move" with a certain prototype would have that member function used.
 
Neo
SELECT ((ACOS(SIN($lat * PI() / 180) * SIN(lat * PI() / 180) + COS($lat * PI() / 180) * COS(lat * PI() / 180) * COS(($lon – lon) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance FROM members HAVING distance<=’10′ ORDER BY distance ASC
 
@Neo I suck at math.
 
Neo
@JamesMcNellis yeah I saw some good info now I know what the 60 is
@James just <include math.h>
 
@JamesMcNellis and how would you do that? remmeber, you can't assign to lvalue references.
 
4:43 AM
swap(T t, T u)
{
    T v;
    v.move(t);
    t.move(u);
    u.move(v);
}
Or something like that. That requires T to be default constructible, but you could write it otherwise, and you can use SFINAE to detect the presence of the move function. It's fugly and messy.
 
V? oh you mean T v.
 
What V? THERE ARE NO V'S IN THAT POST. THERE NEVER WERE ANY V'S IN THAT POST.
 
lol
 
@wilhelmtell You can write a C++ compiler in C, ergo, any C++ features not in C are just syntactic sugar. That was my intended point: if your definition of syntactic sugar is broad enough, then everything can be considered syntactic sugar.
 
Not templates.
 
4:47 AM
(For what it's worth, my definition of syntactic sugar is not anywhere near that broad.)
@wilhelmtell If you can compiler code on the fly, then sure you can!
 
How would you definve a move() of an object?
@JamesMcNellis templates are compiletime. no you can't!
@JamesMcNellis you'd have to write a c++ compiler to mimic templates.
 
@wilhelmtell Yes.
 
How'd you write move()?
void T::move(O& o);
 
@wilhelmtell The same way you'd define a move assignment operator; it'd basically be the same. It would take the resources owned by the argument and set the this object to own them. Just like, for example, the std::auto_ptr copy assignment operator works.
 
What about destructing self?
 
4:51 AM
@wilhelmtell I was just trying to make the point that rvalue references are only syntactic sugar if your definition of syntactic sugar is really broad.
@wilhelmtell What about it?
 
Ok ok.
This is new to me. I had the feeling that rvalue references are adding new opportunities for efficiency. that's what I was led to believe.
 
We need to get this guy in here and see if he thinks they are just syntactic sugar.
 
Ok this is good stuff.
I like syntactic sugar, when it makes big difference. It does here.
I was just listening to Scott Meyers on a podcast from November, talking about rvalue refs. and that got me thinking that it actually just sugar, shifting the need for an extra parameter to work around the copy for return value. then i thought about swapping, which have three redundant copies and thought it's actually necessary.
 
I don't consider rvalue references just to be syntactic sugar. They are a critical language feature. I think the most important facet is that they allow you to write your application code and most of your library code without thinking about them: the only real place you have to worry about them, for the most part, is in core libraries, RAII containers, etc., and you get the (totally awesome) performance benefit everywhere.
My STL-heavy code performs far better when compiled under VC10 than it did under VC9, and I didn't have to change any of it.
 
and now you bring up the .move() trick. and now i like the rvalue references, much better idea than reling on hackish interfaces.
really? but you need a move ctor for move semantics, no?
 
4:58 AM
@wilhelmtell Where can I get Scott Meyer's podcast?&
 
i mean to use swap() you need your type to have a move ctor. no implicit move ctor if i recall?
 
@wilhelmtell Unless you've declared a copy ctor, copy op=, move ctor, move op=, or dtor, you get implicit move operations generated.
 
@Drahakar actually it's from april. but nonetheless: se-radio.net/2010/04/episode-159-c-0x-with-scott-meyers
 
3
A: Why no default move-assignment/move-constructor

James McNellisThe implicit generation of move constructors and assignment operators has been contentious and there have been major revisions in recent drafts of the C++ Standard, so currently available compilers will likely behave differently with respect to implicit generation. For more about the history of ...

@sbi is going to be angry when he comes back and finds we've been talking about C++.
3
 
@wilhelmtell Thank you :)
 
5:00 AM
@JamesMcNellis the wikipedia article of 0x says that if you didn't write a move ctor you don't get one. and if you don't get one move semantics will default to const& which is the old performance characteristic.
 
@wilhelmtell Wikipedia is wrong then. They've changed the specified behavior at least twice now. The answer to which I linked above gives the current specification. It's also likely to be the final specification, since it was discussed in great detail at Batavia in November.
 
@JamesMcNellis isn't it what we do in this room? oh wait, i didn't forget to switch from the Guys Who Love Pink Underwear room by mistake again now did i?
 
@wilhelmtell Sometimes. During the day it's mostly off-topic. I can't think about C++ during the day, though: it makes me make dumb syntactic mistakes in my C# code.
 
@JamesMcNellis It's all Scott Meyer's fault. :-) Or 88%, with 2% on me, 2% on some other and so on (those who participated in the original discussion after Scott's post).
 
@JamesMcNellis What does "the move constructor would not be implicitly defined as deleted" mean? This from your answer above.
 
5:11 AM
@AlfPSteinbach Was this the c.l.c.m post from Augustish that got everyone worrying about the problem?
 
Yes, plus a follow-up in comp.std.c++
 
@AlfPSteinbach Scott Meyers was here?!
 
plus some communication with Howard
@wilhelmtell no, over in comp.lang.c++. but now howard is here on SO :-)
 
@AlfPSteinbach I'm just glad they came to a solution before they ran out of groan-inducing names for their papers. I mean really, "Moving Right Along" was stretching it.
 
5:13 AM
lol
 
@wilhelmtell See N3225 12.8/12 for the list of conditions under which the copy and/or move ops would be implicitly declared as deleted (implicitly declared like T(const T&) = delete;)
 
oh man i'm so lagging behind. i have no idea what delete means :-S
 
@wilhelmtell It's kind of (but not exactly) like declaring it as private so it can't be used.
 
what's the difference?
 
@wilhelmtell I'm not 100% sure that I can explain it accurately. I am not very familiar with C++0x features not available in Visual C++ 2010, since I don't really use any other compilers on a regular basis.
 
5:18 AM
Polymorphism is achieved through virtual functions. Can we call function overloading also as an example for polymorphism ?
 
@JamesMcNellis but there is such a thing as compile-time polymorphism.
 
@JamesMcNellis - So, to explain Polymorphism in C++ is to explain Virtual Functions.
 
@Mahesh no. Polymorphism in C++ has two meanings. One in compile-time, the other in runtime. You need context to know which one is referred.
 
@wilhelmtell run time is through Virutal Functions and compile time is through function overloading. right ?
 
@Mahesh Possibly. Or by templates.
Which is overloading, in a sense, only it's done by the compiler for you.
 
5:26 AM
@wilhelmtell Is std::string a template class?
 
@JamesMcNellis & @wilhelmtell From Scott Meyers's "Overview of the New C++ (C++0x) "=delete" functions can't bu used in any way: they can't be called, can't have their adress taken, can't be used in a sizeof expression, etc.
Template functions may be delete4d.
A virtual function may be deleted, but if it is, all base and derived versions of that virtual mush also be deleted
 
@Mahesh std::string is a typedef. It means std::basic_string<char>, which in turn means std::basic_string<char, std::char_traits<char> >.
 
@wilhelmtell - If std::string isn't null terminated, how to write my own strlen() ?
 
@Mahesh You don't need to: it has a length() member function.
 
@Mahesh don't. use its size() member.
@Drahakar why do we need to delete functions?
 
5:30 AM
@JamesMcNellis - I just want to how are they breaking the loop while computing length. If it is C String, I know that it is terminated by '\0'
 
@wilhelmtell Good question!
 
@Mahesh The length could be stored as a member variable of std::string or it might store pointers to the beginning and end of the sequence, so it could just subtract the pointers.
 
@Mahesh the same way Pascal manages strings, only smarter. std::string knows the length of the string, it doesn't need to mark the end of the string.
 
It could be to disallow a conversion function from all your classes
void f(void*);
void f(const char*) = delete; //f uncallable with [const] char*
*from "Overview of the New C++ (C++0x) - Scott Meyers
 
Yeah but as @JamesMcNellis said private undefined member functions give the same result.
Maybe its the idea that you communicate to the compiler that you have no intention of defining the function. So the compiler can complain about using the function rather than the linker. so it's all about the error message.
 
5:35 AM
Hello, fellow late-nighters!
 
@JohnDibling why hello to you too!
 
Wow! @JohnDibling is here after beer-o-clock!
 
Wierd, right? I am working during London market hours for a couple days.
 
Speaking of beer. Beer image is in my pocket now. Very useful.
 
Ah ha!
The stock market over which the sun never sets.
 
5:39 AM
@James: Exactly. :)
Money never sleeps.
 
Cya later, alligators
 
@Dra peace out
 
On that note, I am going to sleep. My brain hurts after the ampersand overflow we had earlier.
 
lol
same here
:) gn
 
night gents
 
 
2 hours later…
7:27 AM
@wilhelmtell which in turn means std::basic_string<char, std::char_traits<char>, std::allocator<char> > :)
 
 
3 hours later…
10:14 AM
a[3] == *(a + 3) what's a[3][4] then? Sry my C is a bit rusty.
 
10:28 AM
@Nils It depends on the type of a[3]. If that is a raw pointer, or an array that decays to pointer type, then it's just *(*(a+3)+4). Indexing notation more clear.
 
@AlfPSteinbach What if it's a raw pointer? And what exactly is a raw pointer, a void-type pointer?
 
sbi
@JamesMcNellis Yeah, you kids have been really nasty while pop was gone!
 
@Nils A raw pointer type is a type formed using the * syntax, like T*. A raw pointer value a value of such a type. A raw pointer variable a variable of such a type. As opposed to a smart pointer type, which is a type that defines operator* and/or operator-> in order to give the same usage notation as a raw pointer. Iterators are usually not considered smart pointers, though; one extra feature of smart pointer is that it typically manages the life-time of some underlying raw pointer.
@Nils: by the way, it seems you're off-topic: you're talking C++ here!
 
ok so in plain C you just have raw pointers
assert((&(a[3]))[4] == *(a + 3 + 4));
 
sbi
10:35 AM
@AlfPSteinbach You afraid of The Grumpy Old Man? :)
 
where a is int *a;
 
@sbi I'll challenge you any day to Tabasco-drinking contest.
 
I've never used smart pointers before and wonder what would be a good use case for them..
 
Hi, quick question: I'm trying to set all items in my char buff[4096] to 0 by using the following:
void clear_array(char* arr)
	{
		char* begin = arr;
		char* end = begin + sizeof(*arr);
		std::fill(begin, end, 0);
	}
 
@Nils Well, this is off-topic, but in C++ it's opposite: you ask, what is a good use case for raw pointers? One good use case for raw pointer is as actual argument to a C function. Also, main arguments are raw pointers.
 
sbi
10:37 AM
@Nils Every time you write new you have a very good use case for a smart pointer.
 
calling it as such: clear_array(&buff[0]);
 
sbi
Every time you write delete, a kitten dies.
4
 
however it only clear element 0 of the array??
I'm sure I've got some pointer thing wrong here, however I'm not sure what it is I've got wrong?
 
@Tony sizeof(*arr) is a bit fishy, can you see why?
 
I thought in C++ you should rather use references for function arguments.
 
10:40 AM
@AlfPSteinbach perhaps cause it has no idea of its own size really?
 
@Tony because it gives you the size of one array element, in your case 1
 
oh, so perhaps I should have a second arg indicating the size of the array?
 
@Tony yes. or much better, use std::vector. ;-)
 
with the API I'm using, I don't think I can use a vector
however much I'd like to
 
@Tony depends. if the API allocates and/or deallocates for you, then you can't use std::vector. otherwise, you most probably can.
 
sbi
10:42 AM
@AlfPSteinbach Too ordinary. Just take a good, close look at my pic. Do I really look like I'm impressed by a Thal boasting of his ability to swallow Tabasco? Now if you said arm-wrestling, I'd offered you to have a go at my left index finger. Nut Tabasco? That's insulting, no matter which way I look at it.
 
@sbi lol! Well maybe I should have a look at auto_ptr.
lunch time here, thx for the hints :) bye
 
sbi
@Nils That's better than plain pointers (it will save a few kitten), though it's really not the best smart pointer around.
Have a look at boost::shared_ptr, which became std::tr1::shared_ptr in 2003 and hopefully will be std::shared_ptr sometimes next year. The same goes for unique_ptr. They are likely already shipped with your compiler.
 
sbi
@AlfPSteinbach Did you ask my cousin Lila before you published her pic?
Wow, I think this is a primer. I believe I never had 4 downvotes for one answer!
 
sbi
10:50 AM
@AlfPSteinbach I believe porn was frowned upon her the other day.
 
I actually just used the value “0xdeadbeef” in my program to track an invalid pointer. I feel so geeky now.
good morning, guys :)
 
@sbi that's not porn, that's a horn. a green horn, in the side.
 
oh, Gorilla porn … well, I don’t want to disturb ya. carry on /quit
 
sbi
Had @Dead beef for breakfast?
 
what
 
sbi
10:52 AM
@DeadMG Oh nothing. Only @Konrad had you for breakfast. Never you mind.
 
don't believe he dd
 
sbi
@DeadMG No, he isn't a double d, he's pretty flat-chested, in fact.
 
not funny
 
sbi
@DeadMG Maybe I shouldna ha' taken tha' new pill this morning? <slightly_embarrassed/>
 
something like that
 
sbi
10:55 AM
@DeadMG I'll take it up with my doc, Ok?
Anyway, got to work today, for a change.
(No, they don't pay that bad.)
Mhmm. Might be some truth in that pill joke. I'm off...
 
11:17 AM
huh, i'm picking up rep again. zooooon i'll be able to see deleted stuff and who dunnit. :-)
 
 
3 hours later…
1:48 PM
@Alf: Heh, poor guy, can't wait to catch up huh :P
 
@DeadMG how you feeling today?
 
@Tony: Better, but still not great
some over-the-counter drugs are proving quite effective
 
@DeadMG at least those are helping then :)
you got exams soon right?
 
yep
 
2:37 PM
@wilhelmtell C++ supports four kinds of polymorphisms: parametric, inclusion, overloading and coercion.
 
@FredOverflow could you elaborate, e.g. where does ordinary virtual functions fit in there?
 
@JerryCoffin But writing to one union member and then reading from another is undefined behavior, right?
@AlfPSteinbach inclusion
 
the parametric = templtes?
 
@wilhelmtell been there :)
@AlfPSteinbach yes
 
hm, ok. and coercion = cast of pointer or reference?
 
2:43 PM
@wilhelmtell Why would you ever want to return an rvalue reference?
Coercion is implicit conversion.
For example, you can pass ints to a function that wants doubles.
 
@FredOverflow not sure that i would regard implicit conversion as polymorhism. my idea of polymorphism is to be able to do the conceptually same things with objects of different types, with textually the same code.
 
@AlfPSteinbach But that is exactly what coercion does. You can write a function int min(int a, int b) and it works just as well for char and short, for example :)
 
@FredOverflow nah, that's stretching it too far. imho.
 
Well, it's not my definition, it is due to Cardelli and Wegner.
 
@FredOverflow on the other hand, you can write a+b*c and works nicely for any arithmetic type of variables.
@FredOverflow Cardelli and Wagner sound like academics. Unable to master normal English (have to invent silly new terms), and with fetish for Enumerating The Ways. And lacking understanding of what it's all for. :-)
 
2:53 PM
I don't really care about that either. Templates crush all other kinds of polymorphisms for me ;)
 
gotta love templates
 
templates can be quite intimidating to a newbie though
 
why is it that I love concurrency so much?
 
they scared me the first time I looked at them
it's a nice thing to toy with
although if you get it wrong, you can really be in a mess...
 
3:13 PM
there is that
 
sbi
@DeadMG Wait until you have a girlfriend. That will put a stop on you loving concurrency.
 
are you sure?
 
sbi
@DeadMG Well, it might be a case of bad translation. In German, "concurrency" is pretty much a synonym for "rivalry", and most people like at least the other to be monogamous, so they tend to not to like rivals.
 
yeah, that's not related at all in English
concurrency is just performing two actions at once, there's no implied competition
 
sbi
@DeadMG Ah, my bad. Sorry for a pun gone wrong. :(
 
3:26 PM
tut tut, how could you possibly make a pun when there's a very remote chance that it might not make sense in a language which is not your mother tongue?
I should have you arrested and beaten
 
I think it's interesting. I just read Hofstadter presenting Lewis Carroll's nonsense poem in English, German and French. How do you translate nonsense between those languages? He goes into depth on that. Heh.
 
sbi
@DeadMG I've found that a foreign language is, in general, much better for making puns, because you tend to see all the strange quirks that you overlook in your own language. For example, when I learned that English uses the name of a country to refer to a kind of pottery, that opened a host of possible puns, while most natives never thought about it.
 
(Sorry for Bad English, it's not my native language)
 
@Alf: I couldn't tell @sbi: Which country
 
china
i guess?
 
3:30 PM
oh yeah
 
sbi
@DeadMG See, exactly what I mean. @Alf knew immediately, while you wouldn't find it even after my hints.
 
because i'm not native english
 
sbi
@AlfPSteinbach Yep. That's what I was trying to say.
 
I guess since the two are so different, the context easily disambiguates for me
 
i guess a (ordinary) computer would have a hard time figuring that out. large DB search.
or not, perhaps
 
sbi
3:34 PM
@DeadMG In fact, it does for me, too. I'm just seeing how funny it is, while you're not.
And it works the same the other way, too. An American friend of mine who speaks German once pointed out that one German word for "to realize"/"to understand" ("begreifen") essentially means to touch something with your hands and how that always makes him think of "understanding women" ("Frauen begreifen"), which works pretty well in German, too, because nobody remembers that word literally means "to touch", but made him laugh a lot.
 
lol
 
"Time flies like the wind; fruit flies like a banana."
 
lol
 
sbi
@DeadMG See, another American friend knowing German, when pointed out that the sentence "Frauen begreifen" has another meaning, immediately had to laugh. When I tell this among Germans, I have to hint really hard until they coolly say "sh, yeah, that's right, I never noticed that" and they don't think it's funny.
 
they just don't notice, because they immediately understand it and don't look for another meaning
 
sbi
3:39 PM
@AlfPSteinbach See faqs.org/rfcs/rfc1925.html, 2/3.
 
@sbi: Why is it I love concurrency? :P
and
why is it that Microsoft took out all the really useful simple classes in DirectX 11?
 
sbi
@DeadMG An American woman once tried to explain to me the difference between Laura Bush and Hillary Clinton and said that Mrs. Bush would be very concerned which china to put on the table if an ambassador was due to visit, while Mrs. Clinton...
...and the woman was at a loss what to say, so I finished...
...would be more concerned with the facts on the table when the ambassador from China was visiting. That got a loud round of applause from the Americans at the table and a mild laugh from the Germans, who considered this too obvious a joke to be really amused by it.
 
user379888
Can anyone help me out by telling me what happens if you dont declare a destructor?Does the program still runs smoothly?
 
the compiler generates one for you
lol
 
sbi
@DeadMG Well, to at least get back into the vicinity of my joke which backfired, women are generally better at multi-tasking, and men are generally admiring women, so...
 
user379888
3:47 PM
@DeadMG: When you declare it yourself.I have seen that people leave its definition empty.I dont get the point
 
@fahad: There isn't one- unless it's virtual
 
sbi
@fahad You would do this if you need a virtual destructor.
@DeadMG (I'm typing to slowly.)
 
user379888
I am very new so havent covered vitual functions yet : (
 
sbi
@fahad What are you learning from?
 
user379888
Can you help me out with some good video tutorials?
 
3:48 PM
@sbi Actually Laura Bush has done some good things, like keeping attention on the Nobel Peace Prize winner (female) Aung San Suu Kyi in Burma. George Dubja may have been mostly like a sock puppet. But I think Laura perhaps deserves some respect.
 
you don't really need to understand virtual functions
the compiler-generated destructor is non-virtual, so if you want a virtual one, you have to define it
even if it's empty
however if you have an empty non-virtual destructor, it serves no purpose
 
sbi
@AlfPSteinbach That might well be true, but wasn't what the woman was trying to explain. :)
 
user379888
@sbi:I am in a university, I use Robert lafore's C++ book,The complete Reference (forgot authors name)and Bjarne..Bjarne is way too difficult
 
sbi
@fahad Uh oh. I've never heard of Robert Lafore, which, believe it or not, is a bad sign. The problem with C++ books is that most of them aren't worth the paper they are printed on. And I'm not talking writing style here, but plain facts.
Yes, that's right, most of the C++ books out there are plain wrong on many facts.
And don't get me started at whether they use proper C++ idioms...
 
given the titles of some of his books, I'm thinking that it could belike, 15 years old
 
sbi
3:52 PM
@fahad You look at this list:
 
Dec 19, 2001
 
sbi
323
Q: The Definitive C++ Book Guide and List

grepsedawkProvide QUALITY books and an approximate skill level. Add a short blurb/description about each book that you have personally read/benefited from. Feel free to debate quality, headings, etc. Books that meet the criteria will be added to the list. Books that have reviews by the Association of C an...

 
that's pre-C++03
 
user379888
@sbi: I agree but its hard to understand from Bjarne's book
 
sbi
@fahad Which one? He's written half a dozen C++ books!
@DeadMG Another bad sign.
 
user379888
3:53 PM
@sbi: The C++ Programming language
 
sbi
@fahad That is a good book, but covers a lot of ground and assumes quite some existing knowledge. Are you a beginner in C++ or a beginner in programming?
 
delete delete delete delete delete delete delete delete delete delete delete // slaughtering some kittens!
 
user379888
The tuturials at cplusplus.com are also good
 
sbi
@JamesMcNellis Murderer!
 
user379888
Murderer?
 
3:55 PM
@sbi Ha ha ha ha! Wrong @!
 
user379888
I have done C language before and I am beginning C++
 
sbi
@fahad Sorry, that was another joke which backfired... :(
 
user379888
I had the same problem in C."K & R " was way to difficult : (
 
user379888
OH !
 
sbi
@fahad I doubt it. I have yet to see any recommendable online resource besides Eckel's book.
@JamesMcNellis Where? ("WHICH 'V'?)
 
user379888
3:57 PM
@Sbi : thanks I would start thinking in C++ then : P
 
sbi
If TC++PL is to steep for you, I could recommend Lippman's book from that list. They also say that Stroustrup's newest book is quite a good one to start to program with, but I haven't seen it yet.
 
user379888
Take care!
 
sbi
Anyway, I need to go back to working again.
 

« first day (104 days earlier)      last day (4829 days later) »