« first day (583 days earlier)      last day (4380 days later) » 

9:00 AM
Just change the solution platform to good ol' fashioned x86
 
@72con create new VS project
 
@DeadMG How is your compiler project going?
 
@Neil Any fix for that?
@Abyx Tried that, it too is for Windows phone emulator
 
I haven't worked on that in months
 
And I don't know how to change the solution platform; the dropdown is disabled.
 
9:01 AM
@DeadMG What are you working on right now?
 
ow, WoofC is @Dead ?
2
 
You're creating your own language?
 
His language is very Wide.
 
lol, WoofC
2
@RadekdaknokSlupik Just like his mother.
 
I don't get the WoofC joke.
 
9:02 AM
@72con Unfortunately I don't have VS open so I can't help you too much, but if you right click on your project and go to properties, the platform should be set to x86
 
@RadekdaknokSlupik It's a yo momma joke.
 
@RMartinhoFernandes That's nasty!
:D
@RMartinhoFernandes Are you working?
 
lol working
 
Hm. Yeah, something like that.
I'm not chatting here. It's just an illusion.
 
I'll tell your boss
 
9:04 AM
he's operating
 
I don't have a boss.
 
How come?
 
Lol - If you don't have a boss and you're in a chatroom, that's called unemployed
 
I'm self-employed. I think. I hope.
2
 
You're under employment of the client.
 
9:08 AM
Any LibreOffice / OpenOffice contributor in this room?
Oh well, I don't care anyway. That software is extremely irritating and I wish extreme suffering among the developers for not even handling correctly the FREAKING UNDO SHORTCUT.
 
facepalm
 
Is there any point to adding a size_type typedef for non-container classes or should I just stick to size_t?
 
Stick to size_t.
 
@Cicada how so?
 
Unless your type makes a semantic difference (which it should not).
Well CTRL+Z breaks all my formatting for some reason (no, really).
 
9:12 AM
@Pubby Depends on the class.
 
(On Impress)
 
@GManNickG Well this isn't a container class. I imagine stl-like classes should have it.
 
(Like, I have a bulleted list. I add a word. Ctrl+Z. Suddenly all the text unindents itself and the bullets disappear into nowhere.)
 
@Pubby Right, but if your class measures the integer size of something, then it may be useful.
 
9:14 AM
If I Ctrl+Z again in the (naive) hope to cancel the changes
NOPE, everything disappears.
 
Try Ctrl+Y.
 
@Cicada is that the PP pendant?
 
Ctrl+Y doesn't do anything either.
 
Ctrl+Z again only undoes the undoing in stupid programs like Photoshop.
 
@Cicada Use LaTeX instead
 
9:15 AM
@sehe Yes it is. I think I'm just gonna buy MSOffice instead.
 
In most sane software, Ctrl+Z twice undoes the last two actions.
 
@RMartinhoFernandes I like the behavior. :X
 
@ManOfOne Beamer in this case. I guess you're right.
 
Use Abiword!
 
@Cicada Your college should be in a microsoft partner program from which you can get free office actually.
 
9:17 AM
@ScarletAmaranth We do have MSDNAA but that doesn't include office. (I'm already very happy to have VS2010 for free!)
 
We get MS Access.
Useless piece of junk.
 
MS Access isn't web scale.
@ScarletAmaranth your college should have µTorrent installed to get free Office.
Anyway, I wouldn't want to have MS Office even for free.
 
I wish there was a syntax that turned private int foo; into int __foo and int foo() { return __foo; } (dunno if what I said made any sense, I just don't want to have to use silly names to avoid name clashes)
 
Not even if they gave me money with it.
 
9:19 AM
@Pubby It's called C#. :P
 
@Pubby You can use some kind of accessors.
 
@Pubby either #define property <whatever> or use a template<class T> class property {…}
 
13
Q: Portability of Native C++ properties

Josh BrownIn Visual Studio, there is __declspec(property) which creates properties similar to C#. Borland C++ offers the __property keyword with the exact same functionality. In the C++0x, there is mention of a implicit keyword that could be expanded to implement the same functionality. But it didn't m...

 
@Pubby __declspec(property())
=\
 
What's a property? :S
 
9:20 AM
That's what C#'s properties do, essentially
 
Oh you weren't talking about properties?
 
I just don't want to do int m_foo; and then int foo() { return m_foo; }
 
Non-static member variables with accessors.
 
Why don't you want to do that?
 
@Pubby Do like we do in Java and make a getFoo() setFoo(int val)
 
9:21 AM
Use properties.
 
*dodges rotten tomatoes*
 
@Pubby Pretty much what you described. The idea is that before reading or writing a member variable, you can perform some validation or computation on it. This is a "property" of an object, a generalization of a member.
 
@Pubby #define prvt(T, name) T m_##name
 
I don't use msvc
 
9:21 AM
prvt(int, foobar) —> int m_foobar
 
@Cicada Does GCC have an equivalent?
 
No double underscores, please.
 
137
Q: What are the rules about using an underscore in a C++ identifier?

Roger LipscombeIt's common in C++ to name member variables with some kind of prefix to denote the fact that they're member variables, rather than local variables or parameters. If you've come from an MFC background, you'll probably use "m_foo". I've also seen "myFoo" occasionally. C# (or possibly just .NET) se...

 
But then I have to use m_ inside my member functions :(
 
I use name_ for private members.
 
9:22 AM
And the double underscores was just to show it was compiler magic
I guess I make a template class that does it
 
@Pubby: Do you need the function?
 
But what's the advantage of having a int foo() { return foo; } if you're not going to do anything to foo before returning it?
you could have a public const int foo, right?
 
@Neil It needs to be read-only. Like size().
 
@Neil That can't be changed.
 
@Neil i guess encapsulation?
 
9:24 AM
Hmm, oh yeah, now I remember.. all those awful memories flooding back again..
 
I prefix members with _.
 
can one do template<class T> class foo { friend class T; }?
 
@RadekdaknokSlupik Only in C++11 (or in MSVC because of extensions).
 
@Cicada suffix them in case you ever want to start their names with a capital letter.
 
I don't want them to start with a capital
 
9:25 AM
@Cicada This is the work of the devil!
 
Why is it? This is C++ not C#.
Oh wait.
 
I start type names with capital letters.
 
Ew.
 
@Cicada I know why you would want to, but unless you're writing a library...
 
9:26 AM
We're talking about member names here.
 
ew
 
more generally, _Ugly identifiers are reserved in any scope.
so starting with _ is just begging for trouble
 
private: int _iDoEnjoyTroubleIndeed;
 
@Cicada types can also be members. class Foo { private: typedef int Bar_; };
 
The general rule is that you start it with _ if you know that class will be inherited and while it must be protected, you do not want others messing with those variables
Sort of a protected "private" scope
 
9:27 AM
Just document it.
Or make them private with an accessor.
 
@RadekdaknokSlupik Not if you yourself, author of that library intends to override it
 
C++11 has final.
 
Wait, would this work?
 
@Neil Erm. Private scope is not visible to subclasses.
 
template<typename C, typename T>
struct foo : public T {
  friend class C;
};
Wait, nevermind
 
9:29 AM
4 mins ago, by Radek 'daknok' Slupik
can one do template<class T> class foo { friend class T; }?
 
@Neil So, why make it protected if it should not be visible?
 
@RMartinhoFernandes I know that, I'm saying you'd make an AbstractStudent class with some basic members, some of which are very technical and you don't want tinkered with
 
So you start their names with _ and you tinker with them in your own classes which inherit AbstractStudent, but they're still not meant to be tinkered with by people who use that library
 
@Pubby TBH I don't remember if you need to (or are allowed to) have the class keyword. This works for sure: friend T;.
 
9:30 AM
It's a very specific circumstance I think, and I think it's an indicator of bad polymorphism
 
I used it in some weird idiom we made up on SO.
10
Q: Can we increase the re-usability of this key-oriented access-protection pattern?

Georg FritzscheCan we increase the re-usability for this key-oriented access-protection pattern: class SomeKey { friend class Foo; // more friends... ? SomeKey() {} // possibly non-copyable too }; class Bar { public: void protectedMethod(SomeKey); // only friends of SomeKey have access }...

 
@Neil That's what friend is for.
 
@RMartinhoFernandes Not saying you can't do it in other ways, just that that is one way of doing it
 
I prefer compiler enforcement to convention.
 
I myself don't do it that way because I strongly dislike the idea of protected members that aren't supposed to be tinkered with by inherited classes
Better still, there would be no protected members, only protected methods
Otherwise direct usage of protected members would break future implementations if you ever decided to get rid of said members
 
9:32 AM
The best moment of the day has come.
LUNCH
 
lol I just had breakfast. A sausage roll.
 
@Cicada Where do you live, out of curiosity?
 
I'm leaving for a better place. My kitchen.
Somewhere in France.
 
What is a kitchen?
 
It says on my profile.
 
9:34 AM
@RadekdaknokSlupik Kit Chen is a famous Chinese athlete
 
@Cicada You're home?! Aww man now I'm jealous
 
@Neil I'm home too.
 
@Cicada Already?
 
Do you guys at least work at home?
 
9:35 AM
 
I'm free today.
 
Oh, wait, that's not the teddy bear.
Damn, I'm confusing the avatars.
 
I always confuse @ScottW with @Chad.
Is this picture appropriate for a slideshow about C++?
 
No, because it
is Norwegian. Bjarne is Danish.
 
Hmm…
Close enough.
 
9:38 AM
the country of origin of a person is the most fucking irrelevant thing ever
"Congratulations, you were born on a slightly different tract of land?"
 
On the other hand, the OO stuff in C++ came from Norwegian programming language called Simula, mostly.
 
"Congratulations, you're a merkin!"
 
@CheersandhthAlf o_O ? Rly ?
 
"Congratulations, you're a pubic wig!"
 
Simula? Smalltalk ftw.
 
9:39 AM
The OO stuff in Smalltalk also came from Simula.
It happened like this.
 
I know.
Simula was first.
But Smalltalk sucks slightly more.
 
A guy called Alan Kay, PhD student at the time, I think, picked up a magnetic tape with what he thought was an Algol compiler.
But it wasn't.
It was a Simula compiler.
Hm, that was interesting...
 
And them the multiverse imploded!
Right?
 
And that's how kittenz invaded the interwebz ?
 
9:41 AM
@RMartinhoFernandes Divide by zero!
 
Nah. That's a story for another day.
 
lol I just found out that I can reset the TextMate trial starting date by changing the creation date of the settings file.
 
Alan was the third person (I think) to invent palmtop computer, or the IPad
The first one was Vannevar Bush
 
@Neil That's comparatively harmless, actually. The worst that can happen with division by zero is, what? Some space probe falling on the ocean?
 
I cannot remember the second?
 
9:42 AM
@Neil I accidentally by zero. Is this bad?
 
@CheersandhthAlf Steve Jobs?
;)
 
@RMartinhoFernandes Psh, who cares about a stupid space probe anyway, am I right?
 
We're talking before 1975
Or 1972
 
Dividing by zero is an ok thing to do, just don't forget to keep track of the universe carry.
 
It's ok to divide by zero also in math, except 0/0, which is very indeterminate
 
9:43 AM
 
but e.g. 3/0 is ok
it's just 3/0
 
Its result undefined.
 
3/0 = order pizza.
 
it is interesting that if you implement the logic you find you can just reuse complex number implementation
 
Incidentally, the answer is probably something quite uninteresting, but supposing the CPU did no checks prior to dividing by zero, what would the bit outcome be?
 
9:44 AM
the bad thing is that you can't easily add them thingies.
 
I'm pretty sure that these checks are done even inside the CPU unit, for that matter
But assuming they weren't
 
but they can be multiplied and divided, and they can be used to optimize certain algorithms, such as Dempster-Shafer evidence combination
 
Oh, I know what I can do: ideone.com/mM3Yq
That works, right?
 
@Pubby This is better than int foo() { return foo; } ?!?!
 
You're retrieving an indeterminate value and then ignoring it?
 
9:48 AM
@Neil You can't have a member function with same name as member
@CheersandhthAlf Heh, I just wanted it to compile, not supposed to be actual code
 
@Pubby Well call it m_foo
 
The whole idea was to use the same name
 
it should compile
the size in derived class hides the size in base class
 
So, you're doing all that because you don't want to give a different name to the private data member and the public function?
Over-engineering much?
 
@RMartinhoFernandes Yes :)
 
9:51 AM
I think the person who invented pizza with anchovies had bad taste
 
Although now I have naming problems with the class name, damnit!
 
@CheersandhthAlf The chinese have a tradition in Easter where they collect children's urine and leave eggs to brine in it for several days before boiling it. I think they have bad taste.
 
I will resist my urge to post picture
 
@Pubby 6th networking truth: It is easier to move a problem around (...) than it is to solve it.
 
Patrick Star was a genius
 
10:01 AM
I wonder if people understand the irony that Patrick is a starfish with eyes on top of its head, which is not anatomically correct by any means. Most starfish have thousands of photosensitive "eyes" underneath. It'd be like aliens portraying human beings with an extra two limbs and claws rather than hands in order to appear more suitable to the alien viewing audience.
 
But a talking square sponge that cooks hamburgers and lives in a pineapple is okay?
 
cough
@Pubby You forgot the pants.
 
I always forget the pants :(
3
 
Hmm, that would look odd out of context.
 
therefore, star it
 
10:08 AM
@RMartinhoFernandes not too bad it turns out :P
 
@RadekdaknokSlupik on time
 
@DeadMG Obviously.
 
@RadekdaknokSlupik What the HELL? Isn't TextMate a free editor?!?! Oh my god. I couldn't even fathom that
 
I'm an idiot.
(Fishing for stars)
4
@sehe Wait, what?
 
@sehe no it's about fifty bucks.
::socket y u return 0.
 
10:16 AM
Wow. What does it get you for fifty bucks?
 
Nothing more than the trial version.
Except that you don't have to reset the creation date of the settings file every two weeks.
 
@Pubby That is a contradiction the size of yo mama. If you want it to compile, it better start with being actual code :)
 
So, it's a robbery.
 
Highway
 
Why the fuck does std::cout << ::socket(AF_INET, SOCK_STREAM, 0) << '\n'; print 0?
 
10:17 AM
@RadekdaknokSlupik Because... it returns 0?
 
Because ::socket(AF_INET, SOCK_STREAM, 0) is 0.
 
Yeah, but why does it return 0? xD
 
Because.
Why wouldn't it?
 
0 may be valid handle value
 
When I ::connect it says "Bad file descriptor".
 
10:19 AM
On error socket returns -1.
 
But it returns 0.
And isn't 0 the file descriptor of stdin?
 
Usually.
@RMartinhoFernandes Hmm, that didn't quite work as I expected.
 
Wait imma run DTrace on this thing.
 
I'mma run your mother up my flagpole
 
Yup, 0 is a valid file descriptor.
 
10:22 AM
Of course it is.
 
But ::connect refuses to accept that.
 
I don't think you can connect to a file.
 
@RadekdaknokSlupik What do you think it does? It has no endpoint and you write to it? Also, what it protocol 0?
@DeadMG Be quiet. You don't know UNIX :)
 
@sehe protocol is usually 0 when you use AF_INET with SOCK_STREAM.
 
@sehe I'm very glad I don't use UNIX.
 
10:23 AM
It should open a TCP socket.
 
@sehe You can use 0 when there's only one protocol in the given type/family pair.
 
@DeadMG That something else. And you are not glad, just misguided. You use it every day.
 
Domain name lookup also works.
 
@sehe I don't use it. Some services I use may happen to use it. The two are different things.
 
@RadekdaknokSlupik Just checking. And does connect bind to an endpoint. I guess so. Perhaps errno will tell you about what connect doesn't like about it
 
10:24 AM
"Bad file descriptor", he said.
 
strerror(errno) tells "Bad file descriptor"
 
@DeadMG You can do anything to a file on *nix. Now, don't get any ideas, ok?
 
@DeadMG Ok. You don't actively choose to use it. Fine.
Sockets are files. Pipes are files. Everything is a file.
@RMartinhoFernandes :)
 
@RMartinhoFernandes Fortunately, I just don't care.
@sehe Actually, I actively choose to BURN IT.
 
You're a pyro?
 
10:26 AM
@RadekdaknokSlupik that's bad
 
:P
Their avatars are so similar.
 
Shit. Forgot my license plate number.
 
@RMartinhoFernandes Huh. You've got to bring your own? My vehicles have their plates attached. Or at least, last time I checked
 
10:33 AM
This would deserve the ultra gay seal meme.
 
I am not familiar with that one.
 
@RMartinhoFernandes Come to friend chat with us. You will be our friend forever!
 
@RMartinhoFernandes Twas the flag that drew your attention, no?
 
I'm rebooting my computer. That may fix it.
 
Hehe. I picked up a good trick there though
 
10:35 AM
 
@sehe Why are you linking me to "leave the Lounge"?
 
this one
 
And yes, it was the stupid flag.
 
@RMartinhoFernandes ^
Might come in handy. Someday. I never though of it
 
how do i leave
that damn room ?
 
in Friends Forever, 16 mins ago, by Kartik
http://chat.stackoverflow.com/chats/leave/9845
 
@ScarletAmaranth What part of 'forever' don't you understand?
 
LOL
 
> Are you sure you want to leave Friends Forever?
 
10:38 AM
You got it Mr.
 
Yeah i am ABSOLUTELY positive i want to leave that room :D
 
Well I got 'mentioned' in that room - I'm not about to find out why/how
 
Yeah me too, someone said hi to me.
Also, they did so to you sehe :)
After which i fled.
 
Natural response
 
people really fucking love height maps don't they
 
10:41 AM
Maybe we should open up a competing joint friends: for(;;);
@thecoshman Nope. They don't
 
I want to find a nice tut on something else, but can't find the right search words
Want to be able to do procedural terrain generation, but with caves and over hangs etc.
 
That's not a heightmap
 
@Pubby thus the reason I am trying to find a tut for something else
 
Use perlin noise?
 
perlin noise would only be good for generating the data
 
10:44 AM
@RadekdaknokSlupik I get it: you need to revert the date on the settings file for TextMate for Apple to continue to work. Either that, or it is PayPerConnection(TM)
 
@thecoshman Isn't that what you want?
 
@Pubby I want procedurally generated terrain that can support caves and overhangs. I would just use height maps, but they don't do well with caves or steep cliffs
 
But you said perlin noise would be good for that. I don't understand :S
 
@Pubby when did I say that? perlin noise would be good for a height map, but it will not help me make overhangs and caves
 
@Pubby 8th networking truth: It is more complicated than you think.
 
10:48 AM
4 mins ago, by thecoshman
perlin noise would only be good for generating the data
 
I guess this is better than tossing around links to TVTropes.
 
perlin noise is good for 2D image of height data. in would have to addapt to be something like a 3D density map. and then threshold it to get 'air' and 'ground'
 
@RMartinhoFernandes Wow. Nice output
 
perlin noise is just for generating data, how it is stored is a moot point
@RMartinhoFernandes awesome! that is what I am after :D
 
@thecoshman So "is good for 2D" is nonsense by the same token. You just have to do more work to map it on a 3D model. Do the work :)
 
10:52 AM
@sehe I don't want to go down the voxel route :P
 
Isn't std::hash supposed to have a specialisation that takes any type T*?
 
ok, I think it has been long enough, wtf are these lines for? the one's above @RMartinhoFernandes last message
 
@RMartinhoFernandes Am I doing it wrong? return std::hash<const Class>()(this);
inside a const member fn
 
@SethCarnegie wtf is 'const' doing there?
 
10:54 AM
^
 
@SethCarnegie Wait, const Class doesn't match T*.
 
`return std::hash<myDataType>()(this);' would make more sense
 
Tried it without const too and I got a large error message from gcc 4.7
 
@thecoshman What lines?
Btw, that article was the first hit on this query: google.com/#q=procedural+terrain+generation+caves
 
@RMartinho cppreference says template< class T > struct hash<T*>; so that should work right?
 
10:55 AM
@RMartinhoFernandes the dotted one...
 
@thecoshman Oh. That. It supposedly marks the last time you paid attention to the chat. Or something.
 
@RMartinhoFernandes ¬_¬ I feel like I have failed at the internet
2
 
As everything in this chat, you can expect it to never work as expected.
 
@RMartinhoFernandes well that is utter bollocks :P
 
Ah, it had to be std::hash<const Object*>(this) exactly.
 
10:56 AM
Right.
 
Why though?
 
Because there's only a specialization for pointers?
 
the reference says template< class T > struct hash<T*>;, is it wrong or am I not understanding that syntax correct
ly
 
The reference is correct.
That is a partial specialisation.
 
+1
 
10:57 AM
oh, dumb of me
 
Does C++11 allow partial specializations in namespace std?
 
+5
 
-6, let's not keep adding to this counter with out checking for overflows
 
+INT_MAX
 
10:58 AM
@Pubby why wouldn't it
 
@thecoshman Didn't use to
 
=0
@Pubby TIL
lunch time :D
 
@Pubby Yes it does, specifically for things like std::hash, std::less, std::swap etc.
 
But it still might not, does it?
 
10:59 AM
C++ is a functional language, see? #include <functional>
 
This has been asked before. Search SO
 
@sehe Okay cool
 

« first day (583 days earlier)      last day (4380 days later) »