Reputation
13,821
Next privilege 15,000 Rep.
Protect questions
Badges
3 32 63
Impact
~495k people reached

1d
answered How do you address the problem of dealing with an external service that stores your data and you want to keep in sync?
1d
revised How do you address the problem of dealing with an external service that stores your data and you want to keep in sync?
typos
2d
revised When to use functions vs methods?
added 452 characters in body
2d
comment When to use functions vs methods?
@barlop: It must not. The notion of a function can even be missing from a programming language at all (look at your nearest Turing machine). Standalone functions do exist in many languages, and historically came much earlier than objects (even if we discount their use in mathematics). Using a class as a namespace is not unreasonable, but Java also has packages for namespacing, these could suffice. Improving an answer is a good idea, thanks.
2d
comment When to use functions vs methods?
@barlop: I did! Since the parameter is implicit (invisible), its omission is not visible in the signature. Java lacks "functions proper", that is, standalone functions that are not methods of some class. Static methods and lambdas (in Java 8) are used instead.
Apr
19
comment How to make interfaces usable for special classes only?
What is the problem you're solving? There likely is a better approach to it.
Apr
18
comment Clairvoyance in caching - optimal strategies?
I suspect that loading of level assets in a game engine is a similar problem. You can sort of predict what the player might need to see next, but all your assets cannot fit to RAM. You have to have a way to quickly determine and load the assets that are "local" to the player's position.
Apr
18
revised Caching in '3D' - data-structures and octree recursion - hrrm!
added 9 characters in body
Apr
18
comment Caching in '3D' - data-structures and octree recursion - hrrm!
Look at your right column of pictures. The idea is that points of a small cube, which is geometrically a part of the big cube as depicted, are stored together and can be read by one I/O operation. Disks don't read individual bytes anyway, as an atomic read operation they read sectors that are many kilobytes in size. Make geometrically close points readable in one operation "for free". Then OS caching kicks in.
Apr
18
comment Caching in '3D' - data-structures and octree recursion - hrrm!
Virtual memory uses something close to LRU, because once a page needs to be used, it needs to be pulled to RAM anyway. There's a complex interplay between virtual memory paging (pushing out pages that don't fit physical RAM at the moment), disk cache, and the need to minimize I/O while switching between processes that have pages outside RAM. I'm totally not an expert in the matter. What I offered to use is the ready-made I/O cache built into the OS by making data that are likely to be used together stored on the disk together.
Apr
17
revised Caching in '3D' - data-structures and octree recursion - hrrm!
added 17 characters in body
Apr
17
answered Caching in '3D' - data-structures and octree recursion - hrrm!
Apr
11
comment What are 'good' cases for subtype overloads
But usually a visitor (a listener, or another form of callback receiver) does not extend a base class, but rather implements an interface, so I suppose @david-arno's answer below is closer to truth. Using a completely abstract C++ class as an interface, as you do here, makes sense, too.
Apr
7
answered Are static global variables as bad as global variables? How to avoid using them?
Apr
1
comment How do I design concurrent scalable system with guaranteed ordering? How about Akka?
It looks like you need guaranteed ordering per ticker, otherwise things can run in parallel in any order. Is this correct?
Apr
1
reviewed Approve Authenticate user without password
Apr
1
reviewed Reject How to represent complex permissions system in single hash or set of characters?
Apr
1
reviewed Approve Is deep nesting of control flow in code a studied problem?
Mar
30
awarded  Great Answer
Mar
29
awarded  Enlightened