Wikipedia has been described as “the encyclopaedia that works in practice but not in theory”. In theory, an encyclopaedia that anyone can edit should suffer from out-of-control trolling and vandalism, and collapse under its own weight in an instant. In practice, that hasn’t happened; vandals attack Wikipedia daily, but it still does very well as a useful source of information, especially if you bear in mind that its primary competition is not Britannica or other paid-for sources, but the rest of the Internet. Nonetheless, a recent controversy over malicious insertion of false information into Wikipedia had some concluding that the very process by which Wikipedia has “incurable flaws”.
Continue Reading March 9th, 2006
Paul Crowley
For a particular protocol we’re implementing, we need to fit some possibly large serial numbers (in the millions) into a rather limited number of characters (5); the answer, naturally, is to encode the number.
To give ourselves room, we decided to use base 64. Jakarta Commons has some handy codec classes, which saves us the number-to-character translation; so all we need is to convert our serial numbers into bytes.
For that, Tony came up with this pretty one liner in Scheme:
(define (number->bytes num) (unfold zero? (cut remainder <> 256) (cut quotient <> 256) num)
The body works in general for base conversions 10 -> something; for example,
(unfold zero? (cut remainder <> 16) (cut quotient <> 16) 257) -> (1 0 1)
March 8th, 2006
mikeb
My colleagues and I have just spent over a week tracking down a
repeated OutOfMemoryError in a fairly complex web application. In the
process we looked at the jmap and jhat memory profiling tools for the
JVM.
Continue Reading March 8th, 2006
matthias