Skip to main content

Posts

Time Complexity in Algorithms

When you are running an algorithm, it takes some time to run. If your computer is super fast, then your running time would be so tiny fractions of a second, but that time can not be absolute zero. We can call that time  as cost , since it's something like units. More running time, is more cost. You can't guarantee that, Your Computer with some tasks running in background, will take the same time as mine; with the same tasks running in background. It's dependant on both of our computers' CPU, Memory and so on. But I can tell that, my computer almost*  works in a similar manner, every time*. So I calculate that cost  and multiply it with some value for my computer, where as you can get that same cost  and multiply it by some other value for your computer. Calculating that cost,  is what we are about to do now. So if we are going to calculate the cost, the following things matter in a code. Statements Blocks Statements If you are using a l...
Recent posts

Introduction to Play Framework

Play Framework makes building web applications easier with Java & Scala. It is lightweight and in a web-friendly architecture. Play is a RESTful service by default, and built targeting modern web & mobile. REST stands for REpresentational State Transfer. For a great admiration, Linkedin uses Play framework in their infrastructure. We are going to create a simple Registration & login mechanism using Play Framework to understand about it. Note that we are not going to create a database or any permanent storages, so that your registration details can be used in login only until the current run is not stopped. 1. Setting up the environment I've used the following, in developing this login form Java Development Kit 1.8.0_121 ( http://www.oracle.com/technet work/java/javase/downloads/ index-jsp-138363.html ) IntelliJ IDEA 2016.3.3 ( https://www.jetbrains.com/ide a/#chooseYourEdition ) Scala plugin 2.12.1 installed ( https://www.scala-lang.org/download/ ) ...

MVC Design pattern

MVC stands for Model View Controller. This is a popular, and a useful design pattern. I'm coming up with simple explanations, for this very famous design pattern. What is MVC? If you breakdown any software, there will be 3 components in common : 1. Data (We are going to call it Model ) 2. Interface to view or edit the data (View ) 3. Functions that are performed on data (Controller) Why MVC? Any software is likely to be developed in a very dynamic way : in order to maintain re-usability. Your client (or lecturer - who gave you the assignment/coursework maybe) might be adding modifications to the initial requirements, so that you will have to revise the code so many times. Even if the requirement is just a minor change, improper coding style might lead you to several changes that occur like a chain.  Sometimes you might have to create the logic, whereas another person (or a team) is working on the UI. You will not know how will the UI look like until it is final...