My foremost goal while building software is to build stable self-healing systems with deterministic behaviour. I want to ensure my code continues to work even when unexpected events occur. In the event of unknown unknowns, the expectation is a graceful degradation in the worst case. This requirement is even more important when implementing high-risk projects. … Continue reading Guaranteeing software behaviour
I recently ran into a code puzzle; the question asked for the finding the unique element in a list of integers given that every integer appears twice except the single special element. My first solution You could use an array to hash elements to buckets (sort of like counting sort) and then flip their values … Continue reading Adventures with XOR
Bit masks enable the simultaneous storage and retrieval of multiple values using one variable. This is done by using flags with special properties (numbers that are the powers of 2). It becomes trivial to symbolize membership by checking if the bit at a position is 1 or 0. How it works Masking employs the bitwise OR … Continue reading Understanding Bit masks
A tail call is the last call executed in a function; if a tail call leads to the parent function being invoked again, then the function is tail recursive. In the first function - foo; the baz() function is a tail call while in foo2, the baz and biz are tail calls because both are the … Continue reading Understanding Tail Recursion
Static, dynamic, strongly-typed and/or weakly-typed; the terms we routinely use to describe typing in programming languages. However, these terms (especially the last two) have more to them than is generally assumed. There is actually no widely-agreed upon definition for strong and weak typing – there are way too many contradictory views. Good news is that everyone agrees … Continue reading Programming Language Type Systems I
Have you read Gulliver's travels? If you have then you must have read about endianness. The Lilliputians were divided into two factions over what end of an egg to break – the big end or the small end. Isn't it interesting that such a petty and seemingly trivial issue caused both parties to become embroiled in … Continue reading What Endian are you? Big or little?
One of the recent trends in IT is virtualization and it has caught on fast. There is hardly any person in computing that has not heard about it. Some are more familiar about its intricacies but everyone doesn't have to be an expert in this seemingly esoteric field to use it. Here is an introduction … Continue reading Virtualization
Cloud computing has been touted to be the future of computing. Trends suggest a move towards web-based software applications and services. The claim has been further strengthened by the emergence of companies offering cloud-based services to computer users. (e.g. Google Docs). The underlying principle of cloud computing is to have servers offering access to computing … Continue reading Cloud Computing, the future of computing?