Reputation
2,335
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
10 16
Newest
 Yearling
Impact
~89k people reached

Dec
6
answered What actually happens in inheritance (java)?
Nov
29
comment Rationale of IEEE754 direct rounding behavior near infinity
This is an educated guess, not an answer: implementations perform calculations with a higher precision than results, and rounding occurs as part of conversion of this higher-precision form to double. I would agree, however, that that the best explanation is alcohol.
Oct
29
awarded  Enlightened
Oct
29
awarded  Nice Answer
Oct
29
comment Cache Json on disk with fast read back in java/android
Second, this code doesn't provide any indication of how you might be serializing your data -- unless all you're doing is reading and writing the string value of the JSONArray as UTF-8 bytes. In which case, use the simpler (and bug free) code.
Oct
29
comment Cache Json on disk with fast read back in java/android
First, you have two bugs in your code: available() does not do what you think it does, and you're ignoring the return from read. Rather than tell you why these are bugs, I'll point you to the docs. You'll also find that DataOutputStream and DataInputStream have a better way to write strings than what you're doing.
Sep
24
comment Multi-tenant database design
+1, shared-nothing designs are much simpler, and the reasons against them always seem to be premature optimization (or ethically-dubious aggregation of data).
Sep
4
comment Is recursive-descent parsing a panacea for DoS threats posed by 'Evil' regexes? Or does evilness stem from the grammar?
You do realize that the "evil" regex is something that you create, right?
Aug
7
comment How do I bundle library files for use in branches?
@DocBrown - I repeat: I wrote exactly what I meant to write. While I don't believe that artifacts and source code belong together, that does not mean that they can't be stored in the same repo. I just think alternatives are better. Feel free to post your own recommendations, I don't feel like getting into a debate in the comments.
Aug
7
comment How do I bundle library files for use in branches?
@Ixrec - "local" copy, sure, but why in the source control repo? Perhaps I've been spoiled by the Java ecosystem, where Maven Central has been a reliable resource for ten years or so. But even when I was writing C code back in the 80s, we kept our source separate from our builds.
Aug
7
comment How do I bundle library files for use in branches?
@DocBrown - no, I meant exactly what I said. In my view, libraries are dependencies used by your source code, and artifacts produced from your source code, but they are not source code in themselves. You may have a need to store libraries-as-dependencies in a locally-managed repository, but I believe that even there a source code management system with its "forget nothing" design is inappropriate.
Aug
7
answered How do I bundle library files for use in branches?
Aug
7
comment How do I bundle library files for use in branches?
Why is it a big issue? As others have pointed out, the space is only consumed on the client, not the server. And there are many techniques for minimizing that space, the simplest being to delete the branches once you've merged them to trunk. You can also use --depth and --set-depth to control what gets pulled to the client. Or you can create an archived-branches directory where you svn mv branches after merge (although, really, deleting them is far better).
Jul
26
comment What should JITed bytecode do exactly?
Another geezer data point: the DEC PDP-11 Fortran compiler from the 1970s also used a threaded interpreter. They might have done it for ease of implementation, but I strongly suspect that they wouldn't have done it if the performance was bad (and that was pre-cache, with a machine architecture that was flexible enough to run the processor backwards).
Jul
26
comment What should JITed bytecode do exactly?
@delnan - Forth is extremely cache friendly, so I would not be surprised at that claim. Whether you could write (and maintain) a Forth program that's equivalent to an arbitrary C program is another matter (caveat: it's been 30 years since I used Forth professionally, so take that comment with a grain of salt).
Jul
11
comment long (or bizarre) file paths
And as a general comment: why not just store on the heap. Perhaps as a linked-list structure where each node holds an arbitrary-length path component? Yeah, it's overkill for tiny pathnames, but I suspect that it won't be called so often that the overhead is noticeable.
Jul
11
comment long (or bizarre) file paths
One example that I've seen of excessively long paths are Scala (generated) classfile names. There are many Scala projects (including the compiler itself) that you can't build on eCryptfs (the default home-directory encryption on Linux), which has a 240 character pathname limit.
Jul
11
comment Why is heap size fixed on JVMs?
@Ben - yep, you're right. And my second sentence points out that there are alternatives. I don't, however, agree that a fixed-size heap is the wrong way to manage GC in the general case. A properly tuned JVM uses the "right" heap size; in my experience long GC pauses happen when the JVM hasn't been properly tuned. And often the "right" heap size is far smaller than you might think.
Jun
27
answered Is Logger.getLogger(MyClass.class) the best way to initialise log4j loggers?
Jun
26
comment Is Logger.getLogger(MyClass.class) the best way to initialise log4j loggers?
That said, I prefer loggers as instance variables rather than class variables, so eliminate the static keyword and replace Foo.class with getClass().