Thoughts on Thoughts

I had decided to switch to Linux a few weeks ago but I knew it would not be until I had completed all my school related work so I can get my degree.  In the meantime, I had planned on continuing to test Ubuntu on a virtual machine.  As days passed however, I found myself rarely opening the virtual machine, old habits die hard.  This occurred to me because I was thinking of what to put on my final blog post and I did not get any ideas.  I have to begin organizing my files and storing them on the cloud so I can format my hard drive and begin anew with a dual boot setup.  I guess I was in denial to a certain extent because the virtual machine had this occasional lag that I would rather do without, and I did, by using Windows instead.

Hindsight is 20/20

So I read through the first few chapters of “The Art of Unix Programming” by Steven Raymond.  My initial intention was to find topics to help me complete the blogging assignment but I have stated in a few blogs already that I intended to give Ubuntu a more concerted effort this time around.  However, reading through chapter 3 about the various advantages of Linux in terms of security, multitasking, having a unifying idea of everything being a file and using pipes as connectors, etc really made me go out and a google an explicit comparison between Windows and Linux, a comparison here intended for the average user favors Linux by a small margin.  Another comparison shown here is was a response to the same question by a freshman looking to study computer science.  I am a little embarrassed that I had not done this research a long time ago and made myself informed.  I am about to make a permanent switch to Linux as far as all non-gaming computing is concerned.

Based on Historical Events

I was reading about the early history of Unix and how Bill Gates became a multibillionaire after buying rights to QDOS for $50,000 and marketing it as MS-DOS.  I would think just that shrewd maneuvering which eventually led to Microsoft dominating the PC market well into the 21st century would have earned him a biographical movie, “The Operating System” maybe?  Further, I found it even more interesting how the various owners of Unix throughout the years managed to botch every single attempt at turning it into a viable commercial product while non commercial versions initiated by hackers and the open source culture have become viable products.  Consequently, I am slowly moving towards the “free software because it works better” camp.

Python Peculiarities

While completing the python multiplication assignment, I was able to gain a little insight into how python treats standard input from the keyboard.  It seems that python can be told to treat STDIN as a list so a user can iterate through it in a for loop however if this is the case, the for loop waits until the entire input is given from the user with the EOF character before it starts go through the for loop.  This creates limits on line based interactive programming.  The solution was to place STDIN in an iterator and have the for loop iterate through the iterator which then allowed for each line of the code entered by the user to be inspected individually.

Make Makefiles

My entire programming experience prior to this class has been based on Windows machines using tools like Eclipse, Visual Studio 2008 and MPLAB.  I did not have to use a command line while using any of them because they all have GUI option for doing almost anything.  The process of resolving dependencies, compilation and producing an executable were streamlined by these tools.  It was interesting to see how its done manually and then to streamline the process using a makefile.   While my initial exposure to makefiles has been in the context of compiling programs and creating executables, it can be a very useful tool to streamline any process with a dependency and a target.  I have seen an example where it is used to replace a missing file by first downloading it and and unpacking it from a compressed file.  I’m sure I’ll discover interesting ways to use it soon enough.

Pipes and Whatnot

Many rules in Unix philosophy explicitly or implicitly including those of simplicity and modularity encourage writing simpler smaller programs with limited scope and to avoid unneeded complexities.  I understand the advantages to that and I think it is one of the things that becomes intuitive with more programming experience.  What I actually had issues with was that so far, all communication I have seen between small programs was limited to input output files being shared or the sort of resources sharing between different threads running on the same program.  The assignment about Pipes and Forks was a very good introduction of a new method of inter-process communication which I was not aware of before.  While I was able to have a good enough understanding to complete the assignment, just the sheer potential utility of the mechanism for creating programs tells me I have a lot more to learn about it.  Another good reason to keep using Ubuntu.

Standalone Ubuntu Installation

I am currently running Ubuntu 13.04 as a virtual machine on Windows 7, performance is reasonably smooth for the most part.  It does get noticeably slower if my laptop went to sleep or hibernation without suspending or shutting down the virtual machine in advance.  Further, it’s just not very good at multitasking when run as a virtual machine.  It is increasingly becoming clear to me that I need to have a standalone installation in a dual boot setup as I once did on my old laptop to really start exploring.  This made me reflect on why I never developed as much interest the first time around, I had Linux Mint then and the start menu and other UI seemed very similar to windows and I had a painful wireless driver issue.  I suppose it didn’t help that I always had to be in Windows to run programs for the electrical engineering classes I was taking at the time.  Perhaps now that I’m done with school and promptly unemployed, I will find an addictive RTS game I can pick up on Ubuntu and let that help me stay grounded, ultimately, I would like to be well versed on this system because I believe it will soon become an occupational necessity.

Ubuntu Troubles…

Sometimes it takes running into problems to be able to examine the inner working of a system.  So I installed the latest version of Ubuntu on my laptop and everything seemed to go smoothly but then after logging in, I noticed that the “start menu” was not rendering correctly and I couldn’t see any of the shortcuts.  I went on google (and bing is my default search engine for over a year now because I’m trying to give them a chance) trying to solve what I thought was probably a graphics driver related issue but soon stumbled upon a totally different solution, Cairo Dock.  I could actually install and use a different “start menu” if I so happened to choose, it made me reflect on the years of being stuck to the same old start menu in Windows XP and Windows 7.  I then found out there were many other desktop management environments at my disposal just by virtue of it being linux.  This is probably when it occurred to me about the numerous other things I would discover if I kept using this operating system regularly, and that’s the word.

Thoughts on the “Assignment” Assignment

While working on the “assignment” assignment, I realized that creating assignments for a course is an involved process. The focus of the assignment I think should be to expose students to fundemntal mechanisms of solving problems, therefore it is better to avoid problems which have multiple problems but all sharing a similar problem solving mechanism. Further, when it comes to this class, I found that the biggest obstacle for me in developing more interest was my unfamiliarity with the linux operating system environment. So my focus in completing the assignment was to come up with something that allows maximum freedom in how its accomplished while also being a useful enough tool to encourage students to use it for their own needs thereby creating one more personal incentive to stay in the linux environment. While I have learned a whole lot about the linux environment, I anticipate I will learn a lot more if I used it for all my computing needs.

Unix Philosophy

I came across an interesting rule by Rob Pike while reading the first chapter of The Art of Unix Programming.  “Rule 5. Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming”.  While there can be numerous ways to solve a certain problem, I always felt solutions that use data structures that are well fit to the problem always have more simpler solutions and are easier to expand in functionality.  It felt good to have something I thought was intuitive affirmed but the text went even further in the Rule of Representation by stating “where you see a choice between complexity in data structures and complexity in code, choose the former”.  There was no intuitive affirmation or rejection of this statement on my part.