« first day (415 days earlier)      last day (4518 days later) » 

4:00 PM
@RMartinhoFernandes yea that's what I would have thought
 
@thecoshman I don't know. But what does that buy you? VAO describes how vertices are laid out in VBO, not what vertices are to be used.
 
Ok, so this guy went on and changed POD back to "public value struct". Whatever.
1
Q: WRL restrictions

Hamed MahmoodiI want to write a library using C++11 syntax and use it in other projects. As you know, public value struct could not have any methods or operators, so we had to do things like writing static methods in another class to provide behaviour. Also we can't write code like this : private: int _...

@CatPlusPlus They should have called them VBOManager.
 
ok it does seem to exist, but doesn't show up in my file listing when I browse there with explorer
how is that possible?
 
Thanks for you opinion. I wasn't going to. I just wanted to know when one should emulate OOP in C, if at all. Should one immediately switch to C++ if the project seems to benefit from OOP? What can be the obstacles to C++? You've got my point. @robjb
 
Xeo
Maybe the answer you got explains it?
 
4:01 PM
You're browsing wrong place?
 
Technology!
 
@CatPlusPlus true. I was under the impression that VAO was an alternative to VBO
 
Xeo
magic is a good enough explanation for anything imho.
 
@Beginner You can do OOP in C.
But really, why bother.
 
@CatPlusPlus This is my question! :) You can answer it here: stackoverflow.com/questions/8333789/…
 
4:03 PM
I wouldn't ever bother, because C is a horrible language.
 
ok, so you shouldn't answer my question... :D
 
@Beginner I think e.James' answer is good, particularly his comment which mentions using it for large projects needing portable assembly. That's the only time I can think trying to shoehorn OOP practices into C may be of benefit.
 
How do you write a singleton in C?
 
Xeo
You best don't
 
@robjb e.James'? which one do you mean?
 
4:06 PM
e.James is the user who posted the current top answer with 4 votes
 
@Xeo If I had a sock puppet, I'd ask it :)
 
@robjb ah, you mean to my question...
 
"I'll give you the one reason I know of because it has been the case for me: When you are developing software for a unique platform, and the only available compiler is a C compiler. This happens quite often in the world of embedded microcontrollers."
And then, "OO concepts have proven to be very useful, especially for large projects. If you are stuck with a C compiler, why not try to employ as much OO as possible?"
 
@RMartinhoFernandes create_foo calls exit when you call it twice.
Sorry, abort.
 
For anyone interested, I found the really long reddit criticism on Scala from the company that switched back to Java (it was mentioned last night)
gist: 1406238, 2011-11-29 20:09:14Z
 
4:11 PM
I don't trust Java programmers to be sane.
2
 
I wish public speaking was as easy as programming. I have to give my senior presentation tomorrow. :/
 
@CatPlusPlus :(
Frank the sock says your being mean
 
@robjb What is senior presentation?
 
@Beginner What are we presenting, or what does the presentation consist of?
(I guess I could just answer both.)
 
@robjb To whom you present it?
 
Xeo
4:18 PM
man touch sounds wrong somehow
 
I've always wondered why there wasn't a man female
That would come in useful.
@Beginner It's a presentation in front of my graduating class, faculty, and families of class members
 
No manual entry for female
 
man female?
Isn't that, like contradictory?
 
@robjb Try to be as much relaxed as possible. Also, it helps me to think that I'm the smartest person for the moment :)
 
@Beginner Haha, thanks.
 
4:20 PM
@robjb just practice the hell out of it
 
sbi
When you guys look at this transcript excerpt, does it mess up the ' in the question title, too? (I'm just trying to make sure it's not on my end before I post a bug report on meta.)
 
@sbi Yep, it turns it into an entity.
 
Xeo
$ alias woman="man"
$ woman touch
 
@jalf Yep, we have been practicing, but still need more I think
 
keep practicing then :)
 
Xeo
4:21 PM
Touching a woman has never been easier!
 
@Xeo ahahahah.
 
@Xeo So, you touch a man dressed as a woman?
 
Xeo
lol
 
sbi
0
Q: Encoding error for question tilte in chat transcript

sbiAs can be seen in this link, the chat transcript messes up ' in a question title. (I think I have seen this happen with other characters, too.)

 
@sbi Yes
 
4:22 PM
@RMartinhoFernandes M-x woman <ret> man
 
sbi
@Beginner LOL!
 
@awoodland Ugh, emacs.
 
sbi
@robjb What are you referring to?
 
$ touch woman
See, easy.
Cue even-more-confused-reply from the bonobo.
 
@RMartinhoFernandes beats xcode and VS :)
 
sbi
4:24 PM
@robjb You answered to me, rather than to a specific message of mine, with "yes", and I don't know which message that refers to.
 
c u guys.
 
@sbi Yea, just realized that. I misunderstood. Yes, I can see the erroneous HTML markup in that link.
 
@awoodland Fair enough.
 
sbi
@RMartinhoFernandes I should never have revealed that I'm a bonobo in a gorilla costume, because now all you bozos believe my avatar to be a bonobo. Sigh.
 
@sbi Hey, I know that.
Nov 23 at 16:03, by R. Martinho Fernandes
Damn you masked bonobo. I'm not perfect.
Note the masked.
 
sbi
4:26 PM
@robjb Ah! See, wouldn't it be so much easier if you would explicitly refer to a specific message when you are replying to a specific message?
 
lol I typed "I'm so agile I only write tests when it hurts" into google and it auto corrected it to "I'm so ugly I only write tests when it hurts"
 
sbi
@RMartinhoFernandes I know that you know. That doesn't prevent others from messing things up, though.
 
@sbi That it would. Gotta run though, I'll talk to you guys later.
 
3
A: Why can't variables defined in a conditional be constructed with arguments?

Johannes Schaub - litbIt should be noted.that if(functor(f)(123)) ...; would then not be the call of an anonymous functor with argument 123 anymore but would declare a functor initialized by 123. And i think introducing such pitfalls for that little feature is not worth it. Since it may not be clear what the abo...

Fixed!
Right.
 
sbi
@robjb What would prevent others from messing things up? (Did you just mess up your references while telling me that properly referring would help?)
 
4:29 PM
loll
 
Xeo
0
Q: C++ [vector<pair<enum, char*> >*] - size() method fail

Miles Rufat-LatreI am working on a [HashMap] class with specific uses in mind (therefore it is an unusual HashMap). class definition: [template<class Key, class Value> class HashMap] actual structure: [vector<pair<Key, Value*> > bukkits;] IMPORTANT: This class stores pointers to copies ...

Oh boy
unsigned int hash(Key key)
{
    srand(key);
    return (unsigned int)(rand()) % bukkitcount;
}
lol
 
Xeo
That HashMap class makes so many assumptions about the key type...
 
It's an unusual HashMap.
 
Xeo
> The reason I don't use a vector of vectors is that a vector of vectors allows vector indices to change. THAT WOULD BE BAD!! The hash function must always lead to the same bucket.
What?
 
4:36 PM
That's also unusual.
Makes perfect sense so far.
 
Xeo
Someone needs to slap some sense into that person
Any volunteers?
 
Not me.
Sounds like someone who knows too much for his own good.
Ugh, defines instead of typedefs.
 
Xeo
"too much"?
 
Xeo
HashMap(unsigned int maxBukkits)
{
    bukkitcount = maxBukkits;
    bukkits = new HashMapBucket[bukkitcount];
}
Never heard of initializer lists, eh?
 
4:38 PM
What he knows is enough to make him convinced he knows what he's doing.
No amount of convincing will convince him otherwise.
 
Xeo
Usually that happens with people who do not know enough.. When you know enough, you'd use unordered_map.
 
@Xeo But he knows (or thinks so) how to implement one, so he doesn't need the standard library.
Don't bother telling him that. He will go on about how his needs are special because something, probably related to performance, or "hundreds of records".
 
sbi
@Xeo I already leaned out of the window way too far for my own safety in comments to the guy.
 
return 0x0; WTF is this?
 
Xeo
> PS: what's an SO user?
 
sbi
4:43 PM
@RMartinhoFernandes If you think this is bad, look at this: if(ptr != 0x0) return *ptr;
 
    Key* newKey = new Key;
    Key toReturn = *newKey;
    delete newKey;
Silly much?
 
Xeo
Recovering java coder?
Wait, no.. I wouldn't call that code "recovering"
> IMPORTANT: This class stores pointers to copies of the data (that way I can pass the user a pointer so he/she doesn't have to both get() and put(), improving performance). When a Key/Value pair is removed, the value pointer is deallocated with delete.
 
See, performance.
@sbi where is the null dereference?
 
sbi
@RMartinhoFernandes Oops. I misread the condition. Blush.
 
~oldValues();
This compiles?
 
4:49 PM
@RMartinhoFernandes bitwise not?
 
@awoodland Checked that, it's a vector.
vector<pair<Key, Value*> >
 
sbi
He has deleted his question. Maybe my last comment was too much. :)
 
I was going to ask what compiler was that.
I want to know what is ~oldValues();.
 
Xeo
0
Q: Wrapper class in C++

DunnieSay I have the following abstract class: class AbstractClass { public: AbstractClass() {} virtual ~AbstractClass() {} virtual void virtMethod() { printf( "%p\n", this ); } void method() { printf( "%p\n", this ); } ... }; And the following chil...

That AbstractClass is not very abstract.
 
Isn't _wrappee reserved?
 
Xeo
5:01 PM
no?
__wrappee or _Wrappee would be
but single underscore followed by lower-case letter is perfectly fine
 
Sometimes I just wish those rules were simply "Starts with underscore, don't fucking touch it".
4
 
Xeo
But I like that notation for member variables. :(
 
It's also annoying that I can't write colour colour;.
Silly C++.
 
Xeo
0
Q: C++ Indirection in accessing members from another member

CookieGiven the following example code: class Room { Room() : switch(*this) { } Lamp lamp; Switch switch; void TurnOn() { lamp.TurnOn(); } } class Switch { Switch(Room& room) : room(room) { } Room& room; void TurnOn() { room.lamp.TurnOn(); } } My understanding he...

Damn, I want a "stupid question" close reason
2
 
lol
 
Xeo
5:10 PM
Though this one should be able to get closed as a duplicate, there should be many posts on this subject
 
Post the Sesame Street "Measure" song.
 
Xeo
heh
 
sbi
@Xeo Except in global namespace. See this one, which I recently made an FAQ entry.
 
Xeo
Right, I forgot that. But who puts their stuff in global namespace anyways?
And also, where is @Johannes? Wouldn't he be here at this time normally?
 
@sbi isn't it "except at namespace scope" or something like that?
or is it only the global namespace?
 
Xeo
5:18 PM
@jalf No, global scope
because of C functions afaik
 
ok, that's it, I need to get my copy of the standard onto my new laptop
 
Xeo
> edited Nov 18 '10 at 19:36 sbi
> which I recently made an FAQ entry
 
I feel crippled without it
 
Is it cheaper now? Or does ISO still want 100+ $ for it?
 
sbi
@Xeo Oops. Didn't look closely. Sheepish grin.
 
5:21 PM
dunno
 
Xeo
I have the FDIS. I don't have to worry about prices. ♥
 
sbi
@Praetorian ANSI used to sell the PDF for $18.
 
Xeo
I really love the alt + 3 code since I found it.
 
sbi
Didn't that guy from Intel setup a site with the latex(?) sources, so you can create your own PDF for free?
 
5:22 PM
@sbi Yeah, I've heard that folklore before ;) but the new one doesn't seem to be available for that price
 
sbi
@Xeo ??
 
Xeo
alt + 3 == ♥
alt + 3..6 == ♥♦♣♠
 
sbi
@Xeo Ah. ☺☻♥♦♣♠•◘○
 
cpx
♥
 
Why doesn't that work for me? I don't get squat with alt + anything
 
Xeo
5:23 PM
Sadly, alt + 0 isn't anything
 
cpx
@Praetorian alt + fn + 3
 
sbi
What is the resemblance between those Alt key codes (I use 0151 "—" regularly) and the resulting glyph??
 
@Praetorian Keyboard layout.
 
sbi
@Praetorian Windows?
 
Xeo
♪
 
5:24 PM
@cpx still nothing
 
Xeo
Ohh, that's also a nice glyph
 
yep, still running XP
 
cpx
♠♪♥
 
Xeo
♫♪♫
 
sbi
1 min ago, by sbi
What is the resemblance between those Alt key codes (I use 0151 "—" regularly) and the resulting glyph??
 
Xeo
5:25 PM
1
Q: C videos anywhere online

QuestioneerDoes anyone have any knowledge of a C or c++ tutorials that teach the language on video and through examples? Thanks!

Seems to call for @Fred's list
 
@sbi It's the codepoint, I guess.
But there's some weird thing about octal or something.
 
In my zeal to get the cool characters I hit alt + F4 :)
 
lol
It's Alt+numpad numbers.
 
any mac users here?
 
cpx
☻☺♥☻☺♥☻☺♥
 
5:27 PM
@RMartinhoFernandes that works ♣
 
sbi
@RMartinhoFernandes Unicode codepoints?
 
cpx
                                   â™¥
 
But it behaves strangely if you start with a zero.
 
sbi
@RMartinhoFernandes What do you mean, "strangely"?
 
5:32 PM
Alt+169 = ®, Alt+0169 = ©.
@sbi In a way that I haven't figured out.
Yet.
 
sbi
As I said, Alt+0151 works, Alt+151 doesn't.
@RMartinhoFernandes Well, if you fail. we meatbags don't stand a chance, right?
 
Xeo
151oct == 105dec, but alt+105 produces 'i'
 
@sbi No, wait, it's without the zeros that it's strange.
© = U+00A9 = 169 = Alt+0169.
® = U+00AE = 174 = Alt+169. ?
 
Xeo
alt+020102 == alt+0134 == †
Something is strange about those alt-codes
 
sbi
@Xeo †
 
Xeo
5:37 PM
@RMartinhoFernandes alt+184 == ©
 
Makes no sense.
 
sbi
@Xeo A ctually, Alt+0184is "¸" for me.
Whatever that is.
 
cpx
alt+numpad 4 closes tab on opera :/
 
Alt+184 == â•• Alt+0184 == ¸
Maybe its gotta do with Windows' 1252 code page or something, isn't that a Microsoft standard?
 
@sbi The 0 makes it use Unicode.
It's a cedilla btw.
The thing below this special c: ç .
 
sbi
5:41 PM
@RMartinhoFernandes What does that mean?
 
0
A: The Definitive C++ Book Guide and List

R. Martinho FernandesThe Boost C++ Libraries, written by Boris Schäling, and translated to English by Andreas Masur provides an introduction to the Boost libraries. The first edition is available online under a Creative Commons license and covers Boost 1.42.0. There's a newer edition that covers Boost 1.47.0 (but thi...

@sbi If you use a 0184, it generates the character U+0184. If you omit the zero, it does something else.
@sbi Posted a review of that boost book.
 
sbi
@RMartinhoFernandes Yeah! One more upvote and it's on the first answer page.
I can't vote for or against putting it into the question, though, as I haven't read it, nor seen it recommended a lot (as with, for example, Thinking in C++).
 
It can easily float up among the other answers. They're not very high-scoring.
 
sbi
Wow, someone voted to close that question.
 
cpx
5:48 PM
oh that book, I remember reading a chapter about serialization about an year ago.
is it downloadable?
 
No, I think the downloadable versions are paid.
 
sbi
I don't think I agree with stackoverflow.com/suggested-edits/142536. Josuttis is a nice guy, and his std lib book is great, but I never heard much about his book Object-Oriented Programming in C++. What do you guys think?
 
Don't know that one.
Hehe, look at this user's three gold badges: stackoverflow.com/users/14388/grepsedawk?tab=badges
 
sbi
@RMartinhoFernandes Haha, his only question!
@RMartinhoFernandes So you neither. Anyone else an opinion on the matter?
 
Don't put any weight on me not knowing that one. I'm new to this, remember?
 
5:57 PM
Is there a solid C++ book of the highly recommended status, that includes C++0x topics?
 
Not yet.
C++ Concurrency in Action comes out in three weeks.
 
sbi
@RMartinhoFernandes Have you heard about the other ones?
 
@sbi Some of them, yes. And I've read a couple. (TC++PL, Templates: Complete Guide, Modern C++ Design).
 
You see, I'd like to check some of those books out, but I'm worried about them being a little aged.
That and I can't do with something that doesn't read well. I mean, I don't need pictures. But if there's only two paragraphs per page, I'm going to have a hard time.
 
cpx
@sbi Hm, haven't heard of that book.
 
5:59 PM
I haven't digested Modern C++ Design yet. I have to re-read the last third again sometime.
 
cpx
A look inside at amazon might help.
 
sbi
Oh boy, how much faith should I have in the opinion of a C++ programmer who is unable to paste and adapt a paragraph so that its formatting fits the other ones? He was unable to properly format the numbered list item, didn't italicize the book's title, and pasted a link to amazon.ca.
 
That seems like a good project. Create an online tutorial that doesn't suck. However, it'll be hard not to look like you're breaking copywrite.
 
sbi
Oh, and that book is from 2002.
 
@sbi This is when you need a poll on SO. A private poll that you can invite people to.
Meta would be a good place for that. But, it's meta.
 
6:03 PM
Use the stars, Luke.
 
sbi
@Xaade We have done something like this here using pins, counting stars. You can invite the regulars by pinging them.
 
stars?
 
You pin a "Star this if you agree." and a "Star this if you disagree." messages.
 
sbi
@cpx Ok, if that's all I got, and if that fits my gut feeling, I'll remove the thing.
 
And people vote with their stars.
 
6:04 PM
Ironically, they don't fight over stars in Star Wars.
Although, there is the death star....
 
Death Stars.
 
@sbi But the overwhelming majority of users never venture into this room.
 
sbi
@Xaade The overwhelming majority of people don't even know what SO is. So?
@Xeo Oh, you had already seen it.
 
C++ compilers are compulsive liars.
 
Yay! I finally got around to implementing my c++ source file executor. Ideone has been getting way too laggy lately. Plus, I can now use C++ for quick scripting.
 
6:16 PM
C++ for quick scripting?
 
@RMartinhoFernandes Yes. Quick. Simply because I'm more efficient with C++ than with any other language. Now I can just create a source file on my desktop, double click it, and it executes.
 
There is nothing efficient about that. :P
 
@BenjaminLindley you wrote something that takes a source file, compiles it, and executes?
You should have it parse out input comments.
 
It's pretty trivial, really.
 
6:20 PM
/// INPUT : ...
 
You can do something like that in e.g. bash.
 
#!/bin/bash

# Yes, permissive, this is a fucken script
g++ -fpermissive $1
./a.out
 
mawning
 
echo 'TMP=$(mktemp); g++ -x c++ -o ${TMP} - && ${TMP}' > runcpp; chmod u+x runcpp
 
6:24 PM
Screw temp files.
Also, you forgot -fpermissive.
 
What's that for?
 
But mine uses precompiled headers with useful stuff from boost pre-included. I'm not saying it was difficult, but it is useful.
 
@CatPlusPlus To allow all kinds of shenanigans you don't want in normal code.
But it's a script! Make it scripty.
 
lol
 
@BenjaminLindley Clang+LLVM JIT is your friend?
 
6:28 PM
@rubenvb Does that work on Windows yet?
 
Or ROOT's Cling for that matter. That's interpreted C++ for you
 
I still wouldn't use C++ for any scripting.
You can learn Python in 2 hours.
 
It works under MinGW (libstdc++), and C works for everything (no name mangling). Exceptions are broken everywhere you go on Windows. Not sure about the JIT part though, but I think it should be functional.
MS's STL (msvcp*.dll) cannot currently be used by Clang due to linking issues.
 
@KerrekSB I hope you don't mind me using the FPAs :)
 
sbi
@CatPlusPlus Learn Python in 120mins. That's a whole new level for the category of Learn X in Y time units category of books.
 
6:31 PM
@sbi I can top that.
 
That was pessimistic estimate.
 
@CatPlusPlus I know Python a bit. But not nearly as well as I know C++. If you give me a task, I will most likely be able to think of how to do it in C++ much more quickly than in Python.
 
In Python it's "search standard library, use what you've found".
 
sbi
Learn C++ in 300,000mins
@RMartinhoFernandes That is ridiculous.
 
6:33 PM
> The author assumes no prior programming experience and begins by showing the reader the absolute fundamentals of what a program is and guides the readers to write their very first program.
Rofl.
I'd imagine contents of the entire book must be dissecting int main() { return 0; }.
 
@sbi Told I could top 120 mins.
 
sbi
@CatPlusPlus When I was teaching C++ to Java programmers, I tended to spend about 20–30mins explaining the complex details of the classic "Hello, world!" program.
 
Yeah, I certainly couldn't possibly explain what #include does in 10 minutes.
And that's not even "hello world" yet.
 
is there any way to make the chat window black background+white/green text?
 
6:35 PM
UserCSS.
 
sorry, I'm no web browser geek :/
isn't there any button I can press?
 
@sbi Ha, I could teach C++ to three different people during that time!
:P
 
sbi
@rubenvb Black background + green text?! That's gross!
@RMartinhoFernandes I usually had >30 in my first lecture.
 
6:37 PM
Yeah, the contrast is eye killer on that.
And white on black is even worse.
 
I use grey on gray.
 
@sbi Matrix FTW!
neon green, not darkish green
that gives good contrast imho, that's classic high contrast
 
sbi
@rubenvb Unless you're Neo, you'll hurt your eyes doing that.
 
Huh, last update on the server broke cairo.
Why do I have cairo on the server.
Mystery.
 
Isn't that like a visualization thing?
 
sbi
6:39 PM
@rubenvb You wish. I am old enough remembering those green "monochrome" monitors, and I have no wish to go back.
 
Neon green on black is both unreadable and eye-bleeding-contrast.
 
People keep telling me "you're the One". I think they're just misspelling/misprononciating my name and it really should be "you're thé Neo"
Gmail has a theme "terminal". So does my Cyanogenmod 7.1 Android phone
but I can see your point
maybe it's just cool for 5 minutes
 
sbi
Rubbing two of those monochrome monitors was a good way to start a fire to roast your bugs over, back then, though.
 
You could roast them?
Nowadays we have to actually fix them.
 
Mine CRT could do that alone, you just needed to leave it on.
 
sbi
6:42 PM
What's the point in slaying bugs if you can't feed the kids from that work?
 
@sbi Adventure!
 
that has neon green in it
 
sbi
@CatPlusPlus One of the first iMacs, right? :D
 
and that's vim
 
sbi
6:42 PM
@RMartinhoFernandes That's fine so long as you don't have family.
 
You brought it upon yourself.
:P
 
@rubenvb you know, for high contrast we have these super cool colors supported on modern monitors. They're called "black" and "white"
I believe most editors even use them by default. How crazy is that?
 
I was talking about the chat window. Each time I switch between Gmail and SO chat, my eyes start bleeding :(
And my whole keyboard has been repainted six times already :/
 
"Repainted"?
As in paint the letters?
 
well, it wasn't red when I got it
 
6:49 PM
don't bleed on it?
 
blood stains terribly on cheap plastic
 
Hint: the keyboard is for typing, not for facepalming.
2
 
@RMartinhoFernandes facekeyboarding
 
Faceboarding.
 
@RMartinhoFernandes I ran into that once. I didn't get it. There's no way you can read that book in 10 minutes (just straight reading).
That and anyone that wants to get into programming, but can't bother to spend 10 minutes learning a programming language, don't aspire to much.
@CatPlusPlus Sounds.... painful.
@sbi You don't have to be old enough. You just have to unlucky enough to live in a small middle-class town.
I think I qualify for wrapping all kinds of legacy interfaces, thanks to my helping around the public school library.
 
6:55 PM
@CatPlusPlus Sounds like a sport.
 
sbi
@Xaade That might lessen the age restriction somewhat (so does living on the wrong side of the Iron Curtain, BTW), but won't remove it.
Anyway, I'm off to a friend's birthday party. See you all!
 
@sbi Don't know. Public school system follows the "It still works" policy.
 
Ours are getting in the habit of BlackBoard or Toledo. I personally think it's mighty overkill for a middle/high school
 

« first day (415 days earlier)      last day (4518 days later) »