2008-09-29

Indirection or abstraction?

A famous aphorism of Butler Lampson goes: All problems in computer science can be solved by another level of indirection; this is often deliberately mis-quoted with "abstraction" substituted for "indirection". Kevlin Henney's corollary to this is, "...except for the problem of too many layers of indirection."
Abstraction and indirection are very different yet cooperating concepts with two completely different purposes in software development. Abstraction is used to reduce complexity. Indirection is used to reduce coupling or dependence. The problem is that programmers frequently mix these up, using one for the other purpose and just generally screwing things up. By not knowing the difference between the two, and not knowing when to use one vs. the other or both, we end up with insanely convoluted systems with no real advantages.

2008-09-26

HP RAM extension

Here is the manual for RAM extension for HP Compaq nx9420. I'm now considering Linux (preferrably Suse as before) featuring VirtualBox running Windows and Mac OS for solid testing of the application we develop. This would obviously eat lots of RAM, but I know people are able to do Linux and virtualized Windows (some office apps mainly) using only 2 gigabytes, not 4 as I would like. Also it would be nice to swap on the memory of GPU (256 MB there), and use its (GPU's) processing power to boil some coffee. Anyway, KDE seemed more productive and convenient for me half a year ago when I was using it. The only problem was input language switching, but I would figure how to use my favorite Ctrl+Shift+number to switch that sooner rather than later. BTW, IntelliJ Idea (under Windows) still does not allow me to extract constant via Ctrl+Alt+C and Alt+R does not get to the Refactoring menu pulldown. Some kind of global shortcut override I guess?

2008-09-25

Limelight Networks :: Modern CDN

I don't believe this venture relies on sole hardware bandwidth, some academia needs to be involved. Looks like the infrastructure of this content delivery network does not rely on standard internet BGP routes for data replication among core peers.

2008-09-19

IO, NIO and Threading

Well, never thought about the issue, but apparently InputStream.read() is able to throw an instance of InterruptedException at its caller, while the interface states only the IOException. It's quite possible that I miss something, but anyway. Java NIO is a bit leaner in this regard as we have the ClosedByInterruptException.

2008-09-17

mock-testing and threads

Once again was badly burned on issues with moving code across threads. JMock reported failed tests as soon as some call made through the thread boundary. Apparently, we need ExecutorService injections and tinkering with our BaseWorker pattern to keep unit-testing effectiveness and maintainer sanity at the optimum. Those injections were discussed in great detail in the JMock Cookbook.

2008-09-10

Fast file digesting

Well, in case someone would ever try rock-solid digesting, here're my five cents on this matter:
Whirlpool is slow
Btw, the implemetation done by Paulo S.L.M. Barreto and Vincent Rijmen seems to be rarely used. There's no method to update with an array of bytes from a given offs position. Kinda ugly when you try to inject digesting amid a stack of Streams and/or ByteChannels.
I guess it's better to stick with CRC32, or something that very basic.