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" . '
';
}
$missingNumber++;
}

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

Read email and website in Tibetan Language in Nokia phone.

Posted in Uncategorized on October 13, 2011 by tasam21

I’m a tech lover but i can’t afford expensive phone like iphone or blackberry. So I’m simply using Nokia E63 to check my mail and browse websites through Opera mini browser. But Nokia doesn’t support Tibetan font, due to that reason we can’t read the Tibetan language website in Nokia phone. so here i would like to share an idea that we can read tibetan language website in Nokia phone us…ing Opera mini browser, using the following steps:
1. First Download and Install the Opera mini browser in your Nokia phone.
2. Type ‘opera:config’ in the address bar without http or www.
3. Select ‘Yes’ for use bit map fonts for complex script.

4. After that you can read Tibetan language website and email in Tibetan there. And you don’t need to buy iphone for that specific purpose.
5. Hope you like it.

The Karmapa coverage and the Indian Media: Is this the right Way?

Posted in Uncategorized on February 2, 2011 by tasam21

We are living in the 21st Century and with the advancement of technology, it has changed into the “Age of Information”. In this age of information, one can receive or share information through different mediums even within a second. Yet, it is very crucial to provide the accurate information; every one has the responsibility in translating the right information. Nowadays, the media plays a crucial role in providing information but still has the significant responsibility to convey truthful information to the general public.

It’s the media that can lead people into action.

It’s the media that can change the nation.

It’s the media that can ruin the nation.

 

Therefore different nations implement different ways of monitoring the information, like in China major news would be allowed into the public eye only after careful vetting by senior officials but in India media are powerful enough that even governments are so awful of them. I personally support the free media system in the country but that doesn’t mean media to provide fake information or exaggerate things.

Continue reading

Prevent Slow Laptops in a Few Easy Steps:

Posted in Uncategorized on January 14, 2011 by tasam21

My laptop is running slow, what to do? Is that a question you often ask yourself or your friends? Well after reading the following article you wouldn’t have to ask this question again. All you have to do is follow a few steps and your laptop will keep running smoothly for a long time.

1.Defragment your laptop on a regular basis – at least once a week. What your laptop does is that it breaks all of your files up into various pieces, and scatters them throughout your hard drive known as fragments. And what defragmenting does is that it takes all these fragments, and re-organizes them into a space where they can be easily accessed in a faster way and thus reduces the time it takes to seek these files. To do that all you need to do is go to your system tools and click defragment, choose the drives and wait. You should not operate on your laptop while its being defragmented. So it’s better to schedule the defragmentation weekly at a time when the laptop would not be used and it will do the rest. You can download cCleaner from cnet.
Continue reading