As I stood there watching those drops falling downhill, I could feel how powerful they are, with no beginning, with no end, they are moving like they don’t care about who is watching them. The serenity, the peacefulness in the noise of the fall is something I could give away anything in the world for. 180 away from the […]
Better than Yesterday
Different ways of rendering a variable using EJS
The simplest way of rendering a variable is using the scriptlets, similar to the ones used in JSPs <%= variable %> But if you want your code to be rendered or executed but not printed then render it like this: <% variable %> If you want your code to be evaluated as well as rendered (ex: variables containing […]
How to render ng-repeat in reverse order
Many times you would like to render the array contents in reverse when using ng-repeat. You can do that with a simple single line code which uses the slice and reverse method. <tr ng-repeat=”subs in subjects.slice().reverse()”> </tr> The disadvantage to this way of printing the data is that the original array contents get reversed taking up your […]
How to install the latest nodejs version in ubuntu
As of writing this article the latest node version was 4.2.4, you can install this one using the distribution from NodeSource repository: sudo apt-get install curl curl –silent –location https://deb.nodesource.com/setup_4.x | sudo bash – sudo apt-get install nodejs You can find all the sources here, https://github.com/nodesource/distributions/tree/master/deb Then, you have the latest version of node.js installed.
Parkinson’s law on productivity
Parkinson’s law states that work expands to fill the time available to complete it . Can you think back to the fifth grade when the teacher gave you three months to complete your report? You probably could have done that in a week but instead you waited till the last day and were trying to […]
The Strange Bystander effect
Human psychology is a fascinating subject especially when it comes to strange behaviors that we show sometimes. Take for instance the Bystander effect. Suppose you are in a crowded place and you meet with an accident, in that emergency situation you would expect more number of people to come to help you but countless experiments […]
The Four Color Theorem
Four color theorem states that any given plane figure separated by lines can be colored using not more than 4 colors! First proposed in 1852 when a man named Francis Guthrie who was coloring a map of the counties of England discovered that he was able to color all the adjacent countries using only 4 colors […]
The mysterious and beautiful 6174
My favorite will always be 1.618 (The Golden Ratio) but 6174 fascinated me recently mainly because of the mystery it carries. It was in 1949 when an Indian mathematician named D. R. Kaprekar, devised a process now known as Kaprekar’s operation. This was published in “Scripta Mathematica” which was a quarterly journal published by Yeshiva University. […]
Many ways of writing the Fibonacci series program using Java
This is supposed to be a super simple program but how many ways can you write it? Here are a few. Program 1 – Fibonacci with 2 temp variables public class Fibonacci { public static void main(String[] args) { int n = 10; […]