Some Terms Every Programmer Must Know


The Problem: The problem is a specification of valid input and the acceptable output for each valid input. Input Instance: The inputs which fall in the set of valid inputs according to the problem. Size of Input Instance: The memory/storage space needed to represent the input instance. e.g. In Euclidean GCD example, the size of input instance will not be just the representation of the numbers say m and n, but the total of m and n. An Algorithm: An ...

Greatest Common Divisor: Euclid Style


Euclid out of nowhere proposed this algorithm which calculates the greatest common divisor of two numbers. The simplest way of calculating the GCD is probably the simple prime factorization method. But, Euclid was no common chap. He devised a way which calculates the GCD recursively. The idea was to simplify the problem each time, preserving the GCD. Lets discuss the algorithm, in order to understand it- getGCD(n, m) {    while(n % m != 0) {        r = ...

Programming and Mathematics


The fact is that programming and mathematics go hand in hand. Working for a service company has made me lame with my programming skills. Its sad but true that, my brain now doesn’t relax enough to work for self improvement. Although late in life, but I have understood that every computer science student is supposed to know his mathematics well. And here I am not talking about just weird numeric calculations. I am going to commit myself to algorithms now. ...
Death Note, The Movie

Death Note, The Movie


To begin with, lemme just state that I found nothing spectacular about the movie. However, the story line was intriguing and that is why the movie would appeal to any Indian viewer, as they aren’t used to such different stories. I’ve noticed that the asian movies(actually the eastern asia) are heavenly influenced by their folk tales, and so is Death Note which first used to be an anime series. However, in India mythology is a greater hit, that too on ...

Logging in an application


Why file logs over database logs? Why do we even need logs, when we have databases? Databases are cool for storage of data. But as far as log performance is concerned, log files are far better than databases. They prevent databases from getting heavier than they already are, reduce http requests. Also read/write is much faster than read/write of database. Log files look like the clear winner. Log4j Now that we have established that log files are much better than ...