Saturday, July 25, 2015
Cassandra Data Modelling
Sunday, July 19, 2015
Thursday, May 28, 2015
Practical Software Design Principles
Practical Software Design Principles
- Before designing a module visualize what it would look like when it is completed. It gives a great perspective when you can actually visualize the end products and makes designing the individual components which make up the module easier.
- Do not realize too heavily on UML diagrams for creating the initial design. Flow diagrams which show the data flow and API calls along with the API documentation make up for a sufficiently good design documentation. UML is not bad, its just that it is not necessary to know it.
- The best way to understand the design of a system is to go through the code. Design for a software keeps on changing, no matter how good is the initial design. This happens because new requirements keep coming in and the design documents are generally not updated as frequently, so a well documented code is the best way to understand the design of a system.
- Refactoring is inevitable. There can be n number of reasons, why we need to refactor our code. Refactoring does not mean that the design is not good. The aim should be that the design should be such that it is open to change and change easily. Also the changes required should be minimal like removing a method, extracting some method as a util method so that it can be called from various parts of the code.
Tuesday, March 17, 2015
A comparison of major hadoop distributions
A more detailed comparison is available at this link below:
Hadoop Distribution Comparisons
Monday, January 12, 2015
Some Puzzles and Solutions
1.
Puzzle 1:
Problem: you have 100 doors in a row that are
all initially closed. you make 100 passes by the doors starting with the first
door every time. the first time through you visit every door and toggle the
door (if the door is closed, you open it, if its open, you close it). the
second time you only visit every 2nd door (door #2, #4, #6). the third time,
every 3rd door (door #3, #6, #9), etc, until you only visit the 100th door.What
state are the doors in after the last pass? which are open which are closed?
Solution 1: A door will be closed when an even number of passes are made at it and open when an odd number of passes are made at it. To determine the number of passes at a door consider the door number 4. It will be passed during 1st, 2nd and 4th visit, which means it will be passed 3 times, which is an odd number so on final pass it will be open. Similarly, door number 8 will be passed on 1st, 2nd, 4th and 8th visit, so door 8 will be passed 4 times which is an even number, hence the door will be closed on final pass. Now the number of passes for 8, which is 4 is actually 8's divisor, similarly there are 3 divisors for number 4.
Now as we know 'When the number is a square, the number of divisors will be odd. When
it's not a square then the number of divisors will be even.' So all the square integers like 1,4,9,16,25,36,49,64,81,100 will have odd number of divisors, so at the end only these 10 doors will be open.
Subscribe to:
Comments (Atom)

