Technical Textbooks or Lack-There-Of

Once again I’m amazed by Zed Shaw’s exercises for learning Python; you can find them for free here:

http://learnpythonthehardway.org/book/

It’s a surprisingly very intuitive way to learn the Python language. From start to [I'm at the half way point right now 26/50], it’s been a great progressive increase in difficulty and even coolness! However, this makes me wonder why can’t more books or courses take a page from this guy’s book? So many, in fact too many, college textbooks are not effective at all as teaching tools. That’s why I enjoy taking programming classes, especially ECE 2524, that doesn’t require buying a $150+ book which may or may not be effective and efficient. Intro To Unix definitely has its syllabus nailed because I actually enjoy doing exercises from the class’s “book”. Every other class, however, is a whole other challenge!

My advice: rent books for just the semester from places like Amazon.com and never ever buy from the on-campus bookstore without checking prices online! Also, unless you just enjoy the convenience at the end of the year, don’t sell the books back to the bookstore; once again, check online to see what retailers are offering for your edition.

Past and Current Python Homeworks

These past two weeks have mostly been looking at our last and next python assignments. The last homework looked like it was going to be quite difficult. However, after starting the homework, I realized that pretty much everything I needed to know was in the assignment description. The links to other websites with examples helped out a tremendous amount when it came to argparse. If I was not told about argparse, I am sure the homework would have taken twice as long. The next homework that is due seems even more complex. I am just glad for the high level of detail in the description as well as a blog post by the instructor on how to achieve certain actions that the program must do. The main issue I have seen so far in class is the lack of time. It seems like once you just start understanding something, class is over and the next class is on a completely different topic.

Intro to Unix ECE 2524 Entry #3

Had my first issue with Ubuntu today, I guess moreso with the VirtualBox which crashed for the first time. Luckily managed to recover everything.  Still having issues getting it to have the correct resolution within VirtualBox though,  I don’t remember how I got it into widescreen form last time.

Python proved to be more difficult than last weeks assignment.  Getting the parser to work along with the fileinput was more challenging than it originally seemed. At first I had a hard time figuring out how to handle each optional argument in the parser. Eventually figured out you can literally say if argument… and handle it. A lot more intuitive than I thought it would be. After getting that, it still wasn’t working because the optional arguments had dashes within them like –ignore-blanks.  Turns out Python converts these dashes to understrikes so the statement became if “ignore_blanks”.  Then the fileinput tried to take these optional arguments as files which caused more issues. Finally got all of that working and then learned about the shebang too.

ECE3574 continues to have an overwhelming amount of work. Project 2 is some exercises out of the book that are extremely annoying. The exercises require you to implement the functions listed in the book, and you have to figure out what the book wants you to do with each function and what they want you to do with the parameters passed to each function.  One of the exercises you have to use some of the source code given and it’s extremely hard implementing classes and functions that you didn’t design.  It would be a lot easier just to write everything on my own rather than trying to figure out how their stuff works and then incorporating it. Gunna have to go see the TA just to understand what the book expects you to do in certain parts.  Sure hope there won’t be any more assigments out of the book.

Week 3 Updates

This was the third week of using Unix for a class related project, and so far I am liking it. Even though the interface is similar to windows office or XP, its the terminal that makes using Ubuntu good. Like I mentioned earlier, in the Unix Command School assignment, the commands are pretty simple and intuitive. While I like the terminal part of Ubuntu, I don’t know how to decrease the screen brightness on Ubuntu. This is destroying the battery life of my laptop. My plan is get it fixed sometime over this weekend.

As far the second assignment goes, it wasn’t too difficult. I had prior experience in python which made me finish the project quickly. It initially took some time to recall python syntax. I thought that the hardest part of this assignment was uploading .py files to github. I was regretting uploading it after realizing that our programs can be seen by anyone with a Github account. Regardless, I realized that if used correctly, this could be an excellent source to share code.

In addition to this, I had my first project due for ECE 3574. The project required us to get command line arguments and carry out some functions in it. The main focus of the project was managing a database. These are my updates with Ubuntu for this week, and check back next week for more.

Unix Blog Post #2 – Issues :(

Today, I had to switch a virtual machine to run Ubuntu because my Ubuntu install on my hard drive was over heating my laptop. My laptop would constantly run the fan, whether or not, I am doing anything intensive. Initially, I thought it was a video card issue, since I have both an Intel and ATI Radeon graphics cards in my laptop. So I installed the required drivers, which allowed me to turn of the ATI Radeon Graphics card. Unfortunately, my fan continued to exhaust heat from the fans.I am going to take my laptop tomorrow to LUUG. Hopefully, they can figure out what is going. If anyone else can help me, my laptop model is HP Pavilion DV6.

Despite, the driver issues, I am enjoying using Ubuntu. Many of the different commands that I am learning from this class and ECE 3574 are finally starting to sink in. Typing commands into the Ubuntu’s terminal is starting to become more natural. Hopefully, by the end of this class, I will remember most of these commands.

Intro to Unix ECE 2524 Entry #2

Just finished Homework 2 in Python and figured it was time to write another post.  I have  discovered that I do not like Python very much, while syntactically i like that you don’t need squiggly brackets, and you simply do tab which is what you would normally do any other language anyway; I do not like having a debugger to step through the code.  It’s really hard to figure out where an error occurred and which line is causing something to do go wrong. Also not being able to step through and watch the values of variables makes it hard to tell what’s going on. Doing the homework took me quite a while longer than  I thought it would, 1. because there is no debugger, and 2. because all the documentation I have found for Python isn’t very useful. While I was trying to look up some of the functions to use they are not very clear how they work. For one function it said it returned a “tuple” which I understood to be three different parts, but I had no idea how to access those three different parts it created…what does it store those parts into? With no useful examples I merely had to search for another way to solve the problem.  That’s my work with python so far, but I’ll go ahead and explain a little bit about the qt programming I have been doing in ubuntu as well.

So QtCreator turned out to be more useful than the text editor for python, but its still not nearly as helpful as visual studio.  It took me probably a little over an hour just to get things working properly. First off I had to change run settings to output the run to the terminal rather  than the rather useful output at the bottom of the screen that takes in no arguments. After figuring out how to pass arguments from the command line to the terminal within QtCreator, I tried to debug it and realized that the debugger had some sort of error which I believe has something to do with outputting to the terminal.  After googling some solutions for another half hour, I eventually got it working after modifying a couple files.  Once that was out of the way, I was able to get to the heart of the programming and I found that Qt has some nice member function for its types. the QDate type was particularly useful for this assignment which was to create a birthday reminder program.  One function which saved me a lot of time was the function for QDate isvalid(). That actually checks the date to see if its an actual date that exists and it saved me a ton of time by not having to write something like that myself.  Overall the program turned out to be a little easier than I thought it would be, but it still took a really long time to complete.  And that’s about all for this week.

 

Meeting an old friend – Python

It’s funny how irritating and joyful coding can become, all at the same time! This is specially true when you’re walking out of your comfort zone into unchartered turfs.

I remember using Python long back. Really really long back! I was quite comfortable when I read that the second assignment was based on Python. Little did I realize back then that my entire Saturday afternoon was going to be spent on trying to figure out the basics of this old friend.

When I looked at the assignment this morning, it gave me a mini heart-attack! :D

The next one hour was spent on going back and forth through basic Python tutorials, and it was not pleasant. However, the joy of figuring things out and being able to compile without any errors  is enough to fuel you to push through.

Yes, homework 2 did make me nervous in the beginning, but in the end it was fun and once you figure things out on your own, you really want to jump straight into it and get your hands dirty! :D

Looking forward to playing some more with my dear old friend Python.

- Sumit

Basic Shell Commands and Python Exercises

Basic Shell Commands

This week in ECE 2524, we took a look at some of the basic shell commands listed below.

alias diff man rmdir unalias
cat echo mkdir script whereis
cd exit more source which
cp hostname mv ssh whoami
chmod less pwd tar ps
date ls rm touch grep
find head tail ln wc

The exercise was pretty straight forward. As a small group, we divided the commands for each person to research. For each of our commands, we had to find the usage of the command, common flags and options, and some examples. In my opinion, the exercise would have been more helpful if after we discussed our commands, we had an exercise where we would have to use some or most of the commands. However, overall the exercise was a good learning exercise.

 

Python Exercises

We have been following along with an online book, Learn Python the Hard Way, that will teach us how to program in python. I have made it through exercise 9, and so far it has been very helpful. I have quite a bit of experience in various other languages, and this book helps me see the connection Python has with them. I look forward to going through the rest of the book.