Javascript: Decode a string url encoded with PHP

Sometimes you may face a problem when you have to decode a string with Javascript which was originally url encoded with PHP. This can be an API response or cookie set by PHP setcookie function.

A simple way to do this is through decodeURIComponent function in Javascript. But it leaves the “+” signs in the string. For that we can use replace function to replace all the “+” signs with space. Remember, simply using replace function sign will only replace the first occurrence in the string. To replace all the occurrences, use the regex version with g flag.

Here is the code for your reference-

var decodedString = decodeURIComponent( encodedString ).replace( /\+/g, ' ' );

Here encodedString is the url encoded string received from PHP.

Its that simple!

If you have any other method, do share in comments.

Happy coding!

I missed you too

I missed you tooI missed you.

It was the best she ever looked. She was determined to fix everything today. Her flowing hair shining like gold fluttered through the breeze. Once again she looked at her cellphone mirror. “Perfect. He would love to see me.” She said to herself.

It was a bright day, full of sunshine. As she walked by the corner of the main market road, her eyes followed her image reflecting in the huge front glasses of the shops. “He still loves me like old days. We will be together now.” She couldn’t resist talking to herself.

After a long walk along the market main road, the residential area was in sight. She took a deep breath to prepare herself once again. She felt even more confident causing her to speed up. The white castle was now just a few steps away.

It was a small bungalow painted pure white. When sun gazed at it in broad daylight, it shined like a dazzling white monument surrounded by lifeless stones. She crossed the gate and walked inside into the main hall.

He was sitting in a corner on a wooden chair with a small table in front of him. There was a glass chess on the top of the table and it seemed like the game was at full swing. He was in deep thought thinking about the next move and didn’t notice her arrival.

She quietly walked towards him and sat on the empty chair opposite to him. He was still immersed in the game looking into the emptiness. Something clicked and he rose his head with a huge smile. “Check & mate.” he cheerfully declared. His eyes were shining like he has won the world.

She looked at him & smiled. His happiness made her happy. His joy made her cheerful. For a while, she forgot why she was here and felt the moment. He won. She felt as if she had won too.

She waited for a few seconds as he settled down. As he rose his head, he finally noticed her. Along with the smile, a tear came rolling down his cheek. He was speechless. She was as beautiful as she had always been.

He rose up from his chair and moved towards her. She rose up too. He hugged her so tightly as if this moment was going to last forever. It was what they both always wanted, to be together.

A loud voice startled them both. “How dare you?” A huge man appeared from the inner house with an angry face. “Get out now, or I will call the police.”

He froze and felt helpless loosening his arms around her. But she was determined today. While she held his hand, her other hand slowly slipped into her purse which was hanging on her shoulder and she grabbed something. A loud sound, and the man was lying on the floor, surrounded by his own blood. “It ends today” She murmered.

She turned back to see him horrified. “It’s over. No one is going to hurt us anymore. We will go far away from all this. I missed you so much.” As he looked in shock, she slipped her gun back into her handbag and started walking towards the door still holding his hand.

 

 

“I missed you too, Mom” he finally said and followed her out while looking back at his father’s motionless body. The headline of a local newspaper kept on the center table loudly read “Mentally unstable wife accuses husband of child abuse, escapes from asylum.”

List of Important CAT Preparation Books

Important CAT Preparation BooksA lot of candidates ask me about the important CAT Preparation books to be referred while preparing for CAT. They are also confused about whether to join any coaching center or not. If yes, then which CAT coaching institute to join.

In this post, I will try to clear these doubts. I will give you important books list for CAT Preparation. Also, I will share some good resources/material which will help you a lot in your CAT preparation.

I have included links to most of the books & resources. This list is the latest list of books updated for CAT 2016 preparation.

List of Important CAT Preparation Books

Quantitative Ability

There are two good books for Quantitative Ability. Practicing only one of these is enough for your preparation.

How to Prepare for Quantitative Aptitude for the CAT by Arun Sharma

This is the most popular book for quant preparation. It is a very good book with questions segregated into different difficulty levels.

Quantitative Aptitude Quantum CAT For Admission into IIMs by Sarvesh K. Verma

This is another good book. It was suggested to me by a friend and I referred this book for my Quant preparation.

 

Verbal Ability

This is the most important section of CAT which becomes the reason for unexpected CAT scores. Following books should be referred for this section.

Word Power Made Easy by Norman Lewis

This is the most important book of your entire CAT preparation. Read it from end-to-end as per the instructions in the book and your vocab would never be the same.

How to Prepare for Verbal Ability and Reading Comprehension for CAT by Arun Sharma & Meenakshi Upadhyay

This is a good book for Verbal Ability and can be used as the base reference.

Apart from these two, you will also need to refer to study material for Verbal preparation which I will explain later in this article.

 

Data Interpretation & Logical Reasoning

DI & LR are very scoring sections of CAT and should be handled very efficiently. I have listed three books here- two individual books for DI & LR each, and one book for both DI & LR. Do not get all three. Either get first two books, or the third one.

How to Prepare for Data Interpretation for the CAT by Arun Sharma

This book by Arun Sharma is a popular choice for DI.

How to Prepare for Logical Reasoning for the CAT by Arun Sharma

This is a book on Logical Reasoning by Arun Sharma.

Logical Reasoning and Data Interpretation for the CAT by Nishit K. Sinha

This is a good book which covers both the Data Interpretation & Logical Reasoning. You can practice DI & LR questions from this book.

 

Previous Year’s Papers

Once you get through the basics, start practicing previous year’s papers. It will give you a good idea about the exam.
There is one book with last 25 years question papers published by Career Launcher which may be useful.

CAT (Common Admission Test) Topicwise solved papers 1990-2015

 

Study Material

Apart from books, you can use the study material of any one good coaching institute. No need to collect material from multiple institutes. I would recommend either to use TIME material or Career Launcher’s. I used TIME material and it was good.

For quant you will get a lot of questions in various books. But the study material is very much beneficial for Verbal Ability, Data Interpretation & Logical Reasoning. Try to practice all the questions from these topics.

The study material can be bought from the websites of these institutes or from the local market.

 

Bonus Material

I have no information about Erudite, but I found this CAT Preparation material from Erudite on Amazon and it has good reviews. In case you are unable to get material from other coaching centers, you can buy this from Amazon.

 

Coaching vs Self Study

A lot of students are in dilemma whether to join any coaching or not. Coaching is usually good to ensure regularity in our preparation. However, in case you are working or have less time to spare, you can do without it.

Working candidates with limited time can either opt for weekend classes or no coaching at all. Exhausting yourself too much with added burden of coaching will not help.

For college students and non-working candidates, coaching is recommended.

Regarding CAT coaching institute, you can join any good coaching center available in your area. Some of them are TIME, Career Launcher, IMS etc.

 

Here is my detailed article about How to start preparing for CAT.

 

More Digital Resources (To be updated)

I have some additional digital resources which I will share with you shortly. I will update this article with the link of those resources. (Please check back in some time for the same)

I hope this information would prove useful to you and you will crack the CAT and secure a seat in an IIM.

All The Best.

My Idea of a Peaceful Dream Vacation

A group of ducks enjoying the peaceful life of Mysore (Infosys Mysore Campus)
A group of ducks enjoying the peaceful life of Mysore (Infosys Mysore Campus)

We come across so many beautiful people, places and moments in our life. At times, we feel to revisit those moments, to relive the amazing past. Such nostalgia occurs to me every now and then. The memorable moments of my life I spent in Mysore.

Yes, it is my dream vacation destination where I want to spend some quality time again. Away from the chaos of daily life, a place with still lower level of pollution, a place housing one of the best corporate campuses on earth- Infosys Mysore.

It should be at least 1 month long vacation. I would leave from Delhi Airport to land in Bengaluru and from there I would take a cab to Mysore, the city of peaceful life. I can imagine the cool breeze entering my car and touching my face. The weather is amazing throughout the year.

I want to book a guest house, not a typical hotel, but an independent villa-type house, slightly outside the main city, entirely for my use during the vacation duration. It would be a place where I would feel like home. It would be a place where I would not have room service to disturb me or next room neighbors to create any noise.

I will spend the first week roaming around the city everyday and visiting the beautiful places like Mysore palace, Chamundi hills, Vrindavan Garden etc. The city is known for yoga and I want to practice it too while connecting with the people who passionately practice the art of yoga.

A very nice place near to Mysore is Ooty. A beautiful hill station known for its huge expanse of tea farms. It is such a beautiful place that one can forget everything while visiting this heaven. The views from some of its points is so breathtaking that one can sit there and enjoy for hours just by looking at the natural landscape and enjoying the cool breeze. I will visit there for at least 3-4 days hiring a cab service for daily commute.

Two things which are very famous in Ooty are homemade chocolates and tea factory. The tea factory manufactures so many varieties of tea including chocolate flavored tea. One can buy a ticket to even visit the factory and witness the whole production process. At various points, they offer you sample tea of different flavors which is a delight to taste. I will not be able to leave that place without buying at least a few kilos of tea powder.

Another place in Mysore I want to visit is Infosys Mysore campus. It is a beauty in itself. I spent 6 months in training while staying in the campus and next 6 months working while living in Mysore city and the memories of this whole year are still so fresh. One can take days to completely roam the campus on foot and golf carts and parked cycles are a must to expedite the exploration. A day or two there will freshen me up a lot.

For the remaining 2 weeks, I would rather chill out and enjoy the weather, place, people and the life in Mysore. I am sure it would completely recharge me to get back to the same energy level I had when I first visited this place and while going back to Delhi and arriving at the Delhi Airport, the smile on face would be the shiniest of all.

To book your flight ticket, cabs, hotels etc. easily, you may log on to Yatra.com and get great deals on domestic air tickets on Domestic Airlines.

“New IIM” vs “Old” Private B-School

The new IIM dilemmaEvery year, a lot of students get confused between getting into a “new IIM” or established “non-IIM private” B-schools. I hope this article will help them in making a choice.

In last 8 years, we witnessed 13 new IIMs which brought the total number of IIMs to 19 in India. CAT aspirants, who are unable to secure admission in older IIMs and get selected in new IIMs, find themselves in a huge dilemma whether to join these new IIMs or some already established premier non-IIM B-School.

With a lot of opinions of so many so-called “experts”, it is obvious for a prospective B-school student to get confused. So, lets try to find a solution to this problem by analyzing some facts.

Let us first look at what is the current general perception. I heard many people say that new IIMs are not good. They swear by other established non-IIM B-Schools. The sole reason for them is good placements in those colleges compared to new IIMs. Other than that, old established colleges have good faculty, thus good education, good infrastructure and finally good alumni base (which is again good for placements). I do not think there is any other reason due to which these people prefer other B-Schools over new IIMs.

Now lets see what it actually means to be a “good MBA”. As per my understanding, apart from classroom teaching, MBA is mainly about “peer learning” while performing different tasks together in teams. Unlike technological courses, it does not require any sophisticated infrastructure/laboratories other than decent classrooms, auditorium, seminar hall, computer lab, library and faculty/staff cabins/offices. Other than that, any good college will provide some sports facilities and a decent residential facility (hostels).

As per my knowledge, all new IIMs, though operating in makeshift campuses, provide decent level of all these facilities through various means. So, good infrastructure may not be a differentiating factor.

Then comes the learning part. First we consider peer learning which means we need to have good students. As we know, the criteria for getting into IIMs is CAT which is considered one of the most difficult exams of the world due to its very low conversion ratio. For less than 4000 seats in IIMs, 2,00,000+ students are competing every year. This means that the conversion rate is less than 2% which is very low compared to top B-schools of the world.

Even for new IIMs the general cutoff has been near 97 percentile which is higher than or equal to cutoffs for most of the non-IIM B-schools. It means no general student of new IIMs has got percentile less than nearly 97. If good CAT percentile is indicative of hard working, sincere, intelligent and talented students, most of the students admitted to new IIMs are good and thus facilitate good peer learning.

Same is the case with faculty. In most premier colleges, there is a tradition of employing visiting faculty who are experts in their respective fields, along with permanent faculty. As a part of a new IIM with 15+ permanent faculty and 150 students in a batch, I have seen visiting faculty from old IIMs, other top B-schools and industry veterans for various courses. I do not think that I missed any superior kind of learning which I could have got in any non-IIM B-school.

Regarding the course structure, the pattern in new IIMs is almost similar to the older IIMs with similar subjects, electives and exam criteria.

The spirits of students are high in new IIMs as well. They organize events/fests, take part in (and win) various national/international competitions, celebrate majority of festivals, write research papers, attend conferences etc. I did not find anything significantly better in the description of such things happening in premiere non-IIM B-schools from people studying there.

Till now, we saw that when compared to premiere non-IIM B-schools, new IIMs does not have any significant difference or disadvantage in terms of infrastructure,learning, environment, and student spirit. Then where is the actual difference.

This brings us to a very interesting and highly controversial topic of placements. I do agree that old IIMs and a couple of non-IIM B-schools provide excellent placements. Apart from these, I find good placements in some other colleges, but not excellent.

And this is the case even with their huge alumni base. A new IIM without any alumni base getting placements comparable to long established non-IIM B-schools is a huge indication of the excellent quality of an IIM. It shows that the quality of students in IIM makes them not overly dependent on alumni for placements and industry is ready to offer them good profiles.

Moreover, the source of information of placements of any college is the placement report prepared and distributed by that college. There has been a history of highly inflated and misrepresented placement figures by many colleges. Can we actually believe the placement report of any college? I think, it would be better to consider more than just numbers. Though, in case of an IIM, you can try filing RTI to get true information.

May be the new IIMs are new, may be their inception (in 2010) coincided with the world-wide recession which caused them to begin with somewhat less but still decent placements. But is this slight “apparent” difference, the reason to miss the opportunity to study in an IIM?

Also, most of these non-IIM B-schools are expensive than new IIMs in terms of fees. Is it really worth it?

I have shared my viewpoint. You have to take your own decision while considering realistic facts and avoid getting influenced by irrelevant hype and rumors.

After all, an IIM is an IIM and its equally difficult to get into a new IIM.

CAT vs GMAT- Dilemma of every MBA aspirant in India

CAT vs GMATCAT vs GMAT is a tough choice and a lot of factors should be considered to make it a good one.

GMAT is considered easier to crack than CAT based on very low conversion ratio in CAT. However, GMAT is much more expensive than CAT, both in terms of application as well as college fees.

Also, Indian B-Schools are more inclined towards lesser work experience of candidates. In contrast, B-Schools abroad have minimum work experience requirement.

I personally feel that IIMs, XLRI, FMS etc. are more suitable and make more sense if you want to remain in India in the initial years of your career.

So, based on the above scenarios, you need to make a choice as per your circumstances.

Just sharing an interesting fact. Many of my friends who could not clear CAT even after 3-4 attempts finally took GMAT and got into some decent colleges abroad.

For preparation, the content of both the exams is mostly similar however exam pattern is quite different. So, basic preparation can be same for both the exams but you need to subscribe to different test series to practice for the actual exam.

I would suggest to identify your situation based on the scenarios I mentioned earlier and choose to take only one of the two exams. No need to ride in two boats. Going for both the exams will only distract you.

However, if you want to take both the exams for the sake of keeping a back-up, you should first go for CAT because it is a fixed date exam. Once you take CAT, immediately start preparing for GMAT. Having already prepared for CAT, you have little to study and just need to practice a lot as per the pattern of GMAT. Once you get your CAT result, schedule a date for GMAT giving a time gap of about 4-6 months.

Meanwhile, if you clear CAT, you will have to devote a lot of time for interview preparation. So, you can plan your GMAT preparation and date of appointment as per your interview schedule.

Below is information about good resources for preparation of both the excams-

For CAT Preparation, you can refer to my article here- How to start preparing for CAT (IIM)

List of most important books for CAT Preparation- List of Important CAT Preparation Books

Here are some good books for GMAT Preparation-

Beyond the Illusion of Real Togetherness

Real Togetherness

There would be hardly anyone who would want to be alone in life. We always need family, friends, colleagues, acquaintances, neighbors, pets and even unknown people around us. It is human nature to be together and seek happiness and being with others. But has it changed these days?

In old days, the only way of being together was to sit together. Telecommunication was still a distant dream usually practiced in fantasy movies by fictional characters. But everything has changed now. With the advent of 24/7 connectivity through small pocketable handheld devices called mobile phones, togetherness has got a new meaning.

Earlier it was telephony where people used to talk for several hours a day. But with the introduction of internet, smartphones and apps, connectivity is now 24/7. People remain available all the time and remain busy in reading and responding to text messages. And it is so much consuming that they hardly get any time to think anything else.

This connectivity is virtually connecting us to millions of people, but is it real togetherness? I cannot “new-pinch” my friends when they wear a new dress, I cannot dance with them on latest dance numbers, I cannot hug them when I feel lonely, I cannot hold their hands when I feel afraid. Whoever I am connected to using this technology, I am still sitting alone in a 10×10 room holding a smartphone in my hands. This is not togetherness. Rather, this is an illusion of togetherness which is taking away the real togetherness.

The real togetherness is when we are actually together laughing on jokes, dancing on tunes, playing hide-and-seek, caring when someone is sick, cooking new dishes, traveling to new places, solving riddles, drenching in the rain etc. The list is endless and it is so much different than sitting in a room and imagining all these things.

We all are slowly forgetting the joy of being close to nature and we prefer the comfort of sitting in our beds. And it is true that even being alone, we are technically not alone as we are constantly connected through technology. But we need to break free from these and get back to real life.

Kissan has released a nice commercial showing how planting some tomato seeds bring a group of people together belonging to all ages. It shows how we are still those nature loving humans who truly enjoy when they are together, who still recognize the power of togetherness.

We need to do something similar to make things better. There are so many things we can do like enjoy the sunrise every morning on our roofs, walking on the green grass barefoot, singing along with the birds, watering the plants in the garden etc. There is so much we can do.

We are slowly going away from the real life which we need to stop, and being closer to nature is a great way to achieve that.

You can visit the Kissanpur to learn more about above campaign here: http://www.kissanpur.com/

Togetherness without being together

We have fun loving people all around us, but very few of them love people more than fun, and that makes all the difference.

I always wonder the meaning of being together. Is it about being able to look at each other, talk or even touch each other? Save the “touch” part, looking and talking is now-a-days possible no matter you are physical near to each other or not, thanks to the technology in the form of Skype or Hangout.

But, I believe that being together is much more than this. It is when we are together even if we are unable to hug, see, hear, or touch the other person. It is when our hearts are together, our heartbeats are in sync even if we are away, our memories make us feel as if we are still next to each other. This, I believe, is true togetherness.

Usually, in one’s life, family and close friends are the main source of strength and motivation. I am no different. Even while living at different places, unable to meet many of them for months, even years, we are still together. Many times, when I felt low, they inspired me, took my hand and made me stand up to the challenges of life.

Once I was unable to visit my home for 8 long months. I was working thousands of kilometers away from my home while also preparing for MBA entrance exam. Sometimes it became very hectic but my family stood together and kept me going, even though they were so far away from me.

My closest friend lives in my hometown and we are friends from our school time. We rarely chat on line and once in a while on phone. Even then, when we meet even after long duration of time, we feel as if we are meeting each other every day for the last so many years. The bond is unaffected by distance because it is nurtured by love and care.

When I was in Hyderabad, working in a very hectic job on weekdays, preparing for CAT on weekends with no time to spare for roaming around or parties, my roommates helped me out in every possible way. Even away from home, with them I found a new home. I feel lucky to be there, together with them at that time. Sometimes I felt as if they were more worried about my exam than I was. And it all worked out pretty well.

Love and care are the main ingredients of togetherness, mixed with goodness of heart. In the absence of these ingredients, there is no meaning of being with someone. It is as if one is alone even when surrounded by crowd. We have fun loving people all around us, but very few of them love people more than fun, and that makes all the difference.

Housing.com is encouraging people to be #together. You can visit them here: housing.com

The change that fueled life

When I was about to graduate from my engineering college, I felt the uneasiness created by the upcoming change in my life. I felt sad by the thought that soon my college life will be gone. At that time, a very good friend of mine told me that “change is the norm”. And moreover, some changes are irrevocable and one has to accept them anyway.

Very soon my work life began. I was excited to begin a new life. But at the same time, I was little bit skeptical about going 2500 kms away from my home. “Is it worth it?” I asked myself. And guess what, yes, that change in my life was for good. I will cherish those memories for life.

As a matter of fact, I believe most of the changes in our life prove to be good at some point of time or other. When I moved to Southern part of India, I got a chance to experience an entirely new life, to learn so many new things, get familiar with a culture totally different from mine and meet people who are different yet same as I.

When I was in my hometown, I never liked South Indian food, or I can say that I never liked South Indian food cooked in North India. I was prejudiced that I will get the same food there. And fast forward to 1 year later, it became a norm to eat dosa in breakfast for me. I literally loved some of the South Indian dishes.

I am from Northern part of India where we experience extreme weather phenomena throughout the year. There are too much hot dry summers, too much humid summers, excessive rainy season, pleasant spring and extremely chilly winters. It is good to experience all types of weather but all this in a single year sometimes make it difficult.

In South India, I found that weather can be uniform as well. While Mysore and Bangalore were so pleasant throughout the year, Hyderabad only got somewhat hot only for 4 months. That was a new experience and I realized that it was good too in its own way. However, it seemed monotonous to me after being in North for such a long time.

Gradually, all my prejudices were gone and I enjoyed my stay there. And finally, one day, I had to leave that place too. I still remember the day I left that place. I felt really bad. Remember, this was the same place which was thousands of kilometers away from my home and I was feeling bad when leaving it.

This taught me that sometimes some changes in life seem really big and our inner inertia may obstruct us from committing to that change. But most changes are for good and we should overcome that fear and take the opportunity to experience something new. I took my chance and it was definitely worth it.


A company named Housing.com has changed for good. You can visit Housing.com to experience the good change.

When a stranger made me smile

Image Source: www.forangelsonly.org

 At a certain point of time, we start believing that there is nothing good left in this world. But, there are those little moments in life which make us realize that we are wrong, that there are still so many good people in this world and it brings smile to our face, a relief in our heart.

In the present day life where everyone is running around aimlessly, competing with others to win some race, everything seems full of pessimism. At a certain point of time, we start believing that there is no one with a good heart left in this world. But there are those little moments in life which make us realize that we are wrong, that there are still so many good people in this world and it brings smile to our face, a relief in our heart. And I found those moments a few months ago while travelling in Delhi Metro.

It was the evening of a very hectic day full of surprises and I did not want any more surprises. I still had so much to do and I wanted to be at peace. The overly crowded Delhi Metro is no more a place for peace lovers. You can find people fighting for seats, boys leching on girls or people holding their pockets tightly, trying to avert pickpockets.

I got a seat after 4-5 stations. But I still had 30+ stations to go and had to change metro at on place. The battery of my mobile was down so I could not play any games on it to kill time. Suddenly, I noticed that the passenger sitting next to me was watching a movie on his mobile phone. I started watching it though I could not hear the sound.

This went on for a while. Suddenly, that passenger looked at me, smiled and offered me one of the ear buds of his earphone and turned the phone’s screen towards me so that I can also watch the movie. I was surprised. But I had nothing to do. So, I accepted his offer and put the earbud in my ear. The man politely explained me the story of the movie which I missed till that point of time and then we started watching the movie. I felt really good as if my tiredness was gone.

In between, we talked about various things, though I was not much interested in trivial talks. Also, I was a little bit skeptical about him. How can someone be so friendly with a stranger in the present day world? But he was an exception. I double checked my wallet and phone, everything was at its place.

I started enjoying the movie with him and did not even realize that I was just 4 stations away from my destination. At that station that man deboarded the train. Before leaving, he said a very nice good bye and greeted me with a smile which I reciprocated. We never asked each other’s name and we may never recall each other’s faces even if we meet in future. It made me sure that the man did all this without any expectation of gaining something from me. He was just sharing his happiness with me. And someone has rightly said, happiness is multiplied when shared with others.

It made my day. I was no more skeptical about the world. There are still so many affectionate people who smile at strangers without any bad intention. From that day onwards, everything around me looked even more beautiful. more positive. I realized that world is full of optimism if we are willing to look at it. And once we start looking at it, life becomes more beautiful.

The memories of that heartwarming journey will always be there in my heart and I will contribute towards making this world a happier, more beautiful and optimistic place.

You can visit Housing.com/lookup to see how Housing envisions a world filled with positivity.