<?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-8437626984468003984</id><updated>2024-12-18T19:32:42.095-08:00</updated><category term="C++ programming"/><category term="UNIX"/><category term="Ubuntu"/><category term="Ubuntu 12.10"/><category term="BASH"/><category term="C programming"/><category term="Linux"/><category term="gedit"/><category term="C++"/><category term="command line"/><category term="if-else"/><category term="if-then"/><category term="philosophy"/><category term=".cpp"/><category term=".h"/><category term="Bill Gates"/><category term="C++ OOP"/><category term="C++ classes"/><category term="Computer Scientist"/><category term="Dennis Ritchie"/><category term="FNG"/><category term="Linux Mint 14 mouse problem"/><category term="Mac"/><category term="Newbie"/><category term="OOP"/><category term="RTFM"/><category term="Steve Jobs"/><category term="Ubuntu 13.04 Upgrade to 13.04 Ubuntu"/><category term="build-essential"/><category term="class"/><category term="classes"/><category term="do-release-upgrade"/><category term="g++"/><category term="gcc"/><category term="gedit plugins"/><category term="gnome-terminal"/><category term="header files"/><category term="instance of a class"/><category term="logic loops"/><category term="object oriented programming"/><category term="objects"/><category term="run startup scripts at bootup Linux"/><category term="terminal"/><category term="terminator"/><category term="while-loop"/><title type='text'>Penguin-man the Computer Guy</title><subtitle type='html'>A blog about Linux, Programming, and the Mathematics and Philosophy of Computing</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-6112933739693387106</id><published>2014-11-14T23:55:00.001-08:00</published><updated>2014-11-14T23:55:16.274-08:00</updated><title type='text'>Mail script to automate SSMTP</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;
I wanted to use SSMTP to send mail from the terminal. After a little effort, I got it working. I wanted to set up SSMTP as a way of automating alerts from my system and sending them to my emails. In order to do that, I needed a terminal based email that I could call from a script. I&#39;m using a Asus K55 laptop running Ubuntu 14.04 at the moment.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
One of the disadvantages of SSMTP is there is no built in signature section or headings. I figured I&#39;d hack that problem with a little bash scripting. That actually worked quite well and I decided to make an alias to run my script as if it were a built in program. So in this lesson, I will show you three things: how to install and configure SSMTP, how to configure and run it, and how to make the same script and alias that can automate email for you.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To get started we run the following to install SSMTP:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;code&gt;&lt;tab&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get install ssmtp&amp;nbsp;
&lt;/tab&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;After installing SSMTP, we must configure it. run:&lt;br /&gt;
&amp;nbsp;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;       sudo gedit /etc/ssmtp/ssmtp.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Once we have &lt;code&gt;/etc/ssmtp/ssmtp.conf &lt;/code&gt; open in a text editor (I&#39;m assuming you use gedit, you could also use emacs, nano, or vim, etc) place the following inside the document editing in order to use the settings for your account. I&#39;m assuming you are using a gmail account.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;root=myemailaddress@gmail.com&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mailhub=smtp.gmail.com:587&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AuthUser=mygmailusername&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AuthPass=mypassword&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UseSTARTTLS=YES&lt;br /&gt;
&lt;/code&gt;
If you want more basic information on SSMTP,&amp;nbsp;&lt;a href=&quot;http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/&quot;&gt;this&lt;/a&gt;&amp;nbsp;link to another tutorial I used might help. After we are done configuring the email, we can test it. Place the message you want to send in a file, and name it &lt;code&gt;message.txt&lt;/code&gt;. Now, make your signature file, and name it &lt;code&gt;signature.txt&lt;/code&gt;. To email a file with signature in another file, run:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cat message.txt signature.txt | ssmtp recipient-email-address@gmail.com&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that we have tested our email, lets automate it a bit using a BASH script.&lt;br /&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
Script to automate our email&lt;/h2&gt;
Before we get to the scripting, lets look at some formatting details of SSMTP assuming that you are using gmail. I&#39;d be curious how much they vary for other email services. So, to get a &quot;Subject&quot; and &quot;To&quot; in out emails, they must be formatted correctly. The format is as follows at the very top of the email.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;To: recipient@gmail.com&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Subject: Some message&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Keeping that in mind, lets look at the script I wrote. To download the whole script, go&amp;nbsp;&lt;a href=&quot;https://sites.google.com/site/calsfiles01/calvin-johnson/ssmtp-mail-script&quot;&gt;here&lt;/a&gt;. Let&#39;s discuss how to use it. Download it from the link above, place it in home to begin with, and run the following to elevate the scripts permissions and make the script executable.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;code&gt; sudo chmod 777 send-mail.sh&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
After you have done that, create a signature file, &amp;nbsp;name it&amp;nbsp;&lt;code&gt;signature.txt.&amp;nbsp;&lt;/code&gt;Now place the message you want to send in a file, and name it&amp;nbsp;&lt;code&gt;message.txt&lt;/code&gt;. Now run the following:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
./send-mail.sh &quot;subject&quot; &quot;recipient name&quot; body-text.txt recipient-name@gmail.com &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; &lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
You will be prompted twice to accept the settings. Typing Y/y will accept them, and N/n will reject them and not send the email. After the email is sent, the message will be saved as message(date).txt in the current folder.&lt;br /&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
Make an Alias and Place in &lt;code&gt;/etc/&lt;/code&gt;&lt;/h2&gt;
&lt;div&gt;
Now that we have a script to automate email, let&#39;s run it like a real program. To do this, we will place the script and files associated with it into /etc/, and will make an alias to run the program in out ~/.bashrc file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To start, lets make a folder for the script:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sudo mkdir /etc/send-mail/&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Now move your sent-mail.sh file into this folder along with any signatures, etc. you want. Again run the following to elevate the scripts permissions and make the script executable.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;code&gt;
&lt;div style=&quot;font-size: medium; font-weight: normal;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;code&gt;sudo chmod 777 send-mail.sh&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/code&gt;
&lt;/h2&gt;
&lt;div&gt;
Now lets make an alias in our &lt;code&gt;~/.bashrc&lt;/code&gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;code&gt;sudo gedit .bashrc&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Once in ~/.bashrc, add this line to the end of the file:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;alias send-mail=&quot;/etc/send-mail/send-mail.sh&quot;&lt;br /&gt;
&lt;/code&gt;
now, simply type send-mail at your prompt and enjoy automated mail.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/6112933739693387106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2014/11/mail-script-to-automate-ssmtp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/6112933739693387106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/6112933739693387106'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2014/11/mail-script-to-automate-ssmtp.html' title='Mail script to automate SSMTP'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-3262273346379755602</id><published>2013-06-12T02:30:00.000-07:00</published><updated>2013-06-12T02:30:42.714-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASH"/><category scheme="http://www.blogger.com/atom/ns#" term="gedit"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Mint 14 mouse problem"/><category scheme="http://www.blogger.com/atom/ns#" term="run startup scripts at bootup Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX"/><title type='text'>Hack to get Mouse to Work Acer Aspire One 722 and Linux Mint</title><content type='html'>After dual booting my Acer Aspire One 722 netbook with Ubuntu 13.04 and Linux Mint 14, I found that my mouse did not completely work on boot up in Mint. This was problematic for me. I wanted to learn Linux Mint and after a little work on google, I found this work around work around... two terminal commands that completely fixed the problem:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
      sudo modprobe -r psmouse 

      sudo modprobe psmouse proto=imps&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
This was a fine work around, except that I hated having to try to launch the terminal and run these commands with a half crippled mouse. Even cntr-shift-T did not launch the&amp;nbsp;terminal&amp;nbsp;making me believe that the keyboard might not have been fully functional either.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifjuiiuhpbpSkNMh_Tl4hVCMwgaSyTlrObwwvCwxzSK1dOsoPOSsgDYom2xmI54WYPj_LwpfemUYdUaS2zSdZaTXTW0TyQZdCe7nf9zasks7Qu9Rc3Q6osy0eGGVSuj2noCrwQPmyJnmJo/s1600/Acer-Aspire-One-722-Netbook-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifjuiiuhpbpSkNMh_Tl4hVCMwgaSyTlrObwwvCwxzSK1dOsoPOSsgDYom2xmI54WYPj_LwpfemUYdUaS2zSdZaTXTW0TyQZdCe7nf9zasks7Qu9Rc3Q6osy0eGGVSuj2noCrwQPmyJnmJo/s200/Acer-Aspire-One-722-Netbook-1.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;font-size: 13px;&quot;&gt;Acer Aspire One 722 netbook&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Because of this problem, I wanted to find a workaround to this problem. I knew that if I could put these commands in a file that was run during boot, that this problem would be fixed. After several hours of Googling, I figured out that I could place these commands in the&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;/etc/rc.local&amp;nbsp;&lt;/code&gt;file. I found out that the commands placed in this file are run as root at the end of the boot sequence. In order to open up this file run the following command:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
        sudo gedit /etc/rc.local
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Once this command is run (As can be seen in the below screenshot) then we can edit the file located in&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;/etc/rc.local.&lt;/code&gt;&lt;br /&gt;
&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/code&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp8coBfqEDNVnEzgVexSbVIsvardLQkTryN5-Z86cGmAczZSzCKeyQM5W4HNIFpHwclZDKcWlshyI2_zMt5MTZE1bwpHtJvJZ4GL8CEk-FYEu5J56RkMncBtfWLP3__XNYLMgmgh0hmpsp/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp8coBfqEDNVnEzgVexSbVIsvardLQkTryN5-Z86cGmAczZSzCKeyQM5W4HNIFpHwclZDKcWlshyI2_zMt5MTZE1bwpHtJvJZ4GL8CEk-FYEu5J56RkMncBtfWLP3__XNYLMgmgh0hmpsp/s640/Screenshot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Screenshot of the Terminal opening the /etc/rc.local configuration file as root&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh57fsFczf66-nHNir4XmqcrcRuwpsqcpZ51WiKy7_ZnPriMoWiRVcwP9cW1rqGiPiCPrbuYKrE7rDvrqELYM0bycT5Q11hZfEdsSGhDC2vaWTGKBSRt4x6Xu8Z_ZZAfkckxLAQIFEBEM9o/s1600/Screenshot1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh57fsFczf66-nHNir4XmqcrcRuwpsqcpZ51WiKy7_ZnPriMoWiRVcwP9cW1rqGiPiCPrbuYKrE7rDvrqELYM0bycT5Q11hZfEdsSGhDC2vaWTGKBSRt4x6Xu8Z_ZZAfkckxLAQIFEBEM9o/s640/Screenshot1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The /etc/rc.local file after modification&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/3262273346379755602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/06/hack-to-get-mouse-to-work-acer-aspire.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/3262273346379755602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/3262273346379755602'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/06/hack-to-get-mouse-to-work-acer-aspire.html' title='Hack to get Mouse to Work Acer Aspire One 722 and Linux Mint'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifjuiiuhpbpSkNMh_Tl4hVCMwgaSyTlrObwwvCwxzSK1dOsoPOSsgDYom2xmI54WYPj_LwpfemUYdUaS2zSdZaTXTW0TyQZdCe7nf9zasks7Qu9Rc3Q6osy0eGGVSuj2noCrwQPmyJnmJo/s72-c/Acer-Aspire-One-722-Netbook-1.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-79503280412838310</id><published>2013-06-05T22:09:00.000-07:00</published><updated>2013-06-05T22:22:52.216-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command line"/><category scheme="http://www.blogger.com/atom/ns#" term="do-release-upgrade"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 12.10"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 13.04 Upgrade to 13.04 Ubuntu"/><title type='text'>My First Impressions of Ubuntu 13.04 on an Acer Aspire 722</title><content type='html'>I have been an Ubuntu fan for several years now... my first Ubuntu system was a dual booted Ubuntu 10.04/Windows 7 system. After starting to use Ubuntu, I will never forget the increase in speed that I experienced compared to using a Windows system. Ubuntu was sooooo fast!!!&lt;br /&gt;
&lt;br /&gt;
Well several releases later, Ubuntu has been getting heavier... it has been getting almost too slow to run effectively on my Acer Aspire One 722 netbook. I like having a lightweight netbook to carry around. They are portable, and flexible.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifjuiiuhpbpSkNMh_Tl4hVCMwgaSyTlrObwwvCwxzSK1dOsoPOSsgDYom2xmI54WYPj_LwpfemUYdUaS2zSdZaTXTW0TyQZdCe7nf9zasks7Qu9Rc3Q6osy0eGGVSuj2noCrwQPmyJnmJo/s1600/Acer-Aspire-One-722-Netbook-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifjuiiuhpbpSkNMh_Tl4hVCMwgaSyTlrObwwvCwxzSK1dOsoPOSsgDYom2xmI54WYPj_LwpfemUYdUaS2zSdZaTXTW0TyQZdCe7nf9zasks7Qu9Rc3Q6osy0eGGVSuj2noCrwQPmyJnmJo/s200/Acer-Aspire-One-722-Netbook-1.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Acer Aspire One 722 netbook&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Because of the trend that each release is heavier than the last, I was rather hesitant to upgrade. Tonight I decided to upgrade my machine. I was very impressed with how much faster 13.04 is then 12.10. I also noticed that the icon for the nautilus file manager icon was changed to this icon:&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/AVvXsEjcF_TEW32CHGdqQct6UoptW0gXciTacn-tfjrvoPgg-uj9SKoD_95AwM4Zm7Ytlm_7n61sbTWHbz1NE8cVgQ_khwGNlw9CTOVLQWTDUhUwqDaqcrl5yHbLjj_HeRfMxSMb4Gx3OM9d6G0F/s1600/nautilus_file_manager_icon.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcF_TEW32CHGdqQct6UoptW0gXciTacn-tfjrvoPgg-uj9SKoD_95AwM4Zm7Ytlm_7n61sbTWHbz1NE8cVgQ_khwGNlw9CTOVLQWTDUhUwqDaqcrl5yHbLjj_HeRfMxSMb4Gx3OM9d6G0F/s200/nautilus_file_manager_icon.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
From the older Nautilus icon:&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/AVvXsEjoxWvebMG3aBPHYuikWKXOepe2bFR8qiuLuq4TAqoJfD2xuUh2PGzrvbi-FLV6KytzxdrtXnWtUlCCPRAqNUb7ueW2Bvofjqeqtj7pfTr0Rwfzra_B6RhoCGZCRCJl53ND3OkCVc-RR2cs/s1600/nautilus.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoxWvebMG3aBPHYuikWKXOepe2bFR8qiuLuq4TAqoJfD2xuUh2PGzrvbi-FLV6KytzxdrtXnWtUlCCPRAqNUb7ueW2Bvofjqeqtj7pfTr0Rwfzra_B6RhoCGZCRCJl53ND3OkCVc-RR2cs/s200/nautilus.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The icon I am indifferent to, but the speed that nautilus launches is so much faster now. This is a welcomed improvement. The HUD also has a new icon.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
Updating to 13.04 from Ubuntu 12.04 or 12.10&lt;/h1&gt;
&lt;br /&gt;
&amp;nbsp;In Ubuntu, to do this I ran this in the terminal:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
sudo apt-get update &amp;amp;&amp;amp; sudo do-release-upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;
After running this, expect to settle in for a while. Pop a movie in or something, the system does not need to be babysat but it does not take a lot of effort or experience. Put a movie in and put the computer on your lap. You will be prompted on occasion. When done restart your computer and enjoy Ubuntu 13.04. I think my system took about 90 min before being ready to restart.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkgj9MdIao9hSOJ1SZy7j8axI8wGIzvvv9tVLo31vh6QSMGamYlkCLBBIK4lK3nukwf44ihAygp7IQ7uP4NR5-FS35jt9gDJaPMff_lgWWsfAsAe3wrhN1cb1AB43eln2OV7ED3Hp3K08W/s1600/Ubuntu13_04.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkgj9MdIao9hSOJ1SZy7j8axI8wGIzvvv9tVLo31vh6QSMGamYlkCLBBIK4lK3nukwf44ihAygp7IQ7uP4NR5-FS35jt9gDJaPMff_lgWWsfAsAe3wrhN1cb1AB43eln2OV7ED3Hp3K08W/s640/Ubuntu13_04.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My Acer Aspire One 722 desktop just after update to Ubuntu 13.04&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/79503280412838310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/06/my-first-impressions-of-ubuntu-1304-on.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/79503280412838310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/79503280412838310'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/06/my-first-impressions-of-ubuntu-1304-on.html' title='My First Impressions of Ubuntu 13.04 on an Acer Aspire 722'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifjuiiuhpbpSkNMh_Tl4hVCMwgaSyTlrObwwvCwxzSK1dOsoPOSsgDYom2xmI54WYPj_LwpfemUYdUaS2zSdZaTXTW0TyQZdCe7nf9zasks7Qu9Rc3Q6osy0eGGVSuj2noCrwQPmyJnmJo/s72-c/Acer-Aspire-One-722-Netbook-1.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-5182281996667295801</id><published>2013-05-31T22:11:00.001-07:00</published><updated>2013-06-01T13:39:55.253-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASH"/><category scheme="http://www.blogger.com/atom/ns#" term="command line"/><category scheme="http://www.blogger.com/atom/ns#" term="FNG"/><category scheme="http://www.blogger.com/atom/ns#" term="gnome-terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="Newbie"/><category scheme="http://www.blogger.com/atom/ns#" term="RTFM"/><category scheme="http://www.blogger.com/atom/ns#" term="terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="terminator"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 12.10"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX"/><title type='text'>Getting to Know the Linux Terminal and BASH</title><content type='html'>In my&amp;nbsp;&lt;a href=&quot;http://penguin-man.blogspot.com/2013/05/linux-commands.html&quot;&gt;first post on Linux Commands&lt;/a&gt;, I gave a bunch of examples on various commands but I didn&#39;t really give much background about the Terminal, the terminal environment, and the scripting language. Today when we say we are using &lt;i&gt;Linux Commands&lt;/i&gt;&amp;nbsp;most people in the field will understand that we are referring to a specific kind of scripting language that works on UNIX-like environments; specifically, this usually means BASH commands and scripts. But what is BASH, a terminal, or a terminal emulator?&lt;br /&gt;
&lt;br /&gt;
In short we should get a few basics straight. Geeks are sloppy so when we say terminal we usually mean terminal emulator. When we use the terminal, the commands we type are in BASH. BASH is a far which is a far more powerful language than DOS for Windows. Because BASH is a language, we can use it to make small programs and run them from a file.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixp3DWeceGGrRyASdqFVcGj0ByEVSKqix1ZsBTzPvcw4cjhmbSybwtrq17p-DrchkapcapttM1aWFpwSyummMfbFZpp4h3_2qz7P5bEOmaWd-mr4F15ys9QPaH6mcmrHflIA-SQmcI0A7s/s1600/terminal_plain.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;205&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixp3DWeceGGrRyASdqFVcGj0ByEVSKqix1ZsBTzPvcw4cjhmbSybwtrq17p-DrchkapcapttM1aWFpwSyummMfbFZpp4h3_2qz7P5bEOmaWd-mr4F15ys9QPaH6mcmrHflIA-SQmcI0A7s/s320/terminal_plain.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Meet the friendly Gnome-terminal :)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
The Terminal&amp;nbsp;&lt;/h2&gt;
A terminal emulator is a program that you can use to interact with the operating system. The terminal uses text based commands and can read files to allow it to control the operating system. When using a terminal, remember that it goes by several different names including these names:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Terminal&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Command Line&lt;br /&gt;
Command Prompt&lt;/div&gt;
&lt;br /&gt;
In Ubuntu if you are running the Unity desktop (Default GUI for Ubuntu 11.10 and beyond I believe) the way to access the terminal for the first time is from the Heads Up Display (HUD). To access the HUD, press the Win key or clicking on the HUD icon with the mouse:&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG-MUL6P4yZ0lKsD-IYhRJgLu7VrvrYjV3QAlxS5IM93FxU8kXkQZh0DyXpaLV1HpiaHojMy9DdVc7N27BcGLiFTmiYAwZlYy2iPvJy1oGX_1vBr5yvyKFAN7rnPbRTwEBkjo2oajqAnDA/s1600/Hud_Button.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG-MUL6P4yZ0lKsD-IYhRJgLu7VrvrYjV3QAlxS5IM93FxU8kXkQZh0DyXpaLV1HpiaHojMy9DdVc7N27BcGLiFTmiYAwZlYy2iPvJy1oGX_1vBr5yvyKFAN7rnPbRTwEBkjo2oajqAnDA/s200/Hud_Button.png&quot; title=&quot;HUD button&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;HUD icon button at top right had side of Unity Desktop&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Once the HUD launcher opens type the name of the application in the command line; here we type &quot;terminal&quot;. Notice that it is unnecessary to type the entire name.&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/AVvXsEjV98BQ2WhoaqQOGYVr3aGi61mucTnf4X-j_-EIfTxlXvDI72g0YymEf5DEzhtyl43SuFLP9kKWPVmrEAU1jJoFtrZ7nE-inQF4sOFI5DikJfV9mzsnWeV8sy4T-eOxEPZPJTfLHiqOEhF_/s1600/HUD_Terminal.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;223&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV98BQ2WhoaqQOGYVr3aGi61mucTnf4X-j_-EIfTxlXvDI72g0YymEf5DEzhtyl43SuFLP9kKWPVmrEAU1jJoFtrZ7nE-inQF4sOFI5DikJfV9mzsnWeV8sy4T-eOxEPZPJTfLHiqOEhF_/s400/HUD_Terminal.png&quot; title=&quot;HUD&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Click on the terminal application. This will give you the default&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/GNOME_Terminal&quot;&gt;GNOME Terminal&lt;/a&gt;. Once you are using the default terminal, if you right click on the terminal icon you can lock it to the launcher... do this, if you are serious about Linux you will use the terminal all the time. Note, as seen in the picture below, if you right click on the top bar of the terminal you have more options.&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/AVvXsEgxKEA6W0_13KLJOiI3F21-43ENYJnyMNxiOliC2sGOHFDzWgI8FpijtJad59nCsFth5e6L42yHOkB8mYvTyfGvoHuv_3NnEOu6aN9uua2f0XqLCBtP1MaRdfuoy3dah1xmcVld1VgjN70A/s1600/Terminal_dialogBox.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxKEA6W0_13KLJOiI3F21-43ENYJnyMNxiOliC2sGOHFDzWgI8FpijtJad59nCsFth5e6L42yHOkB8mYvTyfGvoHuv_3NnEOu6aN9uua2f0XqLCBtP1MaRdfuoy3dah1xmcVld1VgjN70A/s400/Terminal_dialogBox.jpg&quot; title=&quot;Terminal options dialog box&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Is the gnome terminal the only terminal available in Ubuntu? No, there is&amp;nbsp;&lt;a href=&quot;http://invisible-island.net/xterm/&quot;&gt;xterm&lt;/a&gt;&amp;nbsp;and there is&amp;nbsp;&lt;a href=&quot;http://www.tenshu.net/p/terminator.html&quot;&gt;terminator&lt;/a&gt;; xterm is used in some light weight set ups. My preference is either the gnome terminal or terminator.&amp;nbsp;I actually like terminator a lot and terminator has many more features than gnome terminal. One of these features is seen below:&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDAb_4hwuv6X0eFSz5-mt9RKMoqM1RZ3hgycs8B4BwTLgNnL_UBbIuF-EATk1_ork8dzJCv0isiZt65GiBVUE2bBKIUSm9ZgokhB3pKJoGaZ3k6BaEnHHk-sSSG8B34OMk-6rsfub3k_77/s1600/Terminator.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDAb_4hwuv6X0eFSz5-mt9RKMoqM1RZ3hgycs8B4BwTLgNnL_UBbIuF-EATk1_ork8dzJCv0isiZt65GiBVUE2bBKIUSm9ZgokhB3pKJoGaZ3k6BaEnHHk-sSSG8B34OMk-6rsfub3k_77/s400/Terminator.png&quot; title=&quot;Terminator&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Terminator can be split to show several terminals at once.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Terminal&#39;s window can be split into many segments that are each there own terminal. I do enough stuff on the terminal that this is useful at times. Of course the Gnome terminal allows tabs, but terminals split feature is far more useful. To install the Terminator terminal emulator run the following in a terminal:&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;border: 0px; color: #393939; font-family: monospace, sans-serif; font-size: 12px; line-height: 1.4em; margin-bottom: 14px; padding: 0px 0px 0px 90px; vertical-align: baseline;&quot;&gt;sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator&lt;/pre&gt;
For more information about terminator I like&amp;nbsp;&lt;a href=&quot;http://lifehacker.com/5858676/the-best-terminal-emulator-for-linux&quot;&gt;this article&lt;/a&gt;&amp;nbsp;and the&amp;nbsp;&lt;a href=&quot;http://www.tenshu.net/p/terminator.html&quot;&gt;terminator&lt;/a&gt;&amp;nbsp;home page. I have not used a Mac machine yet, but they too are UNIX based so you can install terminator on a Mac too.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;border: 0px; color: #393939; font-family: monospace, sans-serif; font-size: 12px; line-height: 1.4em; margin-bottom: 14px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;        fink install terminator&lt;/pre&gt;
&lt;h2&gt;
Terminals vs. Terminal Emulators&lt;/h2&gt;
&lt;div&gt;
A terminal emulator is a&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Graphical_user_interface&quot;&gt;GUI&lt;/a&gt;&amp;nbsp;based application; a terminal is the screen of an OS when the the GUI is not running. As we said above, geeks are often sloppy in how they talk and say run &amp;lt;x&amp;gt; in the terminal instead of being correct and saying &amp;nbsp;run &amp;lt;x&amp;gt; in the terminal emulator; so when we say terminal we usually mean terminal emulator and assume you understand. Because many servers don&#39;t have any GUI at all, we often use the &quot;real&quot; terminal in them, and using a terminal is much like a terminal emulator. If you are running Ubuntu, to leave the GUI and see a terminal use the keyboard shortcut&lt;span style=&quot;color: #393939; font-family: monospace, sans-serif; font-size: 12px; line-height: 1.4em;&quot;&gt;&amp;nbsp;cntr-alt-F1, F2, F3, F4, F5, or F6&amp;nbsp;&lt;/span&gt;and to return to the GUI run&amp;nbsp;&lt;span style=&quot;color: #393939; font-family: monospace, sans-serif; font-size: 12px; line-height: 1.4em;&quot;&gt;cntr-alt-F7.&amp;nbsp;&lt;/span&gt;Fun, huh? It is actually a great way to rescue a crashed GUI.&lt;/div&gt;
&lt;h2&gt;
BASH&lt;/h2&gt;
&lt;div&gt;
Once you feel comfortable around the actual terminal itself, it is time to meet BASH.&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Bash_(Unix_shell)&quot;&gt;Bash&lt;/a&gt;&amp;nbsp;is a Unix shell that was developed by the GNU project. The BASH shell replaces the Bourne Shell which in turn replaced the Thompson shell. The Bourne shell was developed in 1977 and BASH was released in June 1989. The Thompson shell that Bourne replaced was written by&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ken_Thompson&quot;&gt;Ken Thompson&lt;/a&gt;&amp;nbsp;in 1971. If your starting to realize that the BASH tradition goes back a ways, your right... it does!!! There is a ton of&amp;nbsp;&lt;a href=&quot;http://www.gnu.org/software/bash/manual/bashref.html&quot;&gt;documentation online&lt;/a&gt;&amp;nbsp;and I will not try to repeat that.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
BASH syntax is pretty easy... the general syntax is:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;        command [arguments] &amp;lt;file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
BASH has a few simple commands everyone should know... here are my basics&lt;/div&gt;
&lt;div&gt;
To list files, run ls:&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;        ls
        ls -l
        ls -a
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
To change directories, run cd:&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;     cd /media/flashdrive/anime
&lt;/code&gt;&lt;/pre&gt;
To change directories to home, run cd ~&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; cd ~&lt;/code&gt;&lt;br /&gt;
To change directories to root, run cd /
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cd /&lt;br /&gt;

                 &lt;/code&gt;&lt;br /&gt;
To change directories back one directory (towards root) run ..
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/code&gt;$..&lt;br /&gt;
To update your Ubuntu or Debian based system run:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
     sudo apt-get update&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get upgrade&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;Or run this which does both...&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&amp;nbsp;&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/5182281996667295801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/05/getting-to-know-linux-terminal-and-bash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/5182281996667295801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/5182281996667295801'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/05/getting-to-know-linux-terminal-and-bash.html' title='Getting to Know the Linux Terminal and BASH'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixp3DWeceGGrRyASdqFVcGj0ByEVSKqix1ZsBTzPvcw4cjhmbSybwtrq17p-DrchkapcapttM1aWFpwSyummMfbFZpp4h3_2qz7P5bEOmaWd-mr4F15ys9QPaH6mcmrHflIA-SQmcI0A7s/s72-c/terminal_plain.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-533096935813321165</id><published>2013-05-23T02:20:00.001-07:00</published><updated>2013-05-23T21:26:24.713-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".cpp"/><category scheme="http://www.blogger.com/atom/ns#" term=".h"/><category scheme="http://www.blogger.com/atom/ns#" term="build-essential"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ classes"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ OOP"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ programming"/><category scheme="http://www.blogger.com/atom/ns#" term="class"/><category scheme="http://www.blogger.com/atom/ns#" term="classes"/><category scheme="http://www.blogger.com/atom/ns#" term="g++"/><category scheme="http://www.blogger.com/atom/ns#" term="gcc"/><category scheme="http://www.blogger.com/atom/ns#" term="gedit"/><category scheme="http://www.blogger.com/atom/ns#" term="gedit plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="header files"/><category scheme="http://www.blogger.com/atom/ns#" term="instance of a class"/><category scheme="http://www.blogger.com/atom/ns#" term="object oriented programming"/><category scheme="http://www.blogger.com/atom/ns#" term="objects"/><category scheme="http://www.blogger.com/atom/ns#" term="OOP"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 12.10"/><title type='text'>Examining Objects and Virtually Modeling Them With Object Oriented Programming</title><content type='html'>Some of the most obvious ideas in the
universe are also the most abstract, and it seems like the definition
of a certain type of object is just such an abstract concept. Lets
imagine for a moment that you see a bowl or a plate. You immediately
recognize the object and place it in a category, the plate category
say. If asked why you believed that the object in question was a
plate, you may have some difficulty in explaining why you felt it was
a plate.&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
Some time ago, after coming into
contact with the idea of object oriented programming I began to 
wonder about what a real object was. This led me on the journey that
I here attempt to take you on. The philosophical idea in question is
&#39;what is an object?&#39; This is actually a problematic question; I asked my friend and philosopher, Mr. Rodney Chlebek, this question, and in response he wrote quite an interesting &lt;a href=&quot;http://rodchlebek.blogspot.com/2013/05/being-qua-being-there-are-no-bowls.html&quot;&gt;post&lt;/a&gt;&amp;nbsp;in which he argues that their are no objects bigger than particles. In an esoteric way I certainly might agree, although I&amp;nbsp;definitely&amp;nbsp;am not enough of a philosopher to have a very educated response there. That said, I do believe that objects do exist in a sense that Chlebek is not examining. I am not per se disagreeing, actually I am extending his&amp;nbsp;argument. I believe that objects, like bowls and plates, exist in a special virtual world of cognition where an object is nothing more than an &lt;i&gt;instance&lt;/i&gt; of a &lt;i&gt;class&lt;/i&gt;. In this virtual world, objects exist in the brains of humans as well as in the computers we create. Let&#39;s examine this claim more deeply...&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VJrYrNfLxLGPQ-tdceN5TW_GU9iXuHBMszLuRHdeCbAdvvTTnw5thGF-BEbu99uFzk1UlTz4WG4unkvwLpv2LQTb8PQWo8GhzxfIZpzfWBlDnPZRYp8ccf1dY9lmkGZysaJ_vIb6fTON/s1600/plate1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VJrYrNfLxLGPQ-tdceN5TW_GU9iXuHBMszLuRHdeCbAdvvTTnw5thGF-BEbu99uFzk1UlTz4WG4unkvwLpv2LQTb8PQWo8GhzxfIZpzfWBlDnPZRYp8ccf1dY9lmkGZysaJ_vIb6fTON/s400/plate1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Does this plate really exist? How do I know it is a plate?&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
To be clear, I might as well define our terms: In this article, we will call these categories that we recognize objects by as&lt;i&gt; classes&lt;/i&gt;, and an individual example example of a certain class we call an &lt;i&gt;instance &lt;/i&gt;of that class. These terms are obviously borrowed from computer science, and we use them in order to be able to better understand the similarity between the &quot;real objects&quot; that we encounter every day, and the &quot;virtual objects&quot; we encounter in software. Of course, if you follow Chlebek&#39;s thinking, and my&amp;nbsp;extension&amp;nbsp;of his thought described above, this distinction is totally artificial. The plate or bowl we earlier spoke about, you&amp;nbsp;recognized&amp;nbsp;not as simply a discrete object, but as a member of a larger category. Of course, you may have placed the plate into more than one category.&lt;br /&gt;
Lets use the &quot;real&quot; plate object again and describe it with the new vocabulary we just introduced: The specific
object you hold and call a &#39;&lt;i&gt;plate&lt;/i&gt;&#39; is an object that is an
instance of the plate class, yet it also belongs in the table-setting
class, the kitchen class, and the pottery, glass or metal class
depending on its construction. What is fascinating is that it
seemingly takes little intelligence or insight to arrive at these
conclusions, despite the fact that in these cognitive processed are
ideas of &lt;i&gt;class inheritance, &lt;/i&gt;and other equally interesting and
abstract ideas.&lt;br /&gt;
&lt;br /&gt;
Object oriented programming is a great&amp;nbsp;allegory&amp;nbsp;for thinking about things, or like I said above, if it is taken like Chlebek and I have stated, maybe the allegory&amp;nbsp;&lt;i&gt;IS&lt;/i&gt;&amp;nbsp;reality. I know that speaking of psychology and philosophy at this junction may be quite&amp;nbsp;bizarre, but object oriented programming and the cognitive&amp;nbsp;phenomena&amp;nbsp;of objects are really on this fine line between philosophy,&amp;nbsp;psychology, and computer science.&amp;nbsp;&amp;nbsp;In keeping with the ideas in object
oriented programming, I believe that a class of objects is a
collection of distinct entities that share a certain defined set of
&lt;i&gt;attributes &lt;/i&gt;and &lt;i&gt;actions
&lt;/i&gt;or &lt;i&gt;purposes&lt;/i&gt;.
What are attributes and actions as I am using the words?&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; margin-left: 0.49in;&quot;&gt;
&lt;br /&gt;
To
me an &lt;i&gt;attribute&lt;/i&gt; is
some characteristic part of an object. I may be a curve, a bump, some
physical property, or dimension or ratio of dimensions.   
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; margin-left: 0.49in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; margin-left: 0.49in;&quot;&gt;
In contrast to an
attribute, an &lt;i&gt;action&lt;/i&gt; is some distinct purpose that the object
has or some motion it makes or work it performs. A plate holds food,
and that is the action for which we most often purchase a plate. A
car makes motions that enable us to move between isolated points.
This too is an important action.  
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
This definition is broad enough to work for both &quot;real&quot; objects and the &quot;virtual&quot; objects that we build in object oriented programming. Real objects have both attributes and actions, as do virtual objects. Since we are speaking of object oriented programming, lets see how this works in pseudo code, and then move on to real code. In object oriented programming, we
identify instances of an object of a class as having &lt;i&gt;data members&lt;/i&gt; and
&lt;i&gt;functions&lt;/i&gt; or &lt;i&gt;methods&lt;/i&gt;. In general, the data members are
variables of some data type, and these are analogous to the
attributes we discuss above. The functions of our class take these
data members and attributes and perform actions with them. This means&lt;/div&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;   class Some_Object
   {
        Attributes;    // Think &quot;Data members&quot; (variables)
        Actions;       // Think &quot;Member Functions&quot;(Methods)
   }&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
Notice that a class includes fixed data and actions that the data does. These actions are an important part of an object. For example, a plate has data members that define its shape, its size, and its material; it also has functions, like the ability to hold food, to be carried without breaking in half, and to hold some liquid. A bowl might then be thought of as a subclass of plate, but with the additional function of holding soup. But what is a subclass? A subclass is a class of objects that contain all the attributes and actions of the &lt;i&gt;parent&lt;/i&gt;&amp;nbsp;class, and and then add to that some specific attributes and actions of their own. Thus the idea of class&amp;nbsp;&lt;i&gt;inheritance&lt;/i&gt;&amp;nbsp;comes into our vocabulary. Lets examine classes and inheritance by building a plate and a bowl class:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;   class Plate
   {
        //Attributes (&quot;Data members&quot;)
          plate_shape;
          size_xAxis;
          size_yAxis;
          size_zAxis;
          plate_material;

        //Actions (&quot;Functions&quot;)
          carry_food();
          stength();
   }
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
The above class is a definition for a plate class, and in C++, we would save this file as a *.h file. Lets call it &amp;nbsp;&quot;class_Plate.h&quot;. Of course, a source file would include this .h file and would take these data members and functions defined in &amp;nbsp;&quot;class_Plate.h&quot; and would flesh each out. Below is class_Bowl.h that defines our bowl class; note how the first line includes the plate class, so that every bowl object is an expanded plate object.&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;   class Bowl
   {
        //Attributes (&quot;Data members&quot;)
          bowl_depth;

        //Actions (&quot;Functions&quot;)
          carry_soup();
   }&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
Note how simple this class is because it already has many of its attributes and functions declared in the &lt;i&gt;parent class&lt;/i&gt;&amp;nbsp;class plates? This is important, to note that since it inherited much, little additional needs to be defined. Really the only thing new is carry_soup(). bowl_depth really is not needed; if I altered the size_zAxis to a larger variable, then I would be able to define the bowl depth. The simplicity of the inherited class Bowl should not surprise us, as an inherited class is a subset of some super class of generic objects.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYme4VfgN2FoGgrdjFenQsTuFw-P-jha5XHV-I9z_uiLo6toGBqL4NJMiRl-FicuH8RllqlCG1PJHpWZtv6RxFORumYznSO9mf_rrwQ5WD_PDE1qvtimkaZb9zuGEqdMZGvwvyVd2BGcik/s1600/plates_bowls.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYme4VfgN2FoGgrdjFenQsTuFw-P-jha5XHV-I9z_uiLo6toGBqL4NJMiRl-FicuH8RllqlCG1PJHpWZtv6RxFORumYznSO9mf_rrwQ5WD_PDE1qvtimkaZb9zuGEqdMZGvwvyVd2BGcik/s400/plates_bowls.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;All these objects are members of class Plates, and only the varying of a few attributes (data members) makes the variety of objects and shapes seen. Of course the subset that are part of class bowl add the action (function) carry_Soup() that gives them an added utility that the plate class super set of objects lacks. Note how we say an object is matching to another object when both are not only instances of the same class, but also when they share the same values of their attributes.&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
I think the above pseudo code and pictures should be enough to convince you that real and virtual objects share much of the same characteristics. An engineers blueprint could be thought of as the definition for a new class or instance of a class; the&amp;nbsp;dimensions&amp;nbsp;are the values of various attributes of the class, and the proximity and interactions of various attributes define the functions of the class.&lt;br /&gt;
&lt;div&gt;
&lt;h3&gt;
Using Objects in the C++ Language&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
Why you ask though would I want to make a virtual object through object oriented programming? Well, the reasons are diverse, but maybe I need to store multiple definitions of an employee, a box, or some other thing. Using OOP, I can make this into an object. In programming, this object is a new data type, and is sometimes called an &lt;i&gt;abstract data type&lt;/i&gt;. In order to understand classes better, lets define a box class in some detail now. Below is the code for the C++&amp;nbsp;header file for a box class:&lt;/div&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;#ifndef Box_Class
#define Box_Class

        #include &amp;lt;iomanip&amp;gt;      
        #include &amp;lt;iostream&amp;gt;
        using namespace std;

        class box
        {
                private:
                        string type;
                        int length;
                        int width;
                        int height;
                        int box_volume;
                
                public:
                      void output_value();
                      int volume();
                      string units(int);
                      float volume_units(int);
                      void input_variables();      
        };
#endif &lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
Notice the simplicity of this declaration; aside from the statements preceded by # signs (preprocessor directives) which are not necessary to understand the concept, this is a simple class. I left the preprocessor directives in the file in order to allow you to copy this code and run it if you chose to. If you copy it, name it &quot;box_class.h&quot; so that when I later show how to compile it, you can follow along. If you want to download the code, the links to these files is at the end of the document. To see how these functions are&amp;nbsp;implemented, here is the source file that defines the functions declared above. A header file and an implementation or source file together make up a class.&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;        #include &quot;box_class.h&quot;
        #include &lt;iomanip&gt;      
        #include &lt;iostream&gt;
        using namespace std;

                      void box::output_value()
                      {
                        cout&amp;lt;&amp;lt; &quot;The box is a &quot; &amp;lt;&amp;lt; type &amp;lt;&amp;lt; &quot; type box,the length is &quot; &amp;lt;&amp;lt; length;
                        cout&amp;lt;&amp;lt; &quot; inches, the width are &quot; &amp;lt;&amp;lt; width;
                        cout &amp;lt;&amp;lt; &quot; inches, and the height is &quot; &amp;lt;&amp;lt; height &amp;lt;&amp;lt; &quot; inches.&quot; &amp;lt;&amp;lt; endl;
                      }


                      int box::volume()
                      {
                        int volume_inches;
                        volume_inches = length * width * height;
                      return volume_inches;
                      }        


                      string box::units(int volume_inches)
                      {
                        string units;

                                if(volume_inches &amp;gt; 1728) {units = &quot;feet&quot;;}
                                
                                else units = &quot;inches&quot;;
                      return units;  
                      }


                      float box::volume_units(int volume_inches)
                      {
                        int volume_inch;
                        float volume;
                        volume_inches = length * width * height;

                                if(volume_inch &amp;gt; 1728) 
                                {
                                  volume = (float)volume_inches/1728; 
                                }                                             
                                
                                else 
                                {
                                  volume = volume_inch; 
                                }
                      return volume;
                      }        


                      void box::input_variables()
                      {
                         cout&amp;lt;&amp;lt; &quot;What type is this box?&quot; &amp;lt;&amp;lt; endl;
                         cin&amp;gt;&amp;gt; type;

                         cout&amp;lt;&amp;lt; &quot;What size is the length?&quot; &amp;lt;&amp;lt; endl;
                         cin&amp;gt;&amp;gt; length;

                         cout&amp;lt;&amp;lt; &quot;What size is the width&quot; &amp;lt;&amp;lt; endl;
                         cin&amp;gt;&amp;gt; width;

                         cout&amp;lt;&amp;lt; &quot;What size is the height&quot; &amp;lt;&amp;lt; endl;
                         cin&amp;gt;&amp;gt; height;
                      }&lt;/iostream&gt;&lt;/iomanip&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
Notice that preceding every function is the box:: syntax. This tells the compiler that this function is part of class box. If you want to compile this project, open your favorite text editor and save this as &quot;source_Box_class.cpp&quot;. My favorite text editor is &amp;nbsp;&lt;a href=&quot;http://projects.gnome.org/gedit/&quot;&gt;gedit&lt;/a&gt;, an open source text editor that works in Linux, Windows, and Mac. Gedit is a project of&amp;nbsp;&lt;a href=&quot;http://projects.gnome.org/&quot;&gt;gnome.org&lt;/a&gt;, an organization that promotes free software and makes the Gnome GUI for Linux. To get gedit on an Ubuntu Linux machine run the following in the terminal:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install gedit
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
Once gedit is installed you may want to configure the&amp;nbsp;&lt;a href=&quot;https://help.gnome.org/users/gedit/stable/gedit-plugin-guide.html.en&quot;&gt;gedit plugins&lt;/a&gt;&amp;nbsp;that are useful to programmers. One &amp;nbsp;of my favorites is&amp;nbsp;&lt;a href=&quot;https://help.gnome.org/users/gedit/stable/gedit-plugins-word-completion.html.en&quot;&gt;word completion&lt;/a&gt;... I think it really helps speed up my programming and make it more accurate. To install them on Ubuntu, type &amp;nbsp;the following in the terminal:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install gedit-plugins
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
Now that we have a good text editor, open it and copy and paste the above code into two files, and name them &quot;box_class.h&quot; and &quot;source_Box_class.cpp&quot; respectively. Save them in the same directory (folder). Now that we have a complete class, we can include it into any main function or program we want. To do this, simply add this line to the top of the main() function:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;    #include &quot;box_class.h&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
The quotes tell the compiler to look in the same directory as the main() for the .h file. Below is an example of a very simple main() that makes an array of boxes and lets you define values of their variables (attributes). It then displays the values of the attributes and the volume calculated by the class. Here is the code; name it &quot;main_classBox.cpp&quot;:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;        #include &quot;box_class.h&quot;
        #include &lt;iostream&gt;
        using namespace std;
        void input_value();

                  string type;
                  int length;
                  int width;
                  int height;
        
        int main()
        {
                int size;
                cout &amp;lt;&amp;lt; &quot;How many times do you want to run this&quot; &amp;lt;&amp;lt; endl;
                cin &amp;gt;&amp;gt; size;

                int volume[size];
                box this_box[size];

                // Must not be (i &amp;lt;= size) or else size =2, and loop iterates 3x
                for( int i = 0; i &amp;lt; size; i++) 
                {
                        this_box[i].input_variables();  
                        this_box[i].output_value();
                        volume[i] = this_box[i].volume();
                                cout&amp;lt;&amp;lt; &quot;The box has a volume of &quot; &amp;lt;&amp;lt; std::setprecision(3) &amp;lt;&amp;lt; this_box[i].volume_units(volume[i]);
                                cout&amp;lt;&amp;lt; &quot; cubic &quot; &amp;lt;&amp;lt; this_box[i].units(volume[i]) &amp;lt;&amp;lt; &quot; .&quot; &amp;lt;&amp;lt; endl;
                   }
          return 0;
        }&lt;/iostream&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
Once this main() is saved, we can compile. I use the&amp;nbsp;&lt;a href=&quot;http://gcc.gnu.org/&quot;&gt;gcc/g++&lt;/a&gt;&amp;nbsp;compiler developed by the&amp;nbsp;&lt;a href=&quot;http://www.gnu.org/gnu/thegnuproject.html&quot;&gt;GNU project&lt;/a&gt;. This compiler can be installed in Ubuntu by installing the&amp;nbsp;&lt;a href=&quot;http://www.ubuntuupdates.org/package/core/quantal/main/base/build-essential&quot;&gt;build-essential package&lt;/a&gt;:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install build-essential
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
Once build-essential is installed, we can compile our program. To do this, run the following:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;g++ main_classBox.cpp source_Box_class.cpp -o boxClass.exe&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
This will create an executable program named boxClass.exe. To run our program type the following in the terminal:&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;./boxClass.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
After running this command, you should see something similar to the following:&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXk0ZXdsCrHu1WoWwjBM8Mtc7IyWyr1IefovOZ2aPyeFfixj5sT6WTAjeJnzXlUJcaGqSU0aDgcs-o757AdEE2HayCqyQabZwthewNiZvmVRTNtIHmYrDv0KtwhfC7fKt6rueG1YdQj3NP/s1600/Terminal_screen_exe_crop.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;412&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXk0ZXdsCrHu1WoWwjBM8Mtc7IyWyr1IefovOZ2aPyeFfixj5sT6WTAjeJnzXlUJcaGqSU0aDgcs-o757AdEE2HayCqyQabZwthewNiZvmVRTNtIHmYrDv0KtwhfC7fKt6rueG1YdQj3NP/s640/Terminal_screen_exe_crop.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Running the box class program in terminal after compilation.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h3&gt;
Conclusion&lt;/h3&gt;
Making a virtual object is a useful technique in a programming language that supports object oriented programming. By understanding it as a way of seeing familiar objects, one can better analyse the real world and can be better able to use OOP as a method.&lt;br /&gt;
&lt;h3&gt;
Links:&lt;/h3&gt;
&lt;a href=&quot;https://sites.google.com/site/calsfiles01/&quot;&gt;My Homepage&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://sites.google.com/site/calsfiles01/calvin-johnson/c-box&quot;&gt;Page on my Website dedicated to hosting the files for this post&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://sites.google.com/site/calsfiles01/calvin-johnson/c-box/main_classBox.cpp?attredirects=0&amp;amp;d=1&quot;&gt;main_classBox.cpp&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://sites.google.com/site/calsfiles01/calvin-johnson/c-box/source_Box_class.cpp?attredirects=0&amp;amp;d=1&quot;&gt;source_Box_class.cpp&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://sites.google.com/site/calsfiles01/calvin-johnson/c-box/box_class.h?attredirects=0&amp;amp;d=1&quot;&gt;box_class.h&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
All of the above are available under the&amp;nbsp;&lt;a href=&quot;http://opensource.org/licenses/GPL-3.0&quot;&gt;GPL-3.0&lt;/a&gt;&amp;nbsp;licence by the author. Please&amp;nbsp;&lt;a href=&quot;mailto:calvinemtp@gmail.com&quot; target=&quot;_blank&quot;&gt;contact me&lt;/a&gt;&amp;nbsp;for permission if this code will be used for other than not for profit educational reasons. Do not republish without permission.</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/533096935813321165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/05/examining-objects-and-virtually.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/533096935813321165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/533096935813321165'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/05/examining-objects-and-virtually.html' title='Examining Objects and Virtually Modeling Them With Object Oriented Programming'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VJrYrNfLxLGPQ-tdceN5TW_GU9iXuHBMszLuRHdeCbAdvvTTnw5thGF-BEbu99uFzk1UlTz4WG4unkvwLpv2LQTb8PQWo8GhzxfIZpzfWBlDnPZRYp8ccf1dY9lmkGZysaJ_vIb6fTON/s72-c/plate1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-3744282336632150996</id><published>2013-05-18T22:00:00.004-07:00</published><updated>2013-05-23T12:45:50.197-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bill Gates"/><category scheme="http://www.blogger.com/atom/ns#" term="C programming"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Computer Scientist"/><category scheme="http://www.blogger.com/atom/ns#" term="Dennis Ritchie"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Steve Jobs"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX"/><title type='text'>Dennis Richie- A Personal Hero </title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #37404e; line-height: 18px;&quot;&gt;A conversation last night with a friend made me think about one of my personal heroes... Mr. Dennis Ritchie. Along with his coworker Ken Thompson, Ritchie is the father of the C programming language... which makes him father of every modern programming language. If that was not enou&lt;/span&gt;&lt;span class=&quot;text_exposed_show&quot; style=&quot;background-color: white; color: #37404e; display: inline; line-height: 18px;&quot;&gt;gh, he is also father of the UNIX Operating system and grandfather of Linux. To the uninitiated, that means that all Apple OS X machines, all androids, 90% of internet servers run on Ritchie&#39;s operating system. Mr Ritchie died one week after Steve Jobs. Ritchie may have been forgotten by the public but he will always be a hero to me...&lt;/span&gt;&lt;/span&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/AVvXsEgERRPSv9jBINPVtjCRVAYkZ2gj7-0MsDmftsBDx3-Q_XocAml3PshqMWn0wo_aNF01xOTeo0Im76A22M_e-gYlaYdG9HeYp05grDk4bgLWm_t3RaqeQZ6eUi6JN7pjL_WVMbqFfTkqPWtM/s1600/DennisRichie.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;273&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgERRPSv9jBINPVtjCRVAYkZ2gj7-0MsDmftsBDx3-Q_XocAml3PshqMWn0wo_aNF01xOTeo0Im76A22M_e-gYlaYdG9HeYp05grDk4bgLWm_t3RaqeQZ6eUi6JN7pjL_WVMbqFfTkqPWtM/s320/DennisRichie.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Denni&lt;span style=&quot;font-family: inherit;&quot;&gt;s Ritchie the computer scientist that created many of the tools of the modern era of computers was born on&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;September 9, 1941 and was found dead in his home where he lived alone on October 12, 2011. While the world gushed over the loss of Steve Jobs, Ritchie&#39;s death garnered little attention. To some deeply involved in the computer community, this seemed terribly unfair.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.zdnet.com/blog/perlow/without-dennis-ritchie-there-would-be-no-jobs/19020&quot;&gt;http://www.zdnet.com/blog/perlow/without-dennis-ritchie-there-would-be-no-jobs/19020&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; font-family: inherit; line-height: 19.1875px;&quot;&gt;Jobs got rich selling computers running the operating system that Ritchie had created, and Gate&#39;s fortune is built on the Windows OS believed to be largely written in C, the language that Ritchie wrote.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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_EWlc5zgTBjhdjMDe4zyAbkRWyGj4XrKYrG5kpS548cmRook9WLhxTn-VyQ6tnFtOac8WsGzGu1r0ky0rxLty-QvLlBBiVLVC_ZbeFu_b8Te4tPeAgfi5mVJ_h0uPV9YpONKWPafMZ1Kb/s1600/sfProgLang.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;561&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_EWlc5zgTBjhdjMDe4zyAbkRWyGj4XrKYrG5kpS548cmRook9WLhxTn-VyQ6tnFtOac8WsGzGu1r0ky0rxLty-QvLlBBiVLVC_ZbeFu_b8Te4tPeAgfi5mVJ_h0uPV9YpONKWPafMZ1Kb/s640/sfProgLang.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;In case someone didn&#39;t get the significance of the &quot;goodbye world&quot; by Ritchie&#39;s picture, it is twist on the traditional first program that is always taught in any programming language. In researching this, I decided to find out where the traditional &quot;Hello World&quot; program came from among programmers, and Richie&#39;s iconic book may have been one of the first places it was used. Some references claim a version of&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 19.1875px;&quot;&gt;the first &quot;Hello, World!&quot; program&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 19.1875px;&quot;&gt;appeared&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 19.1875px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 19.1875px;&quot;&gt;as part of the documentation for the BCPL programming language. If this is true,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 19.1875px;&quot;&gt;Brian Kernighan wrote the first &quot;Hello, World!&quot; program&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;prior to the 1978 printing of the &quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;C Programming Language&quot; by Ritchie and&amp;nbsp;Kernighan.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Hello_world_program&quot;&gt;https://en.wikipedia.org/wiki/Hello_world_program&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;Either way, the &quot;Hello World!&quot; best known and loved is &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb; color: #4e5665; line-height: 19.1875px;&quot;&gt;the traditional hello world program in ANCI C, Ritchie&#39;s language:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 19.1875px;&quot;&gt;#include&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e5665; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;&amp;nbsp;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #4e5665; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;int main(void)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #4e5665; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #4e5665; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;&amp;nbsp; &amp;nbsp; printf(&quot;Hello, world!\n&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #4e5665; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #4e5665; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: #fafbfb; color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;Some quibble about whether a&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fafbfb;&quot;&gt;&lt;span style=&quot;color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;&quot;Hello, World!&quot; traditionally &amp;nbsp;is written with the first letters capitalized or not, or whether there should be&amp;nbsp;exclamation&amp;nbsp;marks behind it. Never mind all that, Hello World is the first programming accomplishment of thousands, perhaps millions of coders including me.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;In changing it to &quot;goodbye world&quot;, we mournfully commemorate one of the greatest hackers of all times.&lt;/span&gt;&lt;/span&gt;&lt;/div&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/AVvXsEjO7xj1R6FSFm7VTE8Tr8CAV-iE0WLc7gd3NWZGXcqQh7NODhMdHhYwKUiR74SPDJ4VE_xTdg8pDNuYkYgbTUeO0RTVM31LhuRQxc3hWJ82d5TmbVLwlAm0tlya4890JOtz41Yp-U2lQJEN/s1600/Ritchie_Thompson.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO7xj1R6FSFm7VTE8Tr8CAV-iE0WLc7gd3NWZGXcqQh7NODhMdHhYwKUiR74SPDJ4VE_xTdg8pDNuYkYgbTUeO0RTVM31LhuRQxc3hWJ82d5TmbVLwlAm0tlya4890JOtz41Yp-U2lQJEN/s400/Ritchie_Thompson.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&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;span style=&quot;color: #4e5665;&quot;&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;It is nearly impossible to imagine a world without C and UNIX. These two innovations along with there numerous&amp;nbsp;derivatives&amp;nbsp;like C++, Objective C, C# and the Linux, BSD, and Android families of operating systems are so pervasive. It could be said that almost all modern programming languages &amp;nbsp;were derived from C in some sense.&amp;nbsp;&lt;/span&gt;&lt;/span&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/AVvXsEiFURZteJv-QcrSHE5nKLwprX4eO5Ly1fs0yhjSwDhhc1-Fvwchgoq5ZCaKV9icXpmAnvTfw_jVbPJWRZb6juNVMzOFVvkZ_zxwiitq5NWROm88QoLt4VYnHnksSejn9GktjUjVMJOtRdfi/s1600/c_prog_lang.jpg&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;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFURZteJv-QcrSHE5nKLwprX4eO5Ly1fs0yhjSwDhhc1-Fvwchgoq5ZCaKV9icXpmAnvTfw_jVbPJWRZb6juNVMzOFVvkZ_zxwiitq5NWROm88QoLt4VYnHnksSejn9GktjUjVMJOtRdfi/s320/c_prog_lang.jpg&quot; width=&quot;248&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #4e5665;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;line-height: 19.1875px;&quot;&gt;Bell Labs, Ritchie&#39;s employer, still has his homepage posted; I found it to be&amp;nbsp;fascinating and it has many links that any geek will love.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.cs.bell-labs.com/who/dmr/&quot;&gt;http://www.cs.bell-labs.com/who/dmr/&lt;/a&gt;&amp;nbsp;Among the links is PDF of the 1972 UNIX manual and many other delightful things.&amp;nbsp;&lt;a href=&quot;http://cm.bell-labs.com/cm/cs/who/dmr/1stEdman.html&quot;&gt;http://cm.bell-labs.com/cm/cs/who/dmr/1stEdman.html&lt;/a&gt;&amp;nbsp;Also, Dennis Ritchie&#39;s classic book on C is still available through many online sources.&amp;nbsp;&lt;a href=&quot;http://www.amazon.com/gp/bestsellers/books/3952&quot;&gt;http://www.amazon.com/gp/bestsellers/books/3952&lt;/a&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/AVvXsEifyfgQ7ukvbBirIvN1GijtZ-7KsKjn0ULbwrMduUcui8mrrPbL5zYm6jZF5AH2ECEkZXI33ZyCkFbd98_kBuKUjlFQ1Bj8uqjD_b5EgR5wLmVoR3Z06MILWyUqH15D2QSftwKFp0h-Sq3r/s1600/dennis_ritchie5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifyfgQ7ukvbBirIvN1GijtZ-7KsKjn0ULbwrMduUcui8mrrPbL5zYm6jZF5AH2ECEkZXI33ZyCkFbd98_kBuKUjlFQ1Bj8uqjD_b5EgR5wLmVoR3Z06MILWyUqH15D2QSftwKFp0h-Sq3r/s320/dennis_ritchie5.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ritchie&#39;s legacy will not vanish quickly, and we can be thankful to have the achievements of Dennis Ritchie to stand on. A wise man said that &quot;If I have seen farther it is because I have stood on the shoulders of giants.&quot; More than once it has been said that every one of us stands on the shoulders of Ritchie.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/3744282336632150996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/05/dennis-richie-personal-hero.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/3744282336632150996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/3744282336632150996'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/05/dennis-richie-personal-hero.html' title='Dennis Richie- A Personal Hero '/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgERRPSv9jBINPVtjCRVAYkZ2gj7-0MsDmftsBDx3-Q_XocAml3PshqMWn0wo_aNF01xOTeo0Im76A22M_e-gYlaYdG9HeYp05grDk4bgLWm_t3RaqeQZ6eUi6JN7pjL_WVMbqFfTkqPWtM/s72-c/DennisRichie.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-8862014524781790061</id><published>2013-05-15T21:17:00.001-07:00</published><updated>2013-05-23T12:47:17.843-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C programming"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ programming"/><category scheme="http://www.blogger.com/atom/ns#" term="if-else"/><category scheme="http://www.blogger.com/atom/ns#" term="if-then"/><category scheme="http://www.blogger.com/atom/ns#" term="philosophy"/><title type='text'>Gaining a basic understanding of the Logic of If and If-else statements</title><content type='html'>Next to while statements, if statements are one of the most important statements that can be made. As we noted in the last post, while statements and if statements &lt;i&gt;control the flow&lt;/i&gt;&amp;nbsp;of logic in a statement. This of course is equally important in language as it is in code. This is all well and good, but what do we mean by &lt;i&gt;controlling the flow of logic &lt;/i&gt;in a sentence? Well, what I mean is that good logic flows in specific ways, and instead of a linear flow we can control that flow with while loops and if statements. Consider the following linear logic flow.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
A ---&amp;gt; B ---&amp;gt; C ---&amp;gt; D&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Here, premises A, B, and C all lead to D... but what if I wanted to lead to either D or E? To accomplish that, I would need to use a &lt;i&gt;control structure&lt;/i&gt;&amp;nbsp;that would make the logic flow to D if some condition were met, and to E if some other condition were met. Ideally, this might be an &lt;i&gt;&lt;b&gt;If-Else&lt;/b&gt;&amp;nbsp;&lt;/i&gt;statement. Before showing pseudo code, lets examine our previous example altered to let us&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
A ---&amp;gt; B ---&amp;gt; C &lt;i&gt;if( condition = true ) ---&amp;gt;&lt;/i&gt; D&lt;br /&gt;
&lt;i&gt;\ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&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;gt; &amp;nbsp; else &lt;/i&gt;---&amp;gt; E&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Note how if the condition is not true (~ condition ), then the logic automatically flows to the &lt;b&gt;else. &lt;/b&gt;This makes the else the default position of the logic flow. In pseudo code, this is how it looks:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; if( condition )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;statements;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;6 &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;7 &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;statements;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;9 &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The other case is a&amp;nbsp;series&amp;nbsp;of if statements.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; if( condition )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;statement_1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; if( condition )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;statement_2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;10 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;11 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;if( condition )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;12 &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;13 &amp;nbsp; &amp;nbsp; &amp;nbsp;statement_3;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;14 &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the case of &amp;nbsp;a series of statements and no else at the end, there is no default behavior. Default behavior in a program is the result of &lt;i&gt;&lt;b&gt;else&lt;/b&gt;&lt;/i&gt; statements, and so if a program has a default behavior, then that should be written as an &lt;i&gt;else&lt;/i&gt;. This makes the following syntax the best format for writing a program:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; if( condition )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;optional behavior;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;6 &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;7 &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default behavior;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;9 &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;Conclusion&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;If and if-else statements are a relatively simple logical structure. Implementing them in code is not very hard to do, but there simplicity belies the power that they bring to life and code.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/8862014524781790061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/05/gaining-basic-understanding-of-logic-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/8862014524781790061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/8862014524781790061'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/05/gaining-basic-understanding-of-logic-of.html' title='Gaining a basic understanding of the Logic of If and If-else statements'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-8533509082598304615</id><published>2013-05-13T23:22:00.001-07:00</published><updated>2013-05-23T12:48:43.158-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C programming"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ programming"/><category scheme="http://www.blogger.com/atom/ns#" term="if-else"/><category scheme="http://www.blogger.com/atom/ns#" term="if-then"/><category scheme="http://www.blogger.com/atom/ns#" term="logic loops"/><category scheme="http://www.blogger.com/atom/ns#" term="philosophy"/><category scheme="http://www.blogger.com/atom/ns#" term="while-loop"/><title type='text'>Understanding the Logic of Looping Structures</title><content type='html'>One of the subjects that gets taught very early in computer programming is the idea of a Logical loop. Unfortunately, it seems that some people find it difficult to see that looping structures are a very important part of understanding the universe, and in this post, we will try to examine the how and why of looping structures in order to see if we can understand them not just as a method of controlling logic flow in a coded program, but as a way of understanding language, behaviors, neurological processes, etc. I hate to be grandiose and pretend that this is an all important concept, but this in fact is a quite profound idea.&lt;br /&gt;
&lt;br /&gt;
Our first question will be a simple one: What is a logic loop? I think that showing this by some kind of&amp;nbsp;pseudo&amp;nbsp;code is the easiest way to begin. Don&#39;t worry if you find this a difficult idea at first... we will attempt to break it down.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;while (some_condition = true )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;// some action is done.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This code snippet (which uses C/C++ syntax) shows that the condition in the parenthesis governs if, and how many times, the statements inside the brackets are done. Before executing the code inside the brackets the very first time, a &lt;b&gt;&lt;i&gt;while&lt;/i&gt;&lt;/b&gt; loop checks that the condition is true. If the condition is true, then the code between the brackets is executed. When the last statement of code between the brackets is executed, the condition is checked again. If the statement is true, the code continues to be executed starting once again with the first line of code between the brackets. If the condition is not true, the loop is exited. To continue this thought, lets look at two loops where we specify the conditions of the code. Once again, this snippet of pseudo code will uses C/C++ like syntax, however it will not compile. We are using pseudo code for logical clarity, not &amp;nbsp;real code. We are also not going to specify a data type for our variables, and will be using line numbers so we can follow the ideas in more clarity.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; x = 5;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; while( x &amp;gt; 0 )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello John&quot;;&lt;br /&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = x -1;&lt;br /&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp; // next line of code&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here in this example we first create a variable, &#39;&lt;i&gt;x&lt;/i&gt;&#39;, in line 1, and then set it equal to five. We then use the &amp;nbsp;variable &lt;i&gt;&#39;x&#39; &lt;/i&gt;as the condition of the loop. Remember the syntax for the while statement:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;while (some_condition = true )&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
In our example above, the third line is&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;while( x &amp;gt; 0 ).&amp;nbsp;&lt;/span&gt;We see that the condition&amp;nbsp;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;( x &amp;gt; 0 )&lt;/span&gt;&amp;nbsp;must equal true. If x &amp;lt;= 0, the condition is not true. But, because x = 5 and 5 &amp;gt; 0, then the condition evaluates to true. The loop executes until the condition is false. To see how to control amount of times the loop executes, consider how the below code will work:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; while( 1 = 1 )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello John&quot;;&lt;br /&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; // next line of code&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
I think the above is obvious... 1 will always equal one no matter what so this is an INFINITE loop... it will loop as a long as the program is running. Remember that an infinite loop could also take this form:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; x = 5;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; while( x &amp;gt; 0 )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello John&quot;;&lt;br /&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;// next line of code&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Do you notice what is missing that would control this statement? The expression to increment the variable &#39;x&#39;. This expression is found on line 6 of the original code and is ( x = x - 1; ). Here we see that for every loop, the variable x becomes one less than its initial value. (Note, the syntax of C++ allows a shorthand version of the statement &amp;nbsp;x = x - 1 to be written x = x--;. The name C++ comes because the x = x-- is the&amp;nbsp;decremented&amp;nbsp;form and x = x++; is the increment form).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
The website&amp;nbsp;&lt;a href=&quot;http://www.cplusplus.com/&quot;&gt;http://www.cplusplus.com/&lt;/a&gt;&amp;nbsp;has some great resources in there tutorials describing control structures in depth. I recommend the following page if you want to better understand the specific syntax for loops in C/C++&amp;nbsp;&lt;a href=&quot;http://www.cplusplus.com/doc/tutorial/control/&quot;&gt;http://www.cplusplus.com/doc/tutorial/control/&lt;/a&gt;. There are three kinds of loops; while loops, the do-while loop, and the for-loop. Similar control structures are if statements, if-else statements, and switch statements. Below is the basic syntax we showed before for a while loop:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; x = 5;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; while( x &amp;gt; 0 )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello John&quot;;&lt;br /&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = x - 1;&lt;br /&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;// next line of code&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
This is the basic syntax for a do-while loop:&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; x = 5;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello John&quot;;&lt;br /&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = x - 1; &amp;nbsp; &lt;br /&gt;7 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}while( x &amp;gt; 0 );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp;// next line of code&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And finally, is the basic syntax for a for loop:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; for(&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;x = 5;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;x &amp;gt; 0;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;x = x - 1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello John&quot;;&lt;br /&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; // next line of code&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Notice how the for-loop takes all the statements that control the loop and places them in the same line. While this is more complex to learn, it is ultimately less lines of code and more elegant.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3&gt;
What do we use Loops for?&lt;/h3&gt;
&lt;/div&gt;
Why do we need loops? What are they used for? Well, when we program, we are emulating reality, and that is where the value of loops is found. Lets take my favorite example that can be expressed either as code or in a sentence. In a sentence &quot;while I pull Sally&#39;s hair, Sally will scream.&quot; Below the same in code form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; while( I pull Sally&#39;s hair )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sally screams;&lt;br /&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This is similar to the statement &quot;while the car has gas and the engine is turned on, the cars engine will run. Here again, there is a condition (&quot;while the car has gas and the engine is turned on&quot;) and a result (&quot;the cars engine will run&quot;). Note though that the condition has an and... this makes a more interesting loop structure. Note that &amp;amp;&amp;amp; is the computer code way of expression a logical and.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; while( ( car has gas ) &amp;amp;&amp;amp; (the engine is turned on)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The engine will keep running;&lt;br /&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we see that we have two statements separated by an and. Remember the truth table for an and statement of two variables which we will call p and q in respect to convention:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p &amp;nbsp; &amp;amp; &amp;nbsp; q &amp;nbsp; &amp;nbsp;Truth value&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;br /&gt;
&lt;br /&gt;
This table shows us why a logical and is so special. Only in one case, both&amp;nbsp;premises&amp;nbsp;are true, is the statement true. Thus, when a while statement contains an a logical AND, the statement is quite narrowly defined. Less narrowly defined is the or statement:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p &amp;nbsp; OR &amp;nbsp; q &amp;nbsp; &amp;nbsp;Truth value&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In a logical or, the statement is true unless both premises are false. That means the difference between an or statement verses an and statement is huge.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Conclusion&lt;/h3&gt;
&lt;div&gt;
In conclusion, we need to look at the ways in which we may encounter loops. In reality we see loops all the time. Consider the following:&lt;br /&gt;
&lt;br /&gt;
&quot;While it is cold, I wear a jacket.&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In the above, identify that the action, &quot;I wear a jacket&quot;, will be terminated when the condition, &quot;while it is cold&quot;, is negated. In logic, a ~ is the symbol used to show negation. So,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;~(action) --&amp;gt; ~(condition)&lt;/span&gt; &amp;nbsp;which could also be written &amp;nbsp; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;NOT(action) --&amp;gt; NOT(condition)&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This means that we can expect that if I am not wearing a jacket, then the weather is NOT cold. This is a simple, but valuable insight. Also note that the use of a while here is appropriate, as I repeatedly don my jacket as long as the weather is cold.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ultimately, anytime we see a process frequently occurs in reality, then we can expect to see it equally frequently in code. In fact, when coding, anytime a task needs repetition until some condition is either met, or not met, the logic of that task is a loop. This makes understanding loops of primary importance to both programmers and philosophers.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/8533509082598304615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/05/understanding-logic-of-looping.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/8533509082598304615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/8533509082598304615'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/05/understanding-logic-of-looping.html' title='Understanding the Logic of Looping Structures'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8437626984468003984.post-8572732866793065651</id><published>2013-05-10T00:06:00.001-07:00</published><updated>2013-05-23T22:22:25.765-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASH"/><category scheme="http://www.blogger.com/atom/ns#" term="gedit"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 12.10"/><category scheme="http://www.blogger.com/atom/ns#" term="UNIX"/><title type='text'>Linux Commands</title><content type='html'>For several years I have been using Ubuntu Linux and overall have become a real enthusiast. I&#39;m sure some old hats might call me a newbie still, and it is true that I still am learning a lot. In some ways, I feel like it takes 2-3 years to get comfortable enough with Linux to start really enjoying it. Anyways, the other day I started taking notes on the normal, and especially the not so normal tasks I do on the terminal. You know there are some things that I just don&#39;t do that often... and when I need to do them, I start to wonder, &quot;How did I do that last time? I know it was easy but I can&#39;t remember how to do it!!!&quot;&lt;br /&gt;
&lt;br /&gt;
Well, the solution is to write down the commands, so that I would remember them. This is a kind of self documentation of sorts, and I first started doing this maybe a year ago. I more recently started trying to teach someone Linux, and they needed some basics written down. So I&#39;ve put several of these together and here it is. Feel free to critique, copy, and edit. This is a work in progress that is made to be saved as a .sh in order to be able to see the markup.&lt;br /&gt;
&lt;br /&gt;
-Cal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Misc Linux Commands&lt;br /&gt;
#&lt;br /&gt;
# OS: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Using Ubuntu 12.10 Desktop Version&lt;br /&gt;
# Author: &amp;nbsp; &amp;nbsp; &amp;nbsp;Calvin R. Johnson&lt;br /&gt;
# Date: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Last update 5-19-2013&lt;br /&gt;
# Credits: &amp;nbsp; &amp;nbsp; &amp;nbsp;Numerous Internet Sources&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Basic Commands&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To update run:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get update&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Or run this which does both...&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Navigate Through Your Filesystem and Directories&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To change directories run cd&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cd &amp;lt;&#39;path to file&#39;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#example is:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cd /media/flashdrive/anime&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To change directories to home, run cd ~&lt;br /&gt;
&lt;br /&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; cd ~&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To change directories to root, run cd /&lt;br /&gt;
&lt;br /&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; cd /&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To change directories back one directory (towards root) run ..&lt;br /&gt;
&lt;br /&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; $..&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To List directories run ls:&lt;br /&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; ls&lt;br /&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; syntax = ls (options)&lt;br /&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; ls -l&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To clear Terminal&lt;br /&gt;
&lt;br /&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; clear&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To close Terminal&lt;br /&gt;
&lt;br /&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; exit&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#To copy files use cp or rsync&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To use cp (copy)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cp /media/flashdrive/anime/picture1.jpg /home/heather/pictures/picture1.jpg&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Or use rsync to copy o whole directory (folder)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#syntax is:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rsync [options] &amp;lt;&#39;source&#39;&amp;gt; &amp;lt;&#39;destination&#39;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#example&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rsync -avi /media/flashdrive/anime/ /home/heather/pictures/&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#the above copies directory anime from flashdrive to pictures&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# To install software&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Using apt-get&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get install &amp;lt;&#39;package&#39;&amp;gt;&lt;br /&gt;
&lt;br /&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; # Before installing many packages, one must add the source or ppa&lt;br /&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; # You will find the ppa listed in the instructions for installing the package&lt;br /&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; sudo apt-add-repository ppa:&amp;lt;package&amp;gt;&lt;br /&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; # Example of adding ppa&lt;br /&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; sudo add-apt-repository ppa:webupd8team/gnome3&lt;br /&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; # Then update&lt;br /&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; sudo apt-get update&lt;br /&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; # Now install&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get install &amp;lt;&#39;package&#39;&amp;gt;&lt;br /&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; # NOTE&lt;br /&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; #When you add a PPA, a new .list file is created under /etc/apt/sources.list.d/.&lt;br /&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; # The files are named based on the PPA name and your Ubuntu version, like this: &quot;someppa-ppa-oneiric.list&quot;.&lt;br /&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; &lt;br /&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; # To edit these PPAs, run:&lt;br /&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; &amp;nbsp; sudo gedit /etc/apt/sources.list.d/*&lt;br /&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; # To remove a ppa&lt;br /&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;sudo add-apt-repository --remove ppa:someppa/ppa&lt;br /&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; # PPA purge&lt;br /&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; sudo apt-get install ppa-purge&lt;br /&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; sudo ppa-purge ppa:someppa/ppa&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Find a file&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&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; find file_name&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Using Wildcards to help find a file&lt;br /&gt;
&lt;br /&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; find partial_file_name* # or&lt;br /&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; find *partial_file_name&lt;br /&gt;
&lt;br /&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; # You can also use the wildcard to list file types&lt;br /&gt;
&lt;br /&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; find *.mp3 # or any other file extension&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#************************************************************************************************&lt;br /&gt;
# Linux Networking Commands&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Look up Information:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sudo ifconfig&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # in windows, &amp;gt;ipconfig&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Release and Renew IP Address:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sudo dhclient&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Restart the Networking Service:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Always Restart the Networking Service After Changing Network Configurations&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sudo /etc/init.d/networking restart # also (start, stop)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Network Config file&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Edit the Network Adapter Configurations&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sudo gedit /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #To Edit the DNS Resolution File&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sudo gedit /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #To See Current Hostname&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sudo /bin/hostname&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Hostname&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #To Echo Hostname&lt;br /&gt;
&lt;br /&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; sudo /bin/hostname newhostname&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #To Change Hostname&lt;br /&gt;
&lt;br /&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; sudo /bin/hostname newhostname&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Ping -- To Determine if You Can See an IP Address&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ping &amp;lt;IP Address&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Determine DNS is Working&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ping &amp;lt;domainname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # UFW firewall&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Change Default Handling of Ports When UFW is Enabled:&lt;br /&gt;
&lt;br /&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; sudo ufw default allow/deny&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Turn UFW on or Off:&lt;br /&gt;
&lt;br /&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; sudo ufw enable/disable&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Open or Close Ports for Everyone:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&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; sudo ufw allow/deny port#&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Delete a UFW Rule:&lt;br /&gt;
&lt;br /&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; sudo ufw delete allow/deny port#&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Allow Access to All Ports from a Specific IP Address:&lt;br /&gt;
&lt;br /&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; sudo ufw allow from IP Address&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # To Allow Access to a Specific Port from a Specific IP Address:&lt;br /&gt;
&lt;br /&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; sudo ufw allow from IP Address to any port port#&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # SSH and FTP&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # SSH -- Secure Shell&lt;br /&gt;
&lt;br /&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; #Install SSH on Server:&lt;br /&gt;
&lt;br /&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; sudo apt-get install ssh&lt;br /&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; # SSH Requires Port 22&lt;br /&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; # Use a Terminal Emulator to Connect to the Server (PuTTy)&lt;br /&gt;
&lt;br /&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; # To check the UFW Firewall&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&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; sudo ufw status&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #FTP -- File Transfer Protocol&lt;br /&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; # Install FTP Server&lt;br /&gt;
&lt;br /&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; sudo apt-get install vsftpd&lt;br /&gt;
&lt;br /&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; # Edit vsftpd Configuration Files&lt;br /&gt;
&lt;br /&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; sudo gedit /etc/vsftpd.conf&lt;br /&gt;
&lt;br /&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; &amp;nbsp; #Uncoment&lt;br /&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #local_enable=YES to Allow Local Users to Login&lt;br /&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; &amp;nbsp; #Uncomment&lt;br /&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #write_enable=YES to Allow File Uploads&lt;br /&gt;
&lt;br /&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; # To Restart vsftpd Service:&lt;br /&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; sudo service vsftpd restart&lt;br /&gt;
&lt;br /&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; # Use an FTP Client to Connect to FTP Server (FileZilla)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#*************************************************************************************#&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code&gt;# Some software installation instructions for Ubuntu 12.10 customisations script
        #Terminal Applications

         # SSH
          sudo apt-get install openssh-server


         # g++ &amp;amp; gcc

          sudo apt-get install build-essential

         # gcc for objective C
         sudo apt-get install gobjc


         # Valgrind
         sudo apt-get install valgrind

         # Python

          sudo add-apt-repository ppa:fkrull/deadsnakes
          sudo apt-get update
          sudo apt-get install python2.6 python2.6-dev


         # Ruby

          sudo apt-get install git build-essential

         # Java
         # sudo add-apt-repository ppa:webupd8team/java
         # sudo apt-get install oracle-java7-install
         # sudo apt-get update
         # sudo apt-get remove oracle-java7-installer

         # R

          gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
          gpg -a --export E084DAB9 | sudo apt-key add -
          gksudo gedit /etc/apt/sources.list
          # add this line to the bottom of sources.list
          # deb http://cran.ma.imperial.ac.uk/bin/linux/ubuntu precise/
          sudo apt-get update
          sudo apt-get install r-base

        #GUI Apps
         # gedit

          sudo apt-get install gedit
          sudo apt-get check gedit


          sudo apt-get install gedit-plugins

         # Gmate-gedit (for Ruby on rails developers)
         sudo apt-add-repository ppa:ubuntu-on-rails/ppa
         sudo apt-get update
         sudo apt-get install gedit-gmate


         # SciTE

          sudo apt-get install scite
          sudo apt-get check scite

         # Openoffice/libreoffice

          sudo apt-get install libreoffice
          sudo apt-get check libreoffice

         # startup disk creator

          sudo apt-get install usb-creator-gtk
          sudo apt-get check usb-creator-gtk

         # transmition bit torrent

          sudo add-apt-repository ppa:transmissionbt/ppa
          sudo apt-get update
          sudo apt-get install transmission-gtk
          sudo apt-get check transmission-gtk

         # firefox

          sudo apt-get install firefox

         #  Chrome

         # wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb  #32bit version

          wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
          sudo dpkg -i google-chrome*
          sudo apt-get -f install

         # Chromium
  
          sudo apt-get install chromium-browser

         # VLC
       
          sudo apt-get install vlc

         # XBMC
                        sudo add-apt-repository ppa:team-xbmc
                        sudo apt-get update
          sudo apt-get install xbmc

         # Texmacs

          sudo apt-get install texmacs

         # Audacious Music Player

          sudo apt-get install audacious

                #       OpenShot Video Editor
                        sudo add-apt-repository ppa:jonoomph/openshot-edge
                        sudo apt-get update
                        sudo apt-get install openshot openshot-doc

        # Utilities

                # compizconfig-settings-manager
                        sudo apt-get install compizconfig-settings-manager

                # Gparted disk editor
                        sudo apt-get install gparted

                # PPA purge
                        sudo apt-get install ppa-purge
                        #sudo ppa-purge ppa:someppa/ppa

                # Ubuntu Tweak
                        sudo add-apt-repository ppa:tualatrix/ppa
                        sudo apt-get update
                        sudo apt-get install ubuntu-tweak

                # Play encripted DVDs
                        sudo apt-get install libdvdcss2 &amp;amp;&amp;amp; sudo /usr/share/doc/libdvdread4/./install-css.sh

                # Extra (Non-Free Codecs)
                        sudo apt-get install non-free-codecs libxine1-ffmpeg gxine mencoder totem-mozilla
                                icedax tagtool easytag id3tool lame   nautilus-script-audio-convert libmad0 mpg321 mpg123libjpeg-prog
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://penguin-man.blogspot.com/feeds/8572732866793065651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://penguin-man.blogspot.com/2013/05/linux-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/8572732866793065651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8437626984468003984/posts/default/8572732866793065651'/><link rel='alternate' type='text/html' href='http://penguin-man.blogspot.com/2013/05/linux-commands.html' title='Linux Commands'/><author><name>Calvin R. Johnson</name><uri>http://www.blogger.com/profile/09610007049277610209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiQfLlh7jeGPCUlmjXzTO2txvYwbVUdwTnEvbWAVBS4nMViAzPZcwcViI6nh5TqK3S9H_eiLRLHLK4fc-egiJBoRRKLAyJZncqs0hF0FH4IYtlorF7NctsvvzerdsYL_c/s220/CalvinPipePicture.jpg'/></author><thr:total>0</thr:total></entry></feed>