1,925 reputation
715
bio website kdgregory.com
location
age
visits member for 4 years
seen 23 hours ago

Dec
30
comment What is different between the internal design of Java and C++ that lets C++ have multiple inheritance?
One could even say that Java is vtables all the way down.
Dec
26
comment Algorithm to merge two sorted arrays with minimum number of comparisons
You could create some adaptive algorithm that attempts to use a merge size > 1, but that isn't going to get you significant savings. A better solution is to map the source arrays into a form that is inexpensive to sort. This, however, depends on your actual situation (and neither of your examples would justify it).
Dec
24
comment What'd be better? To add one more local variable, or to call a method twice in general case?
@Doval - Yes IO is a side-effect. In my original edit I only had two points, but then thought that someone would be sure to call me out on volatile reads. That said, I think that it's important to understand and recognize the difference between what I'll call "active" and "passive" side-effects: the former are caused by your action, the latter are caused by external action. In my experience, most concurrency bugs are a result of the latter, not the former.
Dec
24
comment What'd be better? To add one more local variable, or to call a method twice in general case?
@BartvanIngenSchenau - I always find that profiling leads to more dramatic code restructuring than simply introducing a variable.
Dec
24
answered What'd be better? To add one more local variable, or to call a method twice in general case?
Dec
23
comment Disadvantages of Pointers
For whatever reason, the chat page thinks that I'm not logged in. So to respond to your earlier comment, I've updated the tag wiki to give a better explanation of what a "pointer" is.
Dec
22
revised pointers wiki description
added 6 characters in body
Dec
22
suggested approved edit on pointers tag wiki
Dec
22
awarded  Tag Editor
Dec
22
revised pointers wiki description
greatly expanded, with examples
Dec
22
suggested approved edit on pointers tag wiki
Dec
22
awarded  Nice Answer
Dec
18
comment Why can't the Scala compiler give pattern matching warning for nonsealed classes/traits?
It's unclear what you're asking. Do you want the compiler to emit a warning if the match expression doesn't cover all possible inputs? Perhaps an example would make your question more clear.
Dec
18
revised Calculating physical address given only an offset for my process
add diagram
Dec
18
awarded  Editor
Dec
18
revised Calculating physical address given only an offset for my process
add diagram
Dec
18
answered Calculating physical address given only an offset for my process
Dec
9
comment Using reflection vs creating a new class
Are you able to reflect on the Egg to determine what components it contains?
Dec
8
comment Caching build results
Does sbt do what you want? And if not, why not? You might have to modify your build to create actual JARs for your sub-projects. But yes, the dependency management problem has been solved.
Dec
6
comment Distributing a set of “Jobs” across multiple computers
You would probably find Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions by Gregor Hohpe and Bobby Woolf useful. In their terminology, you use a Splitter to distribute work and an Aggregator to assemble the results. Specific implementations of those patterns, however, are completely dependent on your requirements -- to use maple_shaft's term, it's a data store of some sort.