About Jappi Bains

Jappi is a Post Graduate student of Electronics pursuing specialization in the field of mobile robotics...

Facebook plugin for wordpress – No support from facebook? :-(

Being a hobbyist and not a professional, I have spent lots and lots of tireless days and sleepless nights, trying to integrate the social plugin i.e. facebook for wordpress, offered by facebook, into my blog. All of us who manage their webpages using wordpress know how difficult is it to take approval of various actions and settings from facebook, prior to final implementation on websites.

The login flow using facebook, which was working fine till some time ago, has started throwing an error while I try to login using the administrators account, asking me to take approval for some role permission. When I was going through the documentation for the same I just stumbled upon a post by facebook, that the social plugin, i.e. facebook for wordpress is no longer supported by facebook.

Now, this brings me to feel that facebook has ditched me by withdrawing their support and m feeling bad for all that effort which I have put in for integrating my wordpress blog with facebook.

How many of you also feel the same. I request you all to share your feelings…….

Monitor network usage in Ubuntu

Many a times when we are using our computer for surfing the internet, or other network activities, we feel that though we have a good internet connection, but the browsing speed is not good.

It may happen so that the bandwidth is being consumed by some unwanted application or process running in the background and little or no bandwidth is left for the browser.

But how can we diagnose which application is making how much usage of the internet bandwidth?

Luckily there is a small application available for Ubuntu which does the real time monitoring of the internet bandwidth usage and displays it for you on the screen. The application is “NetHogs”.


For installing use the following steps:-

  • Open a new terminal window using key combination Ctrl+Alt+t
  • On the command prompt issue the command :- sudo apt-get install nethogs
  • After the installation is over, just issue the command :- sudo nethogs
  • Real time data usage of the network will be displayed in the terminal
  • To close the application use key combination Ctrl+c

Once you have the details of the applications or processes hogging you bandwidth, you can close them or selectively kill them.


Sampling from normal distribution

Many a times we need to generate random samples or rather random numbers, which essentially follow or approximate a normal distribution. Such random numbers find extensive applications in the fields of statistics, probability, gaming etc.

We present here  a very small function written in C/C++, which will generate pseudorandom numbers following a normal distribution having mean as zero(0) and given variance (bsq). As the code uses very basic statements, same can be easily tailored for use in other programming languages also.

//Sampling in a normal distribution with mean 0 and variance bsq
double normalSampling (double bsq)
double sum=0, tempB=0,b;
int i;
for (i=1; i<=12; i++)
srand(time(NULL)* i + rand());
// generate a random double number between 0 and 1
tempB=2 * b * tempB;// to generate a random no between 0 and 2b
tempB=tempB-b;//to ensure random no generated falls between -b to b
sum+=tempB;    // add to the cumulative sum
return sum;