Jan 21, 2009

The Simplest Definition of Concurrency

I found this simple, yet sharp definition of Concurrency.
"A and B are concurrent if either A can happen before B, or B can happen before A."

source :   Rajkumar Buyya’s Presentation Deck

Jan 14, 2009

Adding support for "rar" archives in Ubuntu

By default, Ubuntu does not supprt "rar" archives. But it is just a matter of executing a command to fix this.

Open a terminal and type :

sudo apt-get install rar

This will take a only a few seconds to get installed.

If you still have problems with extracting "rar" archives try the following command as well.

sudo apt-get install unrar

Facebook Addiction

Facebook has become the most popular social networking application at present. Although there are other means of social networking, facebook is dominating and it has attracted a huge crowd, especially the younger generation. Facebook delivers the benefits of social networking, but it is highly addictive.



I found a article by  Nick O'Neill which gives a comprehensive insight into this matter. And of course, he suggests some approaches to get rid of this addiction.



Are you addicted to Facebook? I know I am. It starts of with a simple exploration of your friends on the site and suddently you are logging on 10 times a day to see if any of your friends have made updates to their profile, changed their relationship status or have posted new videos or articles. Suddnely you are glued to your computer monitor and the only thing on the screen is Facebook. So maybe your addiction isn’t that bad but apparently enough people are addicted that wikiHow has published an article entitled “How to Quite Facebook.” WikiHow suggests a 6-step solution:

  1. Admit you have a problem - This sounds like the first step to any other addiction. WikiHow suggests that you ask yourself “What did I just accomplish by checking Facebook?” Ha! If only I had that much self-control over my Facebook addiction. Well, at least I admit to it!

  2. Define your goals on Facebook - Hmm … I never really had any goals with Facebook. Although maybe my goal should be to reach 5,000 friends. That surely would get me to login more frequently. WikiHow suggests just logging in to check on friends’ birthdays, keep track of old friends, etc. Once you catch yourself going off track, log off. If only it was that easy!

  3. Make a Facebook Schedule - Seriously? If you find yourself scheduling Facebook into your daily schedule, this should be a serious warning sign. WikiHow suggests that “after each Facebook goal, write down how much time and at what frequency you’ll need to be on Facebook to achieve that goal.” Are they serious? Based on the calculations they suggested, you end up using Facebook for 6 hours and 20 minutes a week. I think this is still a relatively significant amount of time, although I spend much more time on the site.

  4. Think of other things you could be doing - Duh! This is a no brainer. I could be at the gym, socializing in the real world or a million other things but there is a reason I logged on in the first place. I’m starting to think that these suggestions are totally useless!

  5. Leave Facebook - This should have been number one! If you are spending way too much time on Facebook, quit cold turkey. It’s like having your cell phone turned off for 24 hours. Once you do it, you will realize how dependent you have become and think twice about your usage.

  6. Find a substitute - This one is good. Facebook taking up too much time? Find another site that isn’t as good! WikiHow says “if you find you’re at a computer during critical relapse time, find another website to log onto and read instead of Facebook.” Facebook relapse? This is a little crazy.


So how much time do you spend on Facebook? Has Facebook become an addiction for you?

Source : http://www.allfacebook.com/2007/10/how-to-stop-that-facebook-addiction/

Jan 13, 2009

How to reduce the icon size in Ubuntu 8.10

If you are fed up seeing the larger icons in your desktop or in nautilus(in my case), this post might be helpful. As a Linux user, I am so concerned about the look and feel of the operating system, in addition to its performance. I was so annoyed by the extra large icons, which is the default in Ubuntu. So after surfing the web, I found this quick and simple solution to get rid of the larger icons.

  • Open Nautilus

  • Edit --> Preferences -->  View Tab

  • Adjust the zoom level under the "Icon View Defaults" to a preferable size. By default it is set to 100%. Reducing it to 66% will end up with a fairly decent icon size.

  • Click "Close"


screenshot-file-management-preferences

This is how my desktop and nautilus are appearing now.   Looking good, isn't it ?   :-)

screenshot12

Jan 6, 2009

Programming for multi-Core environments...

In day-to-day programming, we do not pay enough attention to the fact that we may not using the power of multi-core architectures optimally. We usually assign the total workload to a single thread. You might wonder that why I am blogging about the very basics of Concurrency. Yes, I am. But I am trying to show the power of concurrency in multi-core environments using some statistics that I collected for an assignment for the module "Concurrent Programming".

Sorting of an integer array using Quick Sort is the task that was used to collect the statistics. Quick Sort was implemented both sequentially and in parallel. And the elapsed time to sort the array was measured for different array sizes.

In the parallel approach, after breaking down the original array into two sub arrays based on the pivot element, two tasks are created for sorting these two sub arrays and assigned these tasks to the Java Executor Framework. (I used Java Executor Framework for managing threads, because it is not necessary to undertake the burden of creating, synchronizing, managing and terminating the threads manually.)

code

Following is the summary of the results obtained.

perThe most intersting observation is the CPU usage graph. I tested this on a dual core machine, hence I get two CPU plots representing each core.

For the sequential approach following graph is resulted.

screenshot-system-monitor_seq

For the parallel approach, following is the graph obtained.

screenshot-system-monitor-par

It is quite interesting to see both cores becomes busy at the sametime while resulting with the inproved performance.

Why use single core, leaving others idle.. ?  :-)

It's 2009...

ist2_6149793-happy-new-year-2009