« first day (1686 days earlier)      last day (3267 days later) » 

8:00 PM
@StackedCrooked global access is only ok with immutability
 
@StackedCrooked It either shows how many things are in fact irrelevant, or just how well you can get shielded from C madness.
 
Ell
jesus
I should eat nothing more often
I am so buzzed just from one pint
it'd take me about 4 to get to this stage usually
 
You just get buzzed quicker on an empy stomach, not more.
 
Ell
Hmm
Well it's significantly quicker then
 
@Xeo Yeah, that's right. Still, I don't remember using my older manual saves in my first game (and my playing style was terrible, as it is even now - there are many parallels with programming there)
 
8:02 PM
@Ell yes
 
Ell
I think all I've eaten today is a pan au chocolat and a croissant
 
Why?
 
Ell
Because I wanted to keep the kitchen clean for my mothers arrival
I eat far too much every other day, it can't hurt :P
I'm consuming the calories in liquid form instead
 
> Historically, I remember when my friend Craig and I were first year co-op students at WATCOM in 1992, he was working on the C++ compiler and I was working on the SQL engine. He tried to explain to me this whole idea of “objects” and “classes” and that this was the future of programming, and I was like, dude, you are crazy, I don’t understand why anyone would want to do this crazy complicated thing. Eventually I caught on, but it took quite a while.
Haha, awesome
 
> dude, you are crazy, I don’t understand why anyone would want to do this crazy complicated thing.
Yep, that's Haskell :P
 
8:14 PM
> I was born at an early age in Ontario, Canada. I became interested in computer programming very shortly thereafter
LOL
 
@ScarletAmaranth Is that the 3D model designer's dog?
 
@milleniumbug I think it's the same reason why so many people write if (p) free(p);. The check is not required, but it's a pattern that has never betrayed them, so they never bothered to look it up.
 
> The “big theme” that I’d like to see is a set of features that make the language more amenable to building software that is (1) more clearly correct, and (2) more amenable to advanced optimizations. Features that allow the compiler to deduce “the developer intends this method to have no observable side effect; that intention is met; at runtime I can parallelize this work with this other work”, for example.
What a nice way to /not/ mention FP
@milleniumbug minecraft
 
> I was born at an early age in Ontario, Canada.
lol
Man how come all these waterloo grads go on to become software giants. What magic did I miss out on
 
8:20 PM
The magic of trying
 
Ell
waterloo grads?
 
@CatPlusPlus I have some other theories, but they're prolly a little biased so I'll refrain from mentioning em.
@Ell Herb and Eric went to the same university (waterloo)
 
Herberic
Her bare rack
 
@Prismatic Back then, Waterloo used to have one of the great professors of software engineering and computer science.
 
who?
 
8:23 PM
Didn't Abba write a song about that? ;)
 
@StackedCrooked That, and also writing in a language that doesn't encourage experiments. "Remove that one statement here, and you're toast." They're just applying the same logic, but one level higher.
 
@Prismatic Guy named Mike Coffin. :-)
 
He doesn't even have a wikipedia page tho
 
No wiki page, doesn't exist.
 
@Prismatic Probably not. He's been at Google long enough he'll probably stay there 'til he retires.
 
8:27 PM
Any relation to you?
 
@Prismatic I've never met this man before in my life! Never, I say. Oh, you're not the police? Well, then yeah, he's my brother.
 
@JerryCoffin Sounds like "my coffin" :)
 
@fredoverflow Which sounds a bit like a social network name.
 
cool
 
Two days ago I realized one of the reasons my performance-folklore ingrained colleague still thinks vector is slow. Calling reserve will fail to compile if the element type is not copyable. This caused him to conclude that vector.reserve always constructs elements, and is therefore slower than manual allocation.
 
Ell
8:31 PM
@JerryCoffin any blood relation? :P
 
> Jon never worked at Microsoft, but we have worked together on every edition of C# In Depth, him as the writer and me as the technical reviewer. It is by far the easiest book to do technical editing on because there are no mistakes in it.
lol
 
@StackedCrooked What does 'reserve construct' mean?
 
4 mins ago, by Jerry Coffin
@Prismatic I've never met this man before in my life! Never, I say. Oh, you're not the police? Well, then yeah, he's my brother.
 
Reserve memory then copy it isntead of like, a placement new?
Ugh my room smells like gasoline and tires wtf
 
@StackedCrooked Movable.
 
Ell
8:32 PM
Oh cool
I'm terrible at chatting today
@Prismatic stop burning shit
 
Yeah, I just explained it in his terms.
 
the shit I burn doesn't smell like gasoline and tires :d
 
@Ell I don't think burnt fecal matter smells like gasoline and tires
 
@Prismatic Which calls... a move (copy) constructor?
 
Calling reserve instantiates the code for copying the old elements to the new storage. Hence they must be copyable (actually movable). This is a bit unfortunate if you only need to use reserve on an empty vector.
 
8:34 PM
He probably said this before C++11
 
Ell
@StackedCrooked does it always do this?
couldn't they sfinae out the code for only moveable stuff?
 
hmmm
 
@StackedCrooked vector could use some tags, like std::vector<int> v(std::reserve_tag, 20);
 
some random dude just spammed me saying they were inviting Random Internet Dudes to their Britishness fest
 
@milleniumbug The problem is that (from the sound of things) he thought when it allocated the memory, it immediately filled it with objects (whereas it actually does just allocate raw memory, and use placement new to construct objects "in place"). It needs the copy/move ability in case you're adding onto an existing allocation, in which case it may need to copy from the old buffer to a new one.
 
8:37 PM
and after I told him that he was a fucking dick for spamming me
I took like five minutes to realize how incredibly racist that was
only British people deserve to be in clans, apparently
 
std::vector: if your element_type is not movable then you're gonna have a hard time
@milleniumbug Yeah.
 
@StackedCrooked That's why std::list is better (no, it isn't)
 
std::list still requires movability I believe
 
@Puppy Doesn't seem that racist to celebrate your heritage?
 
8:38 PM
@Prismatic Yes, yes it is.
 
std::list is the best for concatenation. as long as that's the only operation you use.
 
there's only one use for national heritage and that's to call in a bulldozer to make the land available for something else
 
@Puppy What, it does? std::list is so useless then.
 
@milleniumbug It is of limited value unless you seriously need O(1) in-the-middle insertion or deletion.
 
> The requirements that are imposed on the elements depend on the actual operations performed on the container. Generally, it is required that element type is a complete type and meets the requirements of Erasable, but many member functions impose stricter requirements.
dafuq does that mean
 
Xeo
8:40 PM
You don't need movable / copyable if you don't use push_back, and instead just emplace_back (for std::list), for example
 
@StackedCrooked Well, it used to be, anyway. Nowadays, even that's questionable (since they started to require O(1) on its size()).
 
Ell
@Puppy if it's a clan about being british then obviously :L
 
a clan about being british is a clan about racism.
 
@JerryCoffin But splicing two lists doesn't require a call to size(), does it?
 
Xeo
@StackedCrooked You mean splicing?
 
8:41 PM
Yeah.
 
Xeo
It does
 
@StackedCrooked No, it doesn't, it requires O(N) updates of a variable.
 
Xeo
@Puppy no
 
which is far worse than an O(1) call to size.
 
@StackedCrooked No, but splicing two lists can still mean you have to walk through one of them to properly update the stored size.
 
Xeo
8:41 PM
splicing std::list into std::list is O(1)
 
@JerryCoffin Oh.
 
Xeo
stop getting your facts wrong
 
Wow, list sucks.
 
@Xeo Ah yes if you're splicing a whole list rather than a range or sublist.
 
Xeo
Otherwise it's O(n) in the length of the range
 
8:43 PM
c++11 has constant complexity for list::size()
 
@Xeo No, not always. Even with complete lists, you can still have to walk an entire list to splice it to another (specifically, when the two lists use different allocators).
 
Xeo
@Prismatic we established that already.
 
ah sorry
 
Xeo
@JerryCoffin You can't splice whole lists if they don't have the same type. You have to use an iterator range. :P
 
@Xeo You can't pass the entire list as a list to splice, but if you pass .begin() and .end(), you're still splicing the entire list.
 
Xeo
8:46 PM
@JerryCoffin Note how I worded my message. :D
 
@Xeo Yes, I noted how you worded, and realize what you were trying to do/say, but it's still really wrong.
 
@JerryCoffin lol
 
Xeo
You're just being pedantic because I weasel-worded my way out of that scenario. Pff :P
 
@Xeo No, you're just being pedantic to try to weasel out of admitting you were wrong. :-)
 
TIL I suck at list.
 
8:48 PM
@StackedCrooked I already knew that
 
Ell
@Puppy how?
 
Actually, it's a bit unfair that list is singled out while set and map are just as bad.
 
@Ell Because it's clearly excluding other races for no good reason.
 
Ell
@Puppy it's about culture
 
Xeo
@StackedCrooked There was a splicing proposal for them :<
 
8:49 PM
what, a French person can't appreciate the contributions of the British to WW2?
 
Ell
actually
 
I guess that nobody, ever, would want to be grateful for, you know, inventing modern society with the Industrial Revolution
 
Ell
I guess if it's literally purely race then it's racist vOv
 
those German fuckers just can't handle it
 
Ell
but I'd assume it was about culture
and not literally your citizenship
 
8:50 PM
I'd assume that if you want to assume that somebody can't have a similar attitude to life simply based on the patch of land on which they were born, then you're a fucking moron and a racist.
 
I only recently learned that insertion into map can trigger a rebalancing of the tree. Not that it ever caused me trouble, but dang that sounds slow.
 
@LucDanton [temp.inst]/3 says the instantiation is triggered "Unless a function template specialization has been explicitly instantiated or explicitly specialized [...]". I assume that to mean "anywhere in the program" rather than "in the same TU". Together with [temp.explicit]/10 this seems to back my interpretation. There's also this post on SO.
 
@Puppy How is Wide doing?
 
@StackedCrooked It's not ideal but worth it in general, much like reallocating for a vector.
@Jefffrey Pretty much same as previously- i.e. not really at all
 
:c
 
8:52 PM
Wide don't you spend more time on it? ;)
3
 
work
 
Xeo
@fredoverflow *Widon't
 
well
I simply don't desperately need to do something theoretically productive with my free time anymore and Wide really has little other payoff, I'm clearly the only one with any investment or appreciation of the project, it's not like anybody is benefitting from my hard work in the region of incremental re-analysis
except andy prowl
whom I probably owe some more work
 
nah, you don't. I'm sorry to hear you're not working on it though
welp let's see if has something to offer tonight
 
ah well
I may revive it, it's not exactly the first time I stopped working on it for a period
what I've been thinking is that I may reach out to some people whose opinion I actually respect and ask them what they think, like STL
 
9:02 PM
> In fact all of my friends from Ontario were born at a very early age. It must be characteristic of Ontarians.
lol
 
@Puppy sounds like a good idea
 
Map nodes are often around 40 bytes in size. I think this can make them very vulnerable to false sharing.
 
"are often"? it's completely dependent on a great many factors
there's nothing "are often" about it.
you need sizeof(K) + sizeof(V) + 2*sizeof(void*) + 1 at minimum I believe.
so they may often be 40 bytes if that's how that cookie crumbles.
 
Commonly used types are int, long, pointer, std::string.
 
@Puppy Yup, that seems just right assuming RB-tree or AVL tree.
 
9:09 PM
sure, but that's the programmer's choice, it's not "often"
if you want to avoid false sharing simply make K or V bigger.
 
Using tbb::cache_aligned_allocator would align the nodes to 128 bytes. This totally disables any locality that you might have had if you allocated all your nodes at once.
 
it's a bit of an issue though because you can't use something like an object pool to allocate map nodes
 
Yeah a custom allocator can help.
 
not as much as it could do, though
 
@Puppy You could tag pointers, but no-one's that insane.
 
9:12 PM
they completely are that insane, we just hope that stdlib devs aren't.
 
But then you might be better off using flat_map or something. If it fits your requirements. Also cache-aligned allocator on flat_map would be beneficial.
 
Xeo
@Puppy 4 * sizeof(void*), I believe? Pointer to left/right nodes, and pointers in the iteration list.
 
Also you wouldn't benefit from that since the nodes are on separate blocks too.
 
@Xeo Plus K/V and 1 for r/b or avl
 
Xeo
@Puppy Yeah, meant just the internal pointer part
 
9:15 PM
Eric Lippert sounds like a nice guy.
 
@Jefffrey Yep. Another piece of evidence that competence doesn't necessarily imply grumpiness or arrogance
 
Bjarne S. is also a nice guy.
 
Xeo
Hm. What would you call a member (and the associated enum), that says which kinds of movements are blocked? I was thinking just blocks, as in blocks::walking, but that as an enum name alone feels wrong somehow.
 
blocked maybe
 
@Jefffrey Bartosz and Howard too
 
Xeo
9:18 PM
@AndyProwl Bartosz is so... annoying to listen to.
 
@Xeo impediments
 
Xeo
I can't quantify it, but man.
Can't listen to him for more than 5 minutes.
 
Bartosz is just too calm and mono tone.
 
@Xeo That's subjective, but he's a nice person
 
I'm mono tone too.
 
9:19 PM
I also find his low-energy tone sub-optimal, but I like his style of presentation and I appreciate his humble attitude enormously
 
@Xeo He's the monad nomad.
 
oh and Scott is also a very pleasant guy
 
@AndyProwl Watching at 1.5x makes him sound normal.
 
lol
 
Xeo
@Puppy That sounds wrong as a member for some reason :/
 
9:21 PM
you sound wrong as a member for some reason
 
-1
Q: What does this c/++ code do?

user3735366I have no clue of what this complex code does or how it works please explain. All I know is \t is tab and \b is backspace. #include <stdio.h> int main(void) { for (;;) { printf(" \t\b\b\b\b\b\b"); } return 0; }

c/++ is new
> That prints a space, then a tab, and then presses backspace six times
lol
 
c/++ :D :D
 
Is int main(void) UB?
 
I imagine how a printf statement makes the key go up and down on my keyboard
 
Xeo
no
 
9:22 PM
Or was it void main()?
Or neither.
 
it's not UB, it's just illegal
 
Both?
 
int main(void) is legal, but fuck (void)
 
@Xeo No idea why I assumed std::map::iterator operator++ call is O(log n)
 
Xeo
neither is UB, void main() is just not well-formed according to non-free C++ standard
well, implementation-defined, I should say
 
9:23 PM
OTOH I can't find performance requirements for iterator operations in the standard
 
Xeo
implementations can add anything they want as long as they support int main() and int main(int, char**)
 
I see
 
> complex code
 
Xeo
It's those two that a freestanding implementation doesn't need to support
 
> well its an infinate loop
"infinate" sounds like something anal
 
9:24 PM
@Jefffrey intimate loop
 
@Jefffrey It's not C++ so UB does not apply. Best way to make your code safe actually.
 
@Jefffrey I think you're thinking Italian :D
 
@Xeo Also, hey, that's almost as bad as skip list
 
@AndyProwl Could be, why do you think so?
 
@Jefffrey "infilate"
 
9:25 PM
inflatulate
 
there isn't anything English that comes to my mind as close enough to suggest anal
 
Oh lol. Nah, there's another one.
@StackedCrooked THAT'S IT
 
Xeo
@StackedCrooked is that a reverse fart?
 
how's that "anal"?
 
@AndyProwl you should ...analyze more.
 
9:26 PM
maybe I don't know what "anal" means
@StackedCrooked Can't come up with anything deeper really. Can you offer an analogy?
 
lol
I have an analgam of ideas.
 
I want to pass functions as a template parameter in a function template and invoke them in the function. What I tried (surprisingly) seemed to work right away, but I'm not sure what's really going on: http://coliru.stacked-crooked.com/a/79bc1e46a1132f90

Is there a specific phrase or something I can search for to find out more... 'functions as template parameters' tends to lead to some kinda related fnptr stuff. I want a nicer reference
 
Xeo
Verb: flatulate (third-person singular simple present flatulates, present participle flatulating, simple past and past participle flatulated)
  1. To emit digestive gases from the anus, especially with accompanying sound.
  2. 2001, David Kerans, Mind and Labor on the Farm in Black-Earth Russia [2],
  3. 2003, Vamik D Volkan, The Third Reich in the Unconscious [3],
 
@Xeo oh
got it
 
farts
 
Xeo
9:29 PM
butts
 
yeah guys thanks I got it
 
why oh why did I ever instlal Ubuntu on my real machine instead of a virtual machine
 
buttes
 
Xeo
@Prismatic that's not passing it as a template argument?
just a normal function argument
 
@Puppy lol whats up
 
9:30 PM
@Prismatic Also your lack of std::forward disturbs me
 
not much
 
Oh, you're using &
 
just annoying because I don't want it on my real machine.
 
@Prismatic cplusplus.com :P
 
@Prismatic The usual form is Args&&... args) { f(std::forward<Args>(args)...); }
If you want to make a call equivalent to just calling it directly.
 
9:32 PM
1
A: What does this c/++ code do?

Dan KornIt causes a Windows XP or NT machine to blue screen: https://groups.google.com/forum/#!msg/microsoft.public.vc.language/VnuU_EpDQ7Y/7TAcZaAnVWAJ On other systems, it's just an infinite loop.

wtf?
 
software??? withb ugs?????
 
NEVERE
 
Xeo
Okay, now the question may be interpreted as a malicious attempt to bluescreen some people as they try out the code.
 
@milleniumbug Arg&& should only be unlocked after obtaining "forwarding pitfalls" achievement.
 
impossible to obtain without it
 
9:34 PM
"What does this c/++ code do?" Nothing useful.:) — Vlad from Moscow 11 mins ago
first time I agree with Vlad
 
@Xeo That's certainly one way to attack people.
 
@fredoverflow Hey, I have a virtual WinXP machine. Gonna try this
 
"I heard that if you do this thing, Windows bluescreens!"
 
@fredoverflow wut
 
9:36 PM
@fredoverflow And I thought bluescreen was caused by faulty drivers...
 
it is.
in that case the faulty driver is Windows
 
lol
What does \b mean?
 
What I meant was, I can pass the name of a function to the template function and it 'just works'. The type is deduced as a 'function type' or whatever. And I can call it like a normal function. Is there a specific term for that? (Also thanks for catching the args screw up)
 
ascii backspace character
@Prismatic shoulda-used-a-lambda
 
@Prismatic []foo Xeo's overload set proposal
 
9:38 PM
@Prismatic It works as long as the function is not a template and has no overloads
 
@milleniumbug foo Wide's implementation
 
Xeo
@Prismatic You're just lucky
Andy lists the restrictions.
 
What was the []foo idea again?
 
Xeo
Also, member functions need &T::f
the & is required.
 
9:40 PM
@Puppy Yet another thing to add to the "nice Wide stuff"
 
Xeo
@StackedCrooked sugar for generic lambda
basically
it captures an overload set on a name, if you will
 
@milleniumbug Wide does not have functions, only function objects. All overload sets/generic functions/etc are just objects.
 
@Puppy +1
 
@Xeo It worked without the & though
 
@Xeo Like this? auto []foo = []{ };
 
Xeo
9:41 PM
@Prismatic Because static.
 
Also with the '&' doesn't it become a function pointer? Then you have to use some weird syntax to call it
 
Xeo
@StackedCrooked No. Think of foo being an overloaded name. And []foo being a lambda that just forwards all arguments it gets to the name foo
 
not to call it
 
@StackedCrooked #define OVERLOAD_SET_EMULATION(name) [&](auto&&... args){ return name(std::forward<decltype(args)>(args)...); }
 
not the same
no SFINAE support for one
 
9:43 PM
That's why "emulation"
 
Xeo
-> decltype(auto) is what the result type should be
 
emulation would involve emulating it.
 
The purpose is similar though
 
approximation would be better.
 
it should be called auto(decltype) though
 
Xeo
9:43 PM
@Prismatic Member function pointers always need special syntax.
@AndyProwl nah
 
typeauto(declid)
 
@AndyProwl lol
 
@Xeo It's literally "type deduction with the rules of decltype". auto expresses type deduction, decltype expresses how to do it and parameterizes the procedure
 
Xeo
@AndyProwl decltype(auto) -> the declared type of the deduced expression :D
 
@Prismatic AFAIK in C++ you should always use &foo. However, without & still works because of backwards compatibility with C.
 
9:45 PM
@Xeo I stand by my statement :D
 
do you use '&' with free functions as well?
 
Xeo
for consistency, yes
 
k... ty
 
Xeo
Not necessary, because function names decay to pointers / references immediately if not called, though.
lambdas are nicer anyways
no pointer indirection for one
 
9:46 PM
much like your mother in bed
 
his mother in bed was quite necessary to make him exist
 
never implied the opposite
 
I thought you were reacting to "Not necessary"
 
no
 
@Xeo + cost of not inlining
 
Xeo
9:48 PM
that's part of the indirection
 
@AndyProwl absolutely not. Beds are immaterial
 
@sehe Good evening, sehe
nothing interesting in
but I know some good question will pop up as soon as I close the tab
 
> Merge m4a files not working with ffmpeg
Sounds like a great one.
 
@StackedCrooked lol, it's his 3rd question on ffmpeg
 
9:55 PM
@fredoverflow Oh, nevermind, it got patched.
> What is the best technology to build C ++ applications
Yup, that's the one
 
sigh
I should
 
Go drink a beer
 
nah, I don't feel good and that's most likely because I did go drink a beer on wednesday
 
Hello again
 
Hi, Cinch
7
 
9:58 PM
So I feel like I'm better prepared to jump into networking now
After playing around with Node.js and building something I think I can do something now... I think.
@milleniumbug Can we just call me Vermie?
Like vermin but e instead
;D
 
It depends on how Cinch-y you will be :P
 
@AndyProwl k
 

« first day (1686 days earlier)      last day (3267 days later) »