Archive for March, 2006

A trust metric enabled Wikipedia?

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 2 comments March 9th, 2006 Paul Crowley

Base conversions in Scheme

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)

Add comment March 8th, 2006 mikeb

Java memory profiling with jmap and jhat

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 6 comments March 8th, 2006 matthias

Calendar

March 2006
M T W T F S S
« Jan   Apr »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Posts by Month

Posts by Category