« first day (417 days earlier)      last day (4522 days later) » 

Xeo
12:00 PM
Hi @sbi, fixed ya code
 
sbi
@Xeo Thanks!
 
Xeo
And the code wasn't wrong per se, it just didn't employ perfect forwarding. :)
 
@thecoshman Just ask. :P
But I'm hardly a GL expert.
 
sbi
@FredOverflow Effective C#, Item 18. :)
 
Reading this feels like some dark parallel universe nightmare...
@sbi There's such a thing as "Effective C#"? :-)
 
sbi
12:11 PM
@Xeo Oh, you live in Friedrichshagen? For some reason I had thought you had left Berlin to work somewhere else.
@KerrekSB "Effective Software Development Series, Scott Meyers, Consulting Editor"
 
@sbi Does Scott Meyers work on C#? Or how is he consulting?
(Maybe his contribution was to say, "put 'Effective' in the title -- that works!". :-) )
 
sbi
@KerrekSB He's the "facading editor" of the series.
 
Effective Bookselling, Item 1: Title based on Effective [Language], credit Scott Meyers.
 
@sbi One can imagine a scenario where the publisher approached him after the "EffC++" pilot and said, "let's make this into a series. Think of all the merchandise."
 
Item 2: Put Scott Meyers in the credits.
 
12:15 PM
Item 3: Add "ways to improve" to the subtitle
 
sbi
@KerrekSB I contacted him about Effective XML being much worse than his books years ago, and he seemed quite annoyed and ISTR him saying he wasn't asked about the title. I again contacted him about the comparatively bad editorial quality of Effective C#. By then he was already editor of the series. He said he was already aware of the problem, and again seemed annoyed about it.
 
@sbi Annoyed about your asking, or about the books?
Jeez, Effective XML, seriously?
 
Effective XML: Don't use XML.
 
Oh no, no kidding... :-S
 
12:18 PM
There, I wrote a book, who wants to be a publisher?
 
"Improve your XML"? ABC - always be closing... those tags
 
sbi
@KerrekSB About the quality of the book. He seemed very concerned about it.
 
@sbi Effective Editing: 50 Specific Ways to Improve the Quality of your Book Series
 
> This is an excellent collection of XML best practices: essential reading for any developer using XML. This book will help you avoid common pitfalls and ensure your XML applications remain practical and interoperable for as long as possible
 
Xeo
12:19 PM
> Effective Software Development Series
 
#1 Don't accept Random Crap, just because it's hyped
 
Xeo
> Doesn't contain Scott's books
 
#2 If you're publishing about XML, You're Doing It Wrong
 
sbi
@CatPlusPlus Maybe it helps, I found it dreadful to read, though.
 
12:21 PM
Hahaha: "Page 36: How do you write DTDs that are independent of namespace prefixes?" So... this book is firmly targeted to let 1990s timetravellers appear as awesome wizards to a 1980s audience?
 
DTD?
 
"Page 283: Is XML too verbose for your application?" I had an answer, but it didn't fit into the small margin next to all the markup.
 
lol
 
Document Type Definition. It's old and primitive.
 
sbi
Don't get me wrong. Bill Wagner's Effective C# (2nd ed, covering C# 4.0) is a good read and I certainly learned a lot from reading it. It's just that the editorial quality is quite bad: example code being wrong or not fitting the text, some sentences not making sense, etc. It seemed a bit rushed. In that regards it's not worse than most other books in our field, and better than many, but when you have read Effective C++, you are spoiled by excellent quality and expect thus.
He might have had the chance to fix it in later prints, though. Mine's 2010.
 
12:25 PM
is it a bad thing that I never read any of the C++ books?
or even any of the generic software development books like Mythical Man-Month or Pragmatic Programmer
 
Xeo
Effective C++ really is a good read. Maybe you know a lot already if you've been around SO for a while, but it's still a very good reference material
 
sbi
Maybe you wouldn't boast as badly about how great a genius you are had you read some of the really good C++ books, @DeadMG.
 
lol
you can always hope
 
I've read one C++ book. Long ago, and it wasn't all that good.
 
I recently got Ruminations on C++ and Design and Evolution of C++
But I should also read them.
 
@TonyTheLion Exactly my problem.
 
@KerrekSB Wow.
0
A: Are all temporaries rvalues in C++?

curiousguy If no, can anyone provide me an example where temporary produced in the code is an lvalue? int i; const float &cfr = i;

Anyone knows what is the temporary here?
 
@sbi "poor editorial quality" and "it seems a bit rushed" is the exact same feeling that I got from reading the C#2.0 standard! At least the field is consistent...
@RMartinhoFernandes The poster's sanity?
 
@KerrekSB Ah, so there is none?
 
12:35 PM
@RMartinhoFernandes There's a temporary float, which is lifetime-extended by the const-ref
@RMartinhoFernandes I assume it comes and goes...
 
Oh right! It's a promoted int. I didn't notice the types were different.
 
Sanity points!
 
Roll a d100, subtract from SAN.
 
I wondered, is the log function (math) an intrinsic on the FPU? or is it something calculated?
 
@Xeo I am actually in the middle of it now...I don't feel like I've wasted money at all, but I can't say I've hit anything new to me. Unfortunately, I know just enough to be dangerous...
 
12:37 PM
I think there were log2 in x87.
 
Xeo
@keithlayne The gotcha stuff comes towards the end IIRC
 
sweet
 
FYL2X and FYL2XP1.
 
@TonyTheLion The FPU should have a hardware log, but you can always emulate it if you don't have one
 
> Computes (ST(1) ∗ log2 (ST(0))), stores the result in resister ST(1), and pops the FPU register stack. The source operand in ST(0) must be a non-zero positive number.
 
12:39 PM
@KerrekSB hmmm, now is the log base 2 the standard Log in the math library (C)
 
I never know.
I always do log(x)/log(base).
 
@TonyTheLion No, but it doesn't matter
I guess frexp deals with the binary stuff
Why is frexp called frexp? A strange name.
 
it's ln in cmath?
 
I think it's log10.
No, log10 is log10. log is natural.
 
ah log() is the natural log, good to know
 
12:43 PM
And there's log2, too, supposedly.
 
@KerrekSB fraction and exponent.
 
@RMartinhoFernandes Aah, d'oh
@RMartinhoFernandes "fraction" is strange though. It should be "mantissa" or something. It's not a "fraction" in any sense.
It's not even any sort of "fractional part" of anything
 
It's a "normalized fraction".
According to the standard text.
 
@RMartinhoFernandes Only in a way that requires far more definition and setup than it's worth :-)
 
Xeo
What do you actually call T arr[N];? I always call them static arrays, but that sounds wrong somehow
 
12:48 PM
@Xeo Compile-time sized C-style arrays
 
lol
How about, bunch of stuff?
 
I usually just say "C array"
 
Crap arrays.
Long past the expiration date, with all the decaying.
 
Xeo
Am I still here?
 
No, this is heaven.
 
12:51 PM
No.
 
Xeo
Oooh, so that's why I see no Java coders up here.
 
@Xeo How can you tell them apart?
 
Xeo
@RMartinhoFernandes It's in their eyes.
 
interesting
Effective C++, Third Edition (2005), recommends returning const rvalues
 
12:55 PM
@DeadMG It's prior to rvalue refs, obviously.
 
indeed
I thought that the "swap" trick was already known?
 
@DeadMG That was a long time ago
 
Xeo
@DeadMG Wasn't there a fourth edition already?
 
well, I guess that I'll have to actually accept that soon, it'll be 2012
I still feel like it's 2007
 
So C++0x did actually come out on time!
 
12:56 PM
lol
@Xeo Could only find 3rd Ed
 
Xeo
Hm
 
0
Q: Algorithm and data structure book for beginner?

user1085607I have googled and I have seen the content about the books I found. "Introduction to Algorithms"--I think it's too hard for me because the math in the book is too difficult. "Data Structures and Algorithms in C++"--I've read about 80 pages and I found it's too difficult. "Teach yourself data s...

> "Teach yourself data structure and algorithm in 24 hours"--It missed many topics I want to learn.(ex. DP...)
What's DP?
 
@RMartinhoFernandes Dyadic programming?
 
Oh, dynamic programming, maybe?
 
yes, it's dynamic programming
 
1:01 PM
Isn't C++ Primer Plus that book that, while having a name that would imply being better than C++ Primer is very very worse?
 
I'm not sure, 0% accept rate and void main... and he just wants to access the data...
 
@RMartinhoFernandes As far as I know. There's certainly a reference implying so on the C++ book question
 
Well, it's saddening when you see people rejecting good books (like Cormen's) and asking for books that are more like bad books instead.
 
Xeo
> A bunch of people that hates C++. Some don't know how to write the previous sentence.
 
CLR is teh shit. Still on my shelf. Complete with kool-aid stains from the kids.
 
Xeo
1:04 PM
Hm, shouldn't it be correct to write it both ways?
 
@keithlayne What's CLR?
 
Common Language Runtime?
 
Pretty sure it's the book you were referring to.
 
Xeo
"A bunch (...) that hates C++." and "A bunch of (people that hate C++)."
 
@DeadMG On his shelf? With kool-aid stains?
 
1:05 PM
Introduction to Algorithms is a book by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. It is used as the textbook for algorithms courses at many universities. It is also one of the most commonly cited references for algorithms in published papers, with over 4600 citations documented on CiteSeerX. The book sold half a million copies during its first 20 years. Editions The first edition of the textbook did not include Stein as an author, and thus the book became known by the initialism CLR. After the addition of the fourth author in the second edition, ma...
 
@Xeo Gosh, not again.
 
lol
 
Xeo
:D
 
@keithlayne Oh, I didn't know about the initialism.
 
Xeo
@RMartinhoFernandes Yes!
 
1:06 PM
clearly I have the first edition.
 
ah, I only heard it referred to as CLRS
 
Xeo
Because I missed the initial discussion. :)
 
@Xeo I still don't know if I'm in the group described in the second part.
But you can easily search for the initial discussion.
Here's a hint: chat search sucks.
 
Xeo
@RMartinhoFernandes Aren't both groups the same?
 
@Xeo I mean, the group described as "Some don't know how to write the previous sentence."
 
Xeo
1:08 PM
Ah
0
A: Meaning of "CC_DLL" in this line"class CC_DLL CCSize" in Cocos2d-x

XeoI assume CC_DLL to be defined something like this (using MSVC intrinsics syntax): #ifdef CC_IS_DLL_COMPILATION /* or CC_IS_IMPLEMENTATION or something like that */ #define CC_DLL __declspec(dllexport) #else #define CC_DLL __declspec(dllimport) #endif This is done to have a single definition th...

Am I saying something wrong here?
 
that's usually how it's done
 
Ugh so many capitals and underscores.
 
you can see it in the Windows headers, for example
 
Xeo
Then I don't understand what that guy is complaining about
@RMartinhoFernandes Do better, preprocessor == CAPITAL_AND_UNDERSCORES for me.
 
@Xeo I think the symbol is usually defined in the command line.
 
Xeo
1:10 PM
@RMartinhoFernandes I mentioned that in the comment
But he seems to be after something else
 
Xeo
0
Q: Visual Studio: error C2662 - calling const methods

Blaah BlaahI'm getting multiple "error C2662"s errors in the following code (positions shown in comments): XYVector Rocket::avoidRocketsAndPlanets(float distance, const std::set<Rocket>& otherRockets, const std::set<Planet>& planets) const { XYVector c = XYVector(); for (std::set<Ro...

 
@Xeo Nope.
Also he's wrong with single underscore thingy.
 
Xeo
> You'd have to define CC_IS_IMPLEMENTATION in all implementation files, regardless of you actually export anything from them. – Luchian Grigore 1 min ago
hm
Dunno. Oo
 
is there a QApplication::exit()?
 
1:16 PM
Oh wait, you're defining the symbol in the implementation file. It should always be defined globally when building the DLL (what you mentioned with setting it on command-line).
@TonyTheLion It's easier to look into API docs, instead of relying on others' memory, you know. :P
 
@TonyTheLion yes
 
@CatPlusPlus true
 
@cat heads up
 
1
Q: Error when trying to use VBO "array vertex_buffer_object must be disabled to call this method"

thecoshmanEDIT I have effectivley re-wrote this question in order to greatly imrpove its quality - see revision logs if you must I have narrowed down my problem to the initialisation phase of my program, when I am trying to create my vertex buffer. The code that I am currently using is... vaoID = new in...

 
1:18 PM
@CatPlusPlus Unless it's my memory.
 
@cat you seem to know more then I do
 
Not really.
 
o_0
 
Oh, I wasn't replying to your message.
That was a continuation from my previous message.
Oops.
Chat race conditions may lead to undefined behaviour.
 
ah, carry on
 
1:21 PM
@Xeo that trick with defining CC_IS_IMPLEMENTATION it in the implementation file is nice. I always used the "define SOMETHING_DLL" when using the DLL version, which is hugely unportable. I guess __declspec(dllexport) is ignored when doing things statically?
 
I don't know, try to move EnableVertexAttribArray after VertexAttribPointer.
Also, unbinding buffers is a waste of time.
 
Xeo
@RMartinhoFernandes Rather, undefined reactions. :P
It's really handy to have the C++ standard handy. Or should I collapse that to "The C++ standard is handy"?
 
I answered a question about a standard quote without a standard quote!
 
Xeo
I just reused the quote. Recycling ftw.
 
I also used this :P
 
Xeo
1:27 PM
I really need to learn how to use them
I'd normally use a comma instead of a semicolon in that example sentence
 
Xeo
or maybe a colon?
Oh wait...
 
@Xeo What?
Go read the oatmeal guide.
 
here's a question
why is it I can never solve a problem when attacking it, and then days or weeks later an easy, obvious solution just, comes to mind
 
Because you suck.
 
1:31 PM
hmm
 
Come on, don't tell me you weren't expecting that.
 
lol
true, true
 
He does make a good point
 
@KerrekSB Teach me your wise wizard ways.
 
but if I sucked, then the eventual solutions wouldn't be so good
 
Xeo
1:32 PM
> 9/11 Collapse = “Man Doing Woman From Behind”
 
@DeadMG maybe they aren't that good
 
And he has a top hat, too!
 
There are degrees of suck.
 
well, I don't know if this one will be, but my previous one was certainly unbelievably excellent
 
1:33 PM
Love the "C++ methods". What's up with them freaking "methods"?
 
Those can be measured in bar, btw.
 
meh
"method", "function", it's all the same to m
 
@KerrekSB Pretty much all other languages with OOP stuff call them methods.
It leaks.
 
@Xeo Wait, they only have one pair of legs between them? Weird.
 
Meh, remembering terminology for every language you know separately is hard.
I use "method" sometimes, too.
 
1:34 PM
@RMartinhoFernandes Get your smelly OO leakage of my clean C++ dining table (or vtable).
 
"Method" is shorter than "member function".
 
@CatPlusPlus "method" screams of "you must make everything an object... becauze objects is good..."
 
I see no difference in "method" and "member function".
Well, the latter is longer and more confusing for newbs.
 
@KerrekSB Get your OO stereotyping off of my clean C++ dining table.
 
@CatPlusPlus there's member and non-member functions, there's methods and ...?
 
1:36 PM
member subroutines?
 
Free functions.
 
I've never heard non-member function.
 
@rubenvb madness.
 
@KerrekSB that's my middle name :)
 
non-member function = free function
 
1:37 PM
Also, just function. Methods and functions.
 
The point is that "member function" is simply an objective description of what it is. That's the C++ way. Use it in any way you please. "Method" on the other hand has all sorts of connotations, hence it's a subliminal lock-in into a particular pattern.
 
@KerrekSB how so?
 
@DeadMG What about member non-functions? ;-)
 
You did too much PHP.
 
@KerrekSB What all sorts of connotations?
Method is a function in a class.
 
1:38 PM
lol
 
At least in the languages I know that have methods.
 
Oracle, why do I have to enable JavaScript to download crap.
 
I find methods confusing, cause it's a synonym for "a way to solve a problem". It's like they use member functions for every problem they come across
 
And what's the purpose of having "I agree to license agreement" radio if there's no license agreement in sight.
 
You should be used to overloaded terms by now.
Also, it's not easy to get them in a context where you can honestly confuse them.
"So, I am calling this method in my object and it blows up. What gives?"
"So, I am calling this way to solve a problem in my object and it blows up. What gives?"
 
1:40 PM
Lol.
 
Xeo
What about "static member functions" ? :)
 
@Xeo Static methods.
 
@RMartinhoFernandes yeah, that one was easy
 
Python has methods, static methods and class methods.
 
@RMartinhoFernandes The word "method" is just awkward. Just from its English meaning. Why would you prefer it over the far more systematic and consistent "function", qualified as "member function" in the class context?
 
1:41 PM
It's shorter and more ubiquituous.
 
I root for subroutine. Bring back that Fortran madness! Member subroutines FTW!
 
And static methods are literally just functions in class namespace.
Which makes them pretty much useless.
 
Other OO languages may want to enforce the connection that a class member function is a particular way "in which a class does something", which sort of justifies the word "method", but it implies a strong OO concept.
Whereas C++ doesn't want to force you to think in any particular way
 
And methods are just functions with class or instance passed as first argument.
 
I wouldn't say numeric_limits<int>::max() is a "method" in any sense of the word.
 
1:43 PM
@KerrekSB You think this is some form of Newspeak?
 
Xeo
I wonder why everybody and their dogs define loggers themselves and always fail on function definitions.
 
@RMartinhoFernandes Yeah, in a way.
 
Well, I use it because it doesn't work on me.
 
potato, potato
 
1:43 PM
@RMartinhoFernandes Well, it does make sense in a language which is ostensibly all OO, like Java.
 
Can we skip the high-school literature analysis crap?
 
@Xeo I got mine right the first time (I cheated and looked at qDebug()) :P
 
I think the choice of words reflects accurately the different design goals of the various languages.
 
how do you search your own questions on SO?
 
So I don't mind that languages use those terms in their specs. What I do mind is people thoughtlessly conflating different concepts.
@rubenvb Click your username, and the search field will be prepopulated.
 
1:45 PM
It's the same concept.
A function in a class.
 
Also using endl with logger is silly. Buffered logs are useless.
 
@KerrekSB thanks
 
Xeo
template<class Ch, class Tr>
auto endlog(std::basic_ostream<Ch,Tr>& os)
    -> decltype(os)
{
  typedef std::basic_ostringstream<Ch,Tr> oss_type;
  save_to_log(static_cast<oss_type>(os).str());
}
Would solve all those overloading issues
 
Xeo
std::ostringstream().flush() << "blah" << "foo" << my_var << endlog;
 
1:49 PM
create_temporary_object_that_writes_to_log_on_destruction() << "blah" << "foo" << something;
 
@KerrekSB What difference would references make?
@Xeo Not thread safe.
Garbled log messages are not good.
 
Xeo
@RMartinhoFernandes Add a mutex to endlog...
 
@Xeo Still not thread-safe.
 
Xeo
Why not?
 
std::ostringstream().flush() << "blah" << "foo" << my_var << endlog; // thread 1
std::ostringstream().flush() << "blah" << "foo" << my_var << endlog; // thread 2
 
sbi
1:50 PM
Okay... We have Smartphones and Smart cars, can we start concentrating on making more Smart people now?
 
"blahblahfoomy_varfoo\n\n" is a possible output.
 
Xeo
@RMartinhoFernandes shouldn't that ostringstream be created independently in each thread? oO
 
I like with_log([](ostream& s) { s << "blah blah"; }, __FUNTION__);
 
@Xeo I assume there's only one log file.
 
More or less.
 
Xeo
1:51 PM
@CatPlusPlus __func__
 
Whatever.
 
Xeo
@RMartinhoFernandes yeah, then add a mutex to endlog.
 
All compilers implement __FUNCTION__ anyway.
 
Xeo
I don't see how that wouldn't solve the problem
 
> Thank you for installing the Java Development Kit Version 7 Update 1 from Oracle Corporation. Registering your product will give you the following benefits
What.
 
1:52 PM
What are the benefits?
 
Notification of new versions, patches, and updates
Special offers on Oracle developer products, services and training
Access to early releases and documentation
I mean, what.
 
I just love Java ¬_¬
 
What is this, 1999?
Oracle, seriously.
 
Xeo
@RMartinhoFernandes No playing around with operator overloading, threadsafity and stuff in a Logger class?
 
well, the fucked over open office, so I guess they have turned there attention to screwing with Java
 
Xeo
1:54 PM
You might even #define LOG() std::ostringstream().flush()
 
@Xeo Sorry, that was a reply to Cat.
 
Xeo
@thecoshman What is the alt-code on those eyes again? I always forget
 
@Xeo I guess you are right.
 
Xeo
@RMartinhoFernandes Oh, I see
 
I should go to sleep.
I last woke up yesterday at 07:00.
 
1:55 PM
@Xeo erm... I don't know... its just on the key next to the one key...
 
@Xeo UK keyboard layout.
 
Xeo
Oh, you're using UK keyboard layout
 
@RM you should eat lunch first at least :)
 
Xeo
damn
 
I know what the alt code € is
@Xeo :D
 
1:56 PM
@keithlayne I already did that :)
 
for operator overloadin
I assume that lambdas count as in-built types?
 
@Xeo don't you mean ¬_¬
 
@DeadMG How can you overload for lambdas?
 
Xeo
@thecoshman ¬_¬
 
@RM you can't call it "lunch" when midnight is the middle of your day
 
1:56 PM
Oh, you can for a global lambda.
 
@Xeo don't copy and paste!
 
well, I've got an operator overload that's like, template<typename F> ... operator[](F f);
 
¬_¬
 
¬_¬
 
Quick question: If I'm forwarding an argument and want to return the argument, what should the return type be?
 
1:57 PM
and I want to enable type conversion on the LHS
 
@DeadMG Lambdas are non-union class types, so I guess not builtin.
 
Xeo
@Pubby Show us example code
 
@Pubby huh?
 
Xeo
How are you getting the argument passed etc.
Or rather, show us the function definition
 
  template <typename t>
  inline t foo(t&& x) {
    bar(forward(x));
    return i;
  }
 
1:58 PM
template <typename T> T&& my_fwd(T&& t) { return std::forward<T>(t); } this?
 
@CatPlusPlus pah, I only use real unicode-compliant eyes: fileformat.info/info/unicode/char/1f440/index.htm
 
@Pubby That returns a copy.
 
Yeah, but should it return t& or t&&?
or copy?
 
Xeo
T&&
 
1:59 PM
Unless you want a copy.
 
Ok thanks. Do I need to do anything if I want it to be const?
 

« first day (417 days earlier)      last day (4522 days later) »