Humor Random Comments Thread

On calling clear() on a vector<std::string> my code takes a left turn and reenters at some random point. Seriously, how can one be a programmer and NOT believe in ghosts??
 
On calling clear() on a vector<std::string> my code takes a left turn and reenters at some random point. Seriously, how can one be a programmer and NOT believe in ghosts??

Did you turn optimizations off, before going into debug mode? :lol:
 
All the way off. It just... leaves. The next lines don't get executed anymore, instead the code continues somewhere else. Now, I had such things with memory violations that didn't directly result in access violations, but that really shouldn't happen on calling vector::clear.
 
All the way off. It just... leaves. The next lines don't get executed anymore, instead the code continues somewhere else. Now, I had such things with memory violations that didn't directly result in access violations, but that really shouldn't happen on calling vector::clear.

Yes, that happens when you step through a code, that was optimized by the compiler. This can change the execution order, that is why the debug build is done without ANY optimizations.
 
Yes, that happens when you step through a code, that was optimized by the compiler. This can change the execution order, that is why the debug build is done without ANY optimizations.

There are no optimisations active (that I can find). I must be corrupting the heap somewhere prior to calling that clear, and I'll massacre the bugger quite disproportionately once I find him, but currently I'm still in the denial stage of the bug-finding process...
 
Try looking at the disassembly.
Does it jump away on a non-jump instruction? Fault.
Does it go south into some lib? Anything.
Does it release the quantum for another thread? Multithreaded problem.
Etc.

Try using heaptrace-like things to find what is being lost.

Try taking a good night's sleep to recharge your obviousness detectors, then look at the code the next day.

If all else fails, imagine an alien sitting on a flying saucer near you, and explain the code to him, line by line (i'm serious!).
 
If all else fails, imagine an alien sitting on a flying saucer near you, and explain the code to him, line by line (i'm serious!).

That is what I tried to teach my co-workers at university... you have to know what your progammed code does and not what you think what it should do.

When looking at their code and the errors we get, it was quickly obvious why it failed, because the code was just copy and paste without understanding what it actually does.
 
Try taking a good night's sleep to recharge your obviousness detectors, then look at the code the next day.

That often helps, but usually I set a few breakpoints along the line to help my obviousness detector a bit. In this case, it started beeping quite loudly when I realised that the panel element to which the vector belonged is first initialised when the panel is called for the first time... which is not necessarily before a docking event wants to redefine the list :lol:

If all else fails, imagine an alien sitting on a flying saucer near you, and explain the code to him, line by line (i'm serious!).

My wife might look a bit funny... but wait, I could try explaining the code to her instead... :hmm:
 
My wife might look a bit funny... but wait, I could try explaining the code to her instead... :hmm:
...There is a reason they crash test cars with dummies instead of real people...
 
Sun shafts in Blender, are not the most simple and effective effect to add ... But are the most realistic way to show dirty air. Argh ! I'll be satisfied when Volumetrics will be implemented in Cycles. Sure.
 
I knew the UK got a lot of rain, but...wow.

aF8jYpd.jpg
 
Fun fact: The apparent magnitude of meteors is significantly lower when it's cloudy.
 
I knew the UK got a lot of rain, but...wow.

aF8jYpd.jpg

Stonehenge in Washington? What is this madness?!

Fun fact: When Stonehenge was built native Americans just populated the Arctic and learned how to make tools out of bone...
 
Stonehenge in Washington? What is this madness?!

Fun fact: When Stonehenge was built native Americans just populated the Arctic and learned how to make tools out of bone...

The rain got so severe it flooded the UK and Stonehenge floated towards Washington.
 
Back
Top