sound to headphone on ubuntu




gksudo gedit /etc/modprobe.d/alsa-base.conf

insert at the bottom
options snd-hda-intel model=hp-dv5 enable_msi=1

Reboot and test.

Other models to test are:

Adjust alsamixer

pgfplot on ubuntu



$ apt-file search pgfplots.sty

Install mono and monodevelop on ubuntu 10.04


Category: ,

Ubuntu 10.04 comes with mono. You can check the mono version using

mono -V

To install MonoDevelop follow the following steps-

  1. Click on "System", "Administration", "Software Sources".
  2. Click on the "Other Software" tab.
  3. Click on "Add...", and enter the line:
    deb lucid main
    Screenshot from Software Sources
  4. Click on "Add Source"
  5. Click on "Authentication", then on "Import Key File"
  6. Download this GPG key file, ID 0E1FAD0C, and select it in the "Import Key File" window
  7. Click on "Close", then "Reload" when the pop-up appears. You're all set!
From now on, whenever you try to install or update Mono-related packages on your system, you will be given the badgerports version for preference. You don't need to do anything more than update your system as usual to get started!

Then, go to System -> Administration ->Synaptic Package Manager. Find monodevelop from there. Mark for install and press apply.

Install VirtualBox on Ubuntu 10.04


Category: ,

The Virtualbox (non-free) repository is available for Ubuntu 10.4 Lucid Lynx (kind of late I'd say). You can add it using the 
following command: 
sudo add-apt-repository "deb lucid non-free"
wget -q -O- | sudo apt-key add -
Then install it: 
sudo apt-get update && sudo apt-get install virtualbox-3.2 

How to install latex in ubuntu 10.04 LTS


Category: ,


sudo apt-get install texlive-full 

This will install full latex distribution.  Install taxmaker from System->administration->synaptic package manager.


Ruby on Rails on ubuntu 10.04


Category: ,

Use following commands

sudo su
apt-get install build-essential

sudo apt-get install build-essential rails
apt-get install ruby rdoc libopenssl-ruby

Download rubygems-1.3.7.tgz from web and extract that. Then

cd rubygems-1.3.7
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/local/bin/gem
gem install rails

Install the sqlite3 connector:

sudo apt-get install libsqlite3-dev
sudo gem install sqlite3-ruby

Then follow the link to create your first application using ruby on rails.

How to install flash player in ubuntu 10.04 for amd processors


Category: , ,

1. To get started, go to Applications –> Ubuntu Software Center
2. Next, type ‘Adobe Flash Plug-in’ in the search box, then select Adobe
3. Install it.
4. restart your PC

How to install Apache 2, MySQL 5 and PHP 5 in Ubuntu 10.04



Apache 2
To install Apache server type the following command in terminal.
sudo apt-get install apache2
When it says "Do you want to continue [Y/n]?" just press ENTER.
After installation is finished test it on your browser - "http://localhost". If it shows --

It works!

This is the default web page for this server.
The web server software is running but no content has been added, yet.
That means your server installation is working fine.
Changing document root see.
To install PHP type following command on terminal. 
sudo apt-get install php5 libapache2-mod-php5
Then restart Apache Server using
sudo /etc/init.d/apache2 restart
To install MySQL 5 put the following command on the terminal.
sudo apt-get install mysql-server mysql-client
After intalling MySQL you will need to install another package which will help PHP to connect with MySQL.
Type following command on the terminal for that package.
sudo apt-get install php5-mysql 
To install phpmyadmin use the following command
sudo apt-get install phpmyadmin
Also, by default the phpmyadmin script is installed in /usr/share/phpmyadmin, a directory that isn't access from Apache.

You'll want to do the following to get http://localhost/phpmyadmin to work
cd /var/www
sudo ln -s /usr/share/phpmyadmin phpmyadmin 

Root User in Ubuntu


Category: ,

If you want to enable root account (which is not recommended) enter the following command.
$sudo passwd root
This will prompt for a new root password and once you confirm it, you can start using the root account to login.
If you want to disable root account in ubuntu you need to lock the root account by using the following command
$sudo passwd -l root
If you want to work on a root console you’d better use the following command
$sudo -i

The 10 Most Important Qualities of the Ideal Graduate Research Candidate



  1. Intelligence
    Intelligence (including academic ability, intellect, brightness and common sense) was the most common quality associated with the ideal graduate research candidate.
    "They need to be bright with a good dose of common sense for work in a research laboratory."
    "The best students are those who are bright enough and motivated enough to work independently and submit high quality prose."
  2. Independence / Confidence
    The ability to work and think independently is one of the basic prerequisites for studying a research degree. Qualities associated with independence were confidence, initiative and the ability to take responsibility.
    "They should be able to work with minimal supervision, but that does not mean that the supervisor is not available for discussions on the research being undertaken."
    "Independence of thought is a key attribute that has to develop as the PhD progresses"
    "The student should ideally be able to work independently and develop their own questions and pursue their own lines of thought."
  3. Commitment
    Almost half of the supervisors mentioned commitment (to gain knowledge, to complete work or to do well) as the key to successful research degree completion. Other expressions illustrating commitment were perseverance, persistence, determination, dedication, tenacity, resilience and endurance.
    "The most important qualities a PhD candidate will need are perseverance and commitment, probably more so than raw intelligence."
    "All of the qualities are important for the student to get the most out of their research degree; but if they have a high level of commitment (I REALLY want to do this, and well) then the rest will usually follow".
  4. Literacy / numeracy
    Literacy, mostly described as good writing and language skills as well as the ability to express and organise ideas, is highly valued by most supervisors. Some supervisors also require their students to have essential statistical and mathematical skills.
    "I think that writing ability is very important - it wastes a lot of my time (and the student's) if we have to spend a lot of effort and time on correcting drafts."
    "Literacy is on the list simply because time pressures don't allow a student the luxury of a lack of writing skill to start with, however writing can be taught."
  5. Time management / organisational skills
    The ideal research degree student is organised, can plan their work, meets deadlines, pays attention to detail and meets regularly with supervisors. Overall they have good study and work habits.
    "A good student is one who works hard, plans their programme of work (with advice) and has the imagination to see the beauty and fascination of a research topic and then to write clearly and precisely about what he or she has discovered".
  6. Curiosity / ability to learn
    A valued quality in research degree students is intellectual curiosity and the willingness and ability to learn new things. This curiosity includes having an inquiring and open mind, as well as flexibility and adaptability.
    "A good graduate student is not necessarily the one with the top grades but the one who is willing to ask questions, to challenge what they are told but is also [able] to take advice".
    "The best students will also have real intrinsic curiosity about the world and about their project".
    "The ideal thesis student for me is someone who brings a strong sense of intellectual curiosity to their project and who is willing and able to translate that curiosity into a dedicated course of study".
  7. Enthusiasm and passion
    A successful student is enthusiastic, passionate and has a deep interest in the subject or research.
    "For me, the desire to do research and a passion for the field of inquiry are key, but they are not the only things needed."
    "Although academic background is essential it is not sufficient in the absence of dedication and enthusiasm and communication skill".
    "In my opinion the most important properties are a commitment to work hard, and when problems are encountered to be able to look at them from many angles and find logical solutions. Generally these traits will only come with a strong passion for the work they are doing".
  8. Ability to think
    The ability to think refers to the capacity to develop necessary research skills including the ability to analyze, synthesize, conceptualise, develop an argument and think critically. Ideal students can think broadly ('get the big picture'), laterally and logically.
    "An ideal student is marked by an ability to think, ask questions, and look for the answers in research, and be prepared to write and argue about them (in writing and with supervisors)".
    "The student should be able to think both at the metalevel and at the object level, in other words both about the general coarse-grained aspects of relevance and broad patterns, and at the fine-grained level of intricate details".
  9. Hard working/ diligence
    Studying a research degree requires diligence and hard work. Strong work ethics, discipline, focus, efficiency and professionalism are all necessary for successful study and research.
    "PG study is hard work and dedication. Having a life while studying is also important. The best students have a balance to their lives where they work hard but enjoy their time at university too."
    "Hard working and paying attention to supervisors' advice are highly required."
  10. Motivation
    Good research students have strong reasons for pursuing a PhD or Master's degree; they are ambitious and highly motivated to learn new things and get a graduate degree.
    "I think one reason why so many students take too long to complete is because they are not pursuing a PhD for the right reason (or for any reason at all)"
    "Self-motivation is the essential ingredient that will help make even the more challenged students successful."
    "Although high-intelligence (good exam marks) are required prior to commencing graduate research I would rate motivation as the most important factor".
    "A candidate for a PhD must WANT to do it, and be a self-starter".



Top 5 trends and technologies in software development

In this ever-changing world of software development it's extremely important to keep up with current technologies, methodologies and trends. It can easily get out of hand though - simply there's not enough time for anyone to learn all new stuff, work and live a normal life simultaneously. Selection is thus the key, being smartly selective about new things to learn so we won't miss important stuff but also keep 'junk' or unimportant trends out.
I created this small and ever-incomplete list of things I feel we all should pay attention to and practice. Some items could be considered 'old' (read: more than a few months old) but still not grasped enough yet.
Without further ado I present thee the list:
  • Learn and use a modern scripting language
    • it can be RubyPythonGroovy or TheNextBigShot coming along, it doesn't really matter. What matters is having a quick and easy tool for anything at hand so we won't have to fire up our java IDE for a simple script. Also (most of) these languages encourage good pracices and methods, changing our attitude towards programming and program design. Embracing these "wow, look how elegant and simple that is!" solutions also become expectations with time (because we'll get used to the ease and convenience), thus we will be striving for elegance and quality - helping impoving all of our further designs and codes. Some writings on ruby for example:
  • Learn thogoughly and embrace the philosophy of a modern version control system
    • Be it Git or Mercurial, but start using them. Right now. Embrace the paradigm shift that gave birth to these tools. If not at work then try any of these on a personal project. These tools fit better to a natural cycle of development than our old tools svn or cvs. Being distributed does not mean they can't be used as a central company repo solution. They both encourage the concept of cheap local branching, keeping you safe by being able to revert any time (as traditional VCSes) and also keeping the central main repo clean of nitty-gritty details.
  • Be familiar with NoSQL solutions like MongoDBCouchDB.
    • These beasts can be a real life-saver when traditional relational DBs reach their limits at scaling and performance. Both MongoDB and CouchDB are what's called a 'document-oriented database' which means that instead of rigid schemas the structure of each row is taken into account - they don't even have to have the same fields, etc. The concept of 'row' becomes the concept of 'document'. JSON-like data structures, dynamic queries, efficient storage of binary data (like videos, images), mapreduce support account for their robust and easy use-cases.
  • Learn a functional language - or more than one.
    • It's about the paradigm shift and philosophy again. The more things you see and use the more complete you repertoire will become. Object-oriented / imperative design is not the only one out there. Take a look at Erlang for starters, it's easy to learn and with it you can dip your toe in the water, but for more serious stuffHaskell or OCaml is a must (I vote for Haskell though). I'd say learning a functional language is not an option anymore - it's a must. Some problems can be solved in an insanely easy manner with a functional approach and for example Haskell can easily implement any mathematic definition or problem you'd be having a problem describing in any imperative language. Also GHC (The Glasgow Haskell Compiler) is a state of the art optimizing compiler, one of the best compiler available now. Of course Haskell is not only for scientists, many good libraries are coming out written in haskell. Also see Real world Haskell for a nice intro. Erlang is well known for its fault tolerance, concurrency paradigms, hot-swappable code and exceptional networking support. Having such a tool at hand is always a bonus.
  • Study agile methods and concepts.
    • Agile management is not only for managers. There's a need for the whole team to have a good understanding about their own development and management process. Agile helps to standardize management and daily programmer work, enforcing a small, controllable devel/release/testing cycle and also encouraging good communication all across the team (actually agile just can't work without good communicatiion!). Just look at the Agile manifesto. Some important derivatives and parts of agile methods:
My old friend Muhuk has written a nice follow-up on this topic here - many good points, be sure to check it out!
I'd be glad to hear your opinion, feedbacks and probably huge list of things I've missed here! Thank you for reading this article.

Web Design Tips



Design 0.101 for Programmers

I am not a designer now I will never be a designer. I don't have the talent or the patience for it. Unfortunately my very close proximity to a designer for the past 10+ years has led me to tend to place a higher value on how things look than I did previously (or would probably prefer). 

This becomes an issue early in the development process when a web project is in it's beginning stage and tends to look like the illegitimate offspring of some jurassic-era reptiles. Sometimes we'll work from some nicely designed mockup's, but for larger development projects designing screens first and functionality later ends up being too constraining for the inevitable spec changes that come down the line (see: Specs: The Consultant's MacGuffin ).
I would rather have some flexibility in developing the specific interface elements rather than be limited to an initial design mockup. Designers in general usually prefer or should prefer to have a good a idea of all the elements that will needed to be in a site before really spending the time to generate a find-tuned design, so developing first and (graphically) designing later is a win-win.
... spending 8 hours a day working with something that looks like absolute garbage is incredibly demotivating.
Except that spending 8 hours a day working with something that looks like absolute garbage is incredibly demotivating. The default styles of most web browsers make simple markup look terrible. The good news is that the amount of effort it takes to make a HTML web application look half-way decent is pretty easy, more or less transferable from project to project, and doesn't add complexity that you'll regret later. 

Simply applying a simple header and footer along with a couple of class names to your elements along and a basic CSS file will go a long way towards making your application output prettier and easier on the eyes. I'm going to take three examples of non-styled output and go through a couple of easy steps to make them look a lot nicer: a piece of content, a form and a table. If you're already pretty comfortable with CSS there's not a lot new here, other than the idea of getting some design in earlier in the process than usual (click each image for the html version)

We're going for 4 basic rules to do this:

1. No defaults - just like most people still surf with IE because it's pre-installed there's a lot of websites that don't override the default styles. these are usually the websites that look like a 4-year-old's refrigerator drawing so when I see nothing but Times New Roman it looks like they didn't even try - unless they are doing it on purpose.
2. Differentiation - different elements should look different, so give elements like table cells one look and table headers a very different look - don't just make it bold or one point bigger - give it a background and make it way bigger. When two elements look too similar it ends up looking like either a mistake or just bad design.
3. Grouping - related elements should be grouped together as it makes it easier to tell what's connected on a page. That means adding extra padding between your paragraphs and columns. Pull up a well designed site in your browser and notice how easy it is for your eyes to scan around the different components of the page. Now look at your page - same thing?
4. Whitespace - in general the more the better. Properly spacing elements is the easiest way to improve the look of a site and make it look more professional - remember - when in doubt, pad it out. This is very connected to grouping but worth mentioning separately. White space invites the eye into to read the content.
We're also going to apply 1 meta rule to consider the entire time: Apply the rules above but stay consistent throughout the whole site - nothing looks worse than a mishmash of 60 different colors, fonts, sizes and spacing. So - apply the rules above, but do it in a consistent way - using just a couple different fonts, font sizes, colors, and background colors will make everything a lot easier on the eyes.

My designer gives me 1 baseline guideline: pick two fonts and three sizes and unless you know what you're doing stick to that or the site may start to look messy.

Getting a blank slate 

First things first - give yourself a decent doctype to make sure you are turning on "strict" mode so that you have some sort consistency across browsers:

Next pull in some sane defaults into your CSS file:
/* Reset all white-space to 0 for consistency across browsers */
* { margin:0px; padding:0px; } 

/* Default to some sans-serif font at a specific size */
body { font-family: Verdana, Arial, sans-serif; font-size:12px;  }

/* Get some padding between paragraphs and some line spacing */
p { padding-bottom:5px; line-height:1.4em; }

/* Put some padding back onto our list elements */
ul, ol { margin-left: 10px; }
li  { margin-left:10px; padding-left:10px; }

/* Bye bye ugly blue border */
a img { border:0px; } 

/* No dots around clicked links */
a, a:active { outline: none; }  

/* Class to any floated elements */
.clear { clear:both; }
Now you can do some more involved resets, but I've found the 8 lines of CSS get the job done. 

Giving the page some structure 

Next lets wrap the each of our pages in some sort of template - unstick stuff from the top left of your browser. If you have an idea what target width your website is going to be (many websites these days are fixed width as it's easier to control how stuff looks, but there are plenty of exceptions) you might as well put something in there so that you can get an idea of how much content will fit on the screen at once pretty early in the process. If you are going to have a sidebar (or think you might) put one is as well so that you're working with a realistic sized canvas for your dynamic data. Some sort of dummy navigation that you can swap out as new things are added in will help as well. Depending on how your developing you might have a layout template or a separate header and footer templates:



Now lets drop in a few lines of CSS to center and pad our page out and give it a little structure:
/* Set the width to 900 pixels, centered on the page with a little padding on top */
#container { width:900px; margin:0 auto; padding-top:10px; }

/* 90 pixels to work with at the top - positioned relative so that we can absolutely position our header elements easily */
#header { height:60px; position:relative; }
  #logo { position:absolute; left:0px; top:0px; }
  #tagline { position:absolute; right:0px; top:5px; color:#666666; font-size:14px; font-weight:bold; }

/* Quick right-aligned tab-looking text menu */
/* Make sure to be explicit with the padding and margin on our ul and li elements so we can change the defaults later on as necessary */
#main_menu { height:26px; border-bottom:3px solid #000000; margin-bottom:30px; }
  #main_menu ul { display:block; float:right; list-style-type:none; padding:0px; margin:0px;  }
  #main_menu li { display:block; float:left; margin:0 5px; padding:0px;  }
  #main_menu a { 
    padding:5px 20px;
    background-color: #000000;
  #main_menu a:hover { color: #000000; background-color:#666666; }

#content_container { 
   padding:10px 0px; 
   border-bottom: 1px solid #CCCCCC;
   /* Do the IE hack to get a minimum content container height */
   height:auto !important; 

  /* Floating left and then right means that we can play with the widths of the sidebar and content separately and not worry about explicitly setting the space between */
    #sidebar { float:left; width:200px; }
      .sidebar_header { font-weight:bold; padding-bottom:2px; border-bottom:1px solid #CCCCCC; margin-bottom: 5px;}
      .sidebar_content { padding-bottom:10px; }
    #content { float:right; width:650px; }

#footer { height:20px; position:relative; }
  #copyright { position:absolute; top:5px; right:0px; font-size:10px; color:#999999; }

Here's our three pages with the defaults CSS file and a little bit of structure added to them - already slightly better - they are starting to feel like a website and not something months away from being usable (click to go to the actual html files)

Ok, now lets go each page at a time and try to make them look a little nicer, starting with the piece of content.

Reworking content page

Let's attack the CSS for the content:
First, make the header stand out with a color,  some padding and a larger size.
Second, fix the information line closer to the header, make it smaller and lighten it up a little.
Third give our image some padding so the content isn't stuck to it.
/* Content Styles */

h1 { color: #333333; padding-bottom:15px; font-size:26px; }
.content .info { position:relative; top:-17px; font-size:11px; color:#999999; font-style:italic; } 
.content img { float:left; padding:0px 14px 10px 0px; }
p { color:#444444; }

That was easy, no? Content already looks significantly better and will be nicer to work with as it continues to get developed:

Reworking the form

Next onto our form. With forms, grouping is the most important rule to follow, so that's it easy to tell what's related to what. Now there are different styles of markup your can use to create your forms - for simplicity's sake lets assume you're using a div's and not a table, but either way works. You might have a form markup that looks something like:

Basic Information


First Name:

    Enter your first name


  ...More Items and headers...

If you're targeting ie6 you'll need to add that extra classname to your input elements somewhere to tell you what input type your dealing with, otherwise you can use input[type=text]

Let's take quick stab at some css for a horiztontal (labels next to elements) form. Here's what we're going to do:
  1. right align the labels and  put the description stuck below the field (grouping)
  2. padding out the elements a little (whitespace)
  3. separate out the headers (differentiation, grouping and whitespace)
  4. give the whole form some padding all around (whitespace)
  5. get rid of the default border and add in a psudeo-class when the field is focused. (no defaults)
  6. Align and  Pad out the button a little bit - make it easier to click and a little less default-looking.

a few lines of CSS should do the trick:
 /* Form Styles */
.horizontal_form .item { margin:10px 4px; }
.horizontal_form .item .label { 
.horizontal_form .item .description {
   padding-left: 160px; 
.horizontal_form .item .text_field {
  border:1px solid #999999;
  padding:2px 2px;
.horizontal_form .item .text_field:focus {
.horizontal_form .header {
  margin:15px 0px 10px 0px;
  border-bottom:1px solid #CCCCCC;
  color: #666666; 
.horizontal_form .button { margin-left:200px; padding-top:10px; }
.horizontal_form .button input { padding:4px 10px; }
And we're done:

Already much better, and what's nice is because this was all done with CSS a couple of rule changes and the form can look completely different.

Reworking the table 

Finally let's take care of the table, here's what we're going to do:

1. Get rid of cellspacing and cellpadding
2. Highlight the headers and pad them out a little bit
3. Give the table cells a consistent padding on the left and right as well as top and bottom.
4. Add in some sort of separation - either a thin border between rows or a striping effect looks nice.
 /* Table Styles */

table.account_table {   border-collapse: collapse; }
table.account_table th { 
  padding: 10px 10px;
  background-color: #7caaff; 
table.account_table td { 
  padding: 6px 10px;  
  border-bottom:1px solid #999999;
table.account_table tr.odd td {
table.account_table td.currency { text-align:right; }

And we're done:

Now, you're not going to replace your designer in your organization (nor should you want to, programmers are much better paid) - but at least your work-in-progress will look a lot nicer. The point of this tutorial, and of creating a very basic, black and white site was to show you how little design knowledge and creativity is necessary to make something look halfway decent. Your not going to win any awards, but I bet you get a better reaction from the client with a couple minutes of simple CSS styling than you do from the entire week you spent getting getting that complex javascript validation to work correctly.

There's one thing that you need to be careful about making things look too finished too early - your client was often assume that the better something looks the closer it is to being done. So, for parts of the project that aren't anywhere near being done, make sure there is a stark contrast with the parts that are approaching completion - put a big X through them or give them a grayed out background. (See: Joel on Software's post The Iceberg Secret which talks the issues with having something look "done" when it's not).
Side note: Some people have mentioned the use of CSS frameworks, such as 960 Grid System. I'm not a huge fan of those from a developer's perspective as they leak a lot of information about your layout and design into the HTML of your site, where I don't think it belongs. They are also "heavy" in that you need a lot of css to set up the grid.  I like css Zen Garden philosophy a lot better - separate your content as completely as possible from the design and layout - but to each his own (aka "Flame On!")