If you have ever taken a course in algorithms or data structures you’ll have seen big-O notation. For example you’ll know that a bubble sort runs in O(n²) time and merge sort in O(n log n) time. Maybe you have been explained that with big-O adding and multiplying by constants doesn’t matter, so O(1000n+1000) is …
Category Archives: Programming
Where Java system properties come from
The reference implementation of Java, OpenJDK, has been open source since a long time now, which means we can look under the covers and see the minute implementation details of anything we find interesting or the API doesn’t fully specify. For example, let’s have a look at how the system properties like file.encoding, os.name and …
Almost always, almost everywhere
There are two precise mathematical terms with names that sound delightfully imprecise: almost always, and almost everywhere.
When 0.3 is not 3/10
If you’ve taken a course in numerical computing you’ll be familiar with the various sources of numerical error. First you have representation error that arises when you have to represent a number with a finite number of digits. A common example: the decimal expansion for 1/3 = 0.3333… has a never-ending string of 3’s and …
Simple, Efficient, and Wrong.
I’m finally giving this thing a name of its own, paraphrasing a quote by H.L. Menken: For every problem there is a solution that is simple, efficient, and wrong. Reality has a nasty habit of getting in our way. Like icebergs, real problems have edge cases and complexities that mean most of the problem is …