Monday or Tuesday

Monday and Tuesday were close friends from their childhood. They were neighbours. They had lot of things common in their gardens. Monday had 5 cactus plants and Tuesday had 4 cactus plants. Tuesday had 3 strawberry trees and monday had two. Both of their houses were fenced heavily. So people found it difficult to pass through their garden. Even though both of them had almost the same type of garden, Monday is the one which got all the scolding from people. Because it was the first on the path they had to pass through everytime after Sunday, whose garden is fresh and easy to pass through. Tuesday will be little happy inside since monday got all the scolding, but it kept its joy as a secret and didn’t reveal it to anyone.

monday-tuesday-gardenOn the contrary to Monday’s and Tuesday’s garden, Sunday’s garden was so blissful. People felt pleasant, peaceful and fresh in Sunday’s garden. Even though Sunday and Monday are neighbours, nature of their gardens seem to be so different. People usually were very happy eating the strawberries, swimming in the pond and playing in the tree shades in Sunday’s garden. Even after having all these wealth, Sunday too had a worry. Since it spent all its wealth in making people happy, it didn’t get a chance to make friendship with Monday. So Sunday was jealous on Monday since it had Tuesday as it’s close friend.

Monday and Tuesday got into a big quarrel once. No one knows that the quarrel was a coincidence or it is because of Sunday’s jealous. Monday and Tuesday usually gets into little quarrels and later they console each other and be close friends as usual. But this time it was different, the fight become bigger and bigger. At a point it seemed they won’t be friends there after. Wednesday was a wise guy who lives next to Tuesday. Wednesday wanted to bring peace between Monday and Tuesday. To do that it must find what was the problem and must resolve it. Thursday, Friday and Saturday also came to support Wednesday.

When asked about the problem, Monday hesitated to tell but Tuesday came forward and said that, without its knowledge, Monday got fertilizers from Sunday and made its garden more green with more trees, more fruits, more shade and that increased the water level in Monday’s pond. This in turn made people happy who passed through Monday’s garden. So now people started scolding Tuesday since they felt pleasant with Monday. Since they were close friends Tuesday felt that Monday should have shared fertilizers with it. Monday defended itself by saying that it managed to get very little fertilizer from Sunday, which was sufficient only for its garden.

After hearing statements from both sides, Wednesday analysed the inner reason for this problem and came to a solution. Wednesday said, “people’s mood doesn’t change because of your garden but it changes with their own mindset. They have to work hard on planting trees in each garden to see the growth in the next garden. Since they work fruitfully in Monday’s, Tuesday’s, Wednesday’s, Thursday’s and Friday’s garden. Finally without even working on Sunday’s and Saturday’s garden, they could see it’s well grown. If this equilibrium is broken and people stops working on any of the garden then even Sunday’s garden will become a waste land.”

“All our gardens has more or less the same number of cactus, strawberry and lychee trees. Even the pond sizes are almost the same. People tend to see the strawberry and lychee trees when the work is less and they feel pleasent. On the hectic times , cactus worries them the most. These all depends on what they see. There are times when people find disturbed with even Sunday’s garden also. Monday’s growth with fertilizers are not going to last longer. Next time when people pass through Monday’s garden, they will find the old and regular growth and again they will be upset.”

“Who knows sometime even Tuesday’s garden will also be well cherished and again it will come back to normal. Monday is used to hear all the people scolding so it is able to withstand it. Since it happens very occasionally for Tuesday, it created a big scene out of it. Even Sunday is not totally happy, it doesn’t have a close friend to share its happiness. Everyone have their own happiness and Sorrow. First we must understand the environment that will explain us the situation. Understanding a situation will help us react to a problem in the right way. So we can avoid over reacting or under reacting to a problem and making a mess out of it”. Wednesday’s explanation made Tuesday to understand the conflict and it apologized to Monday and they remained close friends forever.

Install Android 5.0 – Lollipop in Samsung Galaxy S3

Lately, I have been  facing a lot of performance-related problems with my Samsung Galaxy S3. I know the phone is  old when compared to the ones that are available in the market today. Snow White Jr.,(that is what  I call my S3) started to perform very slow. To read a Whatsapp message, I had to wait for forty to fifty seconds. When I turn on the Wi-Fi, for next thirty seconds the screen freezes.

To make my weekend productive, and to get rid of the slowness of my phone. I planned to install Lollipop on my mobile. To do that, I had to first root my phone. Only then was I able to come out of the restriction that Samsung has built into the phone.

Rooting Snow white Jr.

Steps that I followed:

1. I pressed the Volume Down, Home Center, and Power buttons together for about 20 seconds until the phone reset itself and showed an option to get into recovery mode.

2. Once in recovery mode, I connected the micro-USB cable from Geno (my laptop) to Snow White Jr.

3. Next, I downloaded from and unzipped it.

4. I opened the odin3 .exe file that was in the unzipped folder to start ODIN. As per the instruction, the application must highlight the COM number but it didn’t get any at first. So I unplugged the Micro USB and re-plugged it. Then there was a yellow highlighted box with a COM number.


5. In the “PDA” file option, I uploaded the “CF-Root-SGS3-v6.1.tar” file in the GalaxyS3Root folder.

6. In about 10 seconds, Snow White Jr. rebooted and went into ClockworkMod Recovery. And that the ODNI app showed a “PASS!”.

7. After rebooting the phone, I could see “SuperSU” , which is the Superuser app.

8. I verified the root permission by running a rooted app(Titanium Backup) and found it was running alright.

9. I can now get into ClockworkMod Recovery anytime by holding down Volume Up, Center Home, and Power button together for 20 seconds.

Upgrading the OS:

And by now, I have crossed only half the issue. To install the custom OS:

1. I downloaded the following files

a. The OS image file from

b. Google play file from

2. Then I copied those files to my external SD card, because if I wiped the memory of the phone, I would not be able to access files that are not in the SD card.

3. Now, I again went into  Recovery mode and performed the “wipe data / factory reset” and “wipe cache partition” operations. This action removed the old OS files. There comes the shock, but, thankfully, I have already backed up my photos and app data. So I continued without any problem.


4. Then I chose “Install zip from SD card” and selected the OS image file for installation. This is the ‘hero’ step and it took less than a minute to finish.

5. After successfully installing the OS, I went to the previous step and chose “gapp” zip file and installed it.

6. Tada!! I got Lollipop running on my phone.

After installing the new OS, I found a lot of interesting features that were available in the update. I will write about these next weekend.

Learn you node – Part 1


Thought of learning node and started searching for tutorials on Google. And I finally ended up with “Learn you Node”, which was actually funny, simply and informative. I immediately dived into it and made my hands dirty.

Here is the best solutions for each of the exercises.

Exercise 1: Hello World

Write a program that prints the text “HELLO WORLD” to the console (stdout).


console.log('HELLO WORLD')

It is a tradition to write “Hello World” as the first program, while learning a new programming language.

Exercise 2: BABY STEPS

Write a program that accepts one or more numbers as command-line arguments and prints the sum of those numbers to the console (stdout).


var total = 0;
 process.argv.forEach( function(e, i) {
 if (1 < i) {
 total += +e;

To receive the arguments passed to the program, use “process.argv”, where “process” is the global object in node with argv property which has the complete command-line. Output of “process,argv” will be

[ 'path/to/your/node.exe',
 '64' ]

Always the first value will be the path of the node file and the second will have the path of the file that is executed currently. To add the arguments sent to the file, start accumulating from the second index. So comes the line

if (1 < i)

Finally, echo the total.

Exercise 3: My First I/O

Write a program that uses a single synchronous filesystem operation to read a file and print the number of newlines it contains to the console (stdout), similar to running cat file | wc -l.


var fs = require('fs');
var file = fs.readFileSync(process.argv[2]);
console.log(file.toString().split('\n').length - 1);

Here the real serious programming starts, node has tons of extensions and modules. One such modules is “fs”, which stands for filesystem that comes from the node core library. As learned from the previous example, here we get the name of the file to read from “process.argv[2]”, because first two arguments to argv is occupied by path to node and the program file.

Then to count the number of chars in the file, convert the Buffer object to string and split it into array with newline character and count the words.

Exercise 4: My first async I/O!

Write a program that uses a single asynchronous filesystem operation to read a file and print the number of newlines it contains to the console (stdout), similar to running cat file | wc -l.


var fs = require('fs');
var file = fs.readFile(process.argv[2], function (err, data) {
 if (!err) {
 console.log(data.toString().split('\n').length - 1);

Here use the same “fs” module to read the file but this time with “readFile” method to read the file asynchronously. Since the file fetch happens asynchronously, we cannot expect the content of the file in the next line. Use callback to get it and do as done earlier.

Exercise 5: Filtered LS

Create a program that prints a list of files in a given directory, filtered by the extension of the files. You will be provided a directory name as the first argument to your program (e.g. ‘/path/to/dir/’) and a file extension to filter by as the second argument.

var fs = require('fs');
var path = require('path');
var file = fs.readdir(process.argv[2], function (err, list) {
 if (!err) {
 list.forEach( function(file, i){
 if (path.extname(file) === '.' + process.argv[3]) {

This program adds spices to our delicious feast. Use “readdir” to get the list of files in a given directory and walk through each file and find its file type with file extension using the “path” module.

ஆண் !

பெண்ணாய் பிறகாதவன்
எல்லாம் ஆண் !

XX சேராமல்
XY சேர்ந்தவன்
எல்லாம் ஆண் !

கருவுறுதல் பெண்மை
கரு உருவாக்குதல் ஆண்மை !

கரு உருவாக்கும் தன்மை
இல்லாதவனும் ஆணாக முடியும்

ஆணா ?

ஆணா ?

எது ஆண்மை ?

Ever wondered to know thoughts of an animal?

From my childhood, I always use to guess what a pet animal will think about its owner. We the owner of that pet think we are kind to that animal and we give it healthy food and love regularly. But I am not sure all the pets will understand the love of the owner towards it. Personally I feel the freedom of that animal is restricted by making it a pet. I may be wrong because I too never heard any animal speak my language. I am simply curious to know how they think and how will it respond to our reactions.

I know that most of us would have had the same kind of curiosity to know the thought process of animals. Recently I came across a technology developed by a group of Scandinavian visionaries, who call themselves as “Nordic Society for Invention and Discovery”.



No More Woof” is the product that they have developed to hear what your pet talks. The project is in its cradle stage now, they don’t even have a working prototype of what they have envisioned. But the initiative was good. Right now they are only concentrating only on dogs. Since its quite obvious that dogs are the best friend of man. That’s why cats choose to turn deaf ears to their owner’s voice, even after recognizing it, a Japanese scientist recently invented.

It will be really fun and very informative to know how the other animals talk. The technology that is used to read the animal’s thoughts is by detecting the electrical signals generated in the brain for feelings.  Lets see how this comes out.

Use Google analytics from different domain or localhost

Google has updated their Analytics API code so that “ga.js” script will become deprecated very soon. Google recommends the new users to use the “analystic.js” version for future use. Even though the new version is still in beta, it works just fine.

While using the new version of Analytics script, I had to test the code from localhost and from different domains other than the one which I provided while creating the account. Since the domain provided in the code and one in the account information are different the visits weren’t got tracked.

After Googling for some time, I came to notice the domain name that has being provided in the code. So the Analytics API accepts the tracking information received from the specified domain. To override that functionality and send data from other domain or from localhost, extra parameter needs to be added.

Here is the general script provided by Google.

ga(‘create’, ‘UA-xxxxxx-1′, ‘’);

Change the above code like the below one to make it work from other domain names.

ga(‘create’, ‘UA-xxxxxx-1′, {‘cookieDomain': ‘none’});

There are also other kind of customization available like new page view can be identified. Button click, drop down change or anchor click events can be captured and those elements can be tracked by sending the customized parameters. To know more about these functions please visit The Introduction to Analytics.js.

Localize Your Site Contents with Google Translate Gadget

Google was providing the API to translate the website contents for free but now it has been updated to Google translate v2 and the service is no more given out for free. But there is a alternate way to translate your site into any Google translate supported languages by using the gadget they provide.

To do that go to the below link

There you can find the step-by-step procedure to add the widget to your website.

In the first step: “Website Info” enter the website url where you need the translate script to run and choose the original language in which the website carries the contents.

In the next step “Plugin Settings” choose the options as per your requirement.

On completing these two steps finally you will get two tags to be inserted into your source files.

Place the given meta tag before the close of the head tag in your files and place the below snippet where you’d like to display the Website Translator plugin on your page.

You are done now!!!

View demo Here:

Extract – MySQL command to play with DATETIME

Ever wanted to split a datetime into date, time, seconds or hours in MySQL command instead of bringing it into php and processing it? here comes the solution in PHP we have simple date command to do this.

 string date ( string $format [, int $timestamp = time() ] )

Where date() return the current time or the any time given in timestamp into required format such as

date(‘d’) – returns the present date of the month

date(‘n’) – returns the month in numeric

In the same way MySQL also carries a similar command to parse the date into required format.

EXTRACT(unit FROM date)

this  function is used to return a single part of a date/time, such as year, month, day, hour, minute, etc.

the input for ‘unit’ can be anything of the below.

Unit Value

So in a table ‘order’ where it has a column named ‘OrderDate’ with the order creation date in the format ‘YYYY-mm-dd’.

EXTRACT(MONTH FROM OrderDate) AS OrderMonth,
EXTRACT(DAY FROM OrderDate) AS OrderDay,
FROM Orders
WHERE OrderId=1.

The above command will return the year, month and day from the db seperately.

Reset Magento Admin Users password

Whenever you wanna change the Magento’s Admin password directly in the database or wanna cross check the encrypted password in the db with the plain text password, you need to generate the Salt password hash. In the ‘admin_user’ table of your Magento database, you can find all the admin users password. In those password fields, you can notice the last to characters added to the string after the ‘:'(semi-colon). That is the Salt for your installation.

The password may be seem something like this


In the above case K5 is the salt. If the have the raw password and wanna generate the encrypted password, you can do the following

echo md5($salt.'yourpassword').$salt;

Where $salt is the last two characters of your encrypted password that you found in the previous step. Since md5 is used for encryption, there is no decryption exist.

Sort Products by review count in Magento

The product collection in magento can be sorted by the direct product attributes like name, price, sku, created time, etc., by the following way.

$productCollection->addAttributeToSort(‘name’, ‘desc’);

If you want to sort a product collection by the number of review the product has received, there raises the complexity.

Because, ‘reviews_count’ is a attribute available in RatingSummary class and it is not directly related to Product Collection. So to sort products by their reviews count. We need to traverse the collection and obtain the reviews_count attribute from the RatingSummary class and add it directly to the product collection. Following is the snippet for performing the above mentioned task.

$newarray = array();
foreach ($this->_productCollection as $product){
    $rating_summary = $product->getRatingSummary();
    if($rating_summary != null){
        $reviews_count = $rating_summary->getReviewsCount();
        $newarray[$product->getId()] = $reviews_count; 
    } else {
        $newarray[$product->getId()] = "0";
if(is_array($newarray) && count($newarray) > 1){
    if ($sortDirection == 'asc') {
    } elseif ($sortDirection == 'desc') {
    $merged = $this->_productCollection; 
    foreach($newarray as $k => $v) {
        $item = $this->_productCollection->getItemById($k);
        if (!$merged->getItemById($item->getEntityId())) {
    $this->_productCollection = $merged;

here the ‘$sortDirection’ variable carries the value in which way you need the products to be sorted. And finally at the end of the code you will get the product collection sorted by its number of reviews for each product.

happy Coding!! :)