Interview Question: Find the missing number in sequence from 1 to 100/100000

Posted in Programming on October 16, 2016 by tasam21

You can use your own programming logic to find that answer in any languages but I would like to share how to resolve this problem using PHP programming logic:

If the number range is huge like 1 to 100 million then I would prefer to break into smaller ranges and then run the following code to make the CPU to consume less resources.

//1. put the number in array variable
$numberRange = array(1,2,3,4,6,7,9,10,13,15,16,18,19,23,24,25.....);
//2. Initialize the Missing number to be search from 1
$missingNumber = 1;
//3. For loop variable $n initialize with 0, should be less than 100 and increment.
for($n=0; $n<100; $n++) {
//4. Using If condition to check Missing number is in that array for not
if(!in_array($missingNumber, $numberRange)){
//5. Print that Missing number
echo $missingNumber. " is missing number" . '

Tips to run nodejs server permanently

Posted in NodeJs on August 10, 2016 by tasam21

I have figured it out and feel like sharing it here for others to use and save time.

There are 3 ways to run your nodejs app permanently on ubuntu linux machines.

Use ampersand (&) at the end of your command. enter this command “nodejs feed.js &” (without the double quote).
Use forever command of npm package
User pm2 command of npm package

More details
Continue reading

Speed Up Your Web Site

Posted in web world on March 12, 2015 by tasam21

Why Is Page Speed Important?

The main reason why the page loading speed is important is because it creates a better user experience for your visitors. Now a days the search engines also use speed to rank your website in searches as its a vital attribute to a successful website, your visitors won’t stick around on your site if it takes 10 seconds to load a page.This is why search engines will now use page speed as part of algorithm which decides where your site rank in the search engine, so all you have to do is speed up your site which creates a better experience to your visitors and improves your position in the search results.

Lately Google has been making many changes to make the web better, one of the main updates is the Google Panda updates which stops against duplicate content. But the update we are looking at today is speed, Google takes speed into account when ranking you in the search results and visitors tend to leave you site if they have to wait more than a couple of seconds. Continue reading

Managed Hosting Vs. Unmanaged Hosting

Posted in web world on July 18, 2014 by tasam21

Managed hosting and Unmanaged Hosting – We are sure that you’re familiar with both these terms if you have ever thought about purchasing a Virtual Private Server as a part of upgrading web hosting of your website or blog! Along with a number of confusions that arise during the selection process, these two words are quite confusing we guess, especially for those who lack deep technical knowledge about web servers and their types. Apart from VPS, this type of classification can be seen in the case of some dedicated web servers as well. However, in this post, we will discuss noticeable differences between Managed Hosting & Unmanaged Hosting as well as advantages and disadvantages of both. First, we will compare both managed and unmanaged hosting through some prominent aspects. Continue reading

Do you want to enjoy free 3G feature on your iPad?

Posted in Uncategorized on March 1, 2012 by tasam21

Apple has sent out invitations to the San Francisco launch of its new iPad 3 this week. The device will be unveiled on March 7 at a special event in the Yerba Buena Center for the Arts in San Francisco. In India, people mostly prefer to buy iPad with both Wi-Fi and 3G features because they can hardly find the Wi-Fi signal. But for the extra feature, we have to pay an extra amount. I have an iPad with only Wi-Fi feature but I am accessing the 3G feature as well without having to pay for it. Isn’t it great to save some money?
Continue reading

“Sadda Haq” Means “Our Right”

Posted in Uncategorized on November 10, 2011 by tasam21

I knew it from the very beginning when I first saw the article in Times of India about the Censor board instruction to mute the word ‘China’ in Prashant Chaddha’s upcoming release Azaan.

As Chaddha said, “I was told that we are getting an A certificate because of the theme of the film. However, the strange thing was that they also asked us to mute the word China. We tried to reason it out with them but to no avail. Surprisingly, they have passed the word Pakistan but not China”
Continue reading

Google plus “Google+”

Posted in Uncategorized on October 13, 2011 by tasam21

We are all familiar with Facebook, the social network service, and arguably the most popular website that one cannot resist. Facebook currently has more than 750 million users all over the world. Chatting on Facebook has become a popular pastime. Google, which many of us use for searching the internet as well as for email (Gmail), has been trying to compete with Facebook.
Continue reading