« first day (587 days earlier)      last day (4347 days later) » 

12:09 AM
I'm going to sleep. It's a thousand degrees centigrade and I'm dying.
 
12:23 AM
char* func(char* x) {return *x;}
char* func(char*& x) {return *x++;}
//error C2665: 'func' : none of the 2 overloads could convert all the argument types
hmm
 
Did you mean to return char?
 
12:38 AM
@GManNickG er, yes
wait, that error doesn't even match, I must have done something wrong
(nobody is surprised)
either way, tomorrows problem. I'm going home.
 
12:56 AM
すてきなおんがくですね
^ My best Japanese. Lol.
 
1:11 AM
Did you ever do a video chat? This shit has been possible for years but for some reason I never bothered trying it out.
 
What happens when I click that?
 
Not much.
You'll see an info page for the Facebook C++ conference on June 2. It's already sold out though.
 
Oh, ok. You had just mentioned video chat, so I thought maybe there was a video chat for C++ or something.
 
Chat roulette with C++ developers all over the world!
 
1:26 AM
This code relies on UB. How can I fix it without losing performance?
By combining a 6-byte and a 2-byte value in one 8-byte value I can do comparison of one single value instead of two. However, the technique of writing to one field of a union and then reading from another field is UB according to the standard.
 
profile it, I bet they'll be pretty much the same
 
@StackedCrooked I (and Johannes, for that matter) don't think so.
 
@RMartinhoFernandes Not UB?
 
What's UB is to break the strict aliasing rules.
(Which you do :P)
 
@RMartinhoFernandes I thought Johannes was the one that said to me long ago it's UB.
Oh tricky pedant, nevermind.
 
1:31 AM
It's okay if one of the fields involved is a char, for example.
 
Yeah.
 
@RMartinhoFernandes I don't really follow your reasoning here.
 
I would just compare the two members. But if you really need, do std::memcmp on the two structs. This is okay, since they are standard layout, and gives the compiler the opportunity to replace it with an alias to a double word if that's okay (in practice it is). Check the assembly to verify. If that still doesn't do it, manually implement it yourself by treating each as an array of char's, like std::memcmp does, but now use whatever tricks you need.
@StackedCrooked We agree this is UB, yes? int i = 0; reinterpret_cast<float&>(i); (Assume sizeof(int) == sizeof(float).)
 
@GManNickG Yeah, that looks wrong to me.
 
But reinterpret_cast<char&>(i) is fine.
 
1:36 AM
@StackedCrooked Yeah, it breaks strict aliasing rules. But you can always treat a standard-layout (POD in C++03) type as a sequence of bytes (char's), so strict aliasing is not broken in RMartinhoFernandes's example.
 
union { char c[4]; uint32_t u; } a; a.u = 42; std::cout << a.c[1]; is ok. It's UB for union { uint16_t c[2]; uint32_t u; }.
 
I see.
So if I were to replace the uint64_t value with a std::array<uint8_t, 8> I'd be fine?
In my code sample I mean.
 
If uint8_t is unsigned char.
 
I don't even think that would be okay, since you're aliasing with a std::array, not char.
As shallow as it is, std::array is still a wrapper.
 
Oh, right.
 
1:39 AM
I'm assuming uint8_t is typedeffed to unsigned char.
 
Needs to be a raw array.
 
@GManNickG you can still treat standard layout (POD) in c++11 as a sequence of bytes
 
@johnathon Hm?
 
@GManNickG just saying , nothings changed when it comes to POD layout
 
@StackedCrooked: But at that point you're just reimplementing std::memcmp. Just keep the struct without the union and use std::memcmp, let the compiler do that aliasing-to-bytes.
@johnathon Right, I don't think I said anything of the sort.
 
1:42 AM
@GManNickG yea, but you said in c++03 i was just clarifying
 
@johnathon Hm, sorry I don't follow where you're coming from. :) In C++03 we had POD and non-POD only, the former can be treated as a sequence of bytes. In C++11 we have POD, standard-layout, and non-POD. The two former can be treated as a sequence of bytes.
 
@GManNickG in c++ 03 you can have non pod structs as well
 
@johnathon I never said otherwise.
 
@GManNickG Ok, I'll do some tests.
 
@GManNickG "In C++11 we have POD, standard-layout, and non-POD. The two former can be treated as a sequence of bytes."
 
1:44 AM
I said we have POD and non-POD types, which may or may not be class types, it's not relevant.
 
What @GMan was saying was that the requirement is SL in C++11 and POD in C++03.
 
@RMartinhoFernandes i know man , just seeing what his reaction would be
 
Huh? I'm going to disregard the last couple minutes.
 
lol
I know a lot of you guys are gamers, or are into game programming, but how many of you guys have ever wrote a tetris clone?
 
1:49 AM
The fifth panel also applies to postmodernists.
2
 
If you link to the XKCD page instead of directly to the image, it gets oneboxed with tooltip.
 
They should open-source oneboxing so people can add support for their favorite websites.
 
Thing is, Key3 uses memcmp (I think), and while it's faster than Key2, it's so much slower than Key1.
Wait, they aren't all initialized. I should probably fix that.
Zero-initialized keys. It's a really silly benchmark..
Why UB is so much faster :D (Considering it the code does the right thing.)
There is no money is rightfulness.
@johnathon I did :D
 
2:15 AM
@StackedCrooked you did what?
 
Check the link.
 
@StackedCrooked nice , i did my own today using WTL and Direct 2d
@StackedCrooked needless to say, i was bored :))
 
Mine was mostly for toying with computer ai.
 
2:45 AM
Our teacher once opened a bottle of quicksilver and allowed us to push our finger in it to see how it feels.
That probably wasn't a very healthy thing to do.
 
@StackedCrooked quicksilver, you mean mercury?
 
I guess. Dutch name is "kwik".
 
@StackedCrooked yes, mercury
 
Ok, mercury it is.
 
user406009
3:18 AM
This is going to sound stupid, but does anyone know how to do "arrays" in SQL?
 
user406009
Probably called something else in database terminology.
 
user406009
By array I mean an ordered collection of rows of the same type, acting as a column type(somehow).
 
maybe just a result set?
 
3:39 AM
Well, that was intense. Morning everyone!
 
> Technology Lab / Information Technology
> No-cost desktop software development is dead on Windows 8
> You won't be able to use the free Visual Studio Express to develop desktop apps.
 
Seriously?
 
Doesn't really surprise me, although I did think they turned a new page with Windows 7. Oh, well...
If you need to resort to such low tricks to force adoption, your idea/implementation is probably pure crap.
 
yes, it's like <del>communist</del> dictatorship states (IMHO)
(I had to delete "communist" because e.g. Greece and Chile and Argentine, I can't remember, but they were right-wing dictatorship. Although not dictatorships where the idea was to further an ideology. I think MS's new approach is like dictating a political ideology or a religion: if not believe, and also not pay, then u go straight to Hel!)
 
3:59 AM
Personally, I hate what they're doing, emulating the phone app market idea started by Apple (who also recently forced a desktop app store). The fact that applications cannot be distributed freely, but have to go through Microsoft's review and only on their store... Pure and utter bullshit. What's next, they are going to lock us out of the file system like it's common on smartphones? Deprecate and remove the actual standard desktop in favor of Metro crap in Windows 9(or whatever)?
I don't like the new ideas in desktop operating systems...
And I'm not talking about the lack of will or desire for change. I love change. But porting goddamn smartphone ideas into desktop environments is... Well, I can't say nothing but retarded.
But I am looking forward to the new Visual Studio 2011, the support for C++11 features, built-in SSE2 for math. operations (although I have a trust issue with this particular compiler addition since I am used to implementing it on my own). Too bad the circumstances of our introduction are so... Lame.
 
 
2 hours later…
6:34 AM
@CheersandhthAlf The mobile UI isn't emerging, it's being forced down our throats.
 
sbi
6:50 AM
10 hours ago, by sbi
> The Windows SDK no longer ships with a complete command-line build environment. The Windows SDK now requires a compiler and build environment to be installed separately. — The Windows SDK for Win8 will not include a compiler toolchain at all. That's a first.
@DomagojPandža See also here, here, and here, all of which I posted here last night.
 
7:01 AM
@DomagojPandža VC has had SSE2 support for ages (but not autovectorization if that's what you mean). And there's really not much new C++11 support
 
sbi
This is the second time this happens to the Operator Overloading FAQ this month. This has probably undone at least half of the upvotes it got this month. I am now considering following @Shog9' s advice and rip it apart. What say you?
 
@sbi I'm not sure what breaking up the answer would have to do with serial upvoting. Serial upvoting is a problem. Do you think the detection is wrong? I'd have a mod check that. I think votes are anonymous bu they can still check OP address, IIRC.
 
sbi
13
Q: Should this be picked up by the vote fraud detecting algorithm?

sbiSome time ago, I added an entry to the SO C++ FAQ community effort, which deals with C++ operator overloading. For that piece I had spent half a Sunday I was supposed to spend building something out of LEGO for my kids, plus I butchered an article draft that I had lying around which had accumulat...

 
Ah I just noticed the title on that Q :)
> rather than coming to the madhouse to ask to get back a meager 55 rep.
LOL
 
sbi
7:18 AM
This one's for @RMartinho, when he wakes up:
Truth! Justice! Freedom! Reasonably priced love! And a hard-boiled egg! #Glorious25thOfMay
 
> Reasonably priced love!
huh. Is that some sort of a reference?
 
sbi
@sehe What else could it be?
 
@sehe Homosexual love between men perhaps?
I mean, girlfriends can be expensive.
 
@StackedCrooked ?
Well, I guess twisted logic counts as logic too
 
It's closer to lateral thinking than logic.
Anyway, don't mind me :p
 
sbi
7:29 AM
@StackedCrooked We never did.
 
I really need to realign my daily cycle and stop working at night, my sleeping patterns are erratic at best.
 
@sbi That's probably for the best.
@DomagojPandža Melatonin supplementation can be helpful here. Just sayin.
 
sbi
@StackedCrooked The first thing to try should be adhering to a more fixed schedule, though. Stop working at a specific time each night, do not sit at your machine afterwards, go to bed at roughly (+-30mins) the same time each day. Get up at the same time, no matter whether you slept good or not, keep roughly fixed times for meals. For most programmers this should help to ease their insomnia within a week or two.
 
@sbi I KNEW this was coming :p
 
sbi
@StackedCrooked Huh?
 
7:37 AM
@StackedCrooked Ah yes, the circadian rhythm... Nature's way of telling me predators are on their way... I've actually considered it, don't know if I need it yet, I'm going to give sbi's way a try.
 
@sbi It's very much like you to provide a discipline-based answer.
 
sbi
@StackedCrooked Um, is it?
 
Yes it is.
I don't mean that in bad way or anything :)
 
morning all
 
Morning!
 
7:40 AM
Yellow
 
sbi
@StackedCrooked I really don't know what to say to this.
Mebbe it's showing that I could be the father of most of you here. :-/
 
@sbi I think most here would agree with me.
 
@sbi How old are you?
 
@sbi Don't feel bad. My dad would definitely not act like you. You've got more of a cool dad feel to ya.
 
sbi
@StackedCrooked Ah, claiming the backup of the ominous "silent majority". Always a good one...
 
7:42 AM
@sbi You don't agree?
 
sbi
@StackedCrooked With the "silent majority"? Of course, I do! They're always all behind me!
 
can one of you state claim and the other either agree or disagree... I've lost track of which side you both fall on
 
sbi
@thecoshman Just assume we're not on yours. That should do it for you.
Anyway, I once was fighting a bad case of insomnia, too. I worked 60, 90, or even 100hrs a week, slept for 4-6hrs whenever I slipped from my chair, and went back to work right away. After a few months of doing so I nearly went insane with insomnia. Incredibly, it needed someone to point out to me that I should adhere to a saner schedule to cure that. Worked like a charm.
 
@thecoshman Agreeing or disagreeing on the internet? Where have you been these past 10 years? There is only trolling.
 
@sbi I've had such a schedule for years but it never really bothered me. Occasionally a hard day at work when I went too far. But nothing drastic.
But, I didn't work as much. I spent lot's of awake time having fun.
I guess that does make a difference.
 
7:46 AM
@sbi The funny thing about insanity is that you never realize when you're there.
Being able to determine if you're insane by definition makes you sane (or recovering at least)
 
@sbi (╯°□°)╯︵ ┻━┻
 
I don't know what's actually wrong with me, I simply feel that I am wasting time when I'm not working. When I finally get in bed, I start contemplating abstract mathematics, then switch to contemplating number systems, how they are defined, the density of the set of real numbers... Then I manage to stray into thinking about quantum mechanics... And then - death. Every damn night (or sleeping time), I get to death and contemplate worse case scenarios which freak me out.
And then I simply give up and go back to work on my engine, which is probably the only thing lately that is giving me some peace.
Long live coffee.
 
sbi
@StackedCrooked Yeah, I suppose some of us are better equipped for this than others. OTOH, when you work 100hrs/week, you barely have time to sleep and eat, let alone do anything that approaches "fun". That is much harder to deal with than a lot of work plus a lot of recreation.
 
sbi
Also, I had a 2yo at home back then, which I rarely ever saw during those months.
 
7:50 AM
@sbi That lifestyle peaked when I was around 28 years old. Today I wouldn't be able to do that anymore.
 
Soviet agents, they're everywhere!
 
@Neil That foam effect makes me want to give up electric shaving.
 
@StackedCrooked It's totally worth it.
 
I shave dry.
 
sbi
@Neil That's not universally true, actually. Some people are fleeing into insanity, and they certainly realize, to some extend, what's going on.
Also, when one of my grannies sank into dementia, she had better and worse days. In the first few years, however, the better days were those where she was further removed from "sanity", because on those days she didn't realize what was happening to her. For her it was worse to realize.
 
7:54 AM
@sbi I would argue that that's the last vestiges of sanity at work. When you're no longer able to tell, you've arrived.
 
I wonder how it feels to slip away. To lose sense of oneself. The worst thing is that you lose the reference point necessary for comparison. Feels the same.
 
sbi
@DomagojPandža I stopped shaving more than a decade ago. Doing so considerably increased my joy of living.
 
@sbi huh, never imagined you as a beardly person
 
sbi
@DomagojPandža I've lived through a few very bad times in my life, and I could tell you how it feels when it starts. But you wouldn't understand. Nor do I, actually.
 
I went through a weird phase through my childhood, and it may or may not have been some sort of schizophrenia thing
I'm of course perfectly fine now, without medication for that matter.
 
sbi
7:56 AM
@thecoshman Yeah, what with my clean-shaved avatar and all.
 
But I distinctly remember a moment in which I was walking around my neighborhood with my mom, and my mom asked me where we were. I had told her I had no idea, even though I had been there thousands of times before.
 
@sbi surely I am not the only one who builds up a mental image of people, even with nothing to base it on.
 
And I had the weird revelation that I had, in fact, been there before and that I was under some weird spell.
It was then that I actually started to improve. True story.
 
sbi
@thecoshman Of course, you are the only one! Nobody else does that!
 
@sbi ¬_¬ fuck it, I'll come back later
 
sbi
7:58 AM
Uh oh, now I have driven @the away. :(
 
I like to think you're all from different planets, going on and off chat as my starship drifts through your planetary system.
 
sbi
@DomagojPandža What are you smoking while crossing our planetary system?
 

« first day (587 days earlier)      last day (4347 days later) »