« first day (625 days earlier)      last day (4549 days later) » 

07:03
It's nice to see an answer getting some daily traction even a few days after.
I hate when they edit the shit out of the original question and I have to conform my answer to nitpicky gentlemen who encounter it 5 days later.
@DomagojPandža you never have to
13
A: Strange C++ Memory Allocation

Domagoj PandžaData alignment and compiler padding say hi! The CPU has no notion of type, what it gets in its 32-bit (or 64-bit, or 128-bit (SSE), or 256-bit (AVX) - let's keep it simple at 32) registers needs to be properly aligned in order to be processed correctly and efficiently. Imagine a simple scenario...

Damn, pictures do sell.
@DomagojPandža Yes they do. :)
Also, looks pretty. I might invest a bit more time in my answers.
@DomagojPandža That's what I started doing after I got tired of repwhoring. I started favoring quality over quantity.
07:12
@Mysticial I see your answer is reaching the year 2012.
Hah, that's intense. What's the upvote record on SO?
For all-time it's:
4432
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

For non-community wiki, its:
2263
A: Can a local variable's memory be accessed outside its scope?

Eric Lippert How can it be? Isn't the memory of a local variable inaccessible outside its function? You rent a hotel room. You put a book in the top drawer of the bedside table and go to sleep. You check out the next morning, but "forget" to give back your key. You steal the key! A week later, you retu...

You're getting mighty close. :D
07:15
Also, the wiki post - I don't want to be a partypooper, but that isn't really a particularly interesting or complex answer. :$
@DomagojPandža That's why it's wiki.
I'll need to get some time to start writing a C++11 exclusive website. A cute design with modern content.
@DomagojPandža Besides there is a lot of actial info there. It's just kinda hard to.... parse :)
Seems to be some potential for uniqueness on the web.
@sehe Yeah, some people don't understand the value of paragraphs. :(
Perhaps enable trusted community edits, for people from the Lounge who'd like to contribute to the sheer awesomeness of public knowledge.
@DomagojPandža That one is bad
07:25
It is so fun when you get a phone call from your brother who is failing highschool math and you have to waste an entire afternoon teaching the schmuck all the while asking yourself how you two are related.
I can already hear him saying: "I don't care how it works, just give me the formula."
eh
I can understand that perfectly well
@DeadMG BF3 or working? :P
eating
then working
That reminds me, I have to eat, too.
I ate pancakes for breakfast. Yes sir.
And they tasted awesome.
07:30
Real pancakes or that american crap?
Real pancakes
This is le France, we do not eat le American crap!
That's nice, I can't stand those fat things with icky stuff pouring over it.
@DeadMG How the hell did you manage to fire 32k rounds total in BF3 in a play time of 100 hours? :P
~20 hours here, only ~1k rounds fired.
that's probably why you have 5-11 KD and I have 26-5
I'm peaceful like that.
lesson number 1: You kill people by firing bullets at them.
07:35
Shoot me in the left ass cheek, I'll turn the right one.
lol
you have chicks on your ass?
Well, I'm officially on drugs this morning.
I tend to be totally retarded when playing FPS
oh
the 33k shots? That's hits. Not fired.
it actually comes out to about 200k rounds fired
07:37
Can I do a memset(..) on this just to make sure that every member is initialized with 0?
@Nils Yes, but it would be much saner to simply initialize them properly.
then your code won't die when someone tries to add a non-POD
@Nils No
Well I have to deal with crappy C code anyways.
I was just riding with the biggest retard ever in BF3
There is no guarantee that floating point is all zero
But other than that it should work fine
07:39
took over three flags, had to run over people because the gunner sucks more than DeadMG.
ahahah :Đ
@Cicada There certainly is if you goddamn memset it to such.
oooh
you can only say that if I actually suck instead of being way better than you
your piloting, by the way, was highly questionable.
Yeah but in that case you have to memset it separately.
@DeadMG I'm amazing like that.
@Cicada right, but I don't have floating points in my class so it should work..
it takes a special kind of non-skill to fly into the ground, not a mountain, when there's nobody shooting at you.
@Cicada No you don't.
there's nothing special about a float compared to any other POD.
07:41
I was trying to eat, not fair :P
lol
I don't think there's a guarantee somewhere that all bits zero float is 0.0f
It happens to work.
he didn't say the value should be 0.
> make sure that every member is initialized with 0?
But he has no floating point field he said later. So everything's fine.
:)
sbi
sbi
07:47
I slept in the garden, thought of going home Monday morning, take a shower and go to work, but now I don't feel like leaving here and go to work. :(
@sbi what did you to your finger?
sbi
sbi
@thecoshman Cut it on a piece of plastic.
@sbi oh lovely
morning all :D
@sbi wait... what?
you been at the wine again?
Taking down a heli with a tank. Hell yeah.
@sbi looks like the weather is much better over there :)
sbi
sbi
07:57
@thecoshman No. I spent the weekend in my garden. Since I currently have no kids to take care of, there was no need to leave last night, and I decided to go home and prepare for work on Monday morning. Now it is Monday morning, and I don't feel like going to work. Really, is that so hard to understand? You didn't go to work today thinking, "Thank god, it's Monday!", did you?
Ha, that was easy! I just called in at work and talked to my R&D boss. Now I have the day off! Yay, sunshine, here I come!
3
@sbi oh yeah, your garden is not by your house is it, bit of a drive away IIRC. And no, I came in this morning thinking, "I hope I get given the time off to go see my sister after her stroke rather then just having to go and face some the consequences when I get back"
@sbi you smooth git :P
sbi
sbi
@thecoshman Oh, I hope your sister is Ok and recovers well!
And my garden is a 15min bicycle ride from home.
Is there a way to initialize base members, when deriving from a class with just auto generated constructors?
sbi
sbi
@Nils Give them default ctors.
@sbi I'll tell her that the Gorilla wishes her well :P from my understanding, it's not too bad. no mental or speech problems, though she is more or less paralysed down her right side, though it may not be permanent
08:02
not my code
typedef struct my_struct {
int *ptr;
void *someOtherPtr;
} my_struct_t;
That's what I have to deal with
@sbi 15 seconds is a long time to cycle after a few drinks :P
@Nils Consider yourself happy. Please
Now I thought I could just derive a wrapper class from it and initialize all members in the default constructor.
@Cicada lol
If that is terrible code for you, you're incredibly lucky.
To a point it's not even funny.
@Nils struct derived : public my_struct { derived(): ptr(/*value*/), someOtherPointer(/*value*/) {} }
sbi
sbi
08:05
@thecoshman FWIW, I once asked a boss of mine to get the next two days off to go to visit my father, who was just diagnosed with cancer. He told me to pack immediately, and we talk about how to compensate for that (accumulated overtime, vacation, unpaid vacation, whatever) after I came back. I did like that approach.
Yes, you are an employee, but you are also a human being, with relatives, beloved ones, and feelings. An employer should never forget that.
Well well. Just launched a 1M iteration simulation in debug mode so I pretty much have my morning and half of the afternoon off!
@sbi human being
sbi
sbi
@thecoshman 15 minutes. And while I had a few beers last night (I had a coworker with his wife and child visiting), I didn't drink anything but orange juice this morning.
@Cicada That stings, well... For you, maybe not. :Đ
sbi
sbi
@Nils That seems to make sense. (That is C code, actually.) What's your problem with this approach again?
That is pure, ugly C - from the days you actually had to spew struct in front of everything, ending up doing typedefs
Some people still retain this, Microsoft - for example.
08:09
Stop whining about how C is better than C++, please. Just admit it.
@sbi yeah, attempted funny
@sbi yeah, it's been 'oked' with out problems, I've come in today to do my best to make sure things will be ok whilst I am gone.
I didn't think it would be any sort of problem
Mawning, sehe!
@thecoshman Am I allowed to initialize base class members within the initialization list?
I get a C2614 in VS 2008.
sbi
sbi
08:13
@Nils Oh, that is your problem?! OMG. You might want to get yourself a decent introductory text on C++. (That is the only place where you can do that.)
@Nils Post something that you think should compile, and ask away?
Well I wanted to write a wrapper around the C struct which initializes everything with 0.
ok
@Nils No.
can some one help me??
sbi
sbi
@user1317084 Why do you think it's Ok to come into the C++ room and dump your unrelated questions here?
3 messages moved to bin
@Nils No, would be ugly if it were allowed. Contain everything nicely within respective constructors.
@user1317084 Yes, but not here. This is a chat, not a help center. (Unless we're in mood.)
Also, the SDK clearly says "This function has been deprecated as of Windows Vista and its functionality has been replaced by RasDialDlg"
Use RasDialDlg instead.
Yes I was unsure about it since I usually have appropriate constructors for my classes.
@sbi plonked ages ago
sbi
sbi
@thecoshman Yeah, prolly a good idea. Well, on next offense...
@sbi oh look at you, being all patient :P
08:18
@Cicada I cant find how to set the preferred port.. that is my problem
Saying something has been deprecated as of Windows Vista somehow rings the same as "Herp derp said that..."
sbi
sbi
@Nils Well, with structs that don't have a a ctor you can't. And that's that.
@DomagojPandža Not really. From a technical perspective there's nothing wrong at all with Windows Vista. They simply didn't quite show it to the users.
When and how did this "plonk"-meme get started? I feel like I'm an outsider.
@StackedCrooked I have no idea either.
sbi
sbi
08:20
@StackedCrooked In Usenet, about 20 years ago.
@DeadMG Well, it's the same as writing an implementation of Wide and blocking the users from using it properly.
sbi
sbi
Being able to plonk with a picture is threatening to become my most favorite feature of this chat over Usenet. It's just so much more convincing. Only slapping an actual, stinking fish on their table could be better. (A man gorilla can have a dream, yes?)
2
very true, but it doesn't make the implementation itself herp derp at all
But it leaves such a taste in one's mouth when you fail at the most important aspect which is the thing that sells it. There were some nice new foundations, the new driver model, the restructuring of DirectX, allowing for future iterations, although a bit failing with DirectX 10 (like OGL ARB failed with 3.0)
Vista will always be herp derp for me, even though there were some nice moves. Simply feels that way.
Some games have an excellent technical layout and design, but the experience is a plain sucky herp derp.
@DomagojPandža Sure, but I'd still listen to the engineers who made that game.
08:24
Nothing to say of the Microsoft engineers, I actually quite respect those guys.
After all, they did manage to bring forth Windows 7.
damn
libclang, y u no provide type introspection library?
Hmm, that reminds me. I could really check out the only respectable part of the WWDC 2012 videos - the one on LLVM.
Also, VS2012 C++11 support can go fuck a cactus.
indeed
sbi
sbi
Gosh, it just occurred to me that the ability of the rest of the room to slap stinking fishes onto their table when they misbehave would be a strong incentive for newbies to very carefully read the newbie hints before posting here. A very strong incentive. Maybe I should go to meta and ask for such a feature??
meta ever responds/implements our asked-for features?
they're practically worse than Microsoft Connect
08:32
@sbi maybe we need a fish bot? logs who it has seen, any body new get's a fish slapped on them, linking to the newbie hints along with a firm warning that we don't tolerate shit
sbi
sbi
@DeadMG Nothing is worse than Microsoft Connect.
lol
sbi
sbi
@thecoshman My parser threw me off halfway through that. Care to elaborate?
OTOH, the ability of all the users to slap stinking fishes on each other's table would seriously threaten the peace of the room. Given the flag wars that come up once in a while, this would come very close to the very threatening atomic truce we had in the 80s.
@sbi we set up a chat bot. Chat bot automatically messages new people that they should go to newbie hints page and that we don't tale shit, along with a fish
sbi
sbi
Oh, shit tales! Are you telling them to your kids? SCNR :)
08:36
@sbi yeah that's what I ended up with
sbi
sbi
@thecoshman There's no DM feature anywhere on SO, remember? So any fish you slap is seen, smelt, and needs to be cleaned up by everybody logged in. Mhmm. That does seem to be a serious downside of my idea. Too bad.
@Nils You ended up telling shit tales to your kids?
Anyway, there is no point in taking the day off because of the nice weather and then spend the day in front of the computer — even if you do this on the lawn, with insects humming around you. So I will log off now, and enjoy the sunshine. Have a great day at work/studying/procrastinating, everybody!
?
no with the code you posted
@sbi bb
@DeadMG y u no delete answers with more than -3, -4 votes?
@DomagojPandža hm?
08:41
Your answers with -n where n is larger than 4.
@sbi ah, but we can just ignore the bot our selves :P
I don't have any experience with downvoted answers (yet, of course), so I'm not sure on the protocol, are they deleted or preserved/retained?
@DomagojPandža They're not particularly different
besides, some of them I completely stand behind
like one of my -4s is for instructing some poor sod to use a smart pointer
Ah, yes, it is hard to sell C++ to people who think C is C++.
@DeadMG links plz
08:51
-4
A: What is the problem with this piece of C++ queue implementation?

DeadMGGuys. No raw pointers in C++ unless you really need them. Please. Especially for some poor soul who doesn't even know that operator new returns a pointer. Get a std::auto_ptr or a std::shared_ptr.

-4
A: Are there programming languages with no global variables?

DeadMGRealistically, such a thing could never exist. Consider - when you print to the console, where is that console handle coming from? When you refer to a function, where did that function come from? It sure doesn't exist physically on the stack of the function you called it from. That's right - it's...

What a discussion. Dear lord, for such a simple case.
@DeadMG +1, I would comment, but it's a futile task. I see no reason to not use the safer and easier to understand smart pointers
+1 from me, too. We have beautiful concepts like RAII, ways of encapsulating stuff in an elegant matter, it would be a shame not to utilize them. And arguments of learning fall flat on the boundary of it not being a simple raw pointer lesson assimilation but more of a realworld problem.
@DeadMG no vote cast, I see what you are getting at, but I think you have avoided the question. From a more practical sense, he is asking "are there any languages with out the notion of a global name space, ignoring the fact that you have to have some things accessible from a 'global' scope, such as main and OS hooks"
And one more argument on the first question. Alright, it is learning. Learn how to encapsulate naked pointers and make them safe. Make them smart.
That's a C++ lesson.
09:10
damn
Clang's API is much less usable than I expected
ok
WTF is an inline namespace?
@DeadMG It's like a namespace except with using
struct CBUFFER
{
public:D3DXMATRIX Final;
public:D3DXMATRIX Rotation;
public:D3DXVECTOR4 LightVector;
public:D3DXCOLOR LightColor;
public:D3DXCOLOR AmbientColor;
public:float MP;
};
So much public :Đ
lolwot
Somebody should tell the poor sod structs are public by default
Java style.
09:21
A question on SO, he probably failed at padding it properly so he doesn't break boundaries.
0
Q: C++ Directx 11 Constant buffers and hlsl

user1492812RE:I posted again because nobody answered. And because my whole work is stopped by this. Im Miguel Petersen and im currently having a problem with constant buffers in directx 11: My Shader file: cbuffer ConstantBuffer { float4x4 final; float4x4 rotation; // the rotation matrix floa...

I crossed my 1000 rep threshold, don't have the will anymore to answer questions.
"RE:I posted again because nobody answered. And because my whole work is stopped by this."
Also, this made me lol.
mawning
having two std::vector with each some elements, what's the easiest way to find the duplicates in them?
@sehe The site was originally written by a 15-year old. That might have something to do with it :p
@TonyTheLion No idea.
you can do it in O(n log n) if they are comparable and you need the better complexity
O(n) if already sorted
they are not very large
I just need to find the duplicates and remove from one or the other vector
0
Q: DirectXMath.h and v100 in Visual Studio 11 (2012)

HoochI created application that uses DirectXMath.h library. I compiled it in VS11 using v110 Platform toolset with no problem. I wanted to compile my application so that it can run on Windows XP. I changed Platform toolset in project properties to v100. Now Visual Studio can't find include file Direc...

y u no use Visual Studio 2010?
v100 will just rape you within VS2012 because the whole thing is constipated.
09:29
Hmmm. Do I have the guarantee that (int) (doubleVal * intVal) < intVal when doubleVal < 1.0?
@Cicada I think so, yes
no
consider the case where doubleVal is like, 0.95
oh, assuming that intVal is also greater than 0
Assume that intVal is reasonably small (say, <= 256)
And doubleVal is from a random number generator
I still am not certain
09:33
Which outputs doubles [0, 1[
depends on the Standard defined rounding mode
If you multiply any number by [0..1) (I think I go the right brackets) then you will approach zero
It is hard to determine with absolute certainty because of the way rounding works. If it is fairly close, it might just decide they're quite equal - or worse
Going from double precision to int, it's a bitchy ordeal.
oh yeah, rounding issue could cock it up for you
if you could lower the upper limit of the random doubleVal, that could ensure it
Prevent it from hitting "too close to home"
09:35
if the Standard says that 4.95 rounds to 4, you're golden
else, you're definitely not golden
Crap.
But a bronze medal for trying.
Thank you, come again.
@DomagojPandža but don't you dabble in shit php?
@ScottW watch out for those bed bugs
Lost my third parrot to one don't you know
@thecoshman I also take out the trash every once in a while, but that doesn't make me a garbage collector. And I curse all the way through, insulting the trash all the while. :Đ
@DomagojPandža still a better love story than PHP
oooh.... Might sort out a live USB to take with me to my parents...
I was hoping that my rule book would be delivered today... stupid post
have you just found out about gifs or something?
Nah, I just love cats.
Fluffy creatures.
Who doesn't.
cat's are a strange creature... so derpy
10:00
@DomagojPandža I won't love you because you are fluffy. Sorry :/
That's alright, money is better than love.
1
A: Should I use a smart pointer?

DeadMGAlways use a smart pointer wherever you own resources. Owning them manually is extremely error prone and violates many good practices, like DRY. Which one to use depends on what ownership semantics you need. unique_ptr is best for single ownership, and shared_ptr shared ownership. As children d...

what the fuck is James Kanze smoking?
There are time's I wish I was a girl, for instance, it let me use the line "If I wanted to give a fuck at a work, I would be prostitute"
@thecoshman That's just as valid for men, you know.
@DeadMG doesn't really work as well though does it
10:04
why not?
@DeadMG +1, -1, end of story. I ain't even gonna fuckin' comment.
@RMartinhoFernandes I know the difference in meaning, I just often don't see that I have done ti wrong
@DomagojPandža lol
People have no idea how to think about problems. It's not all black and white. Think.
Some things go well with others. It doesn't have to be this or that.
It can, and sometimes is preferable, to be both.
@DeadMG Where do you find the will to argue? They won't listen. They never do.
It's hard to discuss something on a website where pride and ego is everything.
does std::list not work on pointers to the type already? such that, if you create std::list<T*> it is actually going to store pointers to pointers to your actual data?
10:10
@DomagojPandža It's not about them.
it's about the OP.
that poor fuck just wants to do it right, and I'm not going to stand by whilst someone else teaches him bad and wrong.
Yeah, I can understand that. But that James character is confusing the shit out of him.
@DeadMG Perhaps he assumes that the nodes represent a (possibly cyclic) graph instead of a tree.
Wait, he mentions Tree in his comment.
I don't think so. I explicitly said that they were suitable for DAG and strict hierarchy in a comment and he did not suggest that the OP's structure did not fit those.
Whatever he meant, it has nothing to do with the OP.
Or his question.
The only mental overhead around smart pointers is thinking about how awesome they are.
I think you first need to agree on whether or not the Node class owns its child nodes or not. Only then the discussion on smart pointers can become meaningful.
10:19
Using unique_ptr almost guarantees dangling pointers, and using shared_ptr guarantees memory leaks unless you also use weak_ptr (and dangling pointers if you don't). Doing the right thing explicitly is far simpler than trying to second guess tools which were designed for other purposes. — James Kanze 2 mins ago
lulzcopter
@DomagojPandža bold claims :P
@JamesKanze no. just no — thecoshman 28 secs ago
@JamesKanze `Using unique_ptr almost guarantees dangling pointers` - I'm having trouble seeing what you mean. Could you point to an example? — sehe 6 secs ago
That's why I tend not to participate in online discussions. Way too much opinion, way too little fact.
@DomagojPandža Booting you right now :)
Or at least, accepting of facts.
@sehe The Lounge is the only place me enjoys <3
10:22
@thecoshman Ok. Awaiting your substantial response. What are you trying to do there?
@sehe std::unique_ptr<Example> exmp(new Example); :P — Domagoj Pandža 1 min ago
I just had to do it. :$
I'm really curious what he meant, even though I made the joke.
@DomagojPandža bad dog
10:42
Wow that game sucked. 4-0
@Neil What game?
@DeadMG Finale European cup
it's a bunch of grown men being paid absurd amounts of money to pointlessly kick around a ball with poor rule enforcement. what did you expect?
I guess I expected them to earn that money
it's pretty difficult to "kick a ball" with a real economic value
10:45
Are you saying the game was bad? I love that the italians got their asses kicked
saying that a game of football was bad is like saying a C application leaks memory.
@dead I trust you are just displaying a dislike for the sport and not being as stupid as fail to understand how the players are considered worth the money they are
@thecoshman Forgive me. I must have failed to notice how "Kick ball from A to B" built factories, for example.
@thecoshman Dogmatic statements aren't really the way to go IMO.
@DeadMG millions enjoy watching the sport, which provides a chance to expose advertising to millions of people. Thus you have something to sell, advertisement. In order to provide the best advertisement, and thus earn the most money, you need to be making a name for your self. That means they need to the very best players for the team, there are only so many players, thus the supply-demand results in them being worth the vast sums of money they are.
10:51
@thecoshman So worth it, all the premier clubs in English football are under massive debt, most of which is wages, and one of the only two good Scottish clubs has just collapsed because it paid too many wages?
besides, advertisement is of questionable economic value anyway
@DeadMG Much the same thing could be said for the games industry. Big money, but a lot of the companies involved are in debt or going broke all the time
@DeadMG sure, questioned by those who haven't studied it and just prefer to pick their conclusion in advance
@jalf I also believe that that industry is as dead as the dodo.
@jalf Well, I of course have not spent a massive period of time studying advertising. But logically, if Nike stopped advertising, those consumers would still spend their money, just somewhere else. Bad for Nike, but fine for everyone else.
So what are you saying? Other than "I hate football, and therefore it is a waste of everyone's time"?
@DeadMG I never said football clubs had good accountants. It is something they have to do, to balance the books quickly, they could just sell all their star players, but such short sited actions will result in the team falling down the leagues quickly
advertising is like software patents- the only thing it achieves is wasting our money trying to put one effectively equivalent company up over another
@thecoshman It's not just about that. It's about the fact that like, 80% of their expenditures are player wages, and they racked up virtually all their debt buying new players.
10:54
Intrensic value is not the same thing as value you yourself would give something
sure, but if you're invested in one of those companies, that's kind of an important difference ,)
You may not buy a yacht, but many would consider it a worthy investment
for example
@jalf Yes. But what I'm saying is that it doesn't actually create money. It just shuffles it around a bit. And it most definitely costs money.
Well, you can take cigs as a fine case study. They where spending vast sums on trying to out advertise each other. At some stage, such advertisements where banned. The companies come out better, as they could keep all that money, and not have to worry about competition out advertising them
and, IMO, can quite badly bend the competitive markets, in that a company with an inferior product but superior advertising can outsell a company with a superior product- even though it would be in the interests of the consumer in general for the superior product to succeed
10:56
@DeadMG No economical activity actually creates money, unless you include the printing of money as an economical activity
@Neil Well, I don't mean literal, physical cash, but some activities do directly create money, for example, if you mine, then that ore/whatever did not have any value before you extracted it from the Earth.
You mean it doesn't create a product? No, because it creates a service, which unlike products don't require that you own something after its purchase
if you make CPUs, you make money, in the sense that your outgoing product has more function than your ingoing products.
@DeadMG that's what most of the world revolves around bud. There are precious few industries that can generate money
@DeadMG In a certain sense, they're generating entertainment that didn't exist before
10:57
@jalf Would it be possible if I send you my CV?
Value is created because people want to see it
Just like value is created from ore because people would want to buy it from you
@Neil No, there's a difference.
value is created from ore because previously, there was no ore, and now, there is ore.
@DeadMG You think that all the revenue created from the european cup would have been created anyhow had there not been one?
@Neil Those people who spent that money buying Nike trainers because they saw Nike on a shirt of some footballer in the European Cup, would simply have spent that money somewhere else if it had not been there.

« first day (625 days earlier)      last day (4549 days later) »