« first day (1321 days earlier)      last day (3644 days later) » 

4:01 AM
@MooingDuck How would you overload that in a way that takes precedence over the one that's provided by default?
 
@Maxpm both are binary operations so f(x, y) seems the most logical choice
 
@Maxpm more specialized templates. The default is just const T&, const T&. If anyone makes a const int&, const int&, then it'd take priority
 
This is where things get slippery.
I don't like designs with surprises.
 
yeah, I was just beginning to think that
especially since it's all Coordinate<int>, globally overloadable is going to work badly
 
I'm not sure I like the idea that #includeing some header could magically change the result of a pre-existing expression.
 
4:05 AM
yeah. don't make it globally overloadable.
 
There are things you can do. Like:
void foo(T t) { foo_impl(t, Identity<T>());
This way you can prevent accidentally calling int overload with an enum type, for example.
void foo_impl(int  n, Identity<int>);
void foo_impl(Color  c, Identity<Color>);
More verbose, but less fear and doubts.
@Maxpm You can also use ADL for that.
I'm not making sense probably.
Thinking of very different use cases than the one you asked about.
 
4:53 AM
Very easy to understand.
 
Yeah I linked it a while ago.
Not much new.
A bunch of weird things though.
 
And very relevant. His examples are very similar to the codebase at work.
 
And apparently microsoft code is shit
yup
 
Such great examples.
 
lol
I don't remember MS being a dick about no early return.
 
5:03 AM
That is the example of bad code.
 
I like early return :(
 
oh
 
He is telling us to bail out early.
Speaker is James McNellis btw.
 
oh
woah
 
It's really basic stuff but explained very nicely and convincingly.
 
5:15 AM
@StackedCrooked I just finished re-watching How To Design A Good API and Why It Matters. This talk seems like a good next thing to watch.
 
@Maxpm bookmarked
 
I really want the C++now talks :-\
 
Some weird things happening with TrueCrypt
 
UB
Not too keen on littering const everywhere.
But I'm probably wrong.
 
5:37 AM
I love const. I use it almost everywhere I can.
 
Agree.
But they can also subtly change move into copy.
So returning const local object hinders move.
 
const is meh
 
@StackedCrooked You mean stuff like const double foo() { /* ... */ }, or something else?
 
I mean const Item item; return item;
 
What?!?!?
Alex moved here now?
Sorry guys.
 
5:41 AM
Lounge<Drama>
 
He got banned from gamedev chat.
Later.
 
Oh, if DeadMG is here, I managed to get the unicode working. It had nothing to do with what you were talking about.
 
@StackedCrooked That hinders move semantics? Really? Wow.
 
You should play around with kernel32.dll more ;)
 
@Maxpm move changes the source object, and const object must not be changed
so an overload matching const Item&& will be searched.
(I think)
 
5:44 AM
@StackedCrooked But it's only a const object within the function, isn't it? I mean, you could do Item foo = bar();, if bar() looks like const Item item; return item;.
 
// which boils down to this, right?
const Item a;
Item b = a;
of course this is allowed
 
user3010322
When you assign a std::string s = "", the s.empty() function returns a bool that says true...
 
user3010322
.... Which means its special-casing string literals for its type.
 
user3010322
Because it has to chop off the last '\0' in the string literal.
 
user3010322
Before copying the contents into the std::string
 
user3010322
5:47 AM
which is nothing, so it doesn't copy, even though the type is const char[1]
 
user3010322
Fuck special string rules. ._.
 
and c_str() must return it with '\0'
 
@StackedCrooked So then bar() is a modifiable rvalue expression, isn't it?
 
wut, I don't know that
return type of bar with be Item, which will be an rvalue.
however, it will be a copy from the original item (unless the compiler is performing clever optimizations beyond those mandated by the standard)
 
-1
Q: Concept to get a powerful mixed-martial art?

user221794I believe a great combination could be Boxing, Taekwondo and jiu jitsu since each design might educate the fighter to truly have a great hold over all of his physique. Kicks Punchs Jiu- downs are taken by Jitsu=Strong. That's precisely what I believe with respect to the info I understand but what...

^^ wtf?
It's not even trying to sell something.
oh
nvm
 
5:53 AM
@StackedCrooked coliru.stacked-crooked.com/a/5e1a8ad93f6a0d8b is what I get with -O0.
Wait, never mind.
 
Yep const Item&&
 
That's not what you're talking about at all, I don't think.
 
const Item&& is usually not defined so it will pick const Item& (which is the nearest match)
 
Yeah, let me fix that. I'm dumb.
 
Impressively close actually lol
There are like 3k new users to SO per day.
apparently. I read it on meta.
 
5:58 AM
Ctrl-Shift-T uncloses the most recently closed tab
TIL
 
3k sounds about right. There are 7k new questions every day. And it takes about 2 or 3 bad questions to get banned. :D
 
Nope :(
I suck at computer.
 
@StackedCrooked Unfortunately, there's no built-in way to restore all tabs after accidentally closing the entire window. :(
Which is strange, because if Chrome exits ungracefully, it gives you an option to restore them....
 
Firefox lets you.
Gigantic "restore session" button on the bottom.
 
@StackedCrooked lol
session restore is an annoyance for me - I never want all those tabs reopened
 
6:09 AM
yeah that's why you closed them in the first place
 
I turned it off yet it continues to do it
anyone here experienced major wireless network disruptions caused by nearby cell phones transmitting?
I think it's a driver bug because I get dma overruns in kernel message output when it happens
I should just replace the card
ath: phy0: Failed to stop TX DMA, queues=0x005 DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x42000020 DMADBG_7=0x000084c0 ath: phy0: Could not stop RX, we could be confusing the DMA engine when we start RX up
etc
funny that cell phones would cause it :)
 
user3010322
Okay.
 
user3010322
should_chop_null is a working type trait...
 
6:28 AM
Ugh. Stupid copy elision is getting in the way of my SSCCE.
 
That's weird.
 
The stacktrace function is for the template parameters
if I didn't have one it wouldn't tell me the types
 
@StackedCrooked __PRETTY_FUNCTION__ is a nice trick. I'll have to remember that.
 
I often use it.
 
6:42 AM
it's clang/g++ only though
i.e. not standard
 
It's evil and primitive.
 
@Rapptz Well, yeah, but I can't imagine ever wanting to use it for something that's going into production. It's just a cool debugging tool.
 
true
gdb supports print debugging without me actually modifying the source though :v
 
Demangling is a non-standard feature that I have used in production code.
It was just too good.
 
We use it in sol
but I often opt out
 
6:45 AM
sol? Isn't that lua's counterpart?
 
Ah, I see it.
I use this which I stole from Johannes long time ago. coliru.stacked-crooked.com/a/66a2ec0d58944f48
 
Wee I can finally do laundry
 
Laundry.
What is that again?
Oh, like ironing?
I can probably do that.
 
washing clothes
 
6:51 AM
My mom still does it for me.
(because I pay her)
 
lol
 
nowadays I always wash my mum's clothes (because I live with her at the moment) & she always sneak her clothes in right before I wash mine ...
 
@StackedCrooked I'm listening to that Microsoft talk you linked earlier. The idea of using the area under a function's indentation as a complexity metric is really cool.
 
Ah yeah.
That's one way to look at it.
The way I look at it is..
if you see a pile of crap you don't need to measure it to know its bad.
But hey, to each his own :)
But overall a great talk!
This guy has such deep knowledge and yet he manages to keep it simple and useful. I would be too tempted to start talking about fancy tricks.
 
7:07 AM
I need a logical explanation for the fuckery involving unqualified :(
It's fixed in the code but it's still confusing me
 
morning
 
Morning.
 
why do IT dept block outgoing attachments on emails(like .doc files)?
 
user3010322
Company secrets!
 
ah man, pfff
 
7:19 AM
Viruses.
 
Outgoing?
You mean they don't want you to infect the rest of the world with your virus?
 
Because incoming mail servers might blacklist you
And deliverability is everything in mail
 
hmmm
but that means I have to find another way to get the files I need
 
Running a mail server is like dancing on thin ice while being on fire
 
@TonyTheLion Because you rock if you don't block.
Oh wait.
 
7:22 AM
@TonyTheLion upload service
 
That was Node.js motto for a while.
 
Use Dropbox or whatever
Sending files through mail is unreliable anyway
 
It seems so
 
netcat :)
 
heheh
 
7:27 AM
GCC seems to have better errors for templates than clang.
 
:lol: What's orange and sounds like a parrot?
 
carrot
 
gonna go with carrot too
 
It's so dumb but I love it :v
 
7:31 AM
Another old joke:
> Two chemists walk into a bar.

The first one says, "I'll have some H2O."

The second says, "I'll have some water too. But why'd you order it like that? We aren't at work."

The first chemist excuses himself and weeps in the bathroom.
His assassination plot had failed.
 
user3010322
I don't get it.
 
H2O2 is hydrogen peroxide
Hah.
> Why do teenage girls hang out in odd-numbered groups?
Because they can't even.
 
Why are there two move constructions involved in this code instead of just one?
 
return h; moves one, then the result of that one is moved again.
 
7:46 AM
Why does the mere act of returning a value move it?
 
What else is it going to do?
return h; is the same as return HeapInteger(h);
two situations there, copy constructor or move constructor
 
8:15 AM
@TonyTheLion I used to live in Brazil. There was a truck for Pamonha (en.wikipedia.org/wiki/Pamonha), another for milk, and another for gas, and each played their own music.
Hm... Pamonha. I should make that sometime.
And now that I think about it, there was not a truck for ice cream.
 
I saw an ice cream truck 2 days ago for the first time in ~5 years.
 
I have not heard of an ice cream truck for ages ...
speaking of ice cream
ice cream trucks <3 <3 <3 ... yum ...
 
8:43 AM
@Rapptz It would be the same as return HeapInteger(std::move(h));, and even then it's not quite the same because implicit vs explicit
 
there is no youtube video with which I could teach my chooks how to counter striking the magpies
I suspect one of my three chickens has a rather high intelligence
I am going to teach her how to attack her attacker
 
You think about birds too much
 
9:06 AM
5
Q: The two sides of a side-by-side markdown diff are overlapping each other

senshinTime for a super-ultra-trivial bug: if you look at diff #7 for this post on meta.Anime.SE, you see this (on Chrome 34 / Windows 7): The deleted whitespace on the left side of the diff is slightly overlapping the right side of the diff.

 
Chrome sucks :v
 
@CatPlusPlus we know, use FF.
FF must be better, they're inventing a whole new language just to speed up the JS engine
 
There are no good browsers, but yes it's better
 
Use links, obviously. (The text version, not the graphical one.)
 
9:28 AM
"the multiple nested loops note" Are you always this vague? Is it fun? — Lightness Races in Orbit 4 secs ago
haha lol wut email from Spotify
> Hello,
> We've become aware of some unauthorized access to our systems and internal company data and we wanted to let you know the steps we’re taking in response. As soon as we were aware of this issue we immediately launched an investigation. Information security and data protection are of great importance to us at Spotify which is why we’re contacting you today.
>
> Our evidence shows that only one Spotify user’s data has been accessed and this did not include any password, financial or payment information. We have contacted this one individual. Based on our findings, we are not aware o
one user
 
morning
 
@CatPlusPlus I love chrome
 
9:43 AM
@Maxpm Clang either exposes or causes a double free in that code: coliru.stacked-crooked.com/a/08f5a26dec558c51
 
How exciting!
Why on Earth is #1 being destructed before the move to #2?
 
But I'm not in the mood to look through that. I never write any of that copy/move constructor stuff.
I just let std stuff handle that.
 
Worringly, it happens even if I take out the move constructor.
 
@rubenvb That looks like a compiler bug to me.
I'm looking at the constructors, and there's more destructor calls output than constructor calls.
 
9:48 AM
btw, you can write
const unsigned int instance = instances++;
 
@ecatmur Good catch.
 
instance #0 is constructed, destructed, and then moved from and then destructed again.
 
Though ++instances would replicate the existing behavior.
Instance #0 should never actually exist.
The first one constructed is #1.
 
eh
count from zero, peasant
 
I read that ++i is slightly faster than i++
 
9:51 AM
who could possibly give a shit?
 
4
Q: rate ++a,a++,a=a+1 and a+=1 in terms of execution efficiency in C.Assume gcc to be the compiler

Abhijeet Possible Duplicate: Is there a performance difference between i++ and ++i in C++? In terms of usage of the following, please rate in terms of execution time in C. In some interviews i was asked which shall i use among these variations and why. a++ ++a a=a+1 a+=1

 
it's a sample where we're taking the output over the Internet... that's gonna be millions of times slower than incrementing either wy.
 
@Maxpm wow. Where did that come from?
 
@AaronKyleKilleen My experience is that i++ is a lot more confusing than ++i. So unless I actually need the old value (which is very seldom), I always use ++i.
 
It looks like instance #1 is being destroyed before it's passed to the move constructor of instance #2. Then instance #2 has a dangling reference, which it interprets as instance #0. I think.
Check this out. HeapInteger #1428179568. Lol.
Interestingly, if I replace HeapInteger h(123); return h; with just return HeapInteger(123);, it runs without errors.
 
9:58 AM
the this pointers are different though
Move-constructing HeapInteger #2 @0x7fff61419590 from HeapInteger #4197056 @0x7fff61419588.
lol
 

« first day (1321 days earlier)      last day (3644 days later) »