« first day (522 days earlier)      last day (4431 days later) » 

3:00 PM
It is double for range, but in them old days double on the PC had to be handled by coprocessor instructions, which were sort of different from the main code
 
GCC 4.8 with -O3 doesn't do TCO.
But it does if the return type is int.
 
the double case has ugly and lossy conversions involved.
if int is large enough.
 
TIL acronym TCO :-)
 
The code with double generates a lot of fiddling around with fildl (get it? fiddling with fildl?) and this %st register thing. I never did x87 assembly, so I have no idea what's going on.
 
But the point is, this is not tail call optimization, it's a bit more advanced optimization (recognizing that the code can be rewritten to tail call)
 
3:05 PM
Right.
I meant that it doesn't optimize the recursion into a loop.
 
hm, i think i'll test with visual c++ myself (i have that! even the version 11 beta)
thanks for testing g++ 4.8
does anyone have that Apple compiler whatever-its-name?
 
@CheersandhthAlf Clang?
 
I do
 
3:07 PM
Here's the GCC generated assembly for the double version if anyone cares: pastebin.com/Xq7NWzkv It's ginormous. The recursive call is at line 40.
 
could you check this? probably just option -s or -S or whatever it was for generating assembly? possibly option -masm=intel to get readable stuff?
 
Both GCC and clang use -S (clang aims to be a drop-in replacement for GCC)
@CheersandhthAlf Oh, you can change the assembly flavour?
 
Why does unique_ptr have this? unique_ptr& operator=( const unique_ptr&& r );
 
@CheersandhthAlf remember Clang has a demo page, not sure which version it runs currently: llvm.org/demo/index.cgi
 
3:09 PM
@RMartinhoFernandes IIRC the usual practice is to do something like asm("# foo"); to add comments to the assembly output to help finding one's way around the generated code.
 
@Pubby AFAIK it doesn't.
 
@Pubby Because it's movable.
 
But how can you move a const?
 
Oh, const. I doubt anyone ever uses const&&
 
@RMartinhoFernandes It's on cppreference en.cppreference.com/w/cpp/memory/unique_ptr/operator%3D
 
3:10 PM
@CatPlusPlus Not from const&&
@Pubby Where have you seen that?
 
You're imagining things.
 
@Pubby It's wrong then. The standard doesn't list it.
 
@RMartinhoFernandes Yeah, took me a second to notice it.
 
I will fix it then
 
Too late.
Oh damn, captcha.
 
3:11 PM
@CheersandhthAlf this is current Clang's output: pastebin.com/QbRehJB0
 
Probably someone was copy-pasting copy-assignment one.
And forgot to remove the const.
 
that's clang++ -c -S -O3 test.cpp
-O2 version seems identical
 
@RMartinhoFernandes "ginormous" indeed (whatever that means!)
 
One more thing, why std::forward the deleter?
 
@LucDanton It's a two-line function...
 
3:13 PM
You don't expect two lines of C++ code to expand to two lines of assembly code, do you?
 
the LLVM online demo page seems to do something different and add "tailrecurse" comments.
Might be of interest
 
@RMartinhoFernandes In a 100+ line generated file.
@Pubby It could be a reference type, and then std::move wouldn't do the right thing.
 
@LucDanton So each comment I add will turn into 50 lines of assembly (or more).
I'm not sure how that helps.
 
(Especially since I'd have to look up the Intel manual to see what fildl, or fild maybe, is)
 
3:14 PM
Comments are added as-is.
 
I don't want to know.
 
> Finger induced lucid dream
 
@CatPlusPlus Yes, but I can't make up 100 comments in my source code. If I put two comments, each comment will be followed by 50 lines.
 
You can surround the function with comments to find it easier.
 
I have found the function.
 
3:16 PM
Because you're a robot.
 
Isn't it simply everything between .cfi_startproc and .cfi_endproc?
 
@CatPlusPlus sounds so dirty
 
OMG, it's readable! Thanks @Cheers, -masm=intel is awesome.
 
Comment would be after a compiler-generated prologue, though.
And AT&T syntax is so weird I don't know who the hell thought it was a good idea.
 
Oh wait, you guys think that's the whole assembly output?
No, those 100 lines are just the factorial function.
The whole file is 146 lines.
 
3:21 PM
I didn't really read it. :v
I'm so tired, thinking is hard.
 
@CatPlusPlus Someone in AT&T, I suppose.
They should get shot.
 
visual c++ 10.0 failed to optimize at all when I used /O2 (optimize for speed) option
 
Even the int version?
 
VC sucks.
 
3:28 PM
My personal army:
can you weigh in on this perhaps?
1
A: Can I have some input on my binary calculator

minopretGood work delineating the functions. You have met several relevant guidelines for each one of your functions. It is reasonably short. It performs one clearly defined operation. It uses a limited amount of conditional logic. Each of its conditional statements has a purpose that is clearly related ...

 
@KonradRudolph lol
 
Aaaaah, C.
My eyes.
And no, ternary conditional is not good here.
 
agreed
 
@CheersandhthAlf I like how it says it was "generated by Microsoft (R) Optimizing Compiler"
 
3:30 PM
It's nested, and that's unreadable.
 
operation = strchr(input, '*') ? '*' :
            strchr(input, '/') ? '/' :
            strchr(input, '%') ? '%' :
            '0';
// readable now?
 
@RMartinhoFernandes Damn, I just edited my answer to include exactly this. It’s a pretty common idiom after all
 
no
 
@CatPlusPlus Why not, then?
 
3:32 PM
if you take the deleter by value, then std::move it
 
@KonradRudolph Yeah, it looks switchy.
 
x = (0?0
    : condition1?              v1
    : condition2?              v2
    : conditionN?              vN
    :     vELSE
    );
 
@DeadMG Couldn't deleter be a reference though? :S
 
char *x = strstr(input, "*/%"); operation = x ? *x : '0';
 
uh
no, not really
 
3:33 PM
Or something.
I don't remember how it went exactly.
 
@DeadMG Forwarding foo (i.e. no refs) moves it, no?
 
if you intend unique_handle or whatever it is to be a value, then it pretty much must have a value
 
@RMartinhoFernandes Robot markdown fail!
 
Or operation = *(x || "0");
 
@RMartinhoFernandes I don't think so. The argument is an lvalue, so I'd expect it to copy.
 
3:33 PM
But that's borderlining on silly.
 
@CatPlusPlus strstr doesn't do what you think it does.
 
@RMartinhoFernandes So forward or move or nothing?
 
Maybe.
I'm really slow today.
 
@DeadMG std::forward<T> always returns T&&.
So, if you pass it a non-refy type, you get back an rvalue reference, i.e., move it, move it.
 
hm, fair enough
 
3:35 PM
No Shame:
http://stackoverflow.com/questions/9798512/red-tube-api-method-getvideoembedcode
 
One more thing, POD() is value (zero) initialization, right?
 
@CollinHockey lol
 
Why didn't that expand?
 
@CollinHockey Markdown takes a break for multiline messages.
 
Markdown 100000000, chat users 0
 
3:36 PM
@Pubby I don't think value initialization is the same as zero initialization.
 
It's not even Markdown issue.
Oneboxing is orthogonal to Markdown.
 
@RMartinhoFernandes Isn't it the same for POD?
 
@RMartinhoFernandes it reduces to zero initialization for a POD?
 
Maybe.
I always get confused by those.
 
I guess it would be recursive zero initialization
 
3:37 PM
With struct POD { int a; };, won't POD().a; be indeterminate?
 
I never bothered to learn that.
 
@RMartinhoFernandes no
 
@RMartinhoFernandes No. The problem is POD foo; at e.g. local scope.
 
I think it's only indeterminate like this: POD p; p.a;
 
@LucDanton Ah, ok.
 
3:38 PM
Or auto p = new POD; p->a;
 
With no ().
Which is utterly stupid, but hey.
It's C++.
 
Is Lundin trolling me on the codereview thread?! Or did I overlook something here?
I’m just asking because he generally seemed like a sensible, likeable guy
 
like, it saves one xor instruction in the big mess of 80 lines of assembly for that factorial function :-)
 
@KonradRudolph Well, maybe 'the average C programmer' doesn't have any idea of what static typing is!
 
3:42 PM
@Luc Didn’t Linus rant about the fact that C++, rather than C, attracted sub-par programmers?
 
@KonradRudolph I think most differences over the issue of "best" are just because nobody thinks that the to them obvious context needs to be mentioned...
 
either way, if you know what an expression is and what a type is then you must be able to make the necessary inference
 
@KonradRudolph Well, it's definitely not unpredictable.
 
Not Linus' rants again.
Oh hey, Goblin Camp crashes on Windows compiled with MSVC, too.
Now I have no idea how the hell the released version even works.
 
Having a basic idea of how integral promotions work should be part of the average C programmer.
 
3:44 PM
The tax return/check system in Norway crashed yesteday, still down. A Windows-based solution developed by Accenture...
 
Basically, because they suck and bite you when you least expect...
 
Is there a faq/reference for integral promotions?
 
Oh look, we've got null shared pointers somewhere deep in the update loop.
 
If you start by "Everything becomes an int", you have already a good start.
 
Just use int everywhere.
> OGLTilesetRenderer::`scalar deleting destructor':
 
But I can't always use int :(
 
^ Since I worked there about 11 to 12 years ago, I think I am permitted to post this. :-)
 
True story: the reason why I switched to C from C# was because of bit fields. Hehe I was silly.
 
@CatPlusPlus MSVC10 on x64?
 
On x64, but x86 target.
 
3:47 PM
ah, cause there's an optimization bug for x64. Might've been that. Guess not.
 
It's not miscompile, it's logic bug. Those damn shared pointers.
 
wait... can people edit a question with out making it look like the edited... in particular this
 
Shared pointers galore!
 
@thecoshman If you edit within 10 or 15 minutes, it merges the change into the post without noting it.
 
@thecoshman There's a 5 minute window since it's posted (or last edit) when the poster can edit without a trace.
 
3:49 PM
Or maybe 5.
 
Oh I see
that's how people keep getting first posts, then editing in more info...
 
@thecoshman Bazinga!
 
I find it strange the way some one can get a half dozen up votes with in the first minute or two of posting an answer
 
There was a time when edited posts were sorted after non-edited posts.
 
@thecoshman twitter, facebook, C++ lounge sometimes...
 
3:52 PM
Then they added the 5-minute window so that people would not be penalized for fixing tiny mistakes.
 
And yet there's still silly auto-CWing.
 
@RMartinhoFernandes people should be penalized for posting "yes possible!" then editing a bit more info, then a bit more, then a bit more
 
Unless they removed it and I didn't notice.
 
@CatPlusPlus That doesn't hit very often now (since the 5-minute window applies to every edit)
If you do 100 edits in 10 minutes, it only counts as two.
 
I've never seen an auto CW?
 
3:54 PM
After enough edits, your post becomes CW.
Foreeeeeeeeeever.
 
The exact criteria is secret sauce, btw. My theory is that it's random.
Because it makes no sense.
 
I also don't see why the edit can not be traced
 
Wait a sec. The crash is not about the handle at all.
 
@thecoshman I do that by downvoting answers without actual content.
 
The fucking function pointer is null.
 
3:55 PM
surely, a post should only be CW if it's been edited enough times by the community?
 
Waaaaaaaaaaaaaaaaaah.
What the hell is glDeleteObjectARB, anyway.
 
To Meta!
 
@DeadMG Number of different editors is an ingredient too. But it can become so by yourself alone.
@rubenvb Use search. This is an undead horse.
 
Don't forget the pitchforks and torches!
 
Evil weather makes posts CW.
 
3:57 PM
@CatPlusPlus ARB... isn't that code for "Anal Rappage Bud"
 
I have posts with 10+ edits that are fine, but I've seen people complain about it kicking in after six edits.
@thecoshman Wut.
 
and don't forget to melodramatically proclaim that you're leaving forever if you don't get your way
 
Architecture Review Board or something.
Better than glDeleteObjectKhronos
That function doesn't exist in the core. :.
I love legacy GL.
 
It's an extension extension (as in suffix).
 
Hence the ARB!
 
3:58 PM
It must be an older shader extension.
 
I know what the ARB stuff is suppose to be, but in reality, it is mostly just a pain in the ass
 
@CatPlusPlus It's from the days of glCreateProgramObject and such.
Why the heck are you using that?
 
ARB_shader_object.
I don't. Someone else wrote that code.
I'm just trying to fix the damn thing.
 
Are you out of bullets?
 
Wait what's wrong with glCreateProgram? Or are you talking about the ARB version?
 
4:01 PM
That extension is written against GL 1.4.
There's just no point.
 
@Pubby glCreateProgram Object
 
Remove that, it crashes somewhere else.
 
Obviously.
Crap code is crap.
 
Hee hee, vector subscript out of range.
 
obviously
 
4:03 PM
I'm declaring this renderer FUBAR.
 
Are you the only one in that project that can actually write code?
It does sounds like it.
 
I don't know. It was working pretty well not that long ago.
Then life got in the way, contribution rate dwindled and now it's a mess nobody actually maintains.
 
Yeah, damn real life is always screwing with people's lives.
 
I don't know what really happened.
Maybe I've learnt more about C++ in the past two years than I thought.
SDL renderer. Everything is pink.
I mean, what the fuck.
 
It's rendering with SDL?
 
4:09 PM
Everything is pink and FPS is 12.
How am I supposed to trace pinkness.
 
Hire the Pink Panther?
 
user491135
hi thre
 
Woot, got my perpetual-motion-machine-that-even-generates-surplus-power running. Time to tear down the windmills.
 
@RMartinhoFernandes gratz on breaking the laws of physics
 
@RMartinhoFernandes what's this in reference to?
 
4:14 PM
soon the Physics Police™ will come arrest you for your violations
best hide the profits so you can get them after you leave jail
 
@DeadMG Dwarven science sneers on the laws of physics.
 
lol
wouldn't that be hilarious, though, if there was an in-game Physics Police that attacked you for building it?
 
Monty Python much?
 
it is?
 
They liked to have policemen intervene in their sketches.
Not to mention the ending of the Holy Grail.
 
4:16 PM
damn this drawf game >:(
 
well, I am quite a fan of Monty Python work
hehehe
the ending was hilarious, the French already had the castle with the Grail in :D
"Now go away, or I shall taunt you a second time!"
 
There's enough things attacking you in DF.
Like trolls equipped with mittens.
 
Or goblins that can breathe underwater because they're riding a crocodile.
 
that's your fault for violating the laws of physics :P
dang
trying to work collisions for bounding boxes that straddle the boundaries of the subnode bounding boxes and it's Not Teh Funsies™ :(
 
4:22 PM
Oh hey, screenshots don't work, either.
 
@sbi This was just a single header I made on the side, so no check in today!
 
Is there anything in this game that still works? dammit.
 
@CatPlusPlus The bugs?
 
> Protecting Game::itemList from null pointers.
And yet they still happen.
shared_ptr shakes fist
I wanted to do some quick fixes for current issues, but apparently that's impossible.
Back to ripping out large portions of the code and hoping I'll finish some day.
 
@CatPlusPlus the shakes fist thingy gives me pictures of fist shaking which probably not the fist shake you mean
 
4:26 PM
What?
 
I linked it to the wrong message
lol
 
What?
 
what type of fist shake could I be referring to?
NOT that
 
4:28 PM
I know you're referencing some porn-induced thing, but really, the thing with novelty is that it wears off after a while.
 
I guess I'm boring you then
I can leave too if you want
 
argh
 
lol, "porn-induced".
 
4:30 PM
I didn't say that. :.
 
Visual Studio, y u not replace with spaces when I say "Replace with spaces"
 
now I can't paste my code cause half of it is tabs rubbish
 
Visual Stdio? Why are you coding in C?
 
uhoh puppy's here
 
4:30 PM
Use vim.
 
:retab
Magically fixed!
 
Not magically fixed.
 
:set magic
Happy now?
 
I think cat is grumpy today
 
4:31 PM
isn't there some fancy unreadable sed command for this?
 
(For the losers non-vimmers out there, I am not making this up. This option exists)
 
eh, a simple regular expression fixes it anyway
 
Vim has magic, very magic, nomagic and very nomagic.
 
anyone want to read over my Octree code and just check it for me?
 
It's buggy.
 
4:32 PM
I would, but I've never written an octree before
 
Oh, wait, you didn't show it yet.
 
just assume it's buggy
ugh pastebin, use ideone
 
Wait, is that the one with the constructors from hell?
 
yes, but you can skip trying to check them :P
 
4:33 PM
ARargkfdhjgkdhf! It is! The goggles! They do nothing!
 
the constructors from hell :P
apt, my friend
 
I don't know why, but Event Horizon popped up in my mind.
 
Btw, (less+more)/2 also gets you the average. Is there a reason to write it as you wrote (I don't know, stability or something?)
if (z) {
    downrightback; // 101
Missing return.
 
if (z) berightback;
 
4:37 PM
@RMartinhoFernandes No, it just didn't occur to me, which is fairly unbelievable considering the simplicity of the algorithm
 
but then, at the time I was writing the Constructors from Hell™ so
 
I think Intersects is wrong.
 
my intersection logic isflawed
lol
 
Too drained of will and energy to review code.
 
4:41 PM
Ok, you saw it too. I don't need to explain then.
@LucDanton And this one is scary.
 
Eh, not so sure.
 
no, it's definitely broken- at the very least, I need to test both ways around
the test as written is only valid for boxes which intersect at corners, not at faces
 
And at the right corners for that matter.
 
pretty sure that I checked both corners
 
There are 8 corners.
 
4:43 PM
and for all of them, then you have to be inside the other box on all three axis
which is what LiesIn does
it doesn't care where you are inside the other box
 
"good C++ programmers usually stay away from memcpy entirely, and look on any usage as very suspicious, worthy of more close inspection & thinking." - Alf
 
None of the corners that define the box are inside the other box, yet they intersect.
 
I see what you mean now
 
@RMartinhoFernandes Drawing? Where can I upvote you?
 
4:47 PM
:P
 
> For an AABB defined by M,N against one defined by O,P they do not intersect if (Mx>Px) or (Ox>Nx) or (My>Py) or (Oy>Ny) or (Mz>Pz) or (Oz>Nz).
Wikipedia
time to do the old "Steal your algorithms from someone smarter than you"
 
always a good idea
 
@DeadMG It's called "not reinventing the wheel". Much more proper.
 
looking at the starred messages now, if VC sucks, why there needs to be more women programmers?
 
Now you look like you did something productive!
 
4:50 PM
lol
@CheersandhthAlf What?
 
@DeadMG But that's not quite what you have.
 
@DeadMG just silly wordplay, sorry
 
@RMartinhoFernandes I have a pair of AABBs which will handily define themselves as M, N and O, P?
 
(The negation of) that test is basically component-wise Alo <= Bhi && Ahi >= Blo. Your test is Blo <= Alo <= Bhi && Blo <= Ahi <= Bhi.
 
well
as far as I'm concerned, I know that my own original test was bad, I'm going to assume the one from Wikipedia is good, and that it returns true for non-intersection, so it's negation returns true for intersection, which meets my requirements
 
4:55 PM
Sure.
 
so I think I'mma declare it good
 
VS doesn't have std::move?
The algorithm, not the "cast with a name".
 
uh, yes, it does?
oh
there's a std::move which isn't "cast with a name"?
 
Yes.
Like std::copy, but moves.
 
well, I don't actually know
yes, it does have that
 
4:58 PM
But it's not applicable anyway.
 
right
 
Why is insert recursive?
 
so I'm gonna declare myself Teh Donezors™ W.R.T. this Octree malarky
@RMartinhoFernandes Which recursive call?
 
It looks infinite from here.
Line 124.
 

« first day (522 days earlier)      last day (4431 days later) »