The end of the beginning

I didn’t really know what to expect at the beginning of this semester and how this class was going to be taught. Of course I had my doubts going through the class about how some things were going to work or how certain assignments would be handled but everything seemed to work out quite nicely. I can definitely say I took more out of this class than some classes this semesters, most of you guys know which classes I’m talking about… Anyways moving on, looking back I definitely learned a lot from this class. Coming in I thought I was only going to learn about Unix, but really I learned more about C++ and BASH as well as throwing me towards Python. I’m also happy with how much more I learned about learning a new language on my own since we were pretty much released into the wild on our own. In the end I’m happy with what I learned from the class including programming in a Unix environment and so on! I just wish we had more status reports on our grades, but I guess I also learn to care more about the quality of my work and what I learned over grades as well.

So this is the end of the beginning of our introduction to Python, Bash, and Unix. Its time for us to go and explore these areas on our own.

Here comes Linux!

Hey everyone! I just wanted to share some exciting news about how NASA is migrating from Windows to Linux because they “needed an operating system that was stable and reliable.” I’m pretty happy because I love seeing Windows’ downfall since Microsoft only seems to care about money now rather than innovation and its customers. It’s pretty cool and I just wanted to share with everyone!

 

Reference: http://rocketry.wordpress.com/2013/05/07/nasa-to-migrate-iss-computers-from-windows-to-linux/

http://www.zdnet.com/to-the-space-station-and-beyond-with-linux-7000014958/

Project Reviews!

As a gamer I was excited to play all the games groups created! I started with Oregon Trail.

Oregon Trail Review:

The game was pretty easy and straight forward to begin, you really didn’t need any directions for it since you could figure it out on your own. The game was also really clean and easy to read. There were white lines where it should be and so on, which is pretty important in a text based game. I was a bit disappointed that my game didn’t save automatically so I would lose my game if I exited out having to start over again. I did like how every new game had new events instead of the same hard coded events. In terms of code I thought that the group did a pretty good job in terms of making their game Pythonic. There wasn’t a lot of comments either, although it wasn’t really needed for the most case.

Tetris:

Of course I had to try the Tetris game, I mean who could resist a classic? There’s not much to say about the game except it’s a working Tetris game! In terms of coding I think the group did well to make it clean and easy to follow. I wish there were more comments in the Controller.py file though since I wanted to know more of what some of the functions were doing.  I guess you could figure it out but I guessed on what some lines did. I also wish the shapes were different colors but still I was impressed with the quality of the code and game in general.

Text Based Zombie Game [SPOILERS]:

I love zombie movies, games, comics, etc. I was pretty excited try out this game and see what it would be like. I was playing through the game and some parts made me chuckle a bit… like the jail cell scene. Playing through several times I was sort of confused how you’re a zombie but you don’t die until you notice it . I wish the game had more opportunities to do things differently in them. Overall, the game has a lot of potential and the story line can really real people in (and because its about Zombies and there are a lot of Zombie fanatics out there) , I just felt like I was hitting A or B nonstop. In terms of coding, the game was written in C++ and seemed pretty neat and clean.

I’m serious impressed with the level of coding done by all the games and I’m looking forward to playing all of the other games that I haven’t tried yet! Till next time!

Pythonic or not Pythonic? That is the question!

So I’ve gotten more and more used to Python as I continue to work on this final project. I am pretty proud with some individual functions considering  they’re pretty Pythonic… I think. You see I’m not 100% sure still what Pythonic means still but I think they’re Pythonic! For an example I wrote a function to edit only one line in a text file, but it requires me to write over the entire text file. Some parts of this function is pretty Pythonic to me, but over all re-writing an entire text file to just edit one line doesn’t seem very.. Pythonic.  Take a look at the function and tell me what you think!

[code]

def changeAttr(line, text):
lines = open(“character.txt”, ‘r’).readlines()
if line == 4: #if item is being changed then don’t remove all items…
if lines[4].split()[1] == ‘none’: #no item then remove whole line
lines[line] = listOfAtts[line] + “: ” + text +”\n”
else:
lines[line] = lines[line].rstrip(‘\n’) + ” ” + text + “\n” #adds item
else: #if it’s not item change entire line
lines[line] = listOfAtts[line] + “: ” + text + “\n”
out = open(“character.txt”, ‘w’)
out.writelines(lines)
out.close()

[/code]

Anyways back to my original point, I feel like you need so much experience with Python to make larger projects Pythonic as a whole. There’s so many things I do in this final project that are sort of messy because I’m not sure and don’t know if Python has slick tools to do it with so I resort back to what I know, ifs, fors, and whiles which get a bit messy, especially when nested.  I think I’m going to sign up for a Python class Junior or Senior year in order to learn more because I’m definitely hooked onto Python now. Hopefully one day I can write a program that’s 100% Pythonic.

Reddit + Python

I didn’t really have any interest in learning Python in depth in the past. However, all of that changed a few days ago when I was playing on reddit, if you don’t already know what reddit is then you shoudln’t google it. It will save you a lot of time to not know what reddit is. Anyways, back to my story, as I was browsing through reddit I stumbled upon their source code. For those who are interested here’s their git hub:

https://github.com/reddit/

This took me by surprise because I didn’t know Python was that powerful, I mean reddit is entirely written in Python! So I looked through their files, and I was blown away. I also didn’t understand 90% of it but it seemed super interesting. This led me to decide my next independent web development project will be written in Python. I just wanted to share my new interest with everyone!

Phew!!!

Well if anyone is like me, then they’d be glad the test was over. That was such a stressful hour and a half for me. I’m usually fairly confident with my git skills, but I was nervous when I was forking and pushing. Not only that but during the test I was scrambling to test my regular expressions and I was just never sure if my commits or adding files were correct or not. Even after the pushing and finishing the test I wasn’t sure if I did everything right. I’m just happy that we only have one test of this type. I would not like it if all my tests were like this where I wasn’t sure if my submission made it through or not.

It wasn’t a snake in Eden it was a Python

Beginner programmers, like me, are like Adam and Eve. We lack a lot knowledge in programming and are tempted to take the easy way out in our projects. We’re also tempted by languages with a lot of features and are considered “easier” languages to learn. Python being one of these languages. Python’s easy setup and generally easy syntax lures us in. Tempts us with its easiness and dashing good looks. I like Python, I really do. I like it for small and simple tasks sort of like an add on to another language. Python is great for certain things it and it also makes certain tasks tedious. The task project required a noticeable increase in code than past projects. Writing big functions and more code in Python started to show it’s darker side. I’m so used to having brackets separating my blocks of code and in most IDE I could minimize those blocks of code, making it a lot easier to read my code or focus on certain functions. With Python I couldn’t and before not before long the indents all looked the same and I was doomed. I deleted things I shouldn’t have and I added code where I shouldn’t have and so on. After seeing Darren’s code, it would have been smarter to put functions in separate files, but the bigger the function the higher the risk of death by indents. So I guess what I’m ranting about is that Python is good for smaller projects and the indents don’t bother me there but when the project requires 80+ lines of code the indents starts to get to me.

 

Am I the only one that feel this way? Brackets>Indents

Giddy for Git

I’m loving git. I’m not afraid to say it. I know a lot of people hate git and honestly I would too if I was having problems understanding it. I’m not saying I am a git master, but I understand it a bit more than most people at this point. I think what helped me a bit was the use of github for independent projects. Github helped me learn git with more visual help  and I’m more of a visual learner. So when we started learning git in class despite not having much of a visual basis I could still follow along a bit.

I’m pretty happy that we went over git in class and have been using it for projects and such since it gives me a good opportunity to fully understand git. For example, I didn’t fully understand how to use the different branches of git effectively or that your branches can have different versions of your code allowing you to switch back and forth.

Overall, I think git is a really important tool for computer engineers to know and I’m glad we’re getting experience with it. I’ve heard a lot of people complain about it, but they’ll be happy they learned it early since if they become software developers for some company they’ll probably be using some sort of version control on the daily.

In over my head at LUUG but Steam for Linux!

This was my first VT LUUG meeting and I felt pretty overwhelmed. At the beginning we went through a series of topic including a quick snippet on RoR and I came to the conclusion that RoR is not a very secured framework. My favorite was about the release of Steam for Linux though, so from here on out this blog might just be about my thoughts on Steam for Linux. It’s about the only thing I could follow through out the entire meeting. Back to Steam for Linux though, I heard the news that Valve planned on porting Steam to Linux over the summer and I was esctatic. I was just beginning my journey
in the Linux world but I already planned on making Linux my main OS. The only reason I booted up Windows was for playing games, and trust me I tried using PlayOnLInux
as well as Wine but it was just too much work and a pain to be honest. Even if I did get it working there were a couple of games that were reported to be laggy and just not as fast.
So Steam coming to Linux was the best news to me as a new comer to the Linux world. Now that it has been released I feel like Windows is going to be hurt a bit and lose a bit of audience who only stayed on Windows for playing games. This is at least true for me, and my time on Windows will be dramatically less than before. As with the rest of the meeting I was a bit lost when the speaker went into details with IPSec, although I know the basics of VPN and such this topic was in over my head. I also found it hard to follow a lot of what the discussion was about and found it harder and harder to focus as I got more lost. I guess it’s just because I’m an amateur. I then left early since it’s Valentines day and I had arrangements. But hey, Steam for Linux!

A comment on commenting

The first language I dabbled in was Java and that was for a class in high school. Commenting in Java is pretty much the same as commenting in C, C++, C#, and Obj-C. Example:

//Single comment

/*  Block Comment */

After receiving the first assignment for the class, I glanced through it and everything seem well. Although there was no specification for comments, I had to add some anyways since ever since I started coding the idea of commenting and documenting your program was pounded into my head. So of course, by reflex I commented all my programs using the double slash even though I knew Python used a different syntax and of course I got errors. So I simply had to Google up real quick how the commenting syntax for bash and Python which luckily used the same syntax for commenting using the number sign.

Of course this isn’t a big deal or anything, but it’s just irritating sometimes when you’re working with multiple languages on a project and you’re switching between languages. Sometimes you just code and your brain can flip flop the commenting syntax, like what I’ve done so many times before and you get annoying and easily avoidable errors. The most annoying of this is developing a website. HTML’s comment tag is <!– Comment –>, which is sort of annoying when you just want to add comments real quick. Javascript and PHP uses the two slash to comment and it’s sometimes annoying when I switch around and use two slashes in some HTML snippets (even though I’m pretty sure it usually wouldn’t cause errors and just ignore the line, it still could).

Bottom line is I wish all languages just use the same syntax for commenting, even though I’m sure that there are different functionality of the characters in other languages. Here is a list showing the some of the different ways to comment in different languages:

Java, Javascript, PHP,  C, C++, C#, Obj-C: // Comment

Python and Bash: # Comment

Lua (A scripting language): — Comment

Ruby: Ruby is weird since you use the number sign for single comments but block commenting requires this:

=begin comment block =end