<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6895406345069269025</id><updated>2026-10-13T17:05:17.438+05:30</updated><category term="Linux"/><category term="Ubuntu"/><category term="JDBC"/><category term="Terminal"/><category term="Ubuntu Software center"/><category term="Java SE"/><category term="JDBC-ODBC Bridge Driver"/><category term="Java"/><category term="OOP"/><category term="Runtime poymorphism"/><category term="Abstract Classes"/><category term="C++"/><category term="CRUD"/><category term="Java Swing"/><category term="MS Access Database connection in java"/><category term="Programs"/><category term="STL"/><category term="UNIX User communication commands"/><category term="Vector Operations"/><category term="Vectors"/><category term="Bash"/><category term="Basic Definitions and Keywords"/><category term="C Language"/><category term="CPU Utilisation"/><category term="Compiz"/><category term="DSN"/><category term="Dynamic method dispatch"/><category term="Interfaces"/><category term="NetBeans"/><category term="OOPS in C++"/><category term="Recursion"/><category term="Root"/><category term="Vector C++"/><category term="Vector Operations in C++"/><category term="Virus"/><category term="X server"/><category term=".bash_history"/><category term="Abstract Methods"/><category term="Algorithm Design"/><category term="Arrays"/><category term="Avant Window Navigator"/><category term="Black List"/><category term="Browsers"/><category term="Command History"/><category term="Compiz settings Ubuntu"/><category term="Configuring Databases from Eclipse"/><category term="Configuring Databases from Netbeans"/><category term="Constructor"/><category term="Constructors"/><category term="Ctrl-Alt-Backspace"/><category term="DIRSTACK"/><category term="Data Access Objects"/><category term="Data Structures"/><category term="Database Connection Eclipse IDE"/><category term="Database Connection Netbeans"/><category term="Desktop cube"/><category term="Digsby"/><category term="Docky"/><category term="ELinks Web Browser"/><category term="Eclipse Data Development"/><category term="Eclipse Database Tools"/><category term="Eclipse IDE"/><category term="Empathy features"/><category term="Empathy plugins"/><category term="F-Spot Photo Manager"/><category term="File manager"/><category term="Firefox"/><category term="Firestarter"/><category term="Firewall policies"/><category term="Firewall rules"/><category term="Flip flop"/><category term="Force Quit Applet"/><category term="GNOME"/><category term="GUI"/><category term="Gedit Color Schemes"/><category term="Gedit features"/><category term="Gedit plugins"/><category term="Gedit syntax highlighting"/><category term="Gimp"/><category term="Google chat disabled"/><category term="Hacking"/><category term="Hidden File"/><category term="IDE"/><category term="IM"/><category term="Inheritance"/><category term="Instant messengers"/><category term="Iteration"/><category term="JAR"/><category term="JDK"/><category term="JRE"/><category term="Javadocs"/><category term="Javascript"/><category term="KDE"/><category term="Kopete features"/><category term="Kopete plugins"/><category term="Launchers and Menus"/><category term="Links Web Browser"/><category term="Linux  Command line mode"/><category term="Linux Directory Stack"/><category term="Linux Operating System"/><category term="Linux file systems"/><category term="Linux is not Windows"/><category term="Lynx"/><category term="Mac OS"/><category term="MacBuntu"/><category term="MacBuntu and compiz"/><category term="Making Ubuntu look like Mac OS"/><category term="Natty Narwhal"/><category term="Netbeans Database tools"/><category term="Netfilter"/><category term="Network Manager applet"/><category term="Pidgin features"/><category term="Pidgin plugins"/><category term="Product"/><category term="Project"/><category term="Protocol services"/><category term="Register"/><category term="SQL Query Builder"/><category term="SQL Scrapbook"/><category term="Security in Ubuntu"/><category term="Segmentation fault"/><category term="Stack"/><category term="Stack overflow"/><category term="System Monitor"/><category term="Tail recursion"/><category term="Text mode web browsers"/><category term="UNIX bc command"/><category term="UNIX dirs command"/><category term="UNIX factor command"/><category term="UNIX finger command"/><category term="UNIX mail command"/><category term="UNIX news command"/><category term="UNIX popd command"/><category term="UNIX pushd command"/><category term="UNIX units command"/><category term="UNIX wall command"/><category term="UNIX who command"/><category term="UNIX write command"/><category term="Ubuntu 11.04"/><category term="Ubuntu Linux Firewall"/><category term="Ubuntu User Interface"/><category term="Ubuntu networking"/><category term="Unity Desktop"/><category term="Virus removal with Linux"/><category term="WINE"/><category term="Web Browser"/><category term="White List"/><category term="Windows"/><category term="X Window System"/><category term="contentEditable"/><category term="deque"/><category term="digital"/><category term="ext4 file system"/><category term="gdb"/><category term="gdb commands"/><category term="gdb tutorial"/><category term="history command"/><category term="lists"/><category term="main function &quot;C&quot;"/><category term="main( ) inside main( ) in C"/><category term="official repositories"/><category term="sequence container"/><category term="void"/><title type='text'>Sai Ravi Kiran - Technology World</title><subtitle type='html'>My name is &lt;a href=&quot;https://about.me/sairavikiran&quot;&gt;Sai Ravi Kiran Mallampati&lt;/a&gt;.&#xa;&#xa;In this blog, I am writing blog posts about Ubuntu, UNIX Commands, IDE&#39;s, Java, C++ etc.,</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-1472656547234697284</id><published>2012-07-29T11:56:00.001+05:30</published><updated>2012-08-06T18:31:01.280+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Classes"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfaces"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java SE"/><category scheme="http://www.blogger.com/atom/ns#" term="JDBC"/><category scheme="http://www.blogger.com/atom/ns#" term="OOP"/><category scheme="http://www.blogger.com/atom/ns#" term="Runtime poymorphism"/><title type='text'>How Interfaces are used internally in Java</title><content type='html'>Before reading this post, I recommend you to go through the following posts:&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;Interfaces in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot; target=&quot;_blank&quot;&gt;Runtime Polymorphism in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;Abstract Classes in Java : Runtime polymorphism&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interfaces&lt;/a&gt; have played a key role in making the architecture of Java robust and uniform. The &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interfaces&lt;/a&gt; are used in many places in Java. They are extensively used in JDBC architecture, Collections framework, Multi-threading etc., We will see in detail how &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interfaces&lt;/a&gt; have become crucial for Java to become robust and maintain the uniformity.&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;Interfaces&lt;/a&gt; used in JDBC:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;Interfaces&lt;/a&gt; are so well used in architecture of JDBC by Java. I should say Java has got most of the flexibility mainly from &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;interfaces&lt;/a&gt; and &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;abstract classes&lt;/a&gt;. In fact, what Java has done is defined all the method-names in the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interfaces&lt;/a&gt;. It did not give any implementation for any of the methods. So, what the&amp;nbsp; DBMS has to do is just use these method-names and build implementation according to the DBMS implementation. In case of migration from one DBMS to other DBMS literally, only the database driver URL, username, password for connection have to be changed.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now consider a situation without &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;interfaces&lt;/a&gt; in Java. In such cases, each DBMS will have its own set of method-implementations and method-names for specific functionalities in Java. Eventually, the method-names for database processing such as executing SQL stored procedures will differ from one DBMS to other DBMS. Now if we want to just change the DBMS we need to change the entire database processing code instead of just changing the driver URL, username and password.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;Interfaces&lt;/a&gt; used in Multi-Threading:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Similarly &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;interfaces&lt;/a&gt; are critical in view of the multi-threading. We know that a thread can be created by two methods.&lt;br /&gt;
1. Extending Thread class.&lt;br /&gt;
2. Implementing Runnable interface.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now the first method can impair you in one way. If you extend Thread class, there is no way that you can extend another class since multiple inheritance is not allowed in Java. Now the second option is always good since we can create a class that implements any number of &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interfaces&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;Interfaces&lt;/a&gt; used in Collections framework:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Another place where Java has made use of the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;interfaces&lt;/a&gt; is the Collections framework. The Collection framework is the most basic interface. It contains methods to add, remove, search and iterate over list. These are most general functionalities provided. The List, Set and Queue &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interfaces&lt;/a&gt; extend the Collections &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interface&lt;/a&gt;. These interfaces have their specific functionalities in addition to those provided by the Collection &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot;&gt;interface&lt;/a&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/interfaces-in-java.html&quot; target=&quot;_blank&quot;&gt;Interfaces in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot; target=&quot;_blank&quot;&gt;Runtime Polymorphism in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;Abstract Classes in Java : Runtime polymorphism&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/java-database-connectivity-with-ms.html&quot; target=&quot;_blank&quot;&gt;Java Database Connectivity with MS Access -- Part 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/java-database-connectivity-with-ms_30.html&quot; target=&quot;_blank&quot;&gt;Java Database Connectivity with MS Access -- Part 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/java-database-connectivity-with-ms_3244.html&quot; target=&quot;_blank&quot;&gt;Java Database Connectivity with MS Access -- Part 3&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/1472656547234697284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/how-interfaces-are-used-internally-in.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/1472656547234697284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/1472656547234697284'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/how-interfaces-are-used-internally-in.html' title='How Interfaces are used internally in Java'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-6645752245893664204</id><published>2012-07-28T18:21:00.000+05:30</published><updated>2012-08-06T18:28:34.461+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Classes"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfaces"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java SE"/><category scheme="http://www.blogger.com/atom/ns#" term="OOP"/><category scheme="http://www.blogger.com/atom/ns#" term="Runtime poymorphism"/><title type='text'>Interfaces in Java</title><content type='html'>Before reading this post, I recommend you to read the following posts.&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot; target=&quot;_blank&quot;&gt;Runtime polymorphism in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;Abstract Classes in Java:Runtime polymorphism&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
An interface is a collection of methods that must be implemented by the implementing class. An interface only tells the class what to do. Thus, the interfaces only have the declaration of member variables and methods. Implementing class defines all the methods declared in the interface. If a class implements an interface and does not implement all the methods then the class must be declared as &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;abstract&lt;/a&gt;. Variables in interface automatically become static and final variables of the implementing class. Members of interface are implicitly public. A class cannot narrow the accessibility of an interface.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
An object reference of an interface can refer to an object of implementing class. However, only methods that are present in the interface can be called using the object reference of interface.&lt;br /&gt;
&lt;br /&gt;
Now lets put the interface into implementation. We consider the implementation of the Stack data structure. Below is the Stack interface and its implementing class MyStack.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;83&quot; readonly=&quot;readonly&quot; rows=&quot;20&quot; style=&quot;resize: none;&quot;&gt;interface Stack
{
 void push(String str);
 String pop();
 int length();
}

class MyStack implements Stack
{
 private String a[]=new String[10];
 private int top=0;
 
 public void push(String str)
 {
  a[top]=str;
  top++;
 }

 public String pop()
 {
  top--;
  return a[top];
 }

 public int length()
 {
  return top;
 }

 public void print()
 {
  for(int i=0;i&amp;lt;top;i++)
   System.out.println(a[i]);
 }
}
&lt;/textarea&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
The public class which uses the interface and its implementing class is as follows.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;83&quot; readonly=&quot;readonly&quot; rows=&quot;10&quot; style=&quot;resize: none;&quot;&gt;public class UseStack
{
 public static void main(String args[])
 {
  MyStack ms=new MyStack();
  ms.push(&quot;First&quot;);
  ms.push(&quot;Second&quot;);
  ms.print();
  System.out.println(ms.pop());

  // Obj. ref. of interface refer to object of implementing class 
  Stack s;
  s=new MyStack();
  s.push(&quot;1&quot;);
  s.push(&quot;2&quot;);
  // s.print();    
  // Will not compile since print() is not in the interface Stack
  System.out.println(s.pop());
 }
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Interface Vs. Abstract Class:&lt;/i&gt;&lt;/b&gt; &lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Both interface and &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;abstract class&lt;/a&gt; cannot have objects, but can have object references. In case of interface, object reference can reference an object of the implementing class. An object reference of &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;abstract class&lt;/a&gt; can reference an object of subclass. However, &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;abstract class&lt;/a&gt; can have non-abstract methods and instance variables but interface can have neither of them.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Java allows interfaces to be empty. An empty interface contains no variables and methods. It is used to mark a class to be having certain behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Related Posts:&lt;/b&gt; &lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/abstract-classes-runtime-polymorphism.html&quot; target=&quot;_blank&quot;&gt;Abstract Classes in Java:Runtime polymorphism&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot; target=&quot;_blank&quot;&gt;Runtime polymorphism in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/how-interfaces-are-used-internally-in.html&quot;&gt;How Interfaces are used internally in Java &lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/6645752245893664204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/interfaces-in-java.html#comment-form' title='40 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6645752245893664204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6645752245893664204'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/interfaces-in-java.html' title='Interfaces in Java'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>40</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-7437966218985168216</id><published>2012-07-22T11:28:00.001+05:30</published><updated>2012-08-06T18:27:25.931+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Classes"/><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Methods"/><category scheme="http://www.blogger.com/atom/ns#" term="Dynamic method dispatch"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OOP"/><category scheme="http://www.blogger.com/atom/ns#" term="Runtime poymorphism"/><title type='text'>Abstract Classes: Runtime Polymorphism</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Before reading this post, I recommend you to go through
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot; target=&quot;_blank&quot;&gt;Runtime Polymorphism&lt;/a&gt; since this post is an extension of the same. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Consider an organization where an
Employee can be a Regular Employee or a Consultant. After all, an employee
cannot be just an employee. An employee is under one of these categories. To
simulate these types of cases in OOP, we make use of abstract classes in Java. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
An abstract method (pure virtual
function in C++) doesn’t contain a body. An abstract method must be overridden
in subclass. Otherwise, the subclass will become abstract. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
A class having one or more
abstract functions can be declared as an abstract class. We cannot create an object
for an abstract class. However, an object reference for an abstract class can
be created. Now you may doubt the use of creating a class without an object. For
example, in the above example, an object of the Employee class should not be
created since an employee cannot just be an employee. Such types of classes should
be defined as abstract classes. Now if we allow the objects to be created for
an Employee class, it might lead to extra memory usage and also might defeat
the very purpose of &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot;&gt;runtime polymorphism&lt;/a&gt;. But we can create an object reference
of Employee and point it to an object of its subclass. This is where &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot;&gt;runtimepolymorphism&lt;/a&gt; again comes into picture. In the previous post, you must have
already read the golden rule of &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot; target=&quot;_blank&quot;&gt;Runtime Polymorphism&lt;/a&gt;: “&lt;b&gt;An object reference of a
super class can always point to an object of a subclass.&lt;/b&gt;” Instead of the super
class object reference pointing to an object of subclass, we now make the
abstract class object reference pointing to an object of a subclass.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
The implementation for Employee Class is given below.&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;20&quot; style=&quot;resize: none;&quot;&gt;public abstract class Employee {
 private int emp_id;
 private String emp_name;

 public Employee(int emp_id, String emp_name) {
  this.emp_id = emp_id;
  this.emp_name = emp_name;
 }

 public int getEmp_id() {
  return emp_id;
 }

 public void setEmp_id(int emp_id) {
  this.emp_id = emp_id;
 }

 public String getEmp_name() {
  return emp_name;
 }

 public void setEmp_name(String emp_name) {
  this.emp_name = emp_name;
 }
 
 // Abstract Function since implementation differs
 protected abstract int getPay();
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation for RegularEmployee class is given below.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;10&quot; style=&quot;resize: none;&quot;&gt;public class RegularEmployee extends Employee {
 private int salary;
 
 public RegularEmployee(int emp_id, String emp_name,int salary) {
  super(emp_id, emp_name);
  this.salary=salary;
 }

 @Override
 protected int getPay() {
  return salary;
 }
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation for Consultant class is given below.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;10&quot; style=&quot;resize: none;&quot;&gt;public class Consultant extends Employee {
 private int no_hours,hour_rate;
 
 public Consultant(int emp_id, String emp_name,int no_hours,int hour_rate) {
  super(emp_id, emp_name);
  this.no_hours=no_hours;
  this.hour_rate=hour_rate;
 }

 @Override
 protected int getPay() {
  return no_hours*hour_rate;
 }
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
You can observe that the abstract method in the superclass is overridden in both the above subclasses. Now we will see how &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html&quot;&gt;runtime polymorphism&lt;/a&gt; can be applied using abstract classes.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;10&quot; style=&quot;resize: none;&quot;&gt;Employee emp;
// Objects for abstract classes not created
// Object Reference emp created
  
emp=new RegularEmployee(1,&quot;Sai&quot;,2000);
// Object ref. of super class refers to an object of subclass
System.out.println(&quot;Regular Employee&#39;s Pay:&quot;+emp.getPay());
  
emp=new Consultant(2,&quot;Ravi&quot;,100,20);
// Object ref. of super class refers to an object of subclass
System.out.println(&quot;Consultant&#39;s Pay:&quot;+emp.getPay());
&lt;/textarea&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
A class can be declared as an
abstract class even though it doesn’t contain any abstract methods. This can be
used in situations where there are no abstract functions to be overridden in
the subclasses, but at the same time, the abstract class should not have an object.
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
An abstract class can contain
other non-abstract members such as methods and instance variables.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/essence-of-oop-runtime-polymorphism-in.html%20&quot; target=&quot;_blank&quot;&gt;Runtime Polymorphism&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.com/2012/07/interfaces-in-java.html&quot;&gt;Interfaces in Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/07/how-interfaces-are-used-internally-in.html&quot;&gt;How Interfaces are internally used in Java&lt;/a&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/7437966218985168216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/abstract-classes-runtime-polymorphism.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7437966218985168216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7437966218985168216'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/abstract-classes-runtime-polymorphism.html' title='Abstract Classes: Runtime Polymorphism'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-4593703728253585297</id><published>2012-07-08T18:24:00.000+05:30</published><updated>2012-07-08T18:28:26.038+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Dynamic method dispatch"/><category scheme="http://www.blogger.com/atom/ns#" term="Inheritance"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OOP"/><category scheme="http://www.blogger.com/atom/ns#" term="Runtime poymorphism"/><title type='text'>Essence of OOP: Runtime Polymorphism in Java</title><content type='html'>&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;This post does not give the definitions of Runtime polymorphism or Dynamic method dispatch. Instead, it helps Java beginners (or any OOP Beginner) to use runtime polymorphism. I personally think Inheritance and Runtime polymorphism forms the crust of OOP (not just in Java but in all other OOP Languages also).&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The entire dynamic method dispatch is based on the rule that an object reference of the super class can refer to an object of any subclass in the hierarchy. This can be explained with the following example.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Consider there are two classes Person and Faculty. Person class is the super class of Faculty class.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ72VBfXPoPdlA0FFiIjigkfByatIZjFFJuykKFbEJh3vsULxTTSHocTamu1urNsVanlrnhDFpxeHS_S6DyddlPaSQ7ZUMHyct_7PfFeM6kkmZfVXA5F_zUQ4JvRcbnV5ITEQbM0ekM48/s1600/Class_Diagram.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ72VBfXPoPdlA0FFiIjigkfByatIZjFFJuykKFbEJh3vsULxTTSHocTamu1urNsVanlrnhDFpxeHS_S6DyddlPaSQ7ZUMHyct_7PfFeM6kkmZfVXA5F_zUQ4JvRcbnV5ITEQbM0ekM48/s400/Class_Diagram.png&quot; width=&quot;246&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Since superclass and subclass share IS A relationship, every Faculty is a Person. So, whenever Java expects Person, a Faculty can be used. This kind of implicit casting is called upcasting.&lt;br /&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;4&quot; style=&quot;resize: none;&quot;&gt;Faculty f=new Faculty(&quot;Sai&quot;,&quot;sairavikiran@java.com&quot;,&quot;Java SE&quot;);
Person p=f;               // Upcasting done Implicitly 
Person p= (Person) f;     // Explicit
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Unlike in upcasting, every Person need not be a Faculty. Thus, if we use Person in place of Faculty, explicit casting needs to be done. Therefore, we need to use explicit typecasting in order to perform this operation. This kind of explicit casting is called as downcasting.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;4&quot; style=&quot;resize: none;&quot;&gt;Person p=new Faculty(&quot;Sai&quot;,&quot;sairavikiran@java.com&quot;,&quot;Java SE&quot;);
Faculty f=p;              // Downcasting should be done explicitly. Doesn&#39;t compile
Faculty f= (Faculty) p;   // Downcasting should be done explicitly.
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
In runtime polymorphism, the call to an overridden method is resolved at runtime instead of compile time. It occurs when an overridden method is called using an object reference of superclass. Remember that you can only call methods which are present in the super class.&lt;br /&gt;
&lt;br /&gt;
Now let us extend the previous mentioned example with another subclass to &quot;Person&quot; class: NonTeaching class. Now the class diagram is as follows:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEsJZO9zFwdqGIjdbvBVwsmTm7UGdesB6T7ifhytECFC9eZ2kO-HFbs7uAIwuo6XhIrW2Ba2VPKs1tf5PhyphenhyphenfNryOkhgXXYVda-2v0kgKG_YchacVBQDLN59OjldiJLhCUJROo5ZVdonvw/s1600/Class_Diagram%25282%2529.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;326&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEsJZO9zFwdqGIjdbvBVwsmTm7UGdesB6T7ifhytECFC9eZ2kO-HFbs7uAIwuo6XhIrW2Ba2VPKs1tf5PhyphenhyphenfNryOkhgXXYVda-2v0kgKG_YchacVBQDLN59OjldiJLhCUJROo5ZVdonvw/s400/Class_Diagram%25282%2529.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
The below class demonstrates the runtime polymorphism for the above class diagram.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;15&quot; style=&quot;resize: none;&quot;&gt; 
public class UseRuntimePoly {
	public static void main(String[] args) {
		Person p;	// Object reference of &quot;Person&quot; class		
		
		p=new Faculty(&quot;Sai&quot;,&quot;sai@gmail.com&quot;,&quot;Java&quot;);
		// Object reference of superclass refers to an object of subclass.
		p.printDetails();
                // Calls the printDetails() in subclass(Faculty)
		
		p=new NonTeaching(&quot;Ravi&quot;, &quot;ravi@gmail.com&quot;, &quot;Principal&quot;);
		// Object reference of superclass refers to an object of subclass.
		p.printDetails();
                // Calls the printDetails() in subclass(NonTeaching)
	}
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
As can be seen from the code above, Java calls appropriate method depending on the object pointed to by the object reference. In the first case, the object reference p is pointed to the object of Faculty class. So, the printDetails() from the Faculty class is called. In the second case, p points to object of NonTeaching class. Thus, the printDetails() from the NonTeaching class is called.
&lt;/div&gt;
&lt;br /&gt;
Always remember that the dynamic method dispatch is applied only to method that is defined in the super class, overridden in subclass and invoked using an object reference of superclass.</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/4593703728253585297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/essence-of-oop-runtime-polymorphism-in.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/4593703728253585297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/4593703728253585297'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/essence-of-oop-runtime-polymorphism-in.html' title='Essence of OOP: Runtime Polymorphism in Java'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ72VBfXPoPdlA0FFiIjigkfByatIZjFFJuykKFbEJh3vsULxTTSHocTamu1urNsVanlrnhDFpxeHS_S6DyddlPaSQ7ZUMHyct_7PfFeM6kkmZfVXA5F_zUQ4JvRcbnV5ITEQbM0ekM48/s72-c/Class_Diagram.png" height="72" width="72"/><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-8891444253965727236</id><published>2012-07-07T19:21:00.000+05:30</published><updated>2012-08-06T18:07:07.248+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="gdb"/><category scheme="http://www.blogger.com/atom/ns#" term="gdb commands"/><category scheme="http://www.blogger.com/atom/ns#" term="gdb tutorial"/><title type='text'>gdb tutorial</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
.textborder {
border: 1px solid #000000;
}
--&gt;
&lt;/style&gt;

Sometimes when you build a project in C++, it might become necessary that the code needs to be changed/added. In such cases, debugging the entire project becomes really very important because you need to ensure that the program flow is correct and no regression takes place.
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In this post, we will debug the case study which we implemented in C++ demonstrating the employee register with the help of &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;vectors&lt;/a&gt;. To know about how this case study is implemented, read the following posts:
&lt;/div&gt;
1.&amp;nbsp;&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;Vector Operations - API&lt;/a&gt;&lt;br /&gt;
2.&amp;nbsp;&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-2.html&quot; target=&quot;_blank&quot;&gt;Vector Operations - Implementation&lt;/a&gt;&lt;br /&gt;
3.&amp;nbsp;&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-3.html&quot; target=&quot;_blank&quot;&gt;Vector Operations - Implementation part 2&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
We will use GNU C debugger in order to debug the case study. To start debugging of the case study, first we need to type the following command:
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
g++ -g &quot;files.cpp&quot;
&lt;/div&gt;
&lt;br /&gt;
which in our case transforms to be:
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
g++ -g EmployeeRegister.cpp Employee.cpp Display.cpp main.cpp
&lt;/div&gt;
&lt;br /&gt;
To start debugging, invoke gdb with the following command:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
gdb a.out
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
To debug the entire case study, we will set a breakpoint in main.cpp from the beginning of main function. If you need to debug only a part of a huge project, you can specify that particular file with line number. The idea of this breakpoint is to run the project till that particular breakpoint and from there on, we can inspect or evaluate what each programming statement is actually doing.
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
break file.cpp:line_no&lt;/div&gt;
&lt;br /&gt;
which in our case is:
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
break main.cpp:3&lt;/div&gt;
&lt;br /&gt;
Now we want to start running the code line by line with the following command.
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
run
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
To go to the next line for debugging, execute the n command in gdb prompt.&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;When you encounter any function and you want to get inside the function definition, use the s command. This is similar to the &lt;b&gt;Step Into&lt;/b&gt; functionality in debugging.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
In between when you want to check the value of any variable, use the following command:
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;textborder&quot;&gt;
p variable_name
&lt;/div&gt;
&lt;br /&gt;
To exit the GNU C debugger, use the q or quit command.&lt;br /&gt;
&lt;br /&gt;
Now let us use all the above mentioned&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;gdb&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;commands in the case study.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;25&quot; style=&quot;resize: none;&quot;&gt;(gdb) break main.cpp:6
Breakpoint 1 at 0x40399f: file main.cpp, line 6.
(gdb) run
Starting program: /home/sairavikiran/Documents/Employee Register/a.out 

Breakpoint 1, main () at main.cpp:6
6  EmployeeDisplay d;
(gdb) s
EmployeeDisplay::EmployeeDisplay (this=0x7fffffffe130) at Display.h:9
9 class EmployeeDisplay
(gdb) n
main () at main.cpp:7
7  d.menuLooping();
(gdb) s
EmployeeDisplay::menuLooping (this=0x7fffffffe130) at Display.cpp:41
41  Employee emp;
(gdb) n
44   displayMenu();
(gdb) n

 ******************************************************************
 ****************WELCOME TO THE EMPLOYEE REGISTER******************
 ******************************************************************
 1. Add an employee
 2. Delete an employee
 3. Display Employees list
 4. Update an employee
 5. Exit
45   choice=getIntegers(&quot;choice&quot;);
(gdb) n

 Enter the choice: 1
46   switch(choice)
(gdb) n
48    case 1: id=getIntegers(&quot;Employee ID of the employee to be added&quot;);
(gdb) p choice
$1 = 1
(gdb) n

 Enter the Employee ID of the employee to be added: 1
49     if(emp_reg.searchEmployee(id)!=-1)
(gdb) s
EmployeeRegister::searchEmployee (this=0x7fffffffe130, id=1) at EmployeeRegister.cpp:44
44  vector&amp;lt;int&amp;gt;::iterator id_it;
(gdb) n
45  id_it=find(emp_id_records.begin(),emp_id_records.end(),id);
(gdb) n
48  if(id_it==emp_id_records.end())
(gdb) n
49   return -1;
(gdb) n
53 }
(gdb) n
EmployeeDisplay::menuLooping (this=0x7fffffffe130) at Display.cpp:54
54     name=getStrings(&quot;Employee name of the employee to be added&quot;);
(gdb) s
EmployeeDisplay::getStrings (this=0x7fffffffe130, str=...) at Display.cpp:20
20  char* name=new char[40];
(gdb) n
21  cout&amp;lt;&amp;lt;&quot;\n Enter the &quot;&amp;lt;&amp;lt;str&amp;lt;&amp;lt;&quot;: &quot;;
(gdb) n

22  getchar();
(gdb) n
23  cin.get(name,201);
(gdb) n
 Enter the Employee name of the employee to be added: sai
25  return name;
(gdb) n
26 }
(gdb) n
EmployeeDisplay::menuLooping (this=0x7fffffffe130) at Display.cpp:56
56     emp.setId(id);
(gdb) n
57     emp.setName(name);
(gdb) n
59     emp_reg.addEmployee(emp);  
(gdb) p id
$3 = 1
(gdb) p name
$4 = 0x608010 &quot;sai&quot;
(gdb) n



---------------------------------------------------------
 Employee successfully added with the following details
---------------------------------------------------------
 Employee ID:   1
 Employee Name:  sai
---------------------------------------------------------

60     break; 
(gdb) n
42  do
(gdb) n
44   displayMenu();
(gdb) n

 ******************************************************************
 ****************WELCOME TO THE EMPLOYEE REGISTER******************
 ******************************************************************
 1. Add an employee
 2. Delete an employee
 3. Display Employees list
 4. Update an employee
 5. Exit
45   choice=getIntegers(&quot;choice&quot;);
(gdb) q
A debugging session is active.

 Inferior 1 [process 4489] will be killed.

Quit anyway? (y or n) y
sairavikiran@ubuntu:~/Documents/Employee Register$ 

&lt;/textarea&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;Vector Operations - API&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-2.html&quot; style=&quot;background-color: white;&quot; target=&quot;_blank&quot;&gt;Vector Operations - Implementation&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-3.html&quot; target=&quot;_blank&quot;&gt;Vector Operations - Implementation part 2&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/8891444253965727236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/gdb-gnu-c-debugger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/8891444253965727236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/8891444253965727236'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/gdb-gnu-c-debugger.html' title='gdb tutorial'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-3663636811449844768</id><published>2012-07-01T11:45:00.002+05:30</published><updated>2012-07-01T11:45:31.785+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Configuring Databases from Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="Database Connection Eclipse IDE"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse Data Development"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse Database Tools"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse IDE"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Query Builder"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Scrapbook"/><title type='text'>Using Eclipse Database Tools -- Access Database from Eclipse IDE</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Know Java?? Used Eclipse?? Bored with Database command
interface?? Want to access database from Eclipse?? Then this post is for you...&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
We can access database from the Eclipse IDE itself
whenever you want to check some database tables in the middle of a Java or PHP
project. So, life becomes easier when you can do everything related to a
project in a single tool. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
To configure Database access in Eclipse IDE, first we need
to open the Database Development perspective. In the Data Source Explorer, you
can add a database connection by right-clicking on Database Connection &amp;gt;
New.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;v:shapetype coordsize=&quot;21600,21600&quot; filled=&quot;f&quot; id=&quot;_x0000_t75&quot; o:preferrelative=&quot;t&quot; o:spt=&quot;75&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; stroked=&quot;f&quot;&gt;
 &lt;v:stroke joinstyle=&quot;miter&quot;&gt;
 &lt;v:formulas&gt;
  &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;&gt;
  &lt;v:f eqn=&quot;sum @0 1 0&quot;&gt;
  &lt;v:f eqn=&quot;sum 0 0 @1&quot;&gt;
  &lt;v:f eqn=&quot;prod @2 1 2&quot;&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;&gt;
  &lt;v:f eqn=&quot;sum @0 0 1&quot;&gt;
  &lt;v:f eqn=&quot;prod @6 1 2&quot;&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;&gt;
  &lt;v:f eqn=&quot;sum @8 21600 0&quot;&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;&gt;
  &lt;v:f eqn=&quot;sum @10 21600 0&quot;&gt;
 &lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;
 &lt;v:path gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot; o:extrusionok=&quot;f&quot;&gt;
 &lt;o:lock aspectratio=&quot;t&quot; v:ext=&quot;edit&quot;&gt;
&lt;/o:lock&gt;&lt;/v:path&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;v:shape alt=&quot;step 1.png&quot; id=&quot;Picture_x0020_0&quot; o:spid=&quot;_x0000_i1033&quot; style=&quot;height: 129pt; mso-wrap-style: square; visibility: visible; width: 316.5pt;&quot; type=&quot;#_x0000_t75&quot;&gt;
 &lt;v:imagedata o:title=&quot;step 1&quot; src=&quot;file:///C:%5CUsers%5CSony%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png&quot;&gt;
&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn8En4phVgV0xYxD4bg3D_z_ekJlzboQ74kIkjGhJRTWM2Dpg7BXX-Fa2NLxZf98E_YGtKTcq3rxKnUjhqhW5TaLOnlnSSAABhcneohv_YLvXkQUAqB-8JDhrf0RefdbAhOSLx3lJjuQ0/s1600/step+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn8En4phVgV0xYxD4bg3D_z_ekJlzboQ74kIkjGhJRTWM2Dpg7BXX-Fa2NLxZf98E_YGtKTcq3rxKnUjhqhW5TaLOnlnSSAABhcneohv_YLvXkQUAqB-8JDhrf0RefdbAhOSLx3lJjuQ0/s400/step+1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;The list of all the DBMS will be listed in the next wizard
as shown below.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwASMIPHs66jYQJ8rUgkWS9YEfE7w3LViBuK3u4n_Rja2jechhCwPitcSPw5ad9ZH-qFj0TrMYwzl8fd-Lh9bpwhd9xI3v2Jxvyw8iA-7YPEYWqbq2Wptd56ZGBy0AY0JcEJqcpv_t32U/s1600/step+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwASMIPHs66jYQJ8rUgkWS9YEfE7w3LViBuK3u4n_Rja2jechhCwPitcSPw5ad9ZH-qFj0TrMYwzl8fd-Lh9bpwhd9xI3v2Jxvyw8iA-7YPEYWqbq2Wptd56ZGBy0AY0JcEJqcpv_t32U/s400/step+2.png&quot; width=&quot;318&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;v:shape alt=&quot;step 2.png&quot; id=&quot;Picture_x0020_1&quot; o:spid=&quot;_x0000_i1032&quot; style=&quot;height: 492.75pt; mso-wrap-style: square; visibility: visible; width: 393.75pt;&quot; type=&quot;#_x0000_t75&quot;&gt;
 &lt;v:imagedata o:title=&quot;step 2&quot; src=&quot;file:///C:%5CUsers%5CSony%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image002.png&quot;&gt;
&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Click on the new Driver definition button as indicated in
the below figure.&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;v:shape alt=&quot;step 3.png&quot; id=&quot;Picture_x0020_2&quot; o:spid=&quot;_x0000_i1031&quot; style=&quot;height: 492.75pt; mso-wrap-style: square; visibility: visible; width: 393pt;&quot; type=&quot;#_x0000_t75&quot;&gt;
 &lt;v:imagedata o:title=&quot;step 3&quot; src=&quot;file:///C:%5CUsers%5CSony%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image003.png&quot;&gt;
&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA9Gf5M0WUBC47eWC8scCvHIMrupDZhHzIXf70Fc72bAW1JJSKUKqzx4Os7LsgG_R5POmImvo2rZLCJhf9hc6vdNuBPnRcwniTNginGo90_Y0yKILGPpLhfKeSK8SgeP8-wogjuCEu2Jk/s1600/step+3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA9Gf5M0WUBC47eWC8scCvHIMrupDZhHzIXf70Fc72bAW1JJSKUKqzx4Os7LsgG_R5POmImvo2rZLCJhf9hc6vdNuBPnRcwniTNginGo90_Y0yKILGPpLhfKeSK8SgeP8-wogjuCEu2Jk/s400/step+3.png&quot; width=&quot;318&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;
&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Specify the Driver type &amp;gt; JAR file &amp;gt; Username,
Password and Other Database Server details.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;v:shape alt=&quot;step 8.png&quot; id=&quot;Picture_x0020_9&quot; o:spid=&quot;_x0000_i1026&quot; style=&quot;height: 492.75pt; mso-wrap-style: square; visibility: visible; width: 396pt;&quot; type=&quot;#_x0000_t75&quot;&gt;
 &lt;v:imagedata o:title=&quot;step 8&quot; src=&quot;file:///C:%5CUsers%5CSony%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image008.png&quot;&gt;
&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX0SiZsKdG3MWhgXIxxuATqfhzFVp602fKHFtHKqQQMWjYQ1eB6OSKfVMKhnkKFAjoFlJAHnrC1k5RrffX-yKqr5fIkO5DRveYVZZkcPHJrYjiVcr5v1_4rLDwgiQh_0QzDrN3g4PJoQA/s1600/step+4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;332&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX0SiZsKdG3MWhgXIxxuATqfhzFVp602fKHFtHKqQQMWjYQ1eB6OSKfVMKhnkKFAjoFlJAHnrC1k5RrffX-yKqr5fIkO5DRveYVZZkcPHJrYjiVcr5v1_4rLDwgiQh_0QzDrN3g4PJoQA/s400/step+4.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpZTG2JFWtA5ywijqGsPTgAV6ewBfgnRmebJN9joC3i-Z3yrIkNu1nJZTXjOmqacuZUMEdqD_eucZQbmvYxgv_I-1Gpg0fkA4ImDRLOU0zgRb-vSzZtP0bWamzkB10Wh_1ghPJNJF8wA8/s1600/step+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;332&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpZTG2JFWtA5ywijqGsPTgAV6ewBfgnRmebJN9joC3i-Z3yrIkNu1nJZTXjOmqacuZUMEdqD_eucZQbmvYxgv_I-1Gpg0fkA4ImDRLOU0zgRb-vSzZtP0bWamzkB10Wh_1ghPJNJF8wA8/s400/step+5.png&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilSS5aQm8mOMvCXLI-tQYBM6BaB2YK9M-R7mnfO0_q-k5IPhI1mTBLKvvgKu-huPPAsXYhkppF184XklfIr1991p4kizuduCk74Kfu4gDCk1usHXLJWRNFUXEYT99YYNbrrl25x_FPxiw/s1600/step+6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;333&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilSS5aQm8mOMvCXLI-tQYBM6BaB2YK9M-R7mnfO0_q-k5IPhI1mTBLKvvgKu-huPPAsXYhkppF184XklfIr1991p4kizuduCk74Kfu4gDCk1usHXLJWRNFUXEYT99YYNbrrl25x_FPxiw/s400/step+6.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
You can Test the connection by clicking on the Test Connection
Button available in the below wizard. If ping gets succeeded, then click on Next.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP-hH1vYQ74ZTGguZxshdVUVL8_b7YD1gL_7zWOvHHaYApSYzRkmGNIiUuY9qbpVtqtcN6f38C90jAYvbQ8k4QuGQrKUaX2I-DFDAxnk4RkCrnHlGzEhzAXcrGygW1GiK3rqE5W8VctMo/s1600/step+7.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP-hH1vYQ74ZTGguZxshdVUVL8_b7YD1gL_7zWOvHHaYApSYzRkmGNIiUuY9qbpVtqtcN6f38C90jAYvbQ8k4QuGQrKUaX2I-DFDAxnk4RkCrnHlGzEhzAXcrGygW1GiK3rqE5W8VctMo/s400/step+7.png&quot; width=&quot;322&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Verify whether all the details are correctly filled in and
click on Finish.&lt;br /&gt;
&amp;nbsp; &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqH9Pt1bzkIP02vFvwDKe5Re_HKrAb_5cDmhWdiXAQav9RhF6x3Dg6YJ27mdaPStzA1y_a79zBU3xX78u7Vw6ujnzoZyLe4Q7MdpzRHdApLdB8R5wT381R6RTBHEh-jY5Wjy9NXtkKgkM/s1600/step+8.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqH9Pt1bzkIP02vFvwDKe5Re_HKrAb_5cDmhWdiXAQav9RhF6x3Dg6YJ27mdaPStzA1y_a79zBU3xX78u7Vw6ujnzoZyLe4Q7MdpzRHdApLdB8R5wT381R6RTBHEh-jY5Wjy9NXtkKgkM/s400/step+8.png&quot; width=&quot;321&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
You can see that the new connection added is listed in the
Data Source Emplorer view.&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;v:shape alt=&quot;step 9.png&quot; id=&quot;Picture_x0020_10&quot; o:spid=&quot;_x0000_i1025&quot; style=&quot;height: 168.75pt; mso-wrap-style: square; visibility: visible; width: 257.25pt;&quot; type=&quot;#_x0000_t75&quot;&gt;
 &lt;v:imagedata o:title=&quot;step 9&quot; src=&quot;file:///C:%5CUsers%5CSony%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image009.png&quot;&gt;
&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir0JShENL_dpJoECuD8LtLjWw3rIA8q397C45mUU6G0vMcGCxx4WLCo3z5GGILUAOzjF4o-XITVi7HRe-sq5fR8SSPZMd3DoVRqfwsZy6c1ryEC-WSID02nxmTrllDf7jeqJ5br4TyxXM/s1600/step+9.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;261&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir0JShENL_dpJoECuD8LtLjWw3rIA8q397C45mUU6G0vMcGCxx4WLCo3z5GGILUAOzjF4o-XITVi7HRe-sq5fR8SSPZMd3DoVRqfwsZy6c1ryEC-WSID02nxmTrllDf7jeqJ5br4TyxXM/s400/step+9.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The database development perspective in general has Data
Source Emplorer, SQL Results, Execution Plan and Bookmarks Views.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
The Schemas, Users and Roles on a connected database
management system can be viewed in the same Data Source Explorer view.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The SQL Scrapbook can be used to type in SQL commands in
Eclipse. You can execute a command by right-clicking on it and selecting the
relevant Execute option. Also you can get suggestions as you type in a SQL command in
the SQL scrapbook provided by Eclipse.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
You can also use SQL Query Builder which is very similar to
that of the SQL Scrapbook.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Related Articles:&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2010/09/accessing-database-from-netbeans-ide.html&quot; target=&quot;_blank&quot;&gt;Access Database from Netbeans IDE&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/3663636811449844768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/using-eclipse-database-tools-access.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3663636811449844768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3663636811449844768'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/07/using-eclipse-database-tools-access.html' title='Using Eclipse Database Tools -- Access Database from Eclipse IDE'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn8En4phVgV0xYxD4bg3D_z_ekJlzboQ74kIkjGhJRTWM2Dpg7BXX-Fa2NLxZf98E_YGtKTcq3rxKnUjhqhW5TaLOnlnSSAABhcneohv_YLvXkQUAqB-8JDhrf0RefdbAhOSLx3lJjuQ0/s72-c/step+1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-3965538133976677392</id><published>2012-06-30T20:34:00.000+05:30</published><updated>2012-08-06T17:58:38.001+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in C++"/><category scheme="http://www.blogger.com/atom/ns#" term="STL"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector Operations"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector Operations in C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Vectors"/><title type='text'>Vector Operations in C++ -- Part 3</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
In the last post, we implemented the searching procedure followed in the Employee Register. Now we will discuss the CRUD operations on the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;vector&lt;/a&gt; with Employee class.&lt;br /&gt;
&lt;br /&gt;
To go to the previous two posts,&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;Vector Operations in C++ -- Part 1&lt;/a&gt; and&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/%20http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-2.html&quot; target=&quot;_blank&quot;&gt;Vector Operations in C++ -- Part 2&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
For adding an employee, we need to first check if another employee of the same employee ID exists in the vector. If it exists, we should give the relevant message to the user. Since we know that adding or deleting the employees at the ends is done very quickly, we have used the function &quot;push_back&quot; to add the new employee to the end.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;85&quot; readonly=&quot;readonly&quot; rows=&quot;10&quot; style=&quot;resize: none;&quot;&gt;void EmployeeRegister::addEmployee(Employee emp)
{
 // Add the record to emp_records vector and the ID to emp_id_records
 emp_records.push_back(emp);
 emp_id_records.push_back(emp.getId());

 cout&amp;lt;&amp;lt;&quot;\n\n\n---------------------------------------------------------&quot;;
 cout&amp;lt;&amp;lt;&quot;\n Employee successfully added with the following details&quot;;
 cout&amp;lt;&amp;lt;&quot;\n---------------------------------------------------------&quot;;
 cout&amp;lt;&amp;lt;&quot;\n Employee ID: \t\t&quot;&amp;lt;&amp;lt;emp.getId();
 cout&amp;lt;&amp;lt;&quot;\n Employee Name: \t&quot;&amp;lt;&amp;lt;emp.getName();
 cout&amp;lt;&amp;lt;&quot;\n---------------------------------------------------------&quot;;
 cout&amp;lt;&amp;lt;&quot;\n\n&quot;;
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
For displaying the employee details, we must first check if the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;vector&lt;/a&gt; is empty. If it is empty, we need not traverse through the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;vector&lt;/a&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;85&quot; readonly=&quot;readonly&quot; rows=&quot;20&quot; style=&quot;resize: none;&quot;&gt;void EmployeeRegister::displayEmployees()
{
 // First check if the employee vector is empty
 if(isEmpty())
 {
  cout&amp;lt;&amp;lt;&quot;\n No Employee records to display&quot;;
  return;
 }

 // If the vector has some elements, print them in a tabular format
 cout&amp;lt;&amp;lt;&quot;\n\n\n\n--------------------------------------------------------------&quot;;
 cout&amp;lt;&amp;lt;&quot;\n Employee ID \t | \t Employee Name&quot;;
 cout&amp;lt;&amp;lt;&quot;\n--------------------------------------------------------------&quot;;

 for(int i=0;i&amp;lt;emp_records.size();i++)
 {
  cout&amp;lt;&amp;lt;&quot;\n &quot;&amp;lt;&amp;lt;emp_records[i].getId()&amp;lt;&amp;lt;&quot; \t\t | \t &quot;&amp;lt;&amp;lt;emp_records[i].getName(); 
 }

 cout&amp;lt;&amp;lt;&quot;\n--------------------------------------------------------------\n\n\n&quot;;
}
&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
For deleting and updating an employee details, we need to check if the employee with the given ID exists. If it does not exist, the relevant message must be displayed.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;85&quot; readonly=&quot;readonly&quot; rows=&quot;20&quot; style=&quot;resize: none;&quot;&gt;int EmployeeRegister::updateEmployee(int id,Employee emp)
{
 // Before updating, first check whether the employee with the given ID exists or not.
 // If employee with the given ID does not exist, return -1
 if(searchEmployee(id)==-1)
  return -1;
 else
 {
  // Update the employee details in the index to the newly entered details
  emp_records[searchEmployee(id)]=emp;

  cout&amp;lt;&amp;lt;&quot;\n\n\n---------------------------------------------------------&quot;;
  cout&amp;lt;&amp;lt;&quot;\n Employee successfully updated to the following&quot;;
  cout&amp;lt;&amp;lt;&quot;\n---------------------------------------------------------&quot;;
  cout&amp;lt;&amp;lt;&quot;\n Employee ID: \t\t&quot;&amp;lt;&amp;lt;emp.getId();
  cout&amp;lt;&amp;lt;&quot;\n Employee Name: \t&quot;&amp;lt;&amp;lt;emp.getName();
  cout&amp;lt;&amp;lt;&quot;\n---------------------------------------------------------&quot;;
  cout&amp;lt;&amp;lt;&quot;\n\n&quot;;
  return 1;
 }
}

int EmployeeRegister::deleteEmployee(int id)
{
 // Before deleting, first check whether the employee with the given ID exists or not.
 // If employee with the given ID does not exist, return -1
 if(searchEmployee(id)==-1)
  return -1;
 else
 {
  // Delete the record from emp_records vector and the ID from emp_id_records
  emp_records.erase(emp_records.begin()+searchEmployee(id));
  emp_id_records.erase(emp_id_records.begin()+searchEmployee(id));
  cout&amp;lt;&amp;lt;&quot;\n Employee with employee ID &quot;&amp;lt;&amp;lt;id&amp;lt;&amp;lt;&quot; is successfully deleted\n\n&quot;;
  return 1;
 }
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Till now we have done all the operations required for manipulating or displaying the employee data. But a good user interface which is easily understandable by the user is equally important. Thus, we will have a menu with all the above discussed operations. To take numerical and string input from the user, we use two member functions in the class &quot;EmployeeDisplay&quot;. Validation to the complete extent is not done for numerical and string inputs.&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Compiling and running the case study:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Compiling:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
g++ -o EmployeeRegister main.cpp Display.cpp Employee.cpp EmployeeRegister.cpp&lt;/div&gt;
&lt;b&gt;Running the executable:&lt;/b&gt; &lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
./EmployeeRegister &lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
Sample Output for an add operation in the following menu is given below.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;85&quot; readonly=&quot;readonly&quot; rows=&quot;20&quot; style=&quot;resize: none;&quot;&gt; ******************************************************************
 ****************WELCOME TO THE EMPLOYEE REGISTER******************
 ******************************************************************
 1. Add an employee
 2. Delete an employee
 3. Display Employees list
 4. Update an employee
 5. Exit

 Enter the choice: 1

 Enter the Employee ID of the employee to be added: 1

 Enter the Employee name of the employee to be added: Sai Ravi Kiran



---------------------------------------------------------
 Employee successfully added with the following details
---------------------------------------------------------
 Employee ID:   1
 Employee Name:  Sai Ravi Kiran
---------------------------------------------------------

&lt;/textarea&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I have uploaded the entire project at the following link: &lt;a href=&quot;https://sites.google.com/site/welcome2terminal/attachments?pli=1&quot; target=&quot;_blank&quot;&gt;Vector Operations Case Study&lt;/a&gt;. You can download the &quot;Employee Register.zip&quot; from this link.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/3965538133976677392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/06/vector-operations-in-c-part-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3965538133976677392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3965538133976677392'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/06/vector-operations-in-c-part-3.html' title='Vector Operations in C++ -- Part 3'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-7636352080260622103</id><published>2012-06-30T20:16:00.000+05:30</published><updated>2012-08-06T17:56:33.007+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="CRUD"/><category scheme="http://www.blogger.com/atom/ns#" term="OOPS in C++"/><category scheme="http://www.blogger.com/atom/ns#" term="STL"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector Operations"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector Operations in C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Vectors"/><title type='text'>Vector Operations in C++ -- Part 2</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Have some information about &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;vectors&lt;/a&gt; and want to implement the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot; target=&quot;_blank&quot;&gt;vector operations&lt;/a&gt;?? You have come to the correct place.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In the last post, we have discussed about the operations in &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vectors&lt;/a&gt; and the functions that can be used in &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vectors&lt;/a&gt;. If you do not know about vectors in C++, then refer &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;this page&lt;/a&gt;. In this post, we will see the practical implementation of &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vectors&lt;/a&gt; by using a case study.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
We are building an employee register in which an employee has two attributes -- a unique Employee ID and the Employee Name. If you want more attributes such as Date of Birth, Work experience, Designations etc., you can add them. But I thought of keeping it simple. So, I have included only two attributes for an employee. I am not linking this case study to any database programming. But I am sure this case study would be very useful in many of the applications based on CRUD and can be used in applications which include database programming. The following actions are done in this case study:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Add a new employee&lt;/li&gt;
&lt;li&gt;Display the existing employees&lt;/li&gt;
&lt;li&gt;Delete an employee details&lt;/li&gt;
&lt;li&gt;Update an employee details &lt;/li&gt;
&lt;/ol&gt;
We will have a total of three classes:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Employee class&amp;nbsp; -- To define the basic attributes of Employee&lt;/li&gt;
&lt;li&gt;EmployeeRegister class&amp;nbsp; -- To do the vector operations on Employee class&lt;/li&gt;
&lt;li&gt;EmployeeDisplay class --&amp;nbsp; Created for User Interface programming&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
To ensure data abstraction, the header files are separated from the actual implementation. In the header files, the declarations of the variables, classes and methods will be present, while the implementation is covered in the corresponding CPP source files.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
First let us see what Employee class has. The following piece of code is Employee.h which declares the variables and the member functions of Employee class.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;15&quot; style=&quot;resize: none;&quot;&gt;#ifndef _EMPLOYEE_H
#define _EMPLOYEE_H
#include &amp;lt;iostream&amp;gt;
using namespace std;

class Employee
{
 private:
  int id;
  char* name;
 public:
  Employee();
  Employee(int,char*);
  void setId(int);
  int getId();
  void setName(char*);
  char* getName(); 
};
#endif
&lt;/textarea&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The implementation of the Employee class are given below. The getters and setters are defined so as to access the member variables in the Employee class.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;20&quot; style=&quot;resize: none;&quot;&gt;#include &quot;Employee.h&quot;
using namespace std;

Employee::Employee(){}

Employee::Employee(int id,char* name)
{
 this-&amp;gt;id=id;
 this-&amp;gt;name=name;
}

void Employee::setId(int id)
{
 this-&amp;gt;id=id;
}

void Employee::setName(char* name)
{
 this-&amp;gt;name=name;
}

int Employee::getId()
{
 return id;
}

char* Employee::getName()
{
 return name;
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
The implementation of EmployeeRegister class has the following operations:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Adding, Deleting and Updating an employee.&lt;/li&gt;
&lt;li&gt;Displaying the current employee details.&lt;/li&gt;
&lt;li&gt;Searching for an element in the vector.&lt;/li&gt;
&lt;li&gt;Checking whether the vector for Employee class is empty.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
We can check if the vector is empty by using the boolean function &quot;empty()&quot; used in &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vector STL&lt;/a&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; style=&quot;resize: none;&quot;&gt;bool EmployeeRegister::isEmpty()
{
 if(emp_records.empty())
  return true;
 else
  return false;
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Searching is an important operation and will be used by almost all other functions. Imagine you have large number of employee records and you need to search for a record which is the last in the vector. By using linear search, the search process will consume more time. For binary search to be implemented, we need to have the elements in the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vector&lt;/a&gt; in an increasing order which is not the case here. They can be any possible order. Thus, due to all these factors, the STL algorithm &quot;find&quot; is used to find the position of an element in the &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vector&lt;/a&gt;. For this function to be used, we need to create another vector of integers &quot;emp_id_records&quot;. This vector should have all the employee ID&#39;s exactly in the same order as that of the emp_records. So, if we can get the position of an element in one &lt;a href=&quot;http://sairavikiran.blogspot.in/2012/06/vector-operations-in-c-part-1.html&quot;&gt;vector&lt;/a&gt;, we can the index of the other too.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;readonly&quot; rows=&quot;10&quot; style=&quot;resize: none;&quot;&gt;int EmployeeRegister::searchEmployee(int id)
{
 vector&amp;lt;int&amp;gt;::iterator id_it;
 id_it=find(emp_id_records.begin(),emp_id_records.end(),id);

 // If employee details are not found return FAILURE -1
 if(id_it==emp_id_records.end())
  return -1;
 // Otherwise return the position of the record
 else
  return (int)(id_it-emp_id_records.begin());
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/7636352080260622103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/06/vector-operations-in-c-part-2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7636352080260622103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7636352080260622103'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/06/vector-operations-in-c-part-2.html' title='Vector Operations in C++ -- Part 2'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-5494497921594898362</id><published>2012-06-29T20:25:00.000+05:30</published><updated>2012-08-06T17:50:58.715+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arrays"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Constructor"/><category scheme="http://www.blogger.com/atom/ns#" term="Constructors"/><category scheme="http://www.blogger.com/atom/ns#" term="deque"/><category scheme="http://www.blogger.com/atom/ns#" term="lists"/><category scheme="http://www.blogger.com/atom/ns#" term="sequence container"/><category scheme="http://www.blogger.com/atom/ns#" term="STL"/><category scheme="http://www.blogger.com/atom/ns#" term="Vector Operations"/><category scheme="http://www.blogger.com/atom/ns#" term="Vectors"/><title type='text'>Vector Operations in C++ -- Part 1</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
At the end of this series of posts, you will understand the working of vectors, the functions used in vectors. In addition to this, you will be able to do the basic CRUD operations on the vectors.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Vector is a type of sequence container in C++ and is implemented like a dynamic array. Vectors are very similar to arrays except that the arrays have a constant size while vectors can be extended or contracted as needed. However, the size of vector can also be fixed and resized. Once the storage of a vector is exhausted, it grows automatically in 
size. The storage space they have been allocated can be either equal or 
greater than the actual size. The extra amount of storage allocated is 
not used, but is reserved for the vector to be used in case it grows. 
Thus, the vector does not have to re-allocate storage on each occasion 
it grows or a new element is inserted.&lt;br /&gt;
&lt;br /&gt;
Similar to arrays, we can access a given element in a vector easily with the index. The elements of vectors are stored in contiguous memory locations just like in the case of arrays. We can iterate over a vector by using its index or by using iterators used in vectors.&lt;br /&gt;
&lt;br /&gt;
Adding or removing the elements from the vector at the ends is done very well as far as the time complexity is concerned. However, the performance of insertion/deletion at positions other than the ends is worse than that of the other sequence containers in C++ (deques and lists).&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Constructors for the vector class are as follows:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr bgcolor=&quot;grey&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Constructor Name&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default Constructor&lt;/td&gt;
&lt;td&gt;vector&lt;t&gt;&lt;t&gt;&amp;lt;T&amp;gt; vector_name;&lt;/t&gt;&lt;/t&gt;&lt;/td&gt;
&lt;td&gt;vector&amp;lt;int&amp;gt;&lt;int&gt;&lt;int&gt; a;&lt;/int&gt;&lt;/int&gt;&lt;/td&gt;
&lt;td&gt;Creates a vector with no elements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repetitive sequence Constructor&lt;/td&gt;
&lt;td&gt;vector&amp;lt;T&amp;gt;&lt;t&gt;&lt;t&gt; vector_name(No. of Elements to be repeated, Value to be assigned);&lt;/t&gt;&lt;/t&gt;&lt;/td&gt;
&lt;td&gt;vector&amp;lt;int&amp;gt;&lt;int&gt;&lt;int&gt; b(4,100);&lt;/int&gt;&lt;/int&gt;&lt;/td&gt;
&lt;td&gt;Creates a vector of 4 elements with value 100.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iterator constructor&lt;/td&gt;
&lt;td&gt;vector&amp;lt;T&amp;gt;&lt;t&gt;&lt;t&gt; vector_name (Beginning of another vector, End of another vector);&lt;/t&gt;&lt;/t&gt;&lt;/td&gt;
&lt;td&gt;vector&amp;lt;int&amp;gt;&lt;int&gt;&lt;int&gt; c (a.begin(),a.end());&lt;/int&gt;&lt;/int&gt;&lt;/td&gt;
&lt;td&gt;Creates a vector with elements from vector “a”. Can also create a vector by copying only a part of the vector “a”.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Copy constructor&lt;/td&gt;
&lt;td&gt;vector&amp;lt;T&amp;gt;&lt;t&gt;&lt;t&gt; vector_name(another_vector);&lt;/t&gt;&lt;/t&gt;&lt;/td&gt;
&lt;td&gt;vector&amp;lt;int&amp;gt;&lt;int&gt; d(c);&lt;/int&gt;&lt;/td&gt;
&lt;td&gt;Creates a vector by copying the vector “c” into vector “d”.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Accessing an element in a vector:&lt;/b&gt;&lt;br /&gt;
An element in a Vector can be accessed in two ways: &lt;br /&gt;
1. vector_name[index]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;(or)&lt;/b&gt;&lt;br /&gt;
2. vector_name.at(index)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Iterating over a vector using an iterator:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
We can iterate over a vector using a normal for loop with the initialization variable from 0 to the vector&#39;s maximum size (vector.size( )). But here is another method to explore all the elements in a vector:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
vector&amp;lt;int&amp;gt;&lt;int&gt; vector_name;&lt;/int&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
vector&lt;int&gt;::iterator it;&lt;/int&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
for(it=vector_name.begin();it &amp;lt; vector_name.end(); it++)&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout&amp;lt;&amp;lt;*it;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;This piece of code will print all the elements one by one in the vector. Similar to iterator, there is also reverse iterator, which iterates over the vector from right to left.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Functions in Vector:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr bgcolor=&quot;grey&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Function&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;push_back&lt;/td&gt;
&lt;td&gt;vector.push_back(element)&lt;/td&gt;
&lt;td&gt;Inserts the element at the end of the vector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pop_back&lt;/td&gt;
&lt;td&gt;vector.pop_back()&lt;/td&gt;
&lt;td&gt;Deletes the last element in the vector and returns the same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;erase&lt;/td&gt;
&lt;td&gt;vector.erase(position)&lt;/td&gt;
&lt;td&gt;Deletes the element from the vector in the specified position/index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;insert&lt;/td&gt;
&lt;td&gt;vector.insert(element,position)&lt;/td&gt;
&lt;td&gt;Inserts an element (1st argument) into the position (2nd argument) &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
In the next post, we will apply this concept of vectors in our case study, which involves the basic CRUD operations.</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/5494497921594898362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2012/06/vector-operations-in-c-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/5494497921594898362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/5494497921594898362'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2012/06/vector-operations-in-c-part-1.html' title='Vector Operations in C++ -- Part 1'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-4486078606605431367</id><published>2011-06-05T17:35:00.007+05:30</published><updated>2011-06-06T11:56:02.774+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".bash_history"/><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Command History"/><category scheme="http://www.blogger.com/atom/ns#" term="File manager"/><category scheme="http://www.blogger.com/atom/ns#" term="Hidden File"/><category scheme="http://www.blogger.com/atom/ns#" term="history command"/><title type='text'>UNIX Command History</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;All the commands typed by the user are stored in a file named &quot;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;.bash_history&lt;/span&gt;&quot; (for bash) in the Home directory of the User. It is a hidden file as its name is preceded by a dot (.) and therefore you can view this&amp;nbsp; in the File manager only when you hit the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Ctrl-H&lt;/span&gt; combination. To view this file in &quot;bash&quot; the option -a has to be used with the ls command, i.e., to view this file in the command line interface, the command &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ls -a&lt;/span&gt; has to be used.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;This file contains the list of all the commands typed since the system formatting. The operations on the command history such as retrieval or reuse of the commands depends on the contents of this file.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Type &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;history&lt;/span&gt; at the command prompt and you will get the last 500 commands used. If you only want to look at the last 10 commands, you could type the command &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;history 10&lt;/span&gt;. Commands are remembered so you can reuse them.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjNwCl-yoqdFgnGF8V7-vYmw5RCoH_SgVFKwKfTmgKBSeSsZ0xXf3NXsNR4Lj2YKn3SzPyApoCkQWZHlPLXlVXSloRG5wMJJfxNKE1MC8kNF3PUK9u834V3YEZ0W9b5_wfJ_Bv6B5rckw/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjNwCl-yoqdFgnGF8V7-vYmw5RCoH_SgVFKwKfTmgKBSeSsZ0xXf3NXsNR4Lj2YKn3SzPyApoCkQWZHlPLXlVXSloRG5wMJJfxNKE1MC8kNF3PUK9u834V3YEZ0W9b5_wfJ_Bv6B5rckw/s1600/Screenshot-1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;You can reuse any command in the history list by typing its number (as shown by the history command), preceded by an exclamation mark (!). If you want a view a file listing of the Documents folder, and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ls Documents&lt;/span&gt; is command #31 in the list, you could type &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;!31&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK_iJ3857_akXAvAGqW2bJsHZerMkPlBWrx2Hnu-k-EFOeAU5xE8rFFtWSeohJc-jsuocIGxOwd_ce1S292LbEH70ICPgTQRiZGBVVZxeHphg1cK9_cL_7jf_8mcaTNNTkrWpz5Fp5Fw8/s1600/Screenshot-2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK_iJ3857_akXAvAGqW2bJsHZerMkPlBWrx2Hnu-k-EFOeAU5xE8rFFtWSeohJc-jsuocIGxOwd_ce1S292LbEH70ICPgTQRiZGBVVZxeHphg1cK9_cL_7jf_8mcaTNNTkrWpz5Fp5Fw8/s1600/Screenshot-2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Say you’ve just typed a long file-name copy (cp) command, and want to use it again. Typing &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;!cp&lt;/span&gt; will find the last line in your history list that begins with cp and reuse it.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD32W5EcuXziOkCGDdmw5-3aEv7gVMqt83XNsK4izsFkfIvhs5khMiFhz8ApqHd_APtE9mPK8rVx3xSAuhyYRbbm2Clyp0IkHglYA87oEJL83AEICBm_W6C64oYwYGJm7q-IDfFFihrLk/s1600/Screenshot-3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD32W5EcuXziOkCGDdmw5-3aEv7gVMqt83XNsK4izsFkfIvhs5khMiFhz8ApqHd_APtE9mPK8rVx3xSAuhyYRbbm2Clyp0IkHglYA87oEJL83AEICBm_W6C64oYwYGJm7q-IDfFFihrLk/s1600/Screenshot-3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Typing two bangs (!!) will cause the last command you typed to be reused. Finally, typing !? and then part of a recently-typed command will cause bash to auto-complete using the nearest match it can find in the history.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjF1-oxvarEYMH4UTJGrDAP-XuVS2QufNbjHaJH1YZ9J5MFR_JtGRX_HHgUARFY7D3b69zubzlzZHeUloPTLoqb_HqPRir5B-IUYIS7aAyuV2gBvjpcZbgDchzdh5S_0Xll_uwgRBt2mU/s1600/Screenshot-4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjF1-oxvarEYMH4UTJGrDAP-XuVS2QufNbjHaJH1YZ9J5MFR_JtGRX_HHgUARFY7D3b69zubzlzZHeUloPTLoqb_HqPRir5B-IUYIS7aAyuV2gBvjpcZbgDchzdh5S_0Xll_uwgRBt2mU/s1600/Screenshot-4.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/4486078606605431367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/06/unix-command-history.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/4486078606605431367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/4486078606605431367'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/06/unix-command-history.html' title='UNIX Command History'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjNwCl-yoqdFgnGF8V7-vYmw5RCoH_SgVFKwKfTmgKBSeSsZ0xXf3NXsNR4Lj2YKn3SzPyApoCkQWZHlPLXlVXSloRG5wMJJfxNKE1MC8kNF3PUK9u834V3YEZ0W9b5_wfJ_Bv6B5rckw/s72-c/Screenshot-1.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-7170889784037104313</id><published>2011-05-25T18:32:00.002+05:30</published><updated>2011-05-25T18:38:24.699+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Compiz"/><category scheme="http://www.blogger.com/atom/ns#" term="Force Quit Applet"/><category scheme="http://www.blogger.com/atom/ns#" term="Launchers and Menus"/><category scheme="http://www.blogger.com/atom/ns#" term="Natty Narwhal"/><category scheme="http://www.blogger.com/atom/ns#" term="Network Manager applet"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 11.04"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu Software center"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu User Interface"/><category scheme="http://www.blogger.com/atom/ns#" term="Unity Desktop"/><title type='text'>What went wrong in Natty Narwhal Ubuntu 11.04</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;It was 29th of April, 2011 and I just completed my exams. I was so excited to try the new release of Ubuntu as I knew that Ubuntu is going to concentrate much on the User Interface part of the Operating System this time. I really thought it would be a success compared to the earlier versions and new users would definitely try it. But after trying it, I was hugely disappointed. &lt;br /&gt;
&lt;br /&gt;
We understand that user interface is important. But it is not a crucial element in an operating System. Many other things such as the performance, the hardware utilization, memory management determine the success of an operating system. In addition to this, it would be a basic thing to provide software without bugs. The earlier versions of Ubuntu also had some issues. But we cannot expect everything to be perfect, especially for an open source software. On the other hand, if the bugs occur every now and then when we use it; it would be irritating for any kind of a user. Remember its not an alpha or a beta release, its the final release.&lt;/div&gt;&lt;br /&gt;
There are many issues with this release, which are listed below:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Not responding state:&lt;/b&gt; The users able to control the system under this state is one area where Windows is way ahead of Linux. The Windows Task  Manager does a very good job, allowing the user to control the System.&lt;/li&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;We have an applet namely &lt;b&gt;Force Quit&lt;/b&gt; that &lt;b&gt;ends any application forcibly.&lt;/b&gt; This applet in the previous releases used to be a decent application, which responded quickly and took control of the system immediately, when invoked. However, the new release of Ubuntu has not got any such applet and the system often goes into the not-responding state.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;In addition to this, &lt;b&gt;this release does not respond well to the Hot Keys.&lt;/b&gt; Even if we use Ctrl-Alt-Backspace, which is used to kill the X server and log out of the system; we are logged out of the system, which does not display the login screen, thus posing problem to most of the beginners. In this scenario, we are left with using the system in command-line through Ctrl-Alt-(F1 to F6). Thus, the not-responding state eventually makes us to use the Power Button for restarting the system, rather than the conventional way of shutting the machine down.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Banshee Music Player is good when compared to Rhythm box Music player regarding the ease of use. It is selected as a default music player this time instead of Rhythm box Music Player. This crashes every now and then irritating us to the maximum. To some extent, Rhythm box Music Player was better and can be used.&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Customization reduced:&lt;/b&gt; One main reason, I use Ubuntu is the customizations in it. However, this  release left me with dissatisfaction giving absolutely no customization  to the panel.&lt;/li&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;The earlier releases had given control to the user as far as the panel is concerned, through which I was able to add the applets to the panel, which I found to be useful. But now, the panel at the top has got minimum customizations and gives zero control to the user.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The menu bar&lt;/b&gt; is another disappointing change made in the interface. The menu bar appears on the top panel according to the active window or the active application.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The Launcher is a new idea&lt;/b&gt; and it is good when it comes to look and feel. But a huge deal of it still has to be improved. Many parameters of the Launcher are pre-defined and cannot be changed by the user and the drag and drop option for the launcher is not complete. However, after using it, one makes a statement that literally everything has to be done through the launcher only, allowing minimum customization.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The interface sometimes crashes out, especially in the case of drag and drop.&lt;/b&gt; When I tried to move the files from one folder to another by using the drag and drop in the Nautilus File manager, I experienced it to be an absolute prison with the not-responding state again. Interesting point to make a note of is that the previous releases all remained stable with the same kind of mouse drag-and-drop action on the file manager.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The old Compiz settings are far better than the changed ones.&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Untested Software:&lt;/b&gt; I got a feel of using an alpha or beta release when I was using the final release of Natty Narwhal.&lt;/li&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;b&gt;The mouse and keyboard listeners are not well programmed&lt;/b&gt; and have to be looked into once again. Sometimes, the Close, Maximize and Minimize buttons for a window disappear suddenly. We do not know what to do under these circumstances and use the System Monitor to kill that specific application.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The themes sometimes get changed by themselves.&lt;/b&gt; These new themes are out of control of user, as they do not get changed the way we want. In such cases, the previous theme is restored only after the system is restarted and there are situations where even&amp;nbsp; the system restart does not help.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The dialogs or the wizards for the settings in applications especially is cumbersome&lt;/b&gt; as the wizard is found to be defective if it is un-maximized.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Under some circumstances, I came across a situation where the items in the panel are not listed. This makes us difficult to control the system, as the menu for any application appears in the panel.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;There is another situation where everything was going well with my modem and a bug appeared in the Network Manager applet while trying to connect to the Internet. But the Network Manager applet says it does not identify network devices in-spite of everything being fine with the devices.&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This release has got many attractive features as well. The interface has been the focus of the development team this time. But there are some other encouraging features as well.&lt;/div&gt;&lt;ul style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;&lt;b&gt; Ubuntu Software Center:&lt;/b&gt; With every release, the Ubuntu Software Center is getting better and better. The encouraging feature this time is the &lt;i&gt;reviews and ratings&lt;/i&gt; added to the softwares. The reviews put in by various users and their ratings are given.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Easy access to items in Launcher:&lt;/b&gt; The launcher may not be good at the customization but it certainly gives easy access to the items in the Launcher through the simple shortcuts.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Unity Applications Menu Support: &lt;/b&gt;This is a welcome development. Unity now lists the installed  applications under a section &lt;i&gt;&quot;Installed&quot;&lt;/i&gt;. Though it looks good, it is not very user  friendly yet. There are no categories as we saw in GNOME Shell before and it is not very stable as well. This still requires a lot of work.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Improved Search Options in the Unity:&lt;/b&gt; The Search options certainly have been very good compared to the previous versions. The categories such as &lt;i&gt;Frequently used, Installed applications&lt;/i&gt; are included which makes it much more easy for the users. However the auto-completion option has not been added yet. With that option, the Search functionality would become a true class application.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Improved Window movements:&lt;/b&gt; Like in Windows 7, the windows can be thrown to the corners and edges on the environment resulting in maximization, minimization of the windows.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The strategy of the Ubuntu developers must certainly change now. Anything overdone is dangerous. All the operating system concepts must be kept in mind while development and bug-free software is essential in the increase of popularity of a software and Ubuntu is no exception to that. It has been good and sticking to the right areas till Maverick Meerkat. But this time, the interface frequently leads to Force Restarts, which is not a good sign. However, there are many positives that can be made out of this release. What everyone needs is a bug-free software and good user-friendliness; both have to be taken care of. I just think that the next release is going to be a success as the testing will become important this time and will lead to error-free system.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/7170889784037104313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/05/what-went-wrong-in-natty-narwhal-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7170889784037104313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7170889784037104313'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/05/what-went-wrong-in-natty-narwhal-ubuntu.html' title='What went wrong in Natty Narwhal Ubuntu 11.04'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-7780020613566454857</id><published>2011-02-24T14:23:00.000+05:30</published><updated>2011-02-24T14:23:15.752+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Black List"/><category scheme="http://www.blogger.com/atom/ns#" term="Firestarter"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall policies"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall rules"/><category scheme="http://www.blogger.com/atom/ns#" term="Netfilter"/><category scheme="http://www.blogger.com/atom/ns#" term="Root"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu Linux Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="Virus"/><category scheme="http://www.blogger.com/atom/ns#" term="White List"/><title type='text'>Firewalls in Ubuntu -- details and configuration</title><content type='html'>Ubuntu Linux has mainly two strong firewalls, namely:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Netfilter&lt;/li&gt;
&lt;li&gt;Firestarter&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h2&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Netfilter firewall:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Ubuntu has a powerful firewall called &lt;b&gt;netfilter&lt;/b&gt; that is part of the central kernel program. The &lt;b&gt;ufw&lt;/b&gt; command at the terminal allows us to configure the firewall. However, this command needs you to be &lt;b&gt;root&lt;/b&gt; of the system. For this purpose, we add &lt;b&gt;sudo&lt;/b&gt; in before the command. For example, to enable the &lt;b&gt;netfilter &lt;/b&gt;firewall we type the command as: &lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sudo ufw enable&lt;/span&gt;&lt;/b&gt;. The manual pages for this firewall can be seen by typing the command: &lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;man ufw&lt;/span&gt;&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;However, this firewall can be operated in a more user-friendly way, by installing the package named &lt;b&gt;Firewall Configuration&lt;/b&gt;. This package supports common tasks such as allowing or blocking pre-configured, common p2p, or individual ports, and many others. Rules can be easily added, removed and edited with the help of this interface. The interface is simple with easy usage and is recommended for beginner users.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifc0aQKha5wIVqnd1EO-tzofKy2KG7tEMSC4DjvaporhuJbLqCEQDn7PqmKKoLRlm1JKqLkaVFIgreMVIO1tFkT5ph8pW8Z3LoYjrJsctdqrCX8j55LBqn2KFr-ICcQldTNXIpTQ7huYY/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifc0aQKha5wIVqnd1EO-tzofKy2KG7tEMSC4DjvaporhuJbLqCEQDn7PqmKKoLRlm1JKqLkaVFIgreMVIO1tFkT5ph8pW8Z3LoYjrJsctdqrCX8j55LBqn2KFr-ICcQldTNXIpTQ7huYY/s1600/Screenshot.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
We can configure the &lt;b&gt;netfilter&lt;/b&gt; firewall by --&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Adding allow, deny and limit rules.&lt;/li&gt;
&lt;li&gt;Enabling, disabling and reloading the firewall.&lt;/li&gt;
&lt;li&gt;Deleting and Inserting rules.&lt;/li&gt;
&lt;li&gt;Displaying the information and status of the firewall.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h2&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Firestarter firewall:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Another user-friendly Firewall in Ubuntu is &lt;b&gt;Firestarter&lt;/b&gt;. On the start-up for the first time, a wizard will be run, for configuring the network states. You can read the manual pages of this firewall by the command: &lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;man firestarter&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;. &lt;/span&gt;There are three pages/tabs in the Firestarter interface, namely --&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Status page&lt;/b&gt; giving an overview of the firewall state.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Events page&lt;/b&gt;, where blocked intrusion attempts and the firewall history is shown. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Policy page&lt;/b&gt; for altering the behaviour of the firewall.&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmy_k0DN0GkpBxBARUNcIfS4YfRoDMGBgmcbqOmBRjzp-tt01-wwluDPWsEJ2RMSkD5VduG3BvwOBrpI6dbV9CHjvxFu_TUoCsz_RHoiELHqc5sU1Z3qwX06ckJkuEbUru4FtGT7q_s4/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmy_k0DN0GkpBxBARUNcIfS4YfRoDMGBgmcbqOmBRjzp-tt01-wwluDPWsEJ2RMSkD5VduG3BvwOBrpI6dbV9CHjvxFu_TUoCsz_RHoiELHqc5sU1Z3qwX06ckJkuEbUru4FtGT7q_s4/s1600/Screenshot-1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;This firewall can be in one of these three states: &lt;b&gt;Active&lt;/b&gt;, &lt;b&gt;Disabled&lt;/b&gt; and &lt;b&gt;Locked&lt;/b&gt; (Nothing is allowed through the firewall, neither in nor out). The &lt;b&gt;Network section of the status page&lt;/b&gt; gives an overview of the network resource usage. In addition, the status page also lists the Active connections, the firewall is tracking every moment. The entries in the Active connections are color coded as: Gray for a terminated connection and black for a currently active connection. However, terminated connections are removed from the list after 10 seconds.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;b&gt;Events page&lt;/b&gt; shows the history of connections blocked by the firewall. The entries in the Events page can be allowed connections from source, port or everyone or can be disabled events from source or port. The Firestarter colour codes the entries as:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Black&lt;/b&gt; -- A regular connection.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Red&lt;/b&gt; -- A possible attempt to access a non-public service and needs special attention.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Gray&lt;/b&gt; -- Harmless connections, mostly broadcast.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The third page, &lt;b&gt;Policy&lt;/b&gt; can add, edit or remove rules for the firewall. Two types of rules can be created: &lt;b&gt;Inbound rules&lt;/b&gt;, that allow through connections from the network or Internet, and &lt;b&gt;Outbound rules&lt;/b&gt;, that can block unauthorised data emissions from your computer, such as those from potential virus infections, or spyware. Inbound rules allow you to filter all incoming connections. When it comes to blocking data emanating from your computer, Firestarter can enact two different modes:&lt;/div&gt;&lt;ol&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Whitelist: &lt;/b&gt;In this mode, network traffic is not allowed out of the computer unless a rule allows it. This is also known as &lt;b&gt;restrictive policy&lt;/b&gt;.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Blacklist: &lt;/b&gt;In this mode, which is default, all traffic is allowed out of the computer unless a rule specifically forbids it. This is also known as &lt;b&gt;permission policy&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/7780020613566454857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/firewalls-in-ubuntu-details-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7780020613566454857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7780020613566454857'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/firewalls-in-ubuntu-details-and.html' title='Firewalls in Ubuntu -- details and configuration'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifc0aQKha5wIVqnd1EO-tzofKy2KG7tEMSC4DjvaporhuJbLqCEQDn7PqmKKoLRlm1JKqLkaVFIgreMVIO1tFkT5ph8pW8Z3LoYjrJsctdqrCX8j55LBqn2KFr-ICcQldTNXIpTQ7huYY/s72-c/Screenshot.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-3034209072442821424</id><published>2011-02-14T21:03:00.003+05:30</published><updated>2012-08-06T18:21:13.173+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRUD"/><category scheme="http://www.blogger.com/atom/ns#" term="Data Access Objects"/><category scheme="http://www.blogger.com/atom/ns#" term="DSN"/><category scheme="http://www.blogger.com/atom/ns#" term="IDE"/><category scheme="http://www.blogger.com/atom/ns#" term="JAR"/><category scheme="http://www.blogger.com/atom/ns#" term="Java SE"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Swing"/><category scheme="http://www.blogger.com/atom/ns#" term="Javadocs"/><category scheme="http://www.blogger.com/atom/ns#" term="JDBC"/><category scheme="http://www.blogger.com/atom/ns#" term="JDBC-ODBC Bridge Driver"/><category scheme="http://www.blogger.com/atom/ns#" term="JDK"/><category scheme="http://www.blogger.com/atom/ns#" term="JRE"/><category scheme="http://www.blogger.com/atom/ns#" term="MS Access Database connection in java"/><category scheme="http://www.blogger.com/atom/ns#" term="NetBeans"/><title type='text'>Java Swing applications -- Telephone and Address Book -- II</title><content type='html'>&lt;h2&gt;
&lt;i&gt;&lt;u&gt;Implementation:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The Telephone Book application is now designed and we need to just put the coding for that. We already know which objects in &lt;b&gt;swing&lt;/b&gt; package are used as the components in the panels for the application. For example, we have mentioned in the last post about some components such as Drop-down list (&lt;b&gt;JComboBox&lt;/b&gt;), Labels for the appropriate components(&lt;b&gt;JLabel&lt;/b&gt;), Buttons (&lt;b&gt;JButton&lt;/b&gt;), Text-Boxes (&lt;b&gt;JTextBox&lt;/b&gt;), Scroll Panes (&lt;b&gt;JScrollPane&lt;/b&gt;), Results displayed in Tables (&lt;b&gt;JTable&lt;/b&gt;), Confirmation of the results through Dialogs (&lt;b&gt;JDialog&lt;/b&gt;) etc.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The Front end is &lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/grid-layout-no-look-and-feel-if-you.html&quot;&gt;Java Swing&lt;/a&gt; while the application has a database connectivity with &lt;b&gt;MS Access&lt;/b&gt; database. As mentioned in the previous post, there is only one table in the database. The coding is done in two packages:&amp;nbsp;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;TeleAddress&lt;/b&gt; package for Component design and Action listeners &amp;amp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;dao &lt;/b&gt;package for accessing database from the MS Access database through JDBC API&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In all the classes, the constructors play a key role with initializing the frame window processing purposes. Mouse action listeners are applied to the buttons in the interface that interacts with the user, most of them being applied when the user clicks the mouse.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The confirmation dialogs are present in a separate class, named &lt;b&gt;Dialogs&lt;/b&gt; with separate dialogs for contact creation, updating contacts and contact-deletion. The &lt;b&gt;Dialogs&lt;/b&gt; class contains the following:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Two Constructors &lt;/b&gt;-- one for Deletion and the other for Updation / Addition of contacts&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;dialog( ) and deldialog( ) functions&lt;/b&gt; for processing one of the two constructors.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The &lt;b&gt;TelephoneBook&lt;/b&gt; class in &lt;b&gt;TeleAddress&lt;/b&gt; package is the main class in the application and binds all the classes together. The &lt;b&gt;TelephoneBook&lt;/b&gt; class contains the following: &lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;All the Interface-Components such as Buttons, Drop-down lists, Text-Boxes,Labels,Tables etc. are defined in this class.&lt;/li&gt;
&lt;li&gt;5 Panel functions for adding the components into each panel.&lt;/li&gt;
&lt;li&gt;A Constructor having function calls to the Action-listeners.&lt;/li&gt;
&lt;li&gt;A function named &lt;b&gt;initComponents( )&lt;/b&gt; for the lay-out of components.&lt;/li&gt;
&lt;li&gt;All Action-listeners for all the buttons such as &lt;b&gt;Create, Delete, Update, Refresh, Cancel &lt;/b&gt;etc.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The &lt;b&gt;SearchTable&lt;/b&gt; class allows the user to view the results in a table in a different Frame window. The &lt;b&gt;Database &lt;/b&gt;class consists of all the database-connections, where we use the &lt;b&gt;JDBC-ODBC Bridge Driver&lt;/b&gt; for connecting to MS Access. The static methods in this class are used for every database operation being done in the application. The &lt;b&gt;dao&lt;/b&gt; package makes use of &lt;b&gt;PreparedStatement&lt;/b&gt; and &lt;b&gt;Statement&lt;/b&gt; for database query executions. The &lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/java-database-connectivity-with-ms.html&quot;&gt;Database connectivity with MS Access&lt;/a&gt; can be done as shown clearly in these posts as&amp;nbsp;&lt;a href=&quot;http://sairavikiran.blogspot.com/2010/07/java-database-connectivity-with-ms.html&quot;&gt;part 1&lt;/a&gt;, &lt;a href=&quot;http://sairavikiran.blogspot.com/2010/07/java-database-connectivity-with-ms_30.html&quot;&gt;part 2&lt;/a&gt; and &lt;a href=&quot;http://sairavikiran.blogspot.com/2010/07/java-database-connectivity-with-ms_3244.html&quot;&gt;part 3&lt;/a&gt;. The &lt;b&gt;dao&lt;/b&gt; package has the data access objects listed below:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Database&lt;/b&gt; class for Database connection.&lt;b&gt; &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;AddDAO&lt;/b&gt; class for insertion of new contact into the database table.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;DeleteDAO&lt;/b&gt; class for deletion of contact records from the database table.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;OtherDAO&lt;/b&gt; class to get all the records from the database table&lt;/li&gt;
&lt;li&gt;&lt;b&gt;SearchDAO&lt;/b&gt; class to facilitate searching upon inputs given in the Search and Delete panels.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;UpdateDAO&lt;/b&gt; class for updating contact details.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The documentation for the classes of this application have been automatically generated by NetBeans IDE through &lt;b&gt;Javadocs &lt;/b&gt;which can be downloaded &lt;a href=&quot;https://sites.google.com/site/welcome2terminal/attachments/javadoc.rar&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;i&gt;&lt;u&gt;Installation and Configuring the application:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;Pre-requisites:&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;The system should have Java (JDK and JRE) installed on your system, which can be downloaded &lt;a href=&quot;https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter&quot;&gt;from this page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The system should have Microsoft Office Access DBMS.&lt;/li&gt;
&lt;/ol&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;Configuring and Installation:&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Invoke Control Panel -- Administrative Tools -- Data Sources (ODBC). Go to UserDSN tab and click on &lt;b&gt;Add&lt;/b&gt; button.&lt;/li&gt;
&lt;li&gt; Select &lt;b&gt;Microsoft Access Driver (*.mdb, *.accdb)&lt;/b&gt; and click on &lt;b&gt;Finish&lt;/b&gt; button.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Give the Data Source Name as &lt;b&gt;TeleAddressBook&lt;/b&gt; and select the Database &lt;b&gt;Select&lt;/b&gt; button and give the path of the database file which can be downloaded from&lt;a href=&quot;https://sites.google.com/site/welcome2terminal/attachments/Telephone.accdb&quot;&gt; here&lt;/a&gt;. After selecting the &lt;b&gt;.accdb&lt;/b&gt; file, click &lt;b&gt;OK&lt;/b&gt;. Any doubts regarding the configuration of &lt;b&gt;DSN (Data Source Name)&lt;/b&gt; can be clarified with the tutorial specified previously at &lt;a href=&quot;http://sairavikiran.blogspot.com/2010/07/java-database-connectivity-with-ms.html&quot;&gt;this post&lt;/a&gt; with screen-shots.&lt;/li&gt;
&lt;li&gt;Download the JAR file which can be downloaded &lt;a href=&quot;https://sites.google.com/site/welcome2terminal/attachments/TeleAddressBook.jar&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;After configuring the DSN and downloading the JAR file, double-click on the JAR file to invoke the application. If its not invoked with the double-click then open Command-Prompt and type the one specified as: &lt;code&gt;java -jar &quot;/* Complete Path of the JAR file */&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;ol&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/3034209072442821424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/java-swing-applications-telephone-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3034209072442821424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3034209072442821424'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/java-swing-applications-telephone-and.html' title='Java Swing applications -- Telephone and Address Book -- II'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-1378322556855420837</id><published>2011-02-13T21:19:00.005+05:30</published><updated>2012-08-06T18:19:00.455+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRUD"/><category scheme="http://www.blogger.com/atom/ns#" term="Java SE"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Swing"/><title type='text'>Java Swing applications -- Telephone and Address Book -- I</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Before starting the design and implementation of Telephone cum Address Book, I recommend you to go through the following post which gives an insight of how a layout should be in Java Swing.&lt;br /&gt;
&lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/grid-layout-no-look-and-feel-if-you.html&quot; target=&quot;_blank&quot;&gt;How to choose a layout in Java Swing&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It is quite common to have a telephone book to note the contact numbers, addresses and other notes of relatives, colleagues, acquaintances and so on. The search operation still has be improved under such circumstances. We need to find the contact quickly in the telephone-contacts book. In addition to that, updation, deletion of contacts is quite cumbersome in such circumstances. I have come up with a typical CRUD (Create, Read, Update, Delete) kind of an application built on Java -- a Java Swing application to be precise, which provides the following:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Create / Add a new contact to the Telephone book&lt;/li&gt;
&lt;li&gt;Update the details of a contact&lt;/li&gt;
&lt;li&gt;Delete the contact details&lt;/li&gt;
&lt;li&gt;Search functionality based on many parameters such as Name, City,  Contact Numbers, Address etc.&lt;/li&gt;
&lt;li&gt;List the entire list of contacts &lt;/li&gt;
&lt;li&gt;Refresh capability for the changes to be applied to the database.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;u&gt;&lt;i&gt;Advantages over the normal telephone book:&lt;/i&gt;&lt;/u&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt; Quick search and display of details&lt;/li&gt;
&lt;li&gt;Easy updation and deletion of contacts&lt;/li&gt;
&lt;li&gt;Robust contact addition&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;i&gt;&lt;u&gt;User Interface Analysis and Design:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The entire application is built on tabs,  rather than using Menus and sub-menus in the application as most of  them do. But to avoid complexity in the application, the results are  maintained in tabs (&lt;b&gt;JPanel&lt;/b&gt;). The results of the search and listing functionality  are displayed in a Scroll Pane (&lt;b&gt;JScrollPane&lt;/b&gt;). The items in individual  panels are programmed in separate functions to provide easy  maintainability. There are 5 panels in the application which are listed  below:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Create Panel&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Delete Panel&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Update Panel&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Search Panel&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;List Panel&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The search results and the listing operations are displayed in a tabular format (&lt;b&gt;JTable&lt;/b&gt;), with 7 different contact details. The operations on the table can be made by clicking on that particular cell and deleting the corresponding record. The table is added to the Scroll Pane (&lt;b&gt;JScrollPane&lt;/b&gt;) with vertical and horizontal scroll bars as needed.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The form-elements in the panels such as Create, Update and Search Panels is arranged in &lt;b&gt;Grid Layout&lt;/b&gt;. Go through the guidelines to use &lt;b&gt;&lt;a href=&quot;http://sairavikiran.blogspot.in/2010/07/grid-layout-no-look-and-feel-if-you.html&quot; target=&quot;_blank&quot;&gt;Grid Layout. &lt;/a&gt;&lt;/b&gt;&lt;a href=&quot;http://sairavikiran.blogspot.com/2010/07/grid-layout-no-look-and-feel-if-you.html&quot;&gt;All the guidelines listed to use Grid Layout&lt;/a&gt; will have to be followed for better look and feel. The text-boxes (&lt;b&gt;JTextArea&lt;/b&gt;) and buttons (&lt;b&gt;JButton&lt;/b&gt;) are mainly used in all these forms, with the drop-down lists (&lt;b&gt;JComboBox&lt;/b&gt;) also being added to the Search and Update Panels for better functionality and ease of use. The screen-shots can be downloaded &lt;a href=&quot;https://sites.google.com/site/welcome2terminal/attachments/TeleAddressbookscreenshots.rar&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;i&gt;&lt;u&gt;Database Analysis and Design:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
This is a simple application with only a few contact-details which allows us to design the entire database using a single table. The main motto of this series of posts is to work with Java Swing and database is the easiest way to access data. So, we make an assumption that a contact has only single Office, Residence and Mobile contact numbers. The Normalization is not needed as per this assumption and a single table prevents the joining of tables. The database table &lt;b&gt;telephone&lt;/b&gt; consists of fields listed below:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Contact-Name&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Street, Area and City details of the person&#39;s residence&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Office, Residence and Mobile phone numbers&lt;/b&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/1378322556855420837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/java-applications-telephone-cum-address.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/1378322556855420837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/1378322556855420837'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/java-applications-telephone-cum-address.html' title='Java Swing applications -- Telephone and Address Book -- I'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-1313264595950746779</id><published>2011-02-07T11:32:00.001+05:30</published><updated>2011-02-09T17:13:45.518+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Digsby"/><category scheme="http://www.blogger.com/atom/ns#" term="Empathy features"/><category scheme="http://www.blogger.com/atom/ns#" term="Empathy plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="GNOME"/><category scheme="http://www.blogger.com/atom/ns#" term="IM"/><category scheme="http://www.blogger.com/atom/ns#" term="Instant messengers"/><category scheme="http://www.blogger.com/atom/ns#" term="KDE"/><category scheme="http://www.blogger.com/atom/ns#" term="Kopete features"/><category scheme="http://www.blogger.com/atom/ns#" term="Kopete plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="Pidgin features"/><category scheme="http://www.blogger.com/atom/ns#" term="Pidgin plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="Protocol services"/><title type='text'>The Best Instant Messengers in Ubuntu Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;As many of us use Instant messengers, we need to select the best of the best on any platform and Linux is not an exception to this. There are as many as 18 Instant messengers for various chat networks in the Ubuntu Software Center. While Windows has Digsby judged as the best and most popular Instant messenger, Ubuntu has three of them that are popular. If Digsby were in Linux also, I would be more than satisfied to use it because of its real time notifications, the look and feel and the features it provides. But unfortunately, Digsby is currently unavailable on Linux and Mac platforms and works only on Windows. But well, there is no need to worry as there are others which fulfill your requirements. I found the following three to be interesting in Ubuntu:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Pidgin&lt;/li&gt;
&lt;li&gt;Kopete&lt;/li&gt;
&lt;li&gt;Empathy&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;h2&gt;&lt;i&gt;&lt;u&gt;&lt;a href=&quot;http://www.pidgin.im/download/ubuntu/&quot;&gt;Pidgin:&lt;/a&gt;&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfwpXx105UBv5M1dRKWHwybNxGo_dDpx_QAM5vkGH2etZP0FNzDlEtd-RFI6Nat45p4uSegQ2XMhZTENXGo7hPc3O25fqFdXoYdhFIN9UioN1vCog4f_6zjEhe9cub7SzoGPABM9AgPw/s1600/pidgin_logo.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfwpXx105UBv5M1dRKWHwybNxGo_dDpx_QAM5vkGH2etZP0FNzDlEtd-RFI6Nat45p4uSegQ2XMhZTENXGo7hPc3O25fqFdXoYdhFIN9UioN1vCog4f_6zjEhe9cub7SzoGPABM9AgPw/s1600/pidgin_logo.png&quot; /&gt;&lt;/a&gt;Pidgin was the most popular IM in Windows (and Linux) before Digsby came into picture. It was the default IM till Ubuntu version 8.10, but from Karmic Koala, Empathy became its default IM. It is an impressive master piece with a lot of features, with as many as 30 useful plugins and support for over 15 different protocol services such as AIM, MSN, Google Talk, Jabber, Yahoo etc. The only disadvantage I found with this IM is the slow start-up though it might not be a problem with the modern hardware configurations.&lt;br /&gt;
Some of the plugins are listed below:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Voice and video chat support&lt;/li&gt;
&lt;li&gt;Message highlighting&lt;/li&gt;
&lt;li&gt;Enhanced history&lt;/li&gt;
&lt;li&gt;SSL plugins&lt;/li&gt;
&lt;li&gt;Topic change notification&lt;/li&gt;
&lt;li&gt;Spell checker&lt;/li&gt;
&lt;li&gt;Recent conversations and many more&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;As you can see from the above plugin list, this IM has something for every level of user. It suits advanced users, beginners and intermediate users as well. Pidgin is quick at mail notifications, buddy status notifications. I would recommend you this IM if you have not got any on your Linux (not just Ubuntu).&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;&lt;a href=&quot;http://kopete.kde.org/&quot;&gt;Kopete:&lt;/a&gt;&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqBJoJfiSUwlTIL1jXPE7Va-hF39HZZIIddkcughVN0eFfZ5y9SqBYy39Lu7ZH-LCq-1MePLECxQG6w8O4UmJ2OyotR_2BYWh_HouRM_vj-1mYnAi9rToHSCenHUWKYrHXdMT5dhJ7eqI/s1600/kopete_thumb.png&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqBJoJfiSUwlTIL1jXPE7Va-hF39HZZIIddkcughVN0eFfZ5y9SqBYy39Lu7ZH-LCq-1MePLECxQG6w8O4UmJ2OyotR_2BYWh_HouRM_vj-1mYnAi9rToHSCenHUWKYrHXdMT5dhJ7eqI/s1600/kopete_thumb.png&quot; /&gt;&lt;/a&gt;Kopete is an instant messaging and chat application with support for a wide variety of services, such as AIM, Yahoo, ICQ, MSN, IRC, and Jabber. This package is part of the KDE 4 networking module. The layout of Kopete is glossy as it is available in KDE desktop environment. One good feature of Kopete is the KDE Wallet, which acts similar to the master password in Web Browsers. The KDE Wallet has passwords, cookies which once lost cannot be recovered. Besides this, the IM provides indexing for faster file search. Unlike Pidgin, it starts quickly with its look and feel being an extra asset. Notifications part is pretty good. It has got an extensive range of plugins including:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Video, voice chat support &lt;/li&gt;
&lt;li&gt;Translator&lt;/li&gt;
&lt;li&gt;Logging of all messages&lt;/li&gt;
&lt;li&gt;Statistics&lt;/li&gt;
&lt;li&gt;Bookmarks&lt;/li&gt;
&lt;li&gt;Auto replace&lt;/li&gt;
&lt;li&gt;Message highlighting and so on...&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;&lt;a href=&quot;http://live.gnome.org/Empathy&quot;&gt;Empathy:&lt;/a&gt;&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJqk8E5o6uaKdmkT3NkqhHYfDgd491Oxofzm9V0Qy59Q4qbYJa5IkZkB2wCXH8oZI7tAdt_I2j96SoLsVvgMIjonHSe2ebFTaECmARBxadMcTOlbxO6nAdGomNRjydStY5X8SAC6v-10M/s1600/index.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJqk8E5o6uaKdmkT3NkqhHYfDgd491Oxofzm9V0Qy59Q4qbYJa5IkZkB2wCXH8oZI7tAdt_I2j96SoLsVvgMIjonHSe2ebFTaECmARBxadMcTOlbxO6nAdGomNRjydStY5X8SAC6v-10M/s1600/index.jpeg&quot; /&gt;&lt;/a&gt;The Empathy Instant messenger is now the default IM in Ubuntu Linux. The premier advantage of this IM is the notifications. This supports as many as 20 different protocol services including Google talk, Facebook chat, Yahoo etc. It supports all protocols supported by Pidgin. It has support for voice, video chat, file transfers. Apart from this, it supports logging of messages according to date and it is quick.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/1313264595950746779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/best-instant-messengers-in-ubuntu-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/1313264595950746779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/1313264595950746779'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/best-instant-messengers-in-ubuntu-linux.html' title='The Best Instant Messengers in Ubuntu Linux'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfwpXx105UBv5M1dRKWHwybNxGo_dDpx_QAM5vkGH2etZP0FNzDlEtd-RFI6Nat45p4uSegQ2XMhZTENXGo7hPc3O25fqFdXoYdhFIN9UioN1vCog4f_6zjEhe9cub7SzoGPABM9AgPw/s72-c/pidgin_logo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-8335168069808215075</id><published>2011-02-06T19:48:00.004+05:30</published><updated>2011-02-25T13:02:47.325+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Gedit Color Schemes"/><category scheme="http://www.blogger.com/atom/ns#" term="Gedit features"/><category scheme="http://www.blogger.com/atom/ns#" term="Gedit plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="Gedit syntax highlighting"/><title type='text'>Gedit -- The complete Text Editor</title><content type='html'>&lt;span id=&quot;goog_1233186484&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1233186485&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Gedit is the default text-based editor for GNOME desktop. I can say its complete because of its enormous features. Gedit is an open source text based text editor that can be installed in operating systems such as Windows, Linux and Mac (not just Linux). It is powerful for programmers with its wide range of features and plugins, which makes it appealing to any level and type of user.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Computer world is changing from time to time and I can say there is a considerable transition in the field of the text editors. In the early days,&amp;nbsp; many machines were GUI less and the users had to learn &lt;b&gt;vi&lt;/b&gt; editor. Well, fewer and fewer machines are GUI less now. However, it is always important and is considered an extra edge to learn the &lt;b&gt;vi&lt;/b&gt; editor, which is more often than not, useful to edit configuration files. Gedit gives more productivity than all the other predecessor editors such as &lt;b&gt;vi&lt;/b&gt;,&lt;b&gt; emacs &lt;/b&gt;etc.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;u&gt;&lt;i&gt;Syntax Highlighting:&lt;/i&gt;&lt;/u&gt;&lt;/h2&gt;Gedit provides syntax-highlighting capability with a large number of&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Programming languages,&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Hardware programming,&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Scripting languages,&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Markup languages and&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Scientific purposes. (FCL, Octave, GAP, R)&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwds7PoV8YmWrm61MBj80mZBexkWidShyphenhyphenzXxEueOJVqXG9Amt8iR14V4Yuwp3r6ZvLfqC5yu5Yar_EyokoDgGJoxUlHTg0kjL8JglKN6PLjnZ4Tkqoo9A48hzLQGrB5exs2DSX6EnM30w/s1600/GEDIT.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;340&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwds7PoV8YmWrm61MBj80mZBexkWidShyphenhyphenzXxEueOJVqXG9Amt8iR14V4Yuwp3r6ZvLfqC5yu5Yar_EyokoDgGJoxUlHTg0kjL8JglKN6PLjnZ4Tkqoo9A48hzLQGrB5exs2DSX6EnM30w/s640/GEDIT.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;To select the highlighting mode, select &lt;b&gt;View -&amp;gt; Highlighting mode -&amp;gt; Select the mode from the drop down list&lt;/b&gt;.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;u&gt;&lt;i&gt;Gedit Features and Plugins:&lt;/i&gt;&lt;/u&gt;&lt;/h2&gt;&lt;br /&gt;
In addition to the highlighting mode, Gedit supports a number of features such as:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;b&gt;Bracket Completion&lt;/b&gt; -- Automatically adds closing brackets&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Change case&lt;/b&gt;&amp;nbsp; -- Inverts the case in the entire file&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Commenting or uncommenting a selected block of code.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Document statistics&lt;/b&gt; -- Gives some information about the number of characters, words, lines etc., of the file&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Embedded Terminal&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Spell checker&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Tag list&lt;/b&gt; -- Inserts commonly used tags and words into document&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Word completion&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Sorting a document or selected text&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Snippets&lt;/b&gt; -- Insert often used pieces of text quickly mostly becoming the templates of documents with a specified highlighting mode&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Python console&lt;/b&gt; in the bottom pane and thus can run python programs.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Language Support&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;However, some of the above plugins will work only if you add the external plugins, which can be installed with the help of Ubuntu Software Center, by typing in the filter text&lt;span style=&quot;font-family: inherit;&quot;&gt; as &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&quot;gedit-plugins&quot;&lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; and click Install.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&lt;u&gt;&lt;i&gt;Colour Schemes:&lt;/i&gt;&lt;/u&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Apart from all these plugins and features, Gedit consists of some Colour Schemes which customise the environment of this text editor. Some of the colour schemes can be downloaded &lt;a href=&quot;http://live.gnome.org/GtkSourceView/StyleSchemes&quot;&gt;here&lt;/a&gt;. These colour schemes can be installed by selecting &lt;b&gt;Edit -&amp;gt; Preferences -&amp;gt; Font and Colors&lt;/b&gt; tab and then adding the schemes (.xml files) by clicking on the Add button there under.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/8335168069808215075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/gedit-complete-text-editor.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/8335168069808215075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/8335168069808215075'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/gedit-complete-text-editor.html' title='Gedit -- The complete Text Editor'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwds7PoV8YmWrm61MBj80mZBexkWidShyphenhyphenzXxEueOJVqXG9Amt8iR14V4Yuwp3r6ZvLfqC5yu5Yar_EyokoDgGJoxUlHTg0kjL8JglKN6PLjnZ4Tkqoo9A48hzLQGrB5exs2DSX6EnM30w/s72-c/GEDIT.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-6166762554197786402</id><published>2011-02-05T14:39:00.006+05:30</published><updated>2011-02-06T12:41:15.820+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux is not Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="official repositories"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu Software center"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="WINE"/><title type='text'>10 Beginner Mistakes to be avoided by Linux newbies</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Ever increasingly, Linux is becoming more and more popular. Along the way, there are several common mistakes that users new to Linux tend to make. In fact, from time to time, you can even find some seasoned Linux users making some of these same mistakes. If you can avoid these mistakes, the transition to Linux will be a lot easier.&lt;/div&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;1. Installing from outside the official repositories:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This mistake is generally done by those who have used mostly Windows before. They try to programs and software from outside the official repositories just as&amp;nbsp; in Windows. Almost all Linux distributions have official repositories and the software packages need to be installed from them. For example, in Ubuntu, install the software from the Ubuntu Software Center. This Center contains a list of all the softwares available officially. If you have installed the software outside the official repositories, there is a little chance to get assistance.&lt;/div&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;2. Doing selective updates:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This undoubtedly will make your system unstable mostly by broken links. It&#39;s considered a good practice to install &lt;b&gt;all the updates&lt;/b&gt; periodically. To install all the updates, goto System &amp;gt; Administration &amp;gt; Update Manager. Not only this, but delaying these updates would be costly for you. So, it is always suggested to do complete update periodically.&lt;/div&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;3. Linux is not Windows:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There may be a lot of similarities in between Linux and Windows. But, don&#39;t expect Linux to be exactly like Windows. The similarities help in making an easy transition towards Linux.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;4. Avoid learning command line:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The computer world has been changing continuously in the field of user interfaces. Its getting easier and easier for the users to use many operating systems and applications now-a-days. But, the whole process started with the command line user interface. And Linux is an operating system which expects you to learn a bit of command-list. Command line way of doing things is a lot quicker than the GUI. Besides all this, some things can be done only through the command line. So, if you have decided to work with Linux, then learn commands.&lt;/div&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;5. Misusing the help forums:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Even though Linux is free, help for getting started is close at hand, and available from multiple sources. There are help files, user manuals, and even the &quot;man pages&quot; that are easily accessed through either the command line or the other graphical way. For each Linux distribution, there is a separate user forum for getting help regarding all the operating system issues. By searching, you are likely to learn other important things. So, get the most of these user help forums.&lt;/div&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;6. Avoid running as root (when needed):&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Running the operating system with root privileges will surely inflict some damage to your system. So, avoid running as root as far as possible.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;7. Avoid relying too much on WINE:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;WINE is a utility to run Windows executable programs on Linux. Find Linux software counterparts and try using that instead of installing all the softwares through WINE.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;8. Ignoring the system messages and errors.&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;9. Its not Ctrl-Alt-Delete:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In Windows, this shortcut gives you the Task Manager. However, Linux restarts when these buttons are toggled. There is an applet named &quot;Force quit&quot; which can be used for force quitting unresponsive programs.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;10. Giving up too early:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This happens mostly as far as Linux is concerned. Everyone must realise that they are not born knowing Windows. So, put some efforts to learn Linux and you will get rich dividends.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sources:&lt;/b&gt; PC Linux OS Magazine &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/6166762554197786402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/10-beginner-mistakes-to-avoid-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6166762554197786402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6166762554197786402'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/10-beginner-mistakes-to-avoid-for.html' title='10 Beginner Mistakes to be avoided by Linux newbies'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-5480137694673969158</id><published>2011-02-03T22:41:00.002+05:30</published><updated>2011-02-06T12:40:34.257+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CPU Utilisation"/><category scheme="http://www.blogger.com/atom/ns#" term="ext4 file system"/><category scheme="http://www.blogger.com/atom/ns#" term="GUI"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux file systems"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Operating System"/><category scheme="http://www.blogger.com/atom/ns#" term="Security in Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu Software center"/><title type='text'>Ubuntu -- Analysis of the versions 8, 9 and 10</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Ubuntu, a variant of Linux is continuously making its mark in the race among the operating systems as advancements are being made continuously with respect to many operating system aspects. I found huge advancements in regions such as GUI, CPU Utilisation, Networking, booting time etc. though some features were getting down. The Ubuntu Operating system versions will be released in the April and October months of every year with advancements made in some operating system aspects.&lt;/div&gt;&lt;br /&gt;
The versions and the code names of Ubuntu are given below:&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;8.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HARDY HERON&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;8.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTREPID IBEX&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;9.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JAUNTY JACKALOPE&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;9.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KARMIC KOALA&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;10.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LUCID LYNX&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;10.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAVERICK MEERKAT&lt;/i&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The Ubuntu versions 8.04 and 8.10 had nothing to talk much about them.  The software packages were not efficiently run besides the high CPU  utilisation. The security settings were also not that strong. Networking  was not good and connection to Internet through DSL was not present in  Ubuntu 8.04. The look and feel was not appealing and the dependencies had to  be looked after every now and then while installing the software  packages. The Web Browser consumed much of the CPU resources when it was  running, making it uncomfortable to use.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The Ubuntu versions 9.04 and 9.10 started using ext4 file system  which made them to reduce the boot times three times than that of the  8.10 version. These versions boot in 25 seconds much better than the 65  seconds taken by the previous version (8.10). With the same, it managed  to efficiently improve the system performance. These versions also made  the look and feel better by introducing an absolute candy for  notification purposes. The Empathy Instant messenger came into play with  the version 9.10. The wireless network support was included in the 9.04  version. However, the network applet had some bugs, which made the  connection to Internet (Wired using DSL) difficult. Besides all this, the Jaunty Jackalope newly had Tablet and Netbook support.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;I should say that Ubuntu 10.04 and Ubuntu 10.10 are the best which we are having at present. These versions take only 10 seconds for the booting purpose, much better than the previous releases (25 seconds in the previous releases). In addition to the booting time, the software seemed to start quickly. The GUI has changed suddenly and the default theme settings are appealing to the eyes. The Internet got very much slowed down in Ubuntu 10.04 but all those major issues in Ubuntu 10.04 have been rectified now. The security settings are improving version after version in Ubuntu. I can find a lot of difference in the security in Ubuntu 8.10. The Ubuntu Software Center has undoubtedly become charming and more handy than ever, especially in the categorisation of the software. I should say, users had to face a bit of problem with the dependencies, broken links earlier; but now everything is managed so well by the Ubuntu software center, making it more user-friendly. Apart from this, the Instant messaging has added the new features of audio and voice chatting using Empathy Instant Messenger. I found that when the system files are being accessed, the system was taking so much time and was consuming large amount of CPU (almost 90% of CPU utilisation). This is the case when we open it in the GUI. The situation is however different when accessed through the Linux terminal. The authentication is a bit slow in Ubuntu 10.10 even though it was alright in Ubuntu 10.04.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/5480137694673969158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/ubuntu-analysis-of-versions-8-9-and-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/5480137694673969158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/5480137694673969158'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/ubuntu-analysis-of-versions-8-9-and-10.html' title='Ubuntu -- Analysis of the versions 8, 9 and 10'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-908922500115762999</id><published>2011-02-02T21:28:00.007+05:30</published><updated>2011-06-06T12:06:57.348+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX news command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX User communication commands"/><title type='text'>Linux -- User Communication  -- Part-3  --  news command</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;The system administrator is the sole person who can make news under the Linux. He types the information which he wants everyone on the network to know of in different files in &lt;b&gt;/var/lib/sysnews&lt;/b&gt; directory.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Whenever we log in if any fresh news has come in since we logged out last time then a message is displayed on our terminal saying, &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;news: appeal rally&lt;/b&gt; where &lt;b&gt;appeal &lt;/b&gt;and &lt;b&gt;rally&lt;/b&gt; are the names of files in which the news items are available. We may either choose to ignore it, or if any news item interests us we may decide to pursue the same. &lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;First, we can look at the names of the news articles by the command &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;news&lt;/b&gt; with &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;-n&lt;/b&gt; option. Similarly, to know the number of unread news articles that are present in the &lt;b&gt;/var/lib/sysnews&lt;/b&gt; directory, we use the command &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;news&lt;/b&gt; with &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;-s&lt;/b&gt; option. If you try &lt;b&gt;news -s&lt;/b&gt; after you have gone through all the news items it promtly displays the message&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &quot;NEWS: 0 news articles&quot;&lt;/span&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_hyphenhyphenvOns9u-3f2OgAEaODYykaJFpIpKWGL0ZLR4_8gGpYFfFCD9YboIpeZxDr4VBxIXGzC5FyWT_Ro0pglykP9KJm6iHtY6xV1KzfCN2DqysFN_Ln9H1CrWipI_w3qYmrspvdZxyN6KXg/s1600/news1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_hyphenhyphenvOns9u-3f2OgAEaODYykaJFpIpKWGL0ZLR4_8gGpYFfFCD9YboIpeZxDr4VBxIXGzC5FyWT_Ro0pglykP9KJm6iHtY6xV1KzfCN2DqysFN_Ln9H1CrWipI_w3qYmrspvdZxyN6KXg/s1600/news1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Jffj5sy9lCv46kx5_cZDPJN6jZJS67Q7QqhGRFABLh1ML_HDnB_p9DtNaZPbxS8iltlXM0A4zqJ_8lBqHryGvM8rq9v7j-5lZG7g43LXMszxDzoMyPoYyNPL5bF-fhKfeAua4WI26qM/s1600/news2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Jffj5sy9lCv46kx5_cZDPJN6jZJS67Q7QqhGRFABLh1ML_HDnB_p9DtNaZPbxS8iltlXM0A4zqJ_8lBqHryGvM8rq9v7j-5lZG7g43LXMszxDzoMyPoYyNPL5bF-fhKfeAua4WI26qM/s1600/news2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;The command without any options would yield the list of unread news articles one after another.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk-03b4sOt12zobH2xrKxoKuzJYiO9fMGf7IT8evel0vBJjqVmQAdY3lT1YxrIx0B2yaXvUt-g0zSZE9ud3xAM1c9p323CLPAV8vKiH8sK8VHtqi7sPDRBcLdStADT8v4UPyYaYNKUCXE/s1600/news3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk-03b4sOt12zobH2xrKxoKuzJYiO9fMGf7IT8evel0vBJjqVmQAdY3lT1YxrIx0B2yaXvUt-g0zSZE9ud3xAM1c9p323CLPAV8vKiH8sK8VHtqi7sPDRBcLdStADT8v4UPyYaYNKUCXE/s1600/news3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;At the same time, the user can pursue only a particular news article&amp;nbsp; from several items by specifying the article name after the command. For example, if you want to pursue the article named &lt;b&gt;appeal&lt;/b&gt;, then you can run the command at the prompt as &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;news appeal&lt;/b&gt;.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7EBfFN5AyMTVLYHMMyOqVv7Av1JtXhyu8EbB3Zk7LMHms8-0YsEy0ABJOqnzzy1-MgEK8_LbqxUN369N0skKo_zP0boBx4kUgdd6FfdQdNlSRnV6EPPvYeoEhQCe34YEtv4hmHMY_3nM/s1600/news4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7EBfFN5AyMTVLYHMMyOqVv7Av1JtXhyu8EbB3Zk7LMHms8-0YsEy0ABJOqnzzy1-MgEK8_LbqxUN369N0skKo_zP0boBx4kUgdd6FfdQdNlSRnV6EPPvYeoEhQCe34YEtv4hmHMY_3nM/s1600/news4.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;If the user decided to pursue all the news articles (read and unread), then the option &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;-a&lt;/b&gt; has to be used with the command.&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9sokF5BAhW4AQysVdMgGFQPVYWCZWXKVcqT8NxyHdlj2OcDfJrPrDlicFZnCVFffZppPhwKz9YTVcuZ3T7weJg5zIYX_kCtSfK6gpikIAJtJ5_yCz2ANMLGwweU5zvCLgFuM-D2kXI8k/s1600/news5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9sokF5BAhW4AQysVdMgGFQPVYWCZWXKVcqT8NxyHdlj2OcDfJrPrDlicFZnCVFffZppPhwKz9YTVcuZ3T7weJg5zIYX_kCtSfK6gpikIAJtJ5_yCz2ANMLGwweU5zvCLgFuM-D2kXI8k/s1600/news5.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/908922500115762999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/linux-communication-part-3-news-command.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/908922500115762999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/908922500115762999'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/linux-communication-part-3-news-command.html' title='Linux -- User Communication  -- Part-3  --  news command'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_hyphenhyphenvOns9u-3f2OgAEaODYykaJFpIpKWGL0ZLR4_8gGpYFfFCD9YboIpeZxDr4VBxIXGzC5FyWT_Ro0pglykP9KJm6iHtY6xV1KzfCN2DqysFN_Ln9H1CrWipI_w3qYmrspvdZxyN6KXg/s72-c/news1.png" height="72" width="72"/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-6131104026522217101</id><published>2011-02-02T12:59:00.007+05:30</published><updated>2011-06-06T12:09:19.961+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX User communication commands"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX wall command"/><title type='text'>Linux -- User Communication  -- Part-2 -- wall command</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;a href=&quot;http://sairavikiran.blogspot.com/2011/02/linux-communication-part-1.html&quot;&gt;&lt;b&gt; write&lt;/b&gt; &lt;/a&gt; command is used for communication between two users connected to a network. However, if a user wants to send a message to everyone in the network; then the &lt;b&gt;wall&lt;/b&gt; command will be used. The command is mostly used by the administrators for purposes such as the situation where the Unix/Linux system will be shut down in 10 minutes. He does so using &lt;b&gt;wall&lt;/b&gt;. After giving the entire message, Ctrl - D must be pressed. The default behaviour of &lt;b&gt;wall&lt;/b&gt; command is as shown in the below figure:&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzv1n3HgY5ctC_WqS_yhg5qUEtcqqgl8j9RIF3WTOy7eDgRgBdYgfJA8tS4NEJyS8d36TAubI_xKEtqWa-im5VcPScwG-ueyb-7Qu_cCDyrHZWF7wMvhsI6zNltZ-h31q8GFc0pzTi5KA/s1600/wall+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzv1n3HgY5ctC_WqS_yhg5qUEtcqqgl8j9RIF3WTOy7eDgRgBdYgfJA8tS4NEJyS8d36TAubI_xKEtqWa-im5VcPScwG-ueyb-7Qu_cCDyrHZWF7wMvhsI6zNltZ-h31q8GFc0pzTi5KA/s1600/wall+1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWHPbJ09ucJxQ11IWAcJ6d-tRm8VfkW_YQqDBO4LkQvLH5FoWGJD3w2SZpbKIfFztjGX_D7Mal-Rk2UC6nmW9TfTc3b6bN93ozvbT4aJCHDH2iY2yPEesokQ7jXXw1KCTL7CKwSy-xLiI/s1600/wall+file.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Another important thing to note about this command is that it writes to all the terminals irrespective of whether the users have given write permission to their terminals or not, as important messages are often posted using the &lt;b&gt;wall&lt;/b&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Thus, this command is used to broadcast a message to everyone on the network and the necessary message is written onto the terminals of all the users.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;A variation of &lt;b&gt;wall&lt;/b&gt; would be to broadcast the contents in a file to all the terminals. This is done by the command given as: &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&quot;wall &amp;lt; [file-name]&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&quot;&lt;/span&gt;. In this case, Ctrl-D need not be pressed. This is shown in the below figure:&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_2U0UgVIcrvECckTYTiyI0jQkjpyIK6XWzs_QoMmZ8MU6otYJQLXWtPa2SEVGPXSujY9brbPkHsCpwr_P6l5udahVCu01Q3pS7JgiLId2T3H8MP04izf67yqjggeCniv2Qb4UVBN8Cc/s1600/wall+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_2U0UgVIcrvECckTYTiyI0jQkjpyIK6XWzs_QoMmZ8MU6otYJQLXWtPa2SEVGPXSujY9brbPkHsCpwr_P6l5udahVCu01Q3pS7JgiLId2T3H8MP04izf67yqjggeCniv2Qb4UVBN8Cc/s1600/wall+2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
To know about the next part of the Linux user communication, click &lt;a href=&quot;http://sairavikiran.blogspot.com/2011/02/linux-communication-part-3-news-command.html&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/6131104026522217101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/linux-communication-part-2-wall-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6131104026522217101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6131104026522217101'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/linux-communication-part-2-wall-command.html' title='Linux -- User Communication  -- Part-2 -- wall command'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzv1n3HgY5ctC_WqS_yhg5qUEtcqqgl8j9RIF3WTOy7eDgRgBdYgfJA8tS4NEJyS8d36TAubI_xKEtqWa-im5VcPScwG-ueyb-7Qu_cCDyrHZWF7wMvhsI6zNltZ-h31q8GFc0pzTi5KA/s72-c/wall+1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-6553260024115763389</id><published>2011-02-01T23:43:00.009+05:30</published><updated>2011-06-06T12:16:00.331+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX finger command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX mail command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX User communication commands"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX who command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX write command"/><title type='text'>Linux -- User Communication  -- Part-1 -- write command</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;The communication between/among different users in Linux systems connected in a network is actually just as simple as running some commands. A direct application of a network system, communication is handled expertly by Unix. The commands used for such a communication are as follows:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;write&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sairavikiran.blogspot.com/2011/02/linux-communication-part-2-wall-command.html&quot;&gt;wall&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sairavikiran.blogspot.com/2011/02/linux-communication-part-3-news-command.html&quot;&gt;news&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;mail&lt;/li&gt;
&lt;/ol&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;The &quot;write&quot; command:&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;b&gt;write&lt;/b&gt; command can be used by any user to write something on someone else&#39;s terminal, provided the recipient of the message permits communication. There are two pre-requisites for a smooth &lt;b&gt;write&lt;/b&gt; operation:&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt; The recipient must be logged in, else an error message is inevitable.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;The recipient must have given permission for messages to reach his or her terminal.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;If you do not want the messages to be posted on your terminal, just type the command: &lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;mesg n&lt;/span&gt;&lt;/b&gt;. But, by default the terminal allows messages to be posted on it. To know if the messages can be posted on your terminal or not, just type the command &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;mesg&lt;/b&gt;. If the command returns &quot;is y&quot;, then messages can be posted on your terminal, otherwise they cannot be posted. Before using the write command, it is a good idea to first ascertain who all are logged in and who allow messages to their terminals.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwcHnSr25iXGTKxt2COJ9DLMYz-kVDCZPaCPp8yw1HM768bE588snbU973grpnFKYj5LLjbJZv9vPIllbzL8vlvgNdPLRdN5hORWY6iKhO2YhlOH5ki4z0kZzECyrgcORG8rr_3dbtF04/s1600/receiver+not+ready.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigYvxQb0duSUUqnXwZ-7-1lGn1iMopCTeNWYRpCsosKxtxofCWkxZMVdSEcBZ5zPlFRC1jt9oeJIUsAqSyZ8xxKAyCOv81qfZBITh0QX_TUKnRcgJtblAAd0Yx2RreEBlBB1ADxMNyAn0/s1600/write1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigYvxQb0duSUUqnXwZ-7-1lGn1iMopCTeNWYRpCsosKxtxofCWkxZMVdSEcBZ5zPlFRC1jt9oeJIUsAqSyZ8xxKAyCOv81qfZBITh0QX_TUKnRcgJtblAAd0Yx2RreEBlBB1ADxMNyAn0/s1600/write1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;finger&lt;/b&gt; is one command that tells you which users are connected and which, if any can receive messages. It displays a list of all those who have logged in and places a * next to those terminals where &lt;b&gt;mesg&lt;/b&gt; is set to &lt;b&gt;n&lt;/b&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoQmV813IPu9TFxQmsQ-nlsjGPymOaJNxIVfC7T3rYZXT5cmO8nByYwBRhHnRYlSzqwpBopezRVl5iSZQ_pDRbYSS2uJ1la3pmwIKiQC0RvKe39mjXdmCregcEaFeHLwH9itPSvyGwins/s1600/write2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoQmV813IPu9TFxQmsQ-nlsjGPymOaJNxIVfC7T3rYZXT5cmO8nByYwBRhHnRYlSzqwpBopezRVl5iSZQ_pDRbYSS2uJ1la3pmwIKiQC0RvKe39mjXdmCregcEaFeHLwH9itPSvyGwins/s1600/write2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Another command that may be used for this purpose is &lt;b&gt;who -T&lt;/b&gt;. The command &lt;b&gt;who&lt;/b&gt; lists all the users who are currently logged in. When used with -T option, it places a &#39;+&#39; next to users who have allowed messages and a &#39;-&#39; sign beside others.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOeOR2qfBHFYgb53d250-BvOAZcYiYbRgqKXwp93oI55SVRTNsuraqnGgE5BAVA6KJ7bMtgRb1_r17fxcd2VdpaXAzgoQDFdueTKmC0vRpn8cscu90gjQmg96A64zMiXR-rCO5CHDD-1s/s1600/write3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOeOR2qfBHFYgb53d250-BvOAZcYiYbRgqKXwp93oI55SVRTNsuraqnGgE5BAVA6KJ7bMtgRb1_r17fxcd2VdpaXAzgoQDFdueTKmC0vRpn8cscu90gjQmg96A64zMiXR-rCO5CHDD-1s/s1600/write3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Now, the default behaviour of &lt;b&gt;write&lt;/b&gt; command is as shown below. The first screen-shot is the terminal on the sender side and the second on the receiver side.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFb7woDm_VQvCzqa0CWhZ0BxZtNWYzoEcOq-2oSaAJ6Lh5SKTccILkwY7Glhnl1BIUZ2vZajXLGOoubUJl2tO40275GzfYFw4Apk8RFxB4ueIDuMDFZLC7IEr8UQ5xFrEnYnd32qbHmws/s1600/write+4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFb7woDm_VQvCzqa0CWhZ0BxZtNWYzoEcOq-2oSaAJ6Lh5SKTccILkwY7Glhnl1BIUZ2vZajXLGOoubUJl2tO40275GzfYFw4Apk8RFxB4ueIDuMDFZLC7IEr8UQ5xFrEnYnd32qbHmws/s1600/write+4.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjur66nvu2ogfIHsviWTt2sJDZEEEusxQvSWVFe2zhP2g09e63jiRvSoBD516aBZrhEWdYcDUmXhXP31C4GjO4Bp1uY0dMZcfY-U5-ckowXiEl006N2_X2HXuDr3veaIDzTrVnFQqoVLtg/s1600/write+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjur66nvu2ogfIHsviWTt2sJDZEEEusxQvSWVFe2zhP2g09e63jiRvSoBD516aBZrhEWdYcDUmXhXP31C4GjO4Bp1uY0dMZcfY-U5-ckowXiEl006N2_X2HXuDr3veaIDzTrVnFQqoVLtg/s1600/write+5.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;u&gt;Variations of &lt;b&gt;write&lt;/b&gt;:&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Writing to somebody who has set &lt;b&gt;mesg&lt;/b&gt; to &lt;b&gt;n&lt;/b&gt; on his terminal. The permission gets denied on such occasions. However, if the sender has &lt;b&gt;mesg&lt;/b&gt; set to &lt;b&gt;n&lt;/b&gt; and the receiver has &lt;b&gt;mesg&lt;/b&gt; set to &lt;b&gt;y&lt;/b&gt; then the reply to the message is not possible.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaIz0NLWEtthYSaA2ar9Moz3lJwedMuHkjVgUiMw9wBhfysgHrudDQU8f5m9xdQh6ewEDQ9YNSuMVQg9aPROIhiry0EchV-AgNsNAIc3hCtP4h2dvee0EWOrLzuxb5rXX6AuUE3qjbqiI/s1600/write+6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaIz0NLWEtthYSaA2ar9Moz3lJwedMuHkjVgUiMw9wBhfysgHrudDQU8f5m9xdQh6ewEDQ9YNSuMVQg9aPROIhiry0EchV-AgNsNAIc3hCtP4h2dvee0EWOrLzuxb5rXX6AuUE3qjbqiI/s1600/write+6.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;A user logged in at more than one terminal and you want to send a message only to one terminal. The terminal specified in the command will be sent a message simply. If we do not mention the terminal to which the message should be sent, then the &lt;b&gt;write&lt;/b&gt; command comes up with a smart solution in case of confusion. In all the above screen-shots the user is logged in at more than one place. For example, &lt;b style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;write user tty9&lt;/b&gt; writes to the terminal &lt;b&gt;tty9&lt;/b&gt; of user-name &lt;b&gt;user&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;To know about the next part in Linux user communication to know the &lt;b&gt;wall &lt;/b&gt;command, click &lt;a href=&quot;http://sairavikiran.blogspot.com/2011/02/linux-communication-part-2-wall-command.html&quot;&gt;here&lt;/a&gt;. &lt;/div&gt;&lt;ul&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/6553260024115763389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/linux-communication-part-1.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6553260024115763389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/6553260024115763389'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/02/linux-communication-part-1.html' title='Linux -- User Communication  -- Part-1 -- write command'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigYvxQb0duSUUqnXwZ-7-1lGn1iMopCTeNWYRpCsosKxtxofCWkxZMVdSEcBZ5zPlFRC1jt9oeJIUsAqSyZ8xxKAyCOv81qfZBITh0QX_TUKnRcgJtblAAd0Yx2RreEBlBB1ADxMNyAn0/s72-c/write1.png" height="72" width="72"/><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-122683972991794838</id><published>2011-01-31T23:08:00.002+05:30</published><updated>2011-02-06T12:48:30.987+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Data Structures"/><category scheme="http://www.blogger.com/atom/ns#" term="DIRSTACK"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Directory Stack"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX dirs command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX popd command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX pushd command"/><title type='text'>Linux -- Directory Stack</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;
p { margin-bottom: 0.08in; }
&lt;/style&gt;  &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;I am just surprised at the way Data Structures are used in our day-today life not just the computers field. Now, its time to discuss the directory stack. The basic idea of stack is also applied to the directory stack, a list of recently-visited directories. Like any other stack, the directory stack also allows us to view the contents of stack, push an element into the stack, pop an element from the stack. But the difference is that the insertion and deletion operations can be done on any element in the stack, not just the top element of the stack.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;Push operation is carried upon by the &lt;b&gt;pushd&lt;/b&gt; command while Pop operation is carried upon by the &lt;b&gt;popd&lt;/b&gt; command. These two operations can quickly navigate around the file-system. If the pop operation is issued when the stack is empty, the appropriate message is issued. The cd command changes the current element at the top of the stack i.e., the $DIRSTACK variable. The &lt;b&gt;dirs&lt;/b&gt; builtin displays the contents of the directory stack. The contents of the directory stack are also visible as the value of the DIRSTACK shell variable.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;In short, the pushd builtin adds directories to the stack as it changes the current  directory, and the popd builtin removes specified directories from the stack and changes the current directory to the directory  removed.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;The pushd command is similar to the cd command, but pushd retains the directory that you are currently in, in its directory-stack. For example, the command &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;pushd /usr/share&lt;/span&gt; displays the entire directory-stack. It knows that I came to /usr/share from the home directory. If I issue popd, this is going to take my directory-stack and bring me back to the previous directory in the directory-stack. The command saves the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;The popd command removes the top entry from the directory stack, and cd to the new top directory. When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;The basic behavior of pushd, popd and dirs are shown in the figure below:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq6knh24MUlK5ej9MNfV_Fgh9BWru_rt3qR4WHbcn5bU2AFIkQETtZzdmi8zNbsFnumy7rAoJzVTleufX9OU0yG5mZnHiXuMQkcRwOekxuiIbf9E8dE1UcvbDUaNKu6cl4h4aWQpZaZ2w/s1600/pushd+popd+and+dirs.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;422&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq6knh24MUlK5ej9MNfV_Fgh9BWru_rt3qR4WHbcn5bU2AFIkQETtZzdmi8zNbsFnumy7rAoJzVTleufX9OU0yG5mZnHiXuMQkcRwOekxuiIbf9E8dE1UcvbDUaNKu6cl4h4aWQpZaZ2w/s640/pushd+popd+and+dirs.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: justify;&quot;&gt;&lt;br /&gt;
The DIRSTACK array needs some explanation at this point in time. The contents of the array can be displayed by the command &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&quot;echo ${DIRSTACK[*]}&quot;&lt;/span&gt;. If only the second element in the array needs to be printed, then&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &quot;echo ${DIRSTACK[1]}&quot;&lt;/span&gt; as the arrays start with index as 0. The DIRSTACK array is shown in the below figure:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyxB07jASv653-MGuJhQIBL76uZ1O_p9aeP4WSwuRtXNh5aVABKM1V3K1ssESfD6tu-9pq28Ge6kLhgkeImZl7KXRpbAbO7UdRwnv1a23-jztpQQTnHZFQd8ly7F0ah1bCH_gZhPr5-9I/s1600/DIRSTACK.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyxB07jASv653-MGuJhQIBL76uZ1O_p9aeP4WSwuRtXNh5aVABKM1V3K1ssESfD6tu-9pq28Ge6kLhgkeImZl7KXRpbAbO7UdRwnv1a23-jztpQQTnHZFQd8ly7F0ah1bCH_gZhPr5-9I/s640/DIRSTACK.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;i&gt;&lt;b&gt;Variations of dirs:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;
p { margin-bottom: 0.08in; }
&lt;/style&gt;  &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;&lt;u&gt;&lt;b&gt;dirs [+N | -N] [-clvp]&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;+N: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-N: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-c: Clears the directory stack by deleting all of the elements. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-l:&amp;nbsp; Produces a longer listing; the default listing format uses a tilde to denote the home directory. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-p: Causes dirs to print the directory stack with one entry per line. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-v: Causes dirs to print the directory stack with one entry per line, prefixing each entry with its index in the stack.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;The variations of the dirs command are shown in the below figure:&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCAMKI74FVxUFUStCRsQfpZXlrsLuecNjC0P6suEf3NyMRBjua-o964-3-xxqlFCJAGcLTZNmoEBthcghvN_AHwZrhZ5kmIcrhXr5t1dAPNeVvGK_FVyXsQRpBffSTHuBSnWdWBOZFOBU/s1600/dirs+variations.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCAMKI74FVxUFUStCRsQfpZXlrsLuecNjC0P6suEf3NyMRBjua-o964-3-xxqlFCJAGcLTZNmoEBthcghvN_AHwZrhZ5kmIcrhXr5t1dAPNeVvGK_FVyXsQRpBffSTHuBSnWdWBOZFOBU/s640/dirs+variations.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt; &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;i&gt;&lt;b&gt;Variations of pushd:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;
p { margin-bottom: 0.08in; }
&lt;/style&gt;  &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;&lt;u&gt;&lt;b&gt;pushd [dir | +N | -N] &lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;+N: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-N: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;dir: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir&#39;.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;i&gt;&lt;b&gt;Variations of popd:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;
p { margin-bottom: 0.08in; }
&lt;/style&gt;  &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;&lt;u&gt;&lt;b&gt;popd [+N | -N] [-n]&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;+N: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-N: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. &lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;-n: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is  manipulated.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;The variations of pushd and popd are shown in the figure below:&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF33YmkXqIj6_TwbOFSMZ3VrWe_t6BqH4ZHealmPqEwDeXbECO7Hf4f_TvCrJNEsh8FRNbcmh_EdqwqqjWz_pVdelM2NEdAacI5Su4y68NbgtwHDOvzFqTYluOlD9S299EF1nDtOpLIAs/s1600/popd+-n.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;426&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF33YmkXqIj6_TwbOFSMZ3VrWe_t6BqH4ZHealmPqEwDeXbECO7Hf4f_TvCrJNEsh8FRNbcmh_EdqwqqjWz_pVdelM2NEdAacI5Su4y68NbgtwHDOvzFqTYluOlD9S299EF1nDtOpLIAs/s640/popd+-n.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjufjzuTYxKF0m6HDpeYVc9zCsahsqTvMYz6_4BE-WDtZAJfcx_yjT3JLiK258FRQFuKszA5oMKr9ou0CzLQPZwr8RBfGVx9dj2b_9uLl0mVkSIppn8TDB0lMvt_mebN4qTB4OSzr_pUMQ/s1600/popd+variations.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;426&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjufjzuTYxKF0m6HDpeYVc9zCsahsqTvMYz6_4BE-WDtZAJfcx_yjT3JLiK258FRQFuKszA5oMKr9ou0CzLQPZwr8RBfGVx9dj2b_9uLl0mVkSIppn8TDB0lMvt_mebN4qTB4OSzr_pUMQ/s640/popd+variations.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfKHTXIFRzH1c39YrTwIYaFZ257PQXBMoNmCPSP0kMvUn_zMz8sK5lPjO_ufsv8s4u_ncS6sT7Zfap_rB-gIPWiut3nOXEk_gcNFpSAh6XUF4t2X_tWFSD9m8iT5Hc8JCf4XW-OAvSJuU/s1600/pushd+variations.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;422&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfKHTXIFRzH1c39YrTwIYaFZ257PQXBMoNmCPSP0kMvUn_zMz8sK5lPjO_ufsv8s4u_ncS6sT7Zfap_rB-gIPWiut3nOXEk_gcNFpSAh6XUF4t2X_tWFSD9m8iT5Hc8JCf4XW-OAvSJuU/s640/pushd+variations.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;b&gt;Sources:&lt;/b&gt; Bash Reference&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/122683972991794838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/linux-directory-stack.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/122683972991794838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/122683972991794838'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/linux-directory-stack.html' title='Linux -- Directory Stack'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq6knh24MUlK5ej9MNfV_Fgh9BWru_rt3qR4WHbcn5bU2AFIkQETtZzdmi8zNbsFnumy7rAoJzVTleufX9OU0yG5mZnHiXuMQkcRwOekxuiIbf9E8dE1UcvbDUaNKu6cl4h4aWQpZaZ2w/s72-c/pushd+popd+and+dirs.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-3680872489563635134</id><published>2011-01-30T22:53:00.003+05:30</published><updated>2011-06-06T12:23:15.227+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX bc command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX factor command"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX units command"/><title type='text'>Linux terminal - Mathematics</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Important mathematical calculations can be done by using the Calculator application available with the Linux applications. But these calculations and can be made by the following commands in the terminal:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;bc&lt;/li&gt;
&lt;li&gt;expr &lt;/li&gt;
&lt;li&gt;factor&lt;/li&gt;
&lt;li&gt;units&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;1. The &quot;bc&quot; command:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
The programmable calculator called &lt;b&gt;bc&lt;/b&gt; gets you into the calculator mode, and the $ prompt disappears. The command gives almost all the basic mathematics calculations. The input&amp;nbsp; to this calculator is taken line by line. Enter an expression and the result supplied in the next line. The inputs and results are self-explanatory. Typing &quot;quit&quot; gets you out of the calculator mode and ends your tryst with &lt;b&gt;bc&lt;/b&gt;. The basic mathematical calculations can done using &lt;b&gt;bc&lt;/b&gt; command as follows:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6op34juFzaC2vBJFcllw9RnZlcS2cwdLApjgCFozInPVRFjdb-qmMQYIvfxF366SJFMBb6eWYXqaHo3jec2EkRm3MCbyRxerA6CnLGlJCosgEI7bHEHD7R-g9fy4-x0hRgIYY3Fx02rc/s1600/bc1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6op34juFzaC2vBJFcllw9RnZlcS2cwdLApjgCFozInPVRFjdb-qmMQYIvfxF366SJFMBb6eWYXqaHo3jec2EkRm3MCbyRxerA6CnLGlJCosgEI7bHEHD7R-g9fy4-x0hRgIYY3Fx02rc/s1600/bc1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;One of the useful features of &lt;b&gt;bc &lt;/b&gt;is that of a base conversion. The variables &lt;b&gt;ibase&lt;/b&gt; and &lt;b&gt;obase&lt;/b&gt; are set such that &lt;b&gt;ibase&lt;/b&gt; gives the base of the input and &lt;b&gt;obase&lt;/b&gt; gives the radix or base of the output number. As shown in the figure below, the number is given in base 10 and the input is converted into base 2.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5R8LtyxwoI1jqFky86mjHBzKqNNkzxW7InfQ6QzJ3Vt15JTLkRx-Hj7_nBX5r1omoQzdavtfNLbxJ83IUEmlrWNsXmTqO-LCOW2Y_O5e0HGuMer3Pm2muwHHNFfBBm94lrQN2aM9i86c/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5R8LtyxwoI1jqFky86mjHBzKqNNkzxW7InfQ6QzJ3Vt15JTLkRx-Hj7_nBX5r1omoQzdavtfNLbxJ83IUEmlrWNsXmTqO-LCOW2Y_O5e0HGuMer3Pm2muwHHNFfBBm94lrQN2aM9i86c/s640/Screenshot-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In addition, &lt;b&gt;bc &lt;/b&gt;also supports functions like sqrt, cosine, sine, tangent etc., The trigonometric functions sine and cosine ( &lt;b&gt;s()&lt;/b&gt; and &lt;b&gt;c()&lt;/b&gt; respectively)would work only when the &lt;b&gt;bc &lt;/b&gt;command is used with the &lt;b&gt;-l&lt;/b&gt; option. The trigonometric functions expect their arguments in radians not in degrees.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-ActIa9o6DzJ2ljNx7PH3DzLW9VnBRRveOO64sTkpwyzYqhDF7cKPYXUWLEhbQi5v_pbozjWltHfUFEWaIi1E7q71Pc7TEPzzF3RDa0Bsj7y6hoXlWneZcr_DzTXUs62jW1eWSkrnaeo/s1600/bc3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-ActIa9o6DzJ2ljNx7PH3DzLW9VnBRRveOO64sTkpwyzYqhDF7cKPYXUWLEhbQi5v_pbozjWltHfUFEWaIi1E7q71Pc7TEPzzF3RDa0Bsj7y6hoXlWneZcr_DzTXUs62jW1eWSkrnaeo/s1600/bc3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFyq0d3kJxaR4B9EKGeY51qt3CHSX3_-GGH9zjz0CQInR1l2uyBIXSZEmwdBWLmK5VbYLRXZKkm3YTYnBrVX86i7BA0yP1XiZ37q8E-6cxN_JJ8fRW9SP7zgq6oPLhrnyU19sr4Y5ONTY/s1600/Screenshot-3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;428&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFyq0d3kJxaR4B9EKGeY51qt3CHSX3_-GGH9zjz0CQInR1l2uyBIXSZEmwdBWLmK5VbYLRXZKkm3YTYnBrVX86i7BA0yP1XiZ37q8E-6cxN_JJ8fRW9SP7zgq6oPLhrnyU19sr4Y5ONTY/s640/Screenshot-3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;A &lt;b&gt;for&lt;/b&gt; loop can also be run in the calculator mode as shown below.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmgWYE9T8WWqImYK6DftMhoTzfIRUAt6nTZsPsfczCaxuFkLQMqOkZxZFKIdYLQYxnV9LUYwgylzOCt-SjgXxBG9w9LM6VCeTc6fLLzqm3eoAAuLZSYMvG4x4D3RUuNS9sLFkO2hkEqwY/s1600/bc5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmgWYE9T8WWqImYK6DftMhoTzfIRUAt6nTZsPsfczCaxuFkLQMqOkZxZFKIdYLQYxnV9LUYwgylzOCt-SjgXxBG9w9LM6VCeTc6fLLzqm3eoAAuLZSYMvG4x4D3RUuNS9sLFkO2hkEqwY/s1600/bc5.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;2. The &quot;expr&quot; command:&lt;/b&gt;&lt;/u&gt;&lt;/i&gt; &lt;br /&gt;
In addition to &lt;b&gt;bc&lt;/b&gt;, the &lt;b&gt;expr&lt;/b&gt; command is used for evaluating basic mathematical calculations dealing with only integers. The &lt;b&gt;expr&lt;/b&gt; command cannot perform calculations on data other than integers. The operators must be surrounded on both sides by a space. When using * operator, use the backslash ( \ ) for the purpose of escape-sequencing since * operator is a meta-character.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwnle4j0uEuwd2yz18mA8W3Dsd4u0eP-QWeGyLrl3kqrSjEgtGJXxVAuNrQkLgCP16ms7iRS7ccdpcPslRKUUcz4PtBzA_ptwYFkLUJO1qOf-dZ8cJv-r12HaWgZSclgBhr7qDusDT1l8/s1600/bc6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwnle4j0uEuwd2yz18mA8W3Dsd4u0eP-QWeGyLrl3kqrSjEgtGJXxVAuNrQkLgCP16ms7iRS7ccdpcPslRKUUcz4PtBzA_ptwYFkLUJO1qOf-dZ8cJv-r12HaWgZSclgBhr7qDusDT1l8/s1600/bc6.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;3. The &quot;factor&quot; command:&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
The &lt;b&gt;factor&lt;/b&gt; command takes as input an integer and gives the output all the prime factors of the input; each one is printed the proper number of times. To end it, press &lt;b&gt;Ctrl - D.&lt;/b&gt; The command &lt;b&gt;factor &lt;/b&gt;when used with the argument as the input, it returns all the prime factors of that number.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmMy0AWGC5vWsLawkcGRTeXC2R964M9j7nc9RU0l5yAqupDIToq48vIn6DOmY-_6peX1mEMhj6tWVFx8TT7pyqt42ZChZkAWef_g5EuGOHoI1GLtETIBzUrs01hyphenhyphen1pi36cLhKhGR5LzPw/s1600/bc7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmMy0AWGC5vWsLawkcGRTeXC2R964M9j7nc9RU0l5yAqupDIToq48vIn6DOmY-_6peX1mEMhj6tWVFx8TT7pyqt42ZChZkAWef_g5EuGOHoI1GLtETIBzUrs01hyphenhyphen1pi36cLhKhGR5LzPw/s1600/bc7.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;4. The &quot;units&quot; command:&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;b&gt;units &lt;/b&gt;command is another handy utility, which converts quantities expressed in various standard scales to their equivalents in other scales. It works interactively in this fashion:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-Hmu0yLDrloRU0ueij7N0qERvbtUvJpP-u6z0dIucOZ1dfW9x9diogkDoe2DHWryo9eSJtmMWrn1blXo5A0NrNiB00reiDKU9eJnW_bs7b3-o0T6SQixDJVCQdkTF0YbHQVQKRJkbZU/s1600/Screenshot-6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-Hmu0yLDrloRU0ueij7N0qERvbtUvJpP-u6z0dIucOZ1dfW9x9diogkDoe2DHWryo9eSJtmMWrn1blXo5A0NrNiB00reiDKU9eJnW_bs7b3-o0T6SQixDJVCQdkTF0YbHQVQKRJkbZU/s640/Screenshot-6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/3680872489563635134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/linux-terminal-mathematics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3680872489563635134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/3680872489563635134'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/linux-terminal-mathematics.html' title='Linux terminal - Mathematics'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6op34juFzaC2vBJFcllw9RnZlcS2cwdLApjgCFozInPVRFjdb-qmMQYIvfxF366SJFMBb6eWYXqaHo3jec2EkRm3MCbyRxerA6CnLGlJCosgEI7bHEHD7R-g9fy4-x0hRgIYY3Fx02rc/s72-c/bc1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-7716247956724708993</id><published>2011-01-30T11:45:00.004+05:30</published><updated>2011-02-07T22:46:33.277+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Algorithm Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Iteration"/><category scheme="http://www.blogger.com/atom/ns#" term="Recursion"/><category scheme="http://www.blogger.com/atom/ns#" term="Stack"/><category scheme="http://www.blogger.com/atom/ns#" term="Tail recursion"/><title type='text'>Algorithm design --- Iteration, Recursion or Tail recursion</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;The best method for solving a problem has to be chosen under many circumstances. Techniques such as Greedy method, divide and conquer method, dynamic programming etc., are used to solve the problems under different constraints.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In some cases, the method followed to solve a problem might be easy to program but might not deliver good performance due to more space and time complexities; Recursion is one such example. Recursion is a master technique to solve many complicated problems, but the space and time complexity are higher than those in the conventional program without having the recursion. It is trouble using recursion as there is no portable way to tell how deep recursion can go without causing trouble (how much &#39;stack space&#39; the machine has), and there is no way to recover from  too-deep recursion (a &#39;stack overflow&#39;). Recursion requires more number of steps to solve a problem.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Iteration can do things faster for us. However, in some problems, using iteration becomes too cumbersome and tedious to be applied especially when the problem is naturally recursive. Thus, the time taken for designing the algorithm and the efficiency of the algorithm must be taken into consideration while devising a method to solve a problem.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;If iteration is getting complicated, then you always have the  weapon of TAIL RECURSION. With Tail recursion you can get the advantages  of recursion while overcoming the defects in the iteration method. Tail recursion is a process of using the function call as the last executed statement in the function definition. Here, we take the return value as one parameter of function itself. We use stack to maintain all the functions but here it will not append new function in stack but it will overwrite the value of previous function with the current one. Thus, the function call time and stack implementation time will be reduced giving better performance.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Let us solve the problem of finding factorial of a number using these three methods:&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;CASE 1: Using Iteration:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int factorial ( int no){&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; int i, fact=1;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i=no; i&amp;gt;1; i--)&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fact=fact*i;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fact;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/div&gt;&lt;br /&gt;
&lt;b&gt; CASE 2: Using Recursion:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int factorial ( int no) {&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int fact=1;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (no &amp;gt; 1)&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fact=no * factorial (no - 1);&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fact;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/div&gt;This process is implemented in stack as-&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiub9ev1WdiYYwQ7vbp-phmoI6XruJKUUMY7tB5XU-KisIaJoA2NX5iw88tNsUHnQ6zKBJ8YWMTiMTexCnxkI7iOKt3y7PONxdNOTkBK_LYWpuEvqru1Xa3Qu5uVgkNsmWbP8PjVQsPj6s/s1600/Screenshot-3_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;470&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiub9ev1WdiYYwQ7vbp-phmoI6XruJKUUMY7tB5XU-KisIaJoA2NX5iw88tNsUHnQ6zKBJ8YWMTiMTexCnxkI7iOKt3y7PONxdNOTkBK_LYWpuEvqru1Xa3Qu5uVgkNsmWbP8PjVQsPj6s/s640/Screenshot-3_1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6GmhMkG5pxrOcfMVI8iyU5dd-FsNYp6l1-AaQpKn9KJ9Rh0siRpfEqq8WdlFVAHU-PXkmUBhefTDyogoEgeJSAkUnLShN8dfIH_AKLMjb0Ngi_nGsn_p0oQrIPROsGXoh9cLy5wFwv7U/s1600/Screenshot-31.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;CASE 3: Using Tail Recursion:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int factorial ( int n, int fact)&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; if ( n==1 )&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return fact;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; else&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; factorial ( n-1, n*fact);&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/div&gt;&lt;br /&gt;
This will be implemented in stack as-&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPaSGBpqgfLJyiQkStSDQ43PtQcS35kV2691OJIRtNudJTIUHySkKqTUvM1bLUS51ebN_wJvQooBoSHgdd-uYfE-F2YpKYDe90jt5dd9BKJ7BRATsgx85-goluw5g_dc5ymx__S5rQ8q8/s1600/Screenshot-4_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;134&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPaSGBpqgfLJyiQkStSDQ43PtQcS35kV2691OJIRtNudJTIUHySkKqTUvM1bLUS51ebN_wJvQooBoSHgdd-uYfE-F2YpKYDe90jt5dd9BKJ7BRATsgx85-goluw5g_dc5ymx__S5rQ8q8/s640/Screenshot-4_1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Here, the tail recursion takes only 4 steps for getting factorial of number 4. It reduces both space and time and improves the performance.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;References:&lt;/b&gt; &quot;Data Structures Through C&quot; By S.K. Srivastava.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/7716247956724708993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/selecting-best-among-iteration.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7716247956724708993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/7716247956724708993'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/selecting-best-among-iteration.html' title='Algorithm design --- Iteration, Recursion or Tail recursion'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiub9ev1WdiYYwQ7vbp-phmoI6XruJKUUMY7tB5XU-KisIaJoA2NX5iw88tNsUHnQ6zKBJ8YWMTiMTexCnxkI7iOKt3y7PONxdNOTkBK_LYWpuEvqru1Xa3Qu5uVgkNsmWbP8PjVQsPj6s/s72-c/Screenshot-3_1.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6895406345069269025.post-8388899727712166704</id><published>2011-01-14T18:41:00.017+05:30</published><updated>2011-02-06T12:51:46.606+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Compiz"/><category scheme="http://www.blogger.com/atom/ns#" term="Compiz settings Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Desktop cube"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS"/><category scheme="http://www.blogger.com/atom/ns#" term="MacBuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="MacBuntu and compiz"/><category scheme="http://www.blogger.com/atom/ns#" term="Making Ubuntu look like Mac OS"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>MacBuntu and Compiz effects --Make Ubuntu look like Mac OSX</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;After a long gap, I have something interesting for you. The first part is to make Ubuntu look like Mac OS-X and the next part giving you some of the very interesting features of Compiz which I tried.&lt;br /&gt;
&lt;br /&gt;
Unlike the earlier editions of Ubuntu which had a very dry  default theme, the latest versions 10.04 and 10.10 have an interesting  theme by default. Ubuntu must have definitely looked into this aspect  and the booting process. The booting process is so fast that it takes  hardly 20 seconds for the booting to take place. On the other hand, the  Internet speed also has increased reasonably well over the Lucid Lynx  (which had disastrously slow Internet). However, the look and feel of  Mac-OS is top-class with glossy finishes and high resolutions. &lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/lFRP1D4KkH0?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;h2&gt;&lt;i&gt;&lt;u&gt;How to make Ubuntu look like Mac OS X:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;/b&gt;&lt;/i&gt;&lt;/u&gt; &lt;br /&gt;
In order to get the Mac look-and-feel, a package named &quot;Macbuntu&quot; has to be installed. The process for the installation is given below:&lt;/div&gt;&lt;ol&gt;&lt;li&gt; Download the Macbuntu package from the links given below:&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;https://downloads.sourceforge.net/project/macbuntu/macbuntu-10.04/v2.2/Macbuntu-10.04.tar.gz for Lucid Lynx (Ubuntu 10.04).&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;https://downloads.sourceforge.net/project/macbuntu/macbuntu-10.10/v2.3/Macbuntu-10.10.tar.gz  for Maverick Meerkat (Ubuntu 10.10).&lt;/li&gt;
&lt;/ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;After changing the present working directory to the folder which  contains the downloaded file, extract the contents inside this  compressed file to /tmp folder by using the following commands in the  Terminal:&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;tar xzvf Macbuntu-10.10.tar.gz -C /tmp&lt;/li&gt;
&lt;li style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;cd /tmp/Macbuntu-10.10/&lt;/li&gt;
&lt;li&gt;./install.sh&lt;/li&gt;
&lt;/ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;In the steps that follow the installation, give the&amp;nbsp; appropriate values to the questions at each stage.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Now restart your system to get the new look-and-feel of Mac OS.&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBbyLpS8AzeLy9KntFjTJ9wUFk2cWOgm4zebjCwIBo_gwk1tZtu8zvXWW0zEfkdU78p3JXaolhK7UswR8MHKfWpeibCVw4yOreEw6p6XC8t4Jo9Z-eXBfSy_oZKD3l1hxivwzU1DvvHN8/s1600/74316_168035219886689_100000406373590_437672_2738300_n.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBbyLpS8AzeLy9KntFjTJ9wUFk2cWOgm4zebjCwIBo_gwk1tZtu8zvXWW0zEfkdU78p3JXaolhK7UswR8MHKfWpeibCVw4yOreEw6p6XC8t4Jo9Z-eXBfSy_oZKD3l1hxivwzU1DvvHN8/s640/74316_168035219886689_100000406373590_437672_2738300_n.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;h2&gt;&lt;i&gt;&lt;u&gt;Compiz Settings:&lt;/u&gt;&lt;/i&gt;&lt;/h2&gt;&lt;i&gt;&lt;u&gt;&lt;/u&gt;&lt;/i&gt; &lt;br /&gt;
Getting to the later part of the discussion,&amp;nbsp; Compiz effects are something that anyone would like to have for better animations, extras, effects, Window management, Utility, Desktop effects etc.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The things I tried in Compiz are pretty easy ones and Desktop cube, cube reflection and deformation, Scale and Negative are the ones that I predominantly used.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The&lt;b&gt; negative&lt;/b&gt;&amp;nbsp; &lt;b&gt;plug-in&lt;/b&gt; does get the negative version of the environment which we are working on.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWFQzxJ6wKmQSHX2oV0SQkEY-JbsMK_UIcQcXWq22Gj2YPV1vEt-59zpoVHoREl-t4YoNZFRoj2pUceMYYp26cCPSg6cO_v9ovc1SfAXptxzxCj59quAkzqNGNdQ4d4i10uEw1HxBAlNA/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWFQzxJ6wKmQSHX2oV0SQkEY-JbsMK_UIcQcXWq22Gj2YPV1vEt-59zpoVHoREl-t4YoNZFRoj2pUceMYYp26cCPSg6cO_v9ovc1SfAXptxzxCj59quAkzqNGNdQ4d4i10uEw1HxBAlNA/s640/Screenshot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;b&gt;Scale plug-in&lt;/b&gt; gives a list of all the windows maximised at the center of the screen just giving some amazing desktop eye candy as shown in the figure below. It is always handy to have these kinds of plug-ins.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_9sx3EWZcis1aLttsGbqYwy3qZ8DY6CQNzFt_QGIhN3Z4AIWtgfLNd-3Q-FUZt8g9WWZhGx2q7Z2hfF_LfL8L4GmKkdInAcIEoOAoKltmepiPNxhnkHqf1RdjbvO2FhOYFJ-MMYW4sRs/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_9sx3EWZcis1aLttsGbqYwy3qZ8DY6CQNzFt_QGIhN3Z4AIWtgfLNd-3Q-FUZt8g9WWZhGx2q7Z2hfF_LfL8L4GmKkdInAcIEoOAoKltmepiPNxhnkHqf1RdjbvO2FhOYFJ-MMYW4sRs/s640/Screenshot-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;b&gt;Wobble windows&lt;/b&gt; plug-in though is a good piece, seemed to be an unstable one as far as the look in the environment and the wobbling to the eyes are concerned. Among the others, all the plug-ins related to Cube are a treat to the eyes. But one should see that the performance does not get disappointed when you have an extra set of these animations enabled. Cube Atlantis and Cube gears are master-pieces in this section but demand very good hardware all around.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;A balance between the performance and the look-and-feel&amp;nbsp; is the one we should look at because an operating system is not solely about the look-and-feel. Therefore, it is always recommended to think for a while before switching to high graphic oriented plug-ins.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sairavikiran.blogspot.com/feeds/8388899727712166704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/macbuntu-and-compiz-effects.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/8388899727712166704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6895406345069269025/posts/default/8388899727712166704'/><link rel='alternate' type='text/html' href='http://sairavikiran.blogspot.com/2011/01/macbuntu-and-compiz-effects.html' title='MacBuntu and Compiz effects --Make Ubuntu look like Mac OSX'/><author><name>Sai Ravi Kiran Mallampati</name><uri>http://www.blogger.com/profile/14169144813085003819</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBbyLpS8AzeLy9KntFjTJ9wUFk2cWOgm4zebjCwIBo_gwk1tZtu8zvXWW0zEfkdU78p3JXaolhK7UswR8MHKfWpeibCVw4yOreEw6p6XC8t4Jo9Z-eXBfSy_oZKD3l1hxivwzU1DvvHN8/s72-c/74316_168035219886689_100000406373590_437672_2738300_n.jpg" height="72" width="72"/><thr:total>13</thr:total></entry></feed>