Reputation
19,009
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
2 37 75
Newest
 Good Answer
Impact
~671k people reached

8h
comment How to find the cause of an exception in async code
or break on exception thrown (an option in just about all debuggers).
2d
comment Wondering what programming language this is?
that can be anything.
Feb
7
comment Encrypted content in games
A decryption key needs to be bit correct. game state will often use floating point or state that will not be bit exact (order of entities in pools not matching for example). So you'll need to compact the game state before doing any kind of keygen on it.
Jan
30
comment Polygon simplification that encloses original set of points
in other words get a convex hull (possible add some holes to it) and then triangulate it.
Jan
25
comment Can the “level 256 bug” in the game of Pacman be considered an unhandled segfault?
@B1KMusic not all buffer overruns result in a segfault. It depends on how the memory was allocated. If the memory is statically allocated (one big buffer manually split up in different zones) and the area immediately behind the last level was used for something (like sprite graphics) then it wouldn't segfault.
Jan
15
comment Retrieving an incorrectly stored tree data structure
Do you have an index on the parent_id?
Jan
8
comment How to properly reverse the if statement when you have two conditions in it?
@black-room-boy those mean different things, if you started from if (!($first && $second) ) then you have to use if (!($first) || !($second) )
Dec
15
comment Factories, vectors and smart pointers - Design Question
auto_ptr is not the right pointer in nearly all cases. unique_ptr is its replacement.
Dec
11
comment What is meant by reuse of inheritance?
@q126y did you read the pdf the quote is from, cs.auckland.ac.nz/~ewan/qualitas/studies/inheritance/…
Dec
11
comment What is meant by reuse of inheritance?
Every case of inheritance can be replaced with composition by use of a Pimpl (pointer to implementation) style delegation instead of overridden methods.
Dec
5
comment Number of parallel lines in a given set of lines
why not sort them by a/b (or atan2(b,a) )and check how long the longest run of equal slopes is
Dec
1
comment How to deal with a bug which seems to have fixed itself?
Depends on how serious the bug is. If it's just a layout goof then indeed a couldn't repro stamp and be done, but if it could be more sinister then a few hours to end up with a regression test can be worth it.
Nov
30
comment How to convert byte-array (4 bytes) back into float?
Depends on the language, in Java there is the intBitsToFloat and floatToIntBits while in C you'd do a magic pointer cast.
Nov
20
comment complexity of an algorithm, sorting 5% out
@LawrenceAiello no more like quick sort where instead of grabbing the median for pivot you grab the 5th percentile.
Nov
20
comment Write C line by line
run line by line or write line by line?
Nov
20
comment Is C programming language low level or high level?
the "level" of a language is relative. C is high-level compared to assembly but low leveled compared to javascript.
Nov
13
comment Why do Android programmers use Hungarian notation?
Cause that's what the tutorials use and the poor programmers don't know any better.
Nov
10
comment Using compound statements (“{” … “}” blocks) to enforce variable locality
That analysis only considers different types in different blocks but doesn't test your variant.
Nov
9
comment How to make sure people call methods in the right order?
unless you use ComparisonBuilder<ComparisonBuilder<ComparisonBuilder<Void>>> and blockEnd returns the type parameter. This is a pushdown stack. Though I'm not sure how far you can nest them.
Nov
9
comment How to make sure people call methods in the right order?
With generics you can add a type parameter BlockNest so that block() returns a ComparisonBuilder<BlockNest+1> and if BlockNest is 0 you disable blockEnd and enable build.