Thursday, December 3, 2015

Update - December 2015

I haven't posted anything on here in a while, but I will continue soon. For now, holidays and job hunting have become my top priorities :3

However, don't think that I've given up on coding! Currently, I've been doing some Topcoder practice rooms and Project Euler problems to keep my C++ skills sharp and ready for action! I've also been studying up on programmer interview questions and practicing white board problems that I find on the Internet.

As for posting projects, I think I'll have another one posted by the end of the month (at least, that's my goal lol).

So, happy holidays everyone, and I'll see you next time.

Chris

Monday, October 19, 2015

AskUs - Web Application Project

Introduction


Hey everyone. So, the first project I'm going to bring up is one from my Web Design and Application course - codename AskUs. AskUs is a message board and discussion app, akin to sites such as Reddit or StackedOverflow. The user can create an account, log in, post questions, respond to questions, and vote on responses. This was the first group project for the course, and I'm happy with the way it turned out.

In the following sections, I will explain the technologies we used to create AskUs. Additionally, I will detail my role within the group and how I contributed to the project.

The full project can be found on this GitHub page here.

AskUs Homepage Screenshot
Homepage of AskUs

Behind the Scenes


Let's take a look at the tools we used to create the project.

JavaScript was the language of choice for both client and server-side scripting, and Node.js was used to build the server (a little more on that later). This was the first course where I used JavaScript, and this project helped me get better acquainted with the language. The more I used it, the more I fell in love with how easy it was for me to use and understand.

Node.js uses JavaScript in order to build server-side environments for web applications. Users of Node.js can easily install modules in order to increase their server's functionality and make it more robust. Our team used Node.js to build the server for our project, and we used the express, body-parser, cookie/session, router, and jade modules. Express created a web application framework for us to support our project. Body-parser made it easy for us to parse through POST data sent to the server. Sessions allowed us to keep track of valid users (i.e. whether or not a user was logged in). The router module helped us set up routing information between the various pages of our app. Finally, we used the Jade templating engine in order to create our web pages.

The Jade templating engine allows users to create dynamic HTML pages based on the logic and data of the project. For example, our project contains different categories for questions (e.g. travel, food, entertainment). In regular HTML, I would have to hardcode the links to each category by typing out each individual link. If the team decided to add more categories, I would have to go back and add those additional links by hand. However, with Jade, the task becomes much simpler. Say we have an array listing all the categories:
...
tabs: ["new", "travel", "food", "entertainment", "relationship", "career", "life", "other", "myquestions"]
...
We can use simple logic to list out the links:
each tab in db.tabs
li(role='presentation')
a(href='/' + tab) #{tab}
Now, if the team wants to add more categories, the logic takes care of creating the additional links by looping through each element in the tabs array. Easy peasy, lemon squeazy.

Since our project constantly manipulated the DOM tree, Jade helped save us some of the headache of taking care of each change.

For styling, we used Bootstrap to give our project a polished, professional look. Bootstrap also allowed us to make AskUs responsive, and we can easily adjust it for mobile deployment.

Git and GitHub handled version control for our project. It also allowed us to easily contribute to the main code base via forks and pulls.

Finally, we used Vagrant in order to create a development environment where we ran the server. The virtual machine we used came from Semmy Purewal's Learning Web App Development, and it came with a full Node.js setup.

I would like to point out that our project does not use a database for all of its information *shock and ahh*. At this point in our course, we had not yet learned how to incorporate databases into our projects. Therefore, all data was stored in a large JSON object located within the server code. When new data is inserted into the "database", we simply append the data into the JSON object in its respective place.

Our "database"

My Contributions

Now I want to take some time to highlight my specific contributions to the team. 

Our team only had about a month to complete this project. In the early stages of development, I partook in discussions with my teammates about the requirements and specifications our project needs. We held our group meetings in-person and online via email and Google Groups. These discussions took around 2 weeks.

After we focused on the specifications, one other member and myself took one week to create prototypes of the project. We then showcased our prototypes to each other and the other members of the group, and we chose the best parts of the prototypes to include in the final version of the project. Prototyping took about one week, and the rest of the time was spent on building the final project and documentation. 

One of the main parts of the project I was responsible for was sorting the questions into their respective categories. The way I tackled this was that I appended a tag to each question. The tag corresponded to the category that the question belonged in. When the user clicks on a category, the code would look through all the questions with the same tag as the category and display only those questions. Questions would be sorted with the most recently created one listed at the top.

Sorting questions based on categories

Additionally, I helped fine-tune the database. I fixed some bugs and errors that showed up, such as linking the correct creator to the question or response created. Furthermore, I advised another member on the delete system used in our project that allows users to delete his/her questions and responses. 

Finally, I was the main author of the documentation which detailed how to use AskUs. I created a 20 page PDF with screenshots and how-to information.

Final Thoughts

This project taught me valuable information. I gained experience using JavaScript, Node.js, Bootstrap, and Jade. It was the first time I used many of these technologies for a big project like this, and it was interesting to see how everything worked together. I also gained experience working in a group environment. In order to contribute to the project, I had to take apart code written by other people in order to fit my pieces into the puzzle.

I am very happy with the way the project turned out. To reiterate from above, you can view the full project, along with documentation, at this GitHub repo.

Thanks for tuning in,

Chris

Sunday, October 18, 2015

Coming Soon...


Hello all!

I'm going to be posting some of my work that I've done while in school. This consists of projects and assignments and will mostly focus on the programming side of my work (though maybe I might talk about a few research papers here and there). Why will I be doing this?
  • I will be able to have a "portfolio" of my work available on the web
  • I can hopefully reinforce the lessons and concepts I learned while in school
  • I can learn more about how Blogger works and practice with it a little
If only I thought about having a portfolio while in school, I'd be way ahead than where I am right now lol, but it's better to start later than never. Furthermore, digging through some old work can help me pick up some stuff that, thanks to time, has vanished from my mind. Finally, since I'm new to the whole Blogger scene (and blogging in general), I can learn how to use this site and maybe form some good habits on being consistent with something.

So, let's have some fun with it!

Peace,

Chris

Saturday, October 10, 2015

First Post

Hey all,

So I decided to hop on the bandwagon and start a blog. Why? Mostly because my girlfriend has one, and I created this so that I can follow her. Partly so that I can post whatever's on my mind. I still have no idea what to blog about. Will this be a place where I can throw my random thoughts into? Or will it be a more organized collection of thoughts so that it will be a themed blog? I don't know lol.

Hmm... a little about me, then. My name is Chris. I am a Computer Scientist. I have my own website at poisongrapes.com. I love video games, anime, drawing, movies, exploring new places, my family, my friends, my cat, and In-N-Out. Nice to meet you.

Oh, and one more thing. Please be a dear and follow my girlfriend's blog. She's a whole lot more interesting than I am.

Thanks, and have a good day/night.

Chris