Sunday, January 15, 2012

Friday, January 13, 2012

Auto-Mount Hard Drives on Ubuntu

use Storage Device Manager




it is available on Ubuntu Software Center


Saturday, January 7, 2012

Sunday, January 1, 2012

Trim function for std::string

This is a simple and efficient function to trim a string class in C++

void trim(string& astring, const char t){
   string::iterator it;
   
   for (it=astring.begin() ; it < astring.end(); it++){
      if(*it==t){
           astring.erase(it);
       };
   }
}

usage example

trim (number, ' ');

I think it is quite clear.