« first day (1236 days earlier)      last day (3938 days later) » 

22:00
@ThePhD Pure will power. I'm not good at this stuff. Believe me :S
All hail sehe \m/
0
Q: 2 different sorts, 1 functor

BHareI have a functor that I am using to compare 2 values, and if those 2 values are equal it then relies on sorting by alphabetical. Here is an example functor for a class called test who has attributes accessors GetValue and GetName struct test_comp { bool operator() (const test* a, const test...

^ dat title :)
I have no will power
user1804599
sehe ftw
I'm all out
22:01
@sehe Ahahaha! it didnt cross my mind the first time
Awesome! ^
@CaptainGiraffe trying vehemently to remember what that could be
... and a development host with plenty of RAM and some time to kill. Boost spirit is tough on compilers! ;) — marko 1 min ago
@sehe It was the async test for std::sort + merge. If that might jog your memory.
I gotta admit, I don't get it.
not to be shitting on sehe here, but all he did was combine two generic components that are designed to be combined, near as I can tell.
and everybody else is acting like he had some sort of cosmic breakthrough
The quality of his answers is astounding
22:04
@DeadMG No, not at all, but he provides elegant, non-complex solutions to every stated problem (even fairly complex questions). And with that he explains why it works.
He is the great seholio!
@CaptainGiraffe certainly does. I remember I made ~4 variations there. With/without thread/async/future and... ? openmp I believe :)
I feel mentally drained
@Borgleader ... thanks :)
@DeadMG Yeah. That. And the fact that I happen to know I tried for weeks to get boost::containers::scoped_adapters to do what I wanted and failed :S
@sehe Yep, I reused, measured, and refined it a little with a special merge. No open_mp a requirement was only std:: or very common libs. openmp was not on the list.
22:07
I'm cheating the system by conveniently sailing past the ice-bergs lurking
@CaptainGiraffe Mmm. ISTR 4 variants :)
@CatPlusPlus do something other than what mentally drains you
Not helping
user3010322
Hm.
@CatPlusPlus Have a wank cat. That will take your mind off of things.
Have some catnip
user3010322
22:08
I just realized that for transparent objects, my raytracer can't stop at just the first hit.
user3010322
It must see everything.
user3010322
Should I have a limit to how many primitive I can hit?
@ThePhD Usually theres a limit yes, thats how Cycles does it.
Xeo
Xeo
ahahahaha /cc @R.MartinhoFernandes
user3010322
@Borgleader I guessed I'll affix myself to some 64 primitives hit per a single ray.
@Xeo That language council provides a list of new words kids use. They present it as new words in swedish. Although the have no legal status it might be a way to have the Google trademark degrade into xerox status.
well in common language I think there's no question that "google" has become synonymous with "search".
It already did
that has upsides and downsides for them.
Now, I'm really not aware of any problems with the xerox(tm). so...
user3010322
22:14
@Borgleader ... Or 8. Just 8. :D
Make it an option so you can easily tweak it!
user3010322
If I do, it'll be determined at runtime.
user3010322
That means I'll have to use std::vector or some container like it.
user3010322
In order to not make a new std::vector every sample, I would need to use an out parameter for the function.
user3010322
That, or a vector with a specific arena allocator.
user3010322
22:17
Inside an optional
user3010322
std::optional<std::vector<std::pair<Primitive&, Hit>>>
user3010322
Mmmmm. Delicious.
user3010322
@Borgleader Is there a maximum to the maximum you can set it to?
user3010322
Like 128 or something?
you can use a SmallVector or PartialArray instead.
@ThePhD No.
a hyper-realistic raytracer would have no limit- it's really about the performance implications of such a thing.
user3010322
22:18
Well, the only performance implication that I want is the fact that you're hitting extra primitives, not that we're making more std::vector's per pixel or something.
@ThePhD Cycles stops at 1024, but I think Indigo has no limit
meh
user3010322
Eh. I'll just use an out parameter.
making std::vectors is free, it's allocating memory which is even remotely expensive, and there's a number of very similar alternatives that can dodge that in common cases.
not to mention allocators.
personally I'd use a memory arena for virtually all per-frame allocations anyway because it's so fucking cheap.
user3010322
Guess I'd better write a quick arena allocator...
user3010322
22:20
Or, ooh!
I already possess one you can use.
user3010322
I know! I'll just make the algorithm iterative.
Doesnt boost have one?
user3010322
There we go. Only deal with one at a time.
@Borgleader Nope.
pretty sure that pool is an object pool, not an arena.
And the difference would be
user3010322
Object pools usually have the stipulation of reusing freed memory, right?
@CatPlusPlus They're totally different things.
user3010322
Whereas arenas just forward-allocate until you crash the thing that's using it
22:22
@CatPlusPlus Damn you! I'm up to date with Gunnerkrigg Court and the last 2 updates had no story in them :(
@DeadMG Well now I feel enlightened!
an object pool is about random allocation/deallocation for fixed-size objects.
an arena is about fixed-order allocation/deallocation for random-size objects.
really, an object pool is just like malloc() but the size is fixed, whereas an arena is much more like garbage collection or stack allocation.
So just a heap
nope, heap is for random-order random-size.
user3010322
Trying to have arbitrary number of n samples is kind of a hassle. And out parameters are kind of a hassle.
22:26
I don't have brain capacity to care atm
I need more comics
then why did you even ask
Or alcohol or something
user3010322
Return a boolean~
@TonyTheLion that was actually pretty funny. Bit late to detect
user3010322
Catnip?
22:28
Not an overplayed joke at all
We still need wiki frontpage
user3010322
Oh! I know! I can cheat. :3c
user3010322
I'll return an optional and have an out parameter for vector. :D
user3010322
Everyone wins.
Everything's terrible
that sounds like the worst of both worlds.
22:29
@DeadMG thanks anyway for explaining. This helped me a bit getting some contrast going between those concepts (though I'm pretty sure different groups use the same concept with loosely mixed meanings)
user3010322
Fur::optional<std::pair<Primitive&, Hit>> Intersect( std::vector<std::pair<Primitive&, Hit>>& hits, const Ray& ray, Fur::optional<const Primitive&> ignore = nullopt )
user3010322
Kinky.
user3010322
the one returned is the closest hit.
@sehe Yes, I find that these concepts were invented at roughly the same time by several different people who all gave them different names.
user3010322
All the hits are stored in the hits vector.
22:30
@DeadMG unlesss..... it's optional<vector<T...>&> o.O
Xeo
Xeo
I always thought of an arena as 'take big chunk of memory from heap, and use it like the stack'
@ThePhD nullopt? Hehe. I like boost::none better
@Xeo Which is basically what it is.
except when "the stack" isn't tied to the call stack it opens up new abilities.
user3010322
@sehe I know! I like none too, BUT the stupid std:: committee agreed on nullopt.
lifetime semantics
@ThePhD they... waaaat. Ok. consistency with std::nullptr
22:31
I mean, let's face it, most of the time our primary motivation for not using a function local is lifetime.
but arenas can dodge that problem in many ways.
I find that they make an excellent supplemental memory source in many ways.
user3010322
It's a sad, sad day. =[
And then we're just left with the problem of either sharing arenas or garbage collecting them
nullint nullfloat nullvector nullmap nulleverything
22:32
@sehe How so?
user3010322
@sehe Yeah, but I mean, it's not really a null in that sense. none really does sound like a better term for it.
user3010322
none_t and none are still just as good, less letters, and quite honestly just make more english-y sense.
@DeadMG Because now the arena's will have non-function local lifetime. And being arenas, this implies they have dynamic lifetimes. Manage them we will need to
@ThePhD std::nil (So Pascal)
I keep hoping I'll wake up and be able to do anything, but it's been a week and it's still shit. Bleh
@sehe No- things you put on the arenas will have non-function-local lifetime.
22:34
@DeadMG It only depends on the lifetime of the arena. Duh.
the arena itself (and by proxy, everything you put in it) will have whatever lifetime you gave to the arena.
:D
user3010322
@sehe I had nil_t once. I wonder if I still do...
so you can simply put the arena as a function local and go nuts
you don't have to actually manage the dynamic lifetimes of things in the arena.
Xeo
Xeo
@ThePhD oh no so sad, buhuu~ auto none = std::nullopt;
user3010322
22:34
@Xeo I was thinking of doing that. :D
user3010322
struct none_t { };
const auto none = none_t( );
user3010322
I have this here still, even though I transitioned to nullopt already.
in fact
@DeadMG That wasn't my point. My point was that instead of managing the lifetime of small stuff, it's about managing the lifetime of large(r) stuff. Though this is objectively simpler, managing large allocations has its own pitfalls.
I think the Wide arena is bugged in that I don't actually clean up properly.
22:36
It's an EverExpanding arena. Or: Wide+++
const struct {} none
@sehe That's true, and it's why arenas function best when the lifetime of the overall group is very simple/obvious, and when there's definitely a need for that much memory. You'll obviously get screwed if you allocate in 1MB chunks in the arena but you only use 200B.
Now, you too, can have unnameable types
@CatPlusPlus that's a cool conststruct :)
@sehe I need to cut it from Wide. It doesn't really belong here.
user3010322
22:37
@CatPlusPlus It's type has to be namable, though, so you can write function declarations with mystuff ( none_t ).
But then you can reverse-alias it with decltype and feel important
void foo(decltype(Fur::none))
Xeo
Xeo
hm, I don't think I'm in the right mood for any discussions today. too irritable for some reason. so, good night
user3010322
so many letters q_q
user3010322
@Xeo Goodnight Xeo-chaaan~
22:38
@Xeo sleep well
Yeah I'll go to sleep too. Tomorrow I'll wake up and still feel shitty so I'm looking forward to that
but then again
there are so many things I need to do on Wide...
user3010322
Hm. Is it wrong of me to declare none and nil in the global namespace (e.g. without a namespace?)
yes
user3010322
I'm kind of compelled to, because they're basically kinda like keywords.
user3010322
22:40
Albeit it wouldn't be terrible horrible to write the 5 letters beforehand, but...
Also add null and nothing and undefined
@ThePhD using (not in your library headers, please)
personally
> Initializes the contained value by copying (2) or moving(3) the contained value of other, but only if other is engaged. other is still in engaged state if it was in engaged state before the call.
in Wide I'm kinda tempted to just use null for both null pointers and null optionals.
22:41
And then on error resume next and poof visual basic
instead of having two different kinds of null.
Wait. The move constructor doesn't disengage the other value?
user3010322
@EtiennedeMartel I read that, and decided to just disengage it anyways in my implementation.
@DeadMG Remove null pointers and use optional pointers
@EtiennedeMartel ctor of what?
22:41
:v
@sehe std::optional.
@EtiennedeMartel There was quite a bit of antsying about what exactly moving an optional should mean.
user3010322
@sehe optional
but I think they decided that having an engaged-but-moved value was safer and had no obvious downsides.
@DeadMG Oh, so the inner value is empty, then?
22:42
And it's more similar to regular values.
as empty as a moved-from value of that type.
It's right in the 'pay-for-what-you-need' spirit
user3010322
But if you're moving the optional itself, it should disengage the other one.
I mean, what you're talking about is something like std::optional<std::vector<int>> o(std::vector<int>()); auto x = std::move(o); o->push_back(5);
@ThePhD Intuitively, many people think that, but objectively, there are no actual reasons to disengage the other optional.
@DeadMG That's the important bit. This might still include resources that could be reused
22:44
and disengaging it brings extra UB risks that aren't justified when you consider you've got nothing to gain.
user3010322
Hm.
I'm gonna head to bed. Tomorrow is another day to have my wits about me.
Night all
night
user3010322
Nighty night!
user3010322
Geez, everyone's going to bed.
22:45
I'm not.
0
A: Can/Should i inherit from STL iterator?

MorwennAs of today (C++11/C++14), the standard seems to say that it isn't a good idea anymore to derive from std::iterator and that we should give up this practice. Here is a brief explanation, from N3931: Although the Standard has made this mistake almost a dozen times, I recommend not depicting di...

Considering this room probably has the most performance-driven programmers, I figured it would be the best place to ask this question.
A while back I read a question on SO about "when to use assembly language"
so basically you know nothing about us and you're going to dump your problem in our laps.
how very kind of you
user3010322
Never.
user3010322
Always.
user3010322
22:49
Sometimes.
And one of the answers was something along the lines of "don't, unless you're X X"
user3010322
When the moon is high in the sky and full and a naked lady comes and asks you for the best sex of her life. That's when you need maximum performance -- that's when you need Assembly.
I Googled that name and found an amazing article about a guy who hand-tunes assebmly for some supercomputer in a national laboratory
@OregonTrail We actually don't like to talk about performance stuff.
I think he was Japanese or Korean
does anyone know his name?
22:50
@OregonTrail Basically never
no we don't.
nor do we care
I've scoured though comments of popular asm related questions and couldn't find his name
Thought someone might know off-hand
thanks anyway
nope, and I think you missed the part where we don't care.
The article was very inspiring, it seems that this guy has the ability to visualize performance issues related to cache coherence the presence of an alogrithm running on a distributed memory architecture
so am I gonna get slapped if I start binning this guy or can I just get the ball rolling?
22:59
This is hilarious.
@DeadMG That means you care enough to bin him.
This room never changes. I almost feel nostalgic. Almost.
posted on March 05, 2014 by Ankit Asthana

Overview PDB's (Program Database file), PDB stands for Program Database , a proprietary file format (developed by Microsoft ) for storing debugging information about a program (or, commonly, binaries such as a DLL or EXE ). PDB files commonly have...(read more)

16
Q: Gradually construct an object

intelfxSuppose there is a hierarchy of two classes (class Derived: public Base). Both these classes have big memory footprint and costly constructors. Note that nothing in these classes is allocated in heap: they just have a big sizeof. Then there is a function with a fast path (executed always) and a ...

holy shit that got 16 upvotes o.o
Damn, why? Just why.
23:12
~prfeomrance~
I was going to ask him if he'd benchmarked his code to make sure that was indeed a problem, but I was too tired to give a fuck and figured someone else would do it for me.
I was wrong.
> they just have a big sizeof
sizeof doesn't matter
8
Someone else did indeed do that for you
Didnt ask if he benchmarked just sort of remarked it might not matter and moved on to something else.
@intelfx: Have you tried it ? If you have not, how do you know exactly what will occur after the compiler dark magic has been applied ? I understand your gut feeling about it, but where optimizations are concerned, you should measure. — Matthieu M. 15 hours ago
23:18
Oh thats on one of the answers
I meant on the question itself
ah I see
anyway I'm also surprised it got so many upvotes
We all are
that's generally the kind of question that gets downvoted
apparently having two copies of his objects could "overflow" the stack
~500Kb objects
the fuck is he storing? porn?
who knows, perhaps in the OP's environment it is an issue
no idea what an ARM-to-ARM binary translator is
nor how critical its main loop could be
23:28
@AndyProwl It's kinda like a JIT where the source input is already compiled to assembly for a different CPU.
ARM-to-ARM I'm guessing means ARMv8 to ARMv7 or something like that.
If you don't need SFINAE, I'd say a static_assert might be better
23:35
Purely decorative :)
I know I'm weird as fuck, but I wish I could code in C++ this web application
unfortunately C++ can kinda suck applied to web development
user3010322
C++ is great for web dev. :D
@StackedCrooked heh
@ThePhD so many cheap hostings supporting it too :P
23:38
@Jefffrey I'm doing that atm
@Jefffrey and it's working surprisingly well
@LightnessRacesinOrbit Ugh, what are you coding?
@Jefffrey can't tell you
@LightnessRacesinOrbit are you working with dbs?
@Jefffrey yes
sharing Model code between daemon and GUI is awesome too
yay for common language
@LightnessRacesinOrbit what server are you running?
23:41
in development, do people care if you make a branch in git to do something and show it to someone? (As in, a work environment)
> const char *PgConnection::DBName()
Ugh, why postgres, why
user3010322
I wonder if std::list can reserve....
user3010322
Wtf.
user3010322
I can't reserve for std::list. =[[[[[
user3010322
I always have to pay the penalty of constructing a node?!
23:45
@ThePhD doesn't make much sense?
@ThePhD How could that possibly be avoided?
@ThePhD well, darling, maybe a node based container is not what you really want?
@Jefffrey what do you mean?
user3010322
By forward-allocating a bunch of nodes and then letting my emplace my stuff into the node.
@DeadMG @CatPlusPlus any idea how to download Wide builds with wget/curl (site password prevents this currently)
user3010322
23:47
@Jefffrey The only thing I want honeybunches in you in me. <3
so you're paying for constructing and allocating a node as well, it's just that by forward-allocating you're paying up front for nodes you might not need.
@ThePhD <3
user3010322
@DeadMG Yeah, it's the same idea as std::vector::reserve
user3010322
I might not need all the space but I'm allocating it anyways.
@ThePhD It's not at all the same idea, because std::vector::reserve can save you redundant allocations if you do it right.
std::list::reserve could not do any such thing.
23:48
@LightnessRacesinOrbit well, do you actually code your own server too or do you use an existing one (like apache)?
user3010322
The only reason I'm using std::list is because it very effectively supports in-middle insertions.
@ThePhD I've forgot how it's implemented, but have you considered std::deque?
@Jefffrey So, you mean web server. Apache.
There are many types of server, son
user3010322
I'm trying to make it so hits.begin() gives me the closest hit, with every one after being one step further away (makes iteration easier).
@LightnessRacesinOrbit such as?
user3010322
23:50
Because I hit primitives in any random order, I'm not guaranteed to have them in the right order. So I either have to call sort after I hit all my possible primitives or insert them in front.
@ThePhD nah, scratch that, it inserts in the middle at O(n)
user3010322
push_front / emplace_front aren't terrible fun operations to perform on a std::vector
@StackedCrooked I'm looking through all the settings and none of them mention making builds public.
@Jefffrey Database server, physical server, mail server, um name anything it has a server
@ThePhD do you always push in the front?
user3010322
23:52
@Jefffrey I was going to do an binary search + insert for the primitive.
@LightnessRacesinOrbit right, no I meant web server ;)
@ThePhD what do you mean?
@DeadMG anyway, wide is updated
thanks
user3010322
Currently, I was using a std::vector. I was adding elements to it by manually searching the array, finding where the new primitive's first-contact was in relation to the others, and inserting it in the proper place in the vector (based on the first-contact distance, from closer to farther).
user3010322
std::vector is not the nicest data structure for random-position inserts. So I thought to use std::list. To minimize overhead, I wanted to .reserve( 1024 ) to have some nodes allocated up-front.
23:55
@ThePhD why?
Modern warfare:
@CatPlusPlus Ah, it uses standard http authentication. Never mind.
@ThePhD std::list is perfectly fine for that
user3010322
@Jefffrey Because vector has to forward-shift all of the primitives or backwards-shift all the primitives in the list when you insert something in the middle.
user3010322
@Jefffrey Yes, up until you realize every node has to be new'd.
user3010322
23:57
Actually.
user3010322
You know what?
@ThePhD reserving matters with array based containers because pushing new elements can cause an array resize (which is something you should be worried about)... with node based container this problem doesn't exists in the first place
user3010322
@Jefffrey The problem is the default allocator (since I'm not writing a new one just yet) calls new, requesting memory from the operating system for each emplace_back (unlike std::vector).
@StackedCrooked Are you sure? Cause I'm seeing some error strings that don't exist anymore/etc.
@ThePhD yup, well, that's std::list's price... you can't have everything :)
user3010322
23:59
@Jefffrey But I want everything!
@DeadMG which strings? keep in mind that build cache may show old results. (be sure to modify the code a little to cause a cache miss :))
user3010322
Maybe I'll keep the std::vector<Hit> for the hits. And then have a std::vector<Hit*> and then sort the elements from the first vector into the second one.

« first day (1236 days earlier)      last day (3938 days later) »