« first day (797 days earlier)      last day (4154 days later) » 

5:03 PM
@CatPlusPlus You missed the apocalypse!
 
Hmm, free pizza.
 
My boss told me to "share my c++ knowledge". Any ideas as to what I should teach them? (And what not?)
5
 
@StackedCrooked unique_ptr. RAII
 
user142019
@StackedCrooked std::unique_ptr, other RAII shit. std::vector. tinyurl.com/fuck-pointers. Exception-safety. SFINAE. Rule of zero.
 
5:13 PM
Haskell
 
Sooooo, that NRA guy blamed games and films.
 
@StackedCrooked whats-the-word. object guarantees. invariants
 
@Zoidberg'-- Ah yes, the pointer tutorial :)
 
is invariants the right word? Sounds wrong to me
 
@MooingDuck That's for later.
 
5:15 PM
@StackedCrooked it's important. My java code at work, all of the classes are effectively C-structs, that also have members that do stuff. But you have to constantly manually keep members in sync.
@R.MartinhoFernandes: did you ever confirm that this was actually what you had been intending?
 
My priorities are: (1) convince them to always use RAII, (2) treat warnings as errors. That should cleanup the first layer of mess.
 
@StackedCrooked one I just learned: if getting a error about casting a int to a char (or similar), the correct action is not to add the cast. The correct action is to check and make sure it fits, and cast if it does
 
numeric_cast
It's in Boost
Obviously
 
my work doesn't have boost.
 
Priority (0) use fucking Boost
 
5:19 PM
To motivated them I presented them with this puzzle.
 
user142019
@StackedCrooked exception-unsafe!
 
@Zoidberg'-- That's the second problem.
 
Wrong copy semantics
 
Absolutely.
 
user142019
@StackedCrooked The one you weren't looking for. :^)
 
5:20 PM
It's strange that the program doesn't segfault.
 
It's UB
 
user142019
I didn't even read beyond the exception-unsafe ctor.
 
@Zoidberg'-- I was looking for two errors. I ended up with three.
 
It doesn't have to segfault
 
user142019
@StackedCrooked it probably keeps the memory for later allocations for performance reasons.
 
5:21 PM
The memory is likely to be returned to client-side heap manager, not to the OS
So the process still have a right to access it
 
Ah yes.
Right, nullptr deref usually segfaults. But the pointers aren't set to null after deletion.
 
user142019
Try it with large (larger than one page) objects.
 
I got wrong answers like: you didn't set the pointers to null in the destructor.
 
user142019
lol
 
But one person made a surprisingly interesting point: the order of deletion should be reversed.
 
user142019
5:23 PM
That doesn't matter.
 
Which would have been the case when using RuleOfZero.
@Zoidberg'-- Not in this case. But suppose x was a temp dir, and y was a file in x.
 
user142019
The biggest problem with that code is that pointers are used.
 
If the objects are not mutually dependent, order of destruction doesn't matter
 
@StackedCrooked that is interesting
 
@CatPlusPlus Yeah. But I think it's a good practice to follow the classic ABBA pattern.
 
5:25 PM
Maybe
 
When following Rule-of-zero then the order of deletion is always correct.
 
I need food
 
user142019
OmniGraffle acts weirdly when I connect the two ends of a line to the same object.
 
Ah, Gameloft. Such a bunch of morons.
 
user142019
 
5:26 PM
@StackedCrooked lambdas
 
@Zoidberg'-- Agreed.
 
@EtiennedeMartel Sounds great
 
user142019
@StackedCrooked C++-style casting operators.
 
@FredOverflow Yeah. I also want them to stop seeing OOP as the one true way.
 
@R.MartinhoFernandesterribly sorry (btw your avatar hat makes it a biach to copy/paste your name from your profile =P) — WhozCraig 2 hours ago
 
5:28 PM
How much do you want to bet that what they're doing isn't even OOP
 
@FredOverflow syntactic sugar = low priority
 
I don't want to seem like a preachy person that likes to impose arbitrary rules on other people. Therefore I want to have a strong motivating example for each item.
 
Lambdas simplify code
 
I think lambdas will be popular.
But I meet a lot of resistance when I try to enforce warnings as errors.
 
sure, but they don't need reasoning. "There's lambdas. They look like this. They work like this. They're convencient. Moving on..."
@StackedCrooked that's expected
 
5:30 PM
Lambdas are convenient. Convenience doesn't require motivation :)
 
@StackedCrooked pop open production code from your company, go through the warning list one by one, and show how each is a potential bug they overlooked.
 
I've done that a few times.
It's just one person that is preventing it from happening.
 
@StackedCrooked pop open his code, go through the warning list...
 
Alright, so. Should I buy the Bethesda Collection?
 
That might lead to even more resistance. I have to be very careful to not create a "counter movement".
 
5:35 PM
There's Skyrim and Dishonored, amongst other things, in it. For 90$.
 
@EtiennedeMartel how fast does the computer reboot?
 
@MooingDuck Hm?
 
user142019
@StackedCrooked Macros and singletons are bad.
 
user142019
(Though the latter is not really C++-related.)
 
Yeah, but they are probably not in the top 5 of most serious problems in our code.
(1) Code is not exception-safe at all. (2) Use posix api for threading.
 
5:37 PM
@StackedCrooked what are the top five?
@StackedCrooked do you use exceptions at all?
 
@MooingDuck Yes.
 
@StackedCrooked oh
 
There's the idea that lean-and-mean is best.
 
@StackedCrooked lean-and-mean tends to be lean-and-fall-over-and-dies
 
Define "lean-and-mean"
Because POSIX APIs are not either
 
5:39 PM
@CatPlusPlus no overhead with piddly things like destructors and classes
 
That's workable with execute-around and lambdas
Not that it makes sense
 
@CatPlusPlus The uninformed kind of lean-and-mean. Arrays are faster than vector. Etc...
 
But vectors have TWO WORDS OF OVERHEAD MAN
 
@CatPlusPlus The "C is faster than C++" kind of lean-and-mean
 
0
Q: Short Vs Int Gcc

JeanI was expecting Loop2 in the following program to take more time compared to Loop1. But even after enabling optimizations (gcc -O2) I see that both of the loops takes almost same time. Why is that so in my system with sizeof(int)=4 and sizeof(short)=2 ? I was expecting compiler to put a short mul...

Hah
 
5:42 PM
@CatPlusPlus The funny thing is that they overuse inheritance badly. So all of their so-called lean and mean code uses dynamic dispatching and has vtable size overhead.
 
Haha I got hats on meta of all places
 
http://stackoverflow.com/questions/13994739/how-to-use-new-syntax-in-c-11
is my comment dumb here?
 
@bamboon its fine
 
@MooingDuck good, the upvotes got me confused
 
5:45 PM
That survey guy is hilarious
*goes into lesson teacher" deep have you got the results" me:"no, because the people on S.O. are too lazy and weren't interested" If you were a techer what would you say? — deep 22 hours ago
 
@bamboon I haven't decided how to vote on that question. It's a syntax question, but otoh, it's a tricky spot of syntax.
 
@CatPlusPlus Is he a troll or just stupid?
 
@CatPlusPlus HA! I hadn't seen that!
 
I can give you spam. how about log off prevention and infinite IE 4 browser windows opening and 100 page word documents saving inifinitely? thats spamming. — deep 22 hours ago
I can give you spam. how about log off prevention and infinite IE 4 browser windows opening and 100 page word documents saving inifinitely? thats spamming. — deep 22 hours ago
Now he's getting technical.
> I admit that the room owner who initially deleted your first link came down a bit hard on you. (that's pretty typical of him)
Was it @DeadMG?
It sounds like something he would do.
 
user142019
What an idiot.
 
5:52 PM
in bin, 23 hours ago, by DeadMG
3 messages moved from Lounge<C++>
 
What a surprise.
 
user142019
in bin, 23 hours ago, by DeadMG
Survey- fuck you and the horse you rode in on
 
user142019
lol
 
If @DeadMG was an ambassador, we would all be in some sort of global nuclear war by now.
4
 
5:54 PM
Surely
 
user142019
DeadMG should be president of Earth and the Cat should be president of Mars.
 
Haider!
 
user1182183
#define D3DFont_Lucida_Console_8_Bold (0)
#define D3DFont_Tahoma_8_Bold (0)
//etc..
CD3DFont *pD3DFontFixed[] =
{
	new CD3DFont( "Lucida Console", 8, FW_BOLD ),
	new CD3DFont( "Tahoma", 8, FW_BOLD ),
	new CD3DFont( "Arial", 8, FW_BOLD ),
//etc...
};
 
user1182183
how can I make that better? :P
 
@Zoidberg'-- Did you just say that @CatPlusPlus should suffocate, freeze and die in a cold low density atmosphere?
 
user1182183
5:57 PM
so I don't have to initialize 64 fonts ;F
 
How do I find out on my linux distro (ubuntu) whether it's x86 or x64
 
user1182183
@JosephPotts programaticly?
 
processor.
 
@GamErix use std::vector<std::unique_ptr<CD3DFont>> or some such thing
 
um
I mean, o.s wise.
 
5:57 PM
uname -m
 
@GamErix std::array<CD3DFont, 3> D3DFontFixed
 
is that towards me cat?
 
user1182183
@MooingDuck then I still have to initialize all elements :D hm, does it matter WHEN you initialize a font?
 
@JosephPotts yes
 
user1182183
11
Q: How do I know if I am running 32 or 64-bit Linux?

webwesenwhat would be a command to run in different distros?

 
5:58 PM
@GamErix move the initialization to a function
 
@cat has a bad habit of not linking to messages
bad cat
 
user142019
@EtiennedeMartel he can wear a space suit.
 
@GamErix std::vector<CD3DFont, 3> D3DFontFixed = get_font_list();
 
@TonyTheLion Indeed, he's such a lazy bitch.
 
user1182183
@MooingDuck yes I want to do tht but I don't know if the fonts gets initialized outside of the dx9 device tick
 
5:59 PM
Yup
 
@EtiennedeMartel :)
 
user142019
@GamErix std::vector<CD3DFont>
 
@GamErix I know nothing of DX, but it'd be stupid if you had to synchronize font creation with any sort of "tick"
 
user1182183
@Zoidberg'-- ye would be cool to create fonts on the fly but initialization :D
 
user142019
@GamErix uh
 
user1182183
6:00 PM
@MooingDuck with rendering text, let's say, you have to render the text each frame
 
@GamErix why do you have 64 fonts?
 
user1182183
else it dissapears :P
 
@GamErix create once, use many times
 
user142019
std::vector<CD3DFont> fonts{
    CD3DFont{"Lucida Console", 8, FW_BOLD},
    CD3DFont{"Tahoma", 8, FW_BOLD},
    CD3DFont{"Arial", 8, FW_BOLD}
};
 
uh.. does it matter if i'm on x86 or x64 if i'm learning assembly on linux?
 
user1182183
6:01 PM
@MooingDuck ye but changing from bolt to normal etc size requires a new instance
 
Using the book 'Programming from ground up'
 
@GamErix two seperate fonts
 
user142019
@JosephPotts you can use 32-bit programs on 64-bit machine, usually.
 
@JosephPotts just do x86 for now and it won't matter
 
Damn it.
Thanks ;D
 
user142019
6:03 PM
s/Damn it/Dammit/
 
user142019
lol
 
I changed my twitter name/pass last week. I cant remember what I changed them to
 
<--- Aka CatMinusMinus
I'll decrement while @CatPlusPlus incrementts
@MooingDuck Username MooingDuck Passw: MOOOOOOOOOOO
 
mopingduck
 
6:07 PM
mopingcat
TIL Phat does mean Pretty Hot And Tempting
 
Well, well.
Yesterday, I discovered that Far Cry 3's co-op mode might as well be renamed to Racial Stereotypes Shooting At Each Other In The Jungle. With Moderate Lag.
But that's a bit long.
 
and despite trying to reset my twitter password, I'm not getting the emails or texts they claim to have sent me
finally got a text from twitter. I type in teh code. "That's the wrong code. Check your phone and try again."
 
user1182183
 
user1182183
use this or just let it go?
 
user1182183
(just 38 lines, shouldn't blow up your head guys)
 
6:18 PM
@GamErix unique_ptr? Also you completely screwed up the copy semantics and destructor
 
user1182183
@MooingDuck man I though I did good and I totally screwed up :o
 
@GamErix if (this == &that) is a sign you did it wrong
srsly. std::unique_ptr
 
user1182183
huh then what should it be ;x
 
std::vector<std::unique_ptr<CD3DFont>> fonts;
oh, you mean the assignment operator? Do you have a way to copy a CD3DFont? If not then TextCreate's copy assignment and copy constructor should be deleted.
@GamErix also you have new without delete
 
user1182183
@MooingDuck hm ye I think there is no copy, I just did that without thinking :F
 
6:21 PM
so at that point, TextCreate is just like std::unique_ptr, but less flexible.
 
user142019
I need food.
 
user142019
Otherwise I'll die.
 
@Zoidberg'-- makes sense
 
user1182183
hm then the ryle of three is not needed in this case?
 
user142019
lol
 
6:22 PM
Oh dear. I'm venturing into old code. Wish me luck.
 
user1182183
 
user142019
@EtiennedeMartel Bad luck.
 
user1182183
@EtiennedeMartel GoodLuck
 
user1182183
-1/+1 lol
 
user142019
Well he didn't say what kind of luck.
 
6:23 PM
@Zoidberg'-- I hate you too.
 
user142019
@EtiennedeMartel Good.
 
@GamErix The rule of three is being replaced with the rule of zero. In any case, you still have to have something for the copy assignment/copy constructor. In this case, it's the deletion of them. Rule of three is applied by explicity deleting the functions (not just deleting the code)
 
user142019
:^)
 
user1182183
@Zoidberg'-- true, but assuming he wants no problems with old code.. xD
 
@EtiennedeMartel Report in every 20 min or I'm calling an ambulance :P
 
6:24 PM
@GamErix when I said delete the functions I meant TextCreate(const TextCreate& rhs) = delete;
because now you're violating the rule of three :(
 
user1182183
ah
 
user1182183
yeah It'stricky for me :F
 
or if C++03, then make them private with no definition.
 
user142019
@GamErix pro tip: tinyurl.com/fuck-pointers.
 
If it's C++11 then you're violating rule of zero :v
 
6:26 PM
@GamErix can we start over? Why do you have a TextCreate class?
 
user1182183
@CatPlusPlus only the compiler is c++11 but the code itself.. not?
 
Alright, time to debug the shit out of this Win32 code...
 
user1182183
@MooingDuck I need to have dynamic control over fonts which are created and can be displayed
 
@Borgleader Have fun
 
@GamErix so how does the TextCreate class help that?
 
6:27 PM
@CatPlusPlus Well it shouldn't be too hard, I'm following Alf tutorial and I'm getting a random crash.
 
user1182183
@MooingDuck so I can have everything in an array and don't need to worry about initialization and destruction? :$
 
I probably fucked up somewhere
 
user142019
Dammit UML y u both aggregation and composition and difference between those y u so vague.
 
user1182183
so I can do CreateText("MyyText",fontID)
 
@GamErix std::vector<CD3DFont> should work fine?
 
6:28 PM
Woa, SimCity 4 for 5$?
 
user1182183
@MooingDuck hm ok then I'll just make a function for adding a font
 
Psychonauts!
 
@Zoidberg'-- Aggregation -> Container, Composition -> One of you member variables is of another class. It's not vague..
 
@EtiennedeMartel where?
 
Buy Psychonauts if you don't have it otherwise
 
6:28 PM
@CatPlusPlus Already got it as part of a HIB.
 
@GamErix oh wait, it's got the stupid Initialize Invalidate thing. That makes sense. I see.
 
wait what do you mean by 4?
 
By 4 he means it's SimCity 4 what else
 
I wasn't reading properly. I read Sims :C
 
user142019
6:30 PM
@Borgleader can't you use multiplicity with composition?
 
Screw Sims
 
user1182183
@MooingDuck so continue using TextCreate struct or just make functions? :P
 
So, should I buy it?
 
@Zoidberg'-- I don't think so no. The example I always remember is like... for aggregation you have a Phonebook class and a PhoneNumber class well the PhoneBook aggregates PhoneNumber because it will contain a high number of them. Where as a PhoneNumber will aggregate 2 Strings one of the actual Number and the other for say the name of who it belongs to.
 
6:32 PM
Maybe someone can supply a better example.
 
Your wrapper is so complete, you might as well do std::unique_ptr<CD3DFont, font_deleter> and a factory function for that.
 
user1182183
@MooingDuck okay, thanks :D
 
user142019
@Borgleader I thought it was more related to lifetime and ownership (think std::shared_ptr vs std::unique_ptr sort of thing).
 
6:34 PM
@CatPlusPlus I feel dumb now
 
user1182183
@MooingDuck that first one looks nicer :)
 
@GamErix requires unneeded overhead sometimes though
 
user142019
@Borgleader thanks.
 
struct font_deleter { void operator()(CD3DFont* font) { font->Invalidate(); } };
using font = std::unique_ptr<CD3DFont, font_deleter>;
font make_font(std::string name, int height, int flags) { ... }
 
user1182183
@CatPlusPlus and this has less overhead? :P
 
6:35 PM
OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD OVERHEAD
No
 
My colleague just cut holes in a box, put the box on his head and is now calling himself "Boxman".
 
user1182183
@CatPlusPlus ok and make_font should be placed ...?
 
@CatPlusPlus Make the op() const.
 
I thought about it, but writing from memory and all that
 
I'm not sure if it fucks up or not, but tis better.
 
6:38 PM
@EtiennedeMartel I was expecting "and he started singing: My dick in a box"
 
"I'm dick in a box"
 
@Borgleader I'm not even sure he even knows that song.
 
@EtiennedeMartel What do you guys smoke at work?
 
@GamErix it has the same overhead as what you were doing, but is harder to get it wrong
 
6:40 PM
What's that CD3DFont anyway
 
Well this is interesting... it's the function that returns the string that fails... no clue why though
 
@CatPlusPlus I assume a Class for Windows Direct 3D Fonts.
 
@Borgleader I've seen weirder things happening with strings
 
@R.MartinhoFernandes That guy? I'm pretty sure he's autistic or something.
 
Yeah but it's not on MSDN
 
6:41 PM
static std::wstring const value = L"O wondrous world!"; <-- This fails
-.-;
 
Don't use wstring
 
Hey, @Etienne, I own Borderlands 2 now. You can stop pestering me.
 
@R.MartinhoFernandes YAY
 
@CatPlusPlus It's Alf's code
 
@Borgleader global in a delay loaded dll in MSVC?
 
6:42 PM
@Borgleader I don't care. Don't use wstring
It's ~bad~
 
@MooingDuck Idk what that means but I will look it up
 
But then again your code uses WinAPI
 
hey guys :-)
 
@Borgleader is that variable a global? is it in a dll? was it compiled by msvc?
 
@CatPlusPlus Isn't wstring the same thing as string but for wchar_t?
 
user1182183
6:43 PM
@MooingDuck uu, pastebin.com/UBerh6uq
 
@MooingDuck it's a static inside a function, not in a dll, yes MSVC
 
wchar_t is bad
 
out of the blue: what sounds better on an application "intern" or "freelancer" ?
 
6:44 PM
@GamErix sec
 
@R.MartinhoFernandes sureee :P
no seriously, what do you think?
 
user142019
@libjup not intern; extern "C"
 
user142019
@libjup If I were an employer, I wouldn't give a damn.
 
I'll have my new computer on Thursday :toot:
 
@Zoidberg'-- idk... intern sounds like you have more working experience in a team; but freelance sounds kinda cool too
 
user142019
6:47 PM
Just list both or pick one at random.
 
user142019
Also don't lie. Were you a freelancer or an intern?
 
To be honest, in my CVs I just write the truth.
Pun intended.
 
Most freelanced work is so bad, I'd never mention it anywhere to anyone
What pun
 
user142019
"Freelancing" always makes me think of crappy PHP projects.
 
6:48 PM
There is no pun
 
user142019
@CatPlusPlus to be honest
 
user1182183
yep works (at least compiles)
 
So, I came across this message on the HL2 Steam community site:
> Do i have to go through the game files and delete saves or can i do it in game?
 
That's not a pun
 
@CatPlusPlus To be honest, I write the truth.
 
6:48 PM
Guess what the only comment was?
 
@Zoidberg'-- i'm not lying at all.. it started as an intern but i'm still working freelanced...
 
user142019
@libjup then list both or the ones you want them to know.
 
I still don't have a CV
:v
 
user142019
I have a Careers profile lol.
 
(Y) :)
 
6:50 PM
> THQ FILES FOR BANKRUPTCY
 
@libjup Is that a butt above your head?
3
WTF did I just say.
 
yesterday, by Etienne de Martel
Well, that's official: THQ filed for bankruptcy.
 
Hey, ducky, have you figure out the linked list ownership thing I mentioned the other day? If not I think I finally have some time and the right mood to write it now.
 
6:52 PM
> no i half-life 2 buy what??? help
 
Bullshit Sainsbury’s bullshitting me about their age verification policy, and my bike got stolen today :/
all in all, not one of my best days
 
user142019
In Amsterdam people just steal a random bike if their bikes get stolen.
 
@KonradRudolph Time to get drunk! Oh wait, can you buy alcohol?
 
user142019
Not that I agree it's a good thing.
 
What's Sainsbury's anyway
 
6:54 PM
@EtiennedeMartel elsewhere, sure. I left my groceries at their shitty store and went shopping at M&S
 
2 hours ago, by Mooing Duck
@R.MartinhoFernandes: did you ever confirm that this was actually what you had been intending?
 
Oh. Why didn't I get notified.
 
Also come buy alcohol here, nobody gets ID'd ever
 
user142019
@CatPlusPlus supermarket
 
user142019
VODKA
 
6:55 PM
wchar_t is as good as we have atm
 
@R.MartinhoFernandes so, Y/N?
 
survived redneck hell
 
@MooingDuck Yes.
 
@johnathon no
 
user142019
6:56 PM
wchar_t is terrible.
 
@R.MartinhoFernandes k
 
@johnathon Everything is as good as we have.
 
@R.MartinhoFernandes indeed.
 
wchar_t solves nothing
 
user142019
It solves the problem of who uses inferior tools.
 
6:57 PM
SMH.
 
@CatPlusPlus Except "If only we had a character-related piece of crap..."
 
*goes to turn wrenches.... *
 
user142019
@EtiennedeMartel such as char?
 
Problem is DrawText take LPCWSTR (aka wchar_t* afaik)
 
user142019
@Borgleader convert when you need to.
 
6:58 PM
So you wchar_t should exist only as long as it's needed for interop
 
@Zoidberg'-- char is simply a very bad name for a byte. Nothing inherently wrong with it.
 
@Borgleader Low Polygon Count Worthless Shitty Train Rails?
 
In fact it should be called byte
 
user142019
And its signedness is implementation-defined. And it is really a byte but it acts like a character when using it with streams and whatnot.
 
@EtiennedeMartel The dual semantics of it are wrong.
 
6:58 PM
Because it's hardly a character
 
@R.MartinhoFernandes Yeah, good point.
 
@R.MartinhoFernandes Long-Pointer to C Wide String? But I like your version better :P
 
Stop being right. It's annoying.
4
 

« first day (797 days earlier)      last day (4154 days later) »