The Final Post

22 04 2012

So this will be the final post of the semester and I am overall, very happy with how everything turned out and so I want to do a quick recap of the semester.

Group Work

I was fortunate enough this semester to be parked up with what I’d consider the top group in the class. No offense to the other groups, I just feel that in the way of team chemistry we had it. We were all on the same page and I think we all got along really well. We set goals and met goals and coming into the final week of the semester and before our big final group presentation I just want to thank them all. This semester could have been a much bigger headache than it was and I think everyone played a roll in one way or another, and that’s really what team work is all about.

With all of that being said I haven’t made much progress on my final bug fix as a result of the pretty hectic ending schedule I have found myself a part of but I have done a little and although I don’t see having it done by the final presentation I do se me finishing up with it shortly after and as I’ve talked about before, picking up more bugs and attempting to stay involved in the Firefox community. I think we all really appreciated the help that we got from those more involved with Firefox and it seems that as much as we appreciate them, they appreciate us and the help that we can offer and that’s what makes the community so strong.

Individual Work

Outside of the big group project we also had a bunch of individual work to do and blogging about all of our experiences was a really good way to show what we’ve done. I really don’t need to go into too much detail about the work here as that’s really what most of my previous entries are about. It’s been nice though, to be able to publicize our work and show off what we’ve been doing, what we’ve learned, and ultimately create something we can show off a bit instead of turning in written assignments. The main thing with blogging that I have come to love is it gets your thought out of your head and down somewhere that you can always go back to for whatever the reason. It has for me, helped cultivate new thought also. I have found that often times writing down my frustrations and thinking about it outside of working on whatever it is I am writing about, helps abstract the thought process. Much like getting up and walking away from something that just isn’t working for a couple of minutes or a couple of days, but writing helps forces that “away time”.

Overall

The big picture this semester has been working on open source projects and with the open source community and this as a whole I feel, has made me a better and more resourceful worker and programmer. Especially within the open source world, things don’t always go as planned and learning to get around that or work with it has taught me a lot about myself as a programmer and a lot about how to be a good one. It’s been great working with good communities and also on somewhat bad code (Homebase). And all of these experiences with these open source projects have ultimately helped me along and provided me with a new interest to pursue I otherwise would have ever explored. POSSCON, Firefox and Homebase, were all great learning experiences that I can carry with me forever.

Although this is my last entry for class, I suspect it will not be my last blog entry. I am hoping I can blog about my general experiences with my internship at SAS this summer and continue to write about the things I am working on in my life also. It’s a great way to get your thoughts out and maybe help out some others too.

Until next time!





The Big Show

20 04 2012

So right now I am a blog behind moving into exam week!! Oh no!! I’ll catch up and do one tomorrow also. Today though I’d like to talk about the poster session today and how nice it was to be a part of something like that and be around others who are also passionate and motivated to do something. And although the vast majority of work this semester was for a class, all the group goals were self driven and I think that says a lot about who we are (My Group) and what we are capable of.

The Session

The session was awesome because we had the opportunity to be exposed to others reporting on their work and research and also expose our work and do the peacock thing. The most rewarding part about it is having others interested in what you’re doing and the ability to pass that along to others, and really show interest in their work. I’ve never been a part of something like this but it really i amazing, the things that many of my undergrad peers have been working on. Sometimes we forget that we are here to get ready to get out into the working world and that often means we don’t pay enough attention to what we are doing and dedicate the time we need to dedicate to learning what’s in front of us and absorb as much of it as we can. For all of the faith that I lose in people going to school for all of the wrong reason, I did have much of it restored today when I saw just how many people are passionate about what it is they are doing and learning. Being a part of a group on individuals that have worked on something meaningful to them and to see the culmination of so much hard work from so many is something that can motivate and inspire and I feel that’s what I really got out of the poster session today.

A Bigger Picture

Having been a part of something like this for the first and probably last time in my life, unless I go into teaching at some point, was a good kick in the rear and a bit of a reality check. Talking with one of my classmates today I realized that this is really one of the last moments that we have before we go out and work for a living and when we come home soon, there won’t be any homework. So what then? With this thought I am truly grateful that we have been pushed out into the open source world and forced to swim or drown trying. It gives me something to look forward to in that I now have the confidence to work on something like Firefox with confidence and keep on learning and doing soothing meaningful outside of my future employment. And I do hope that my job really does challenge me and force me to learn and keep on learning but I know sometimes this isn’t the case. However I am glad to have found an outlet for my desire to learn new things. More than just contributing to open source and being around other people who have done something similar in their respective fields, I realized that I have gained an extra drive and bit of confidence to really get myself out there and get my hands dirty in whatever it is that interests me and I am glad to have a little bit of fire to get me going.

A Simple Message

I think that if I didn’t have this experience I would be a lot worse off than I am now, and I am sure my group, class mates, and those who were in the poster session today would all say the same. Sometimes you just need to get out there and put some effect into something or you’ll never know what you’re capable of. So I think it’s important to surround yourself with motivated intelligent people, and if you do, the fire and passion you have for whatever it is you have it for, will stay lit. But if you stop learning about new things and working on new things and stop finding things that interest and inspire you, well then, I feel sorry for you. Always find your passion, because most of the time, it needs a little finding, but you’ll be glad you went out there and tried.

Until next time!





Wrapping Up the Semester Part 2 of 2: No I in Team

15 04 2012

So this is the continuation of the previous post that focused on the open source experience. But now we are here to talk about the value of working in, and as a team. Why is this important? Well I get into the dirty details but the main thing you have to think about is how often do you think you’re flying solo at your job, a solo developer, or a solo anything for that matter? We work in teams everywhere we go, and big projects like ours should be no different.

Why It’s Important

Working in a team and having that experience over the last couple of semesters has become a valuable experience for a number of different reasons, but the main one is actually understanding how to work with people and collaborate on larger projects. Normally we find ourselves working solo on our programming assignments or papers or what have you for school, but rarely do we work in groups for extended periods of time. Pairs are pretty common, but groups of 5 not so much. It has become more visible that education is taking a turn toward group work, but it still has a ways to go. The really important point for it to consider is that fact that no matter what field of study you’re in, I’d almost guarantee you have to work with people in one way or another and often will have to collaborate in groups. This does’t seem like a daunting task but there are little skills that can make a difference.

The main skill you need to develop is people skills, for future work it is extremely important and knocking the kinks out of your people skills in school is important. If you can’t work well and communicate with others, you’re bound to not last too long. Having a good relationship with your co-workers is as important as the work you do. Employers are going to hire people who work well with others because those people will be able to get things done as a part of the group environment that most places try to cultivate.

Another important thing about working in a group is learning that you aren’t always right, and your way isn’t always best. Sometimes we need help, and sometimes we have a terrible solution to a problem that someone else has better solution for, and understanding when to ask fro help and learning how to take a step back is an important skill. I say skill because it can be hard for us to swallow our pride and ask for help or accept another way of doing things is key to having any success.

Knowing when to take charge and how to divide work is another huge asset to have. It is often times that project managers will not be tech people or that there is no project manager and nobody there to take control. Having experience with group projects helps build the confidence in taking charge and taking the reigns. There will inevitably be a moment when you are working with others and everyone is doing there own thing, and accumulatively, nobody is getting any closer to the end goal. Being able to step up and say you do this, here is out plan, lets try to stick to it and get back on track isn’t something anyone or everyone can do, and having the confidence to do so is just another weapon in the arsenal.

All of these skill as great but ultimately nothing without being able to effectively communicate. This really ties into everything, and a skill you can really only pick up through practice. Some people have a natural ability but most of us need a little practice to become effective communicators. This includes asking for help, giving advice, giving status reports, directing a group and much more. You may have the ability or the confidence or comfort to do any of the things listed above but if you can’t communicate effectively, then those skill are really useless because you cannot use them. What’s the best way to get help here? Group projects.

Conclusions

Really the point is that there are invaluable skill to be learned from working in a group with school projects and activities. It’s important because in the end we will all have jobs where we have to work together, or with others, and being able to do that and do it well is an important competency. The great thing bout doing this and focusing the project around open source is you are not only working with your immediate group members but also the community as a whole. It is possible to be successful and not work in, or be able to work with others, but I’d say that 99% of us will fail if we can’t, so why not get tossed into the fire when we can fail, rather than when failed is not an option?

Until Next Time!





Password Reset Nightmare

13 04 2012

So for tonights work we we assigned a problem with RMH Homebase and the way it handles passwords. Out of the box the default password for any user is set to their login ID… yeah. Another problem with the way Homebase handles passwords is the way that the passwords get reset. The House Manager has to be contacted to reset forgotten passwords. This can be a big problem… like when the House Manager forgets their own password. So building upon last post we obviously don’t have a very secure or user friendly interface here, so what can we do to solve this? I’m not sure what you’re thinking but I can give you my two cents.

Default Password

First things first is lets figure out this default password nonsense. At this point, if you know someones login you know their default password which isn’t so good. So with that being said we need a better default password that only that person will know. Well where can we get such information from? How about our database? Looking at the Persons table we have a number of different options to choose. The problem that I have here is the fact that all of the sample info provided by the sandbox setup is actually all the same outside of the user ID. But looking through we have a couple of good candidates.

Normally we will select our user ID and right now the user ID is set to the users first name and their phone number, so our sandbox isn’t helping much but we can generally come up with a pretty good combination on things to set the default password to. The fields the interest me the most are the first name, last name, phone number, zip code, and birth date fields. Why? These are are relatively unique and personal pieces of information about each user. From here we want to select pieces of the fields we want to use and combine them. So generally I think a good place to start is last name, but not the full last name, just the first three letters. What if their last name is less than that? Then we will just grab all of the letters. Next lets grab something that might be a little less know. So most of the time if you know someone you’ll know their last name and their phone number and a whole lot of other information about them, even their birthday, but rarely their birth year. So for the password we now have the first three letters in their last name and their birth year, so 5 characters. Lets try to get the standard 8 character password out of this so for good measure lets grab the last three letters in their first name. This makes our password relatively simple for the user upon initial login by using non subjective information like their address which may change. This also makes it hard enough for outsiders to make them feel secure and make us confident in the far that if you know someones login you don’t also know their password unless you absolutely know them well. Another options for the additional info is their zip code, but this can sometimes change so can sometimes cause issues.

Resetting The Password

So we don’t want to have to go through the House Manager for this for a number of reasons but namely, this can become annoying for them and they may also forget their password, and then what. So the easiest thing to do is to allow the user to reset their password themselves. Well how you ask… I’ll tell you.  Because we have now come up with a great secure default password why not make the user simply revert the password back to the default by clicking a button if thats what they want to do. On the login page we already ask for their login so why not also give a little button to reset the password on their account, so if they ever forget their password they can do it by entering their login name and clicking the button. One thing we do need to check is that the login name exists and that it is entered. Then we can simply call a stored procedure on our database to reset the password to the normal default. Easy right? Maybe not.

Implementing the Changes

So before I go into detail. I have had continued issues with Homebase and cannot say f0r sure these changes work, but I can go over with you the changes that need to be made to do what I’ve discussed above. Lets start with the password reset as this can really get us going. So when we create an account we want to set the default password to the first 3 letters of their last name + their birth year + the last 3 letters of their last name. Because all of these amount to a string we have a very easy way of doing this by using PHP’s substr(). First we want to make a function called reset password inside of the person class that will easily reset the password for us using the users login ID.

Steps inside of the function: We want to read in from the user their login name and when the password reset button is pressed we want to pass that to the function. So our parameter for our function is the user ID. The next thing we do with that is select, from the database what we need to make the password. so something like this:

function set_default_password($id){

   // This will select the data that we want for the password and save the result
$results = mysql_query("SELECT first_name, last_name, birthday FROM dbPersons WHERE id = '$id'")or die(mysql_error());

   // get the first three letters of the last name
$pw = substr($results['last_name'], 0, 3)
// append the the birth year
$pw = $pw + substr($results['birthday'], -2)
// append the last three of the first name
$pw = $pw + substr($results['first_name'], -3)

   // set the new password
mysql_query("UPDATE dbPersons set password = 'md5($pw)' where id = '$id'")

}
The above can also be used when we create a user. The key is to create the user in the database without a password and then immediately after run the function. Or if you don’t feel comfortable with that then we can simply create a similar function that takes the first name, last name and birthday in as parameters and then creates the password and returns it.

To set this up on our login page (which I again cannot see) all we have to do is create a submit button that forwards us to a page that takes the user id in as a parameter, runs the function, and then displays a success or failure message and spits us back to the login screen so the user can login. I will hopefully be able to get this working once I get Homebase working properly and consistently but until then I think I’ve pretty much covered what to do and how to do it. Not so tough once you think about it and apply yourself.

Until next time!





9 Elements of a Good User Interface

11 04 2012

So I am going to split up the 2 parter for the time being, I was planning on writing why working with a team is a good experience but will focus on some key elements of User interface design based around the chapter my class has been assigned to read this semester. We will get back to the importance of working in a team in a few posts.

I’d like to start by talking a little on interfaces from my perspective before we dive into what our chapter has to say. The main thing that I believe drives a good user interface is completeness and simplicity. If there is too much, the user can become overwhelmed and this will often drive users away. Making things simple to use and understand is the most important aspect of the software in parallel with functionality. It does’t matter what it does if the user can’t figure out how to use it. Completleness is also important in the sense that the interface provides all of the tools the user needs. While often times people think this can oust the former, they really go hand in hand. Organize what the UI needs to be effective into groups and organize accordingly, because it doesn’t matter how something looks if it doesn’t do anything… Conflicting? You decide.

Completeness

Wow, one of the topics mentioned above. And I actually wrote the above before reading through the chapter. The little blurb the book gives us pretty much covers this one. As it says, the UI should contain all the essentials required by the use cases and nothing more. Just enough to do the job in simpler words. Why clutter the UI with things the user is never going to use? A better question, why build in functionality the user can’t use?

Language

This doesn’t mean don’t have a potty mouth because depending on your domain that may be the best language to use. The main thing to consider with language is be constant and domain appropriate. If you are building a site to help educate someone and provide them with a basic understanding of something like molecular biology, use the right verbiage. They probably aren’t there because they know the basics, so explain them in basic terms. Where consistency falls in to place is evident but I will explain. If a button does one thing on on page it should do the same on another, and the “Back” button should always say the same word. Not “Back” then “Previous” then “Later”. Don’t be cute, be usable.

Simplicity

Surprise here! The page should be simple to use. Not too cluttered and not too empty. Have what the user needs and nothing more. Don’t drown out the message in tons of other doodads and whirligigs. “KISS” that page (Keep It Simple Stupid). If something doesn’t exist in the design specs don’t just add it. Keep every page looking nice and friendly and don’t overwhelm you users.

Navagatability

In essence pages should be able to be easily navigated. Not only that, but it should be easy to navigate between pages or screens. If you can’t get where you want to go then you’ll probably stop trying. Imagine if all roads zig-zagged and forked every 100 feet with no street signs. Would you drive? Could you?

Feedback and Recovery

This one is tricky because it definitely something I would have thought of but something that makes complete sense. Let the user know what they have just done, what they are doing (I added this one), what they can do next, and how to undo the thing they’ve just done. This helps the user not become frustrated by accidentally clicking something and not knowing what just happened. Holding the users hand is always better then letting them get lost in the woods.

Data Integrity

Check all user input and ensure that it is valid before keeping it in the database. Not only that, but let the user know what is valid input and what is wrong with their current input if something is incorrect. Again, hold their hand and show them the way.

Client-server Integrity

Make sure that user interactions with the system don’t effect other users who are on the system at the same time. Each users interactions should be independent of all others and no data from one session should interfere with the others. Keeping users and their data and interactions separate is part of making the user feel comfortable. Do you always feel comfortable of Facebook where everyone knows what you’re doing? Not always right? Exactly…exactly.

Security

Users should only have access to the things they should have access to. A normal user of the system should not be able to change the administrators password but the opposite may be alright depending on the system. Don’t open all of the doors to those without the key.

Documentation

This is a big one because it is often an afterthought if it ever though about at all. Obviously if your making something like a website, documentation might not be needed but with any sort of application, make sure you document the how toe’s. It’s that whole holding the hand thing. If the user cannot figure out something, show them the way. We can teach the little padawans.

Why?

Consider these 9 things and I think you can probably make a pretty good interface for anything you are working on. Why is this important. Well read what I had to say in the beginning. The gist, there is no point in having great functionality if the user can’t figure out the interface and there is no point in having a good interface if it doesn’t do anything. Ya dig?

Until next time!





Wrapping Up The Semester Part 1 of 2: What Open Source is All About

8 04 2012

So working this entire semester on open source projects has really brought to light some things I’ve never thought about before that I would like to talk about. Throughout school most students keep aiming for some sort of job with a company like Google, Facebook, Amazon, Apple, etc as their dream job. The question is always how can you get experience and how do you look better to a company like the previously mentioned. Internships and personal projects help, namely, experience is the key. GPA and experience. You could have a 4.0 but If you never do anything outside of your school work that’s almost as useless as never having gone at all. What’s been good about this semester and working with Firefox in a team setting is we’ve gotten useful experience in an applied setting and done so through collaboration with others which is just as important. This entry will be part 1 of a two part post about the importance of each.

Open Source Experience

Open source can be a wonderful thing and frustrating all at the same time. With a project like Firefox there are so many resources and so many people around to help, so getting assistance is great, but there can also be too much help at times. I talked about it before but sometimes you get someone pointing you in one direction and someone pointing you in the complete opposite. The current issues that I have is not knowing how I need to fix the bug I currently have ownership of. There are multiple people who have commuted on the bug but it seems we still do not have confirmation on the right way that the code should be refactored to fix the bug. The main thing is there can sometimes be an overwhelming amount of information and no clear correct path when there sometimes needs to be.

It isn’t all bag though. The great thing again, is that there are so many resources. Not only that, but there are so many different ways to contribute. One of the groups in our class moved from bug fixes to updating the extensive documentation on their project after the release of it’s new version. This may not be what you’d expect from open source, but it is in fact a daunting task, with hundreds of pages of documentation to update. There are so many things you can do though. Because open source is in fact, open source, most projects are not for profit and often need help with all aspects any normal business would have. Even things like marketing and design are niches to be explored inside of every open source project. Normally people think that they can’t help out if they don’t know how to code or don’t know a lot about computers but that’s just the problem. You can, and they need you. Contributing to open source is like having an internship or your own personal project, but in a different setting and with so many people there to help you out.

Right now it is rare to get students of computer science involved in open source which I think is a mistake. There is no better way to gain some great experience and really get hands on. You learn how to utilize resources, you learn problem solving and collaboration skills. Sometimes you have to figure it all out on your own and sift through tons of garbage, but at the end of the day you’ve learned something and have ultimately become a better worker. There is no better way to learn to use your resources and also think for yourself. I think coming soon there needs to be a bug adjustment to the way that we teach, not just programming but everything. I think that there should be more involvement of students in open source, and not just programmers, but anyone who could have something to offer, writers for documentation, markers and business people to help promote the use of the project, designers for logos and websites. We all need to get involved because we are all missing out on quite possibly the best way to gain applied experience and learn from it. We need to start promoting open source experience in education, and in general. Because in the end, we help the project, the community and ourselves in the process.

Until next time!





Working with RMH Homebase and Its Database

5 04 2012

We are back to working with RMH Homebase for today looking into more of the database side of things as well as attempting to implement some new functionality per request, that is appended in the rear of our book

Working With The Database Directly

As almost an addition to my previous post, when developing a database there are 6 normalization criteria to follow, according to Chapter 7 of Software Development: An Open Source Approach. Two of which we are keeping in mind when looking through the RMH Homebase database. It is pointed out that the dates table has both, rows that have empty data cells and redundant attributes. Specifically in dbDates we see the date used as the id but also that there are columns for day, month and year also. This is redundant and thus unnecessary. If we need to, we can easily extract any of these three parts of the dat from the ID attribute. When running an update on the table or a specific row, we could have problems of consistency in that we may update the id or one of the specific dat attributes without updating the table everywhere that this data appears. If we have a call to the database that relies on the consistency of this data then we could have some potentially serious consistency issues which may cause scheduling problems or the incorrect date being displayed. This same issue can be seen in dbWeeks where the ID is again a date but this time the date that starts the week, but that same date is also a part of the dates  attribute that shows all the days for that week and spelled out in the name attribute. In this table we could potentially have the same issues as described above.

Another issue that is present in dbDates is the fact that many unused attributes are present in the table. A solid indicator that this attributes either don’t need to exist at all (If nothing uses them) or occupy their own table (a few of the entries use them). We can also see this in dbShifts and dbPersons, where many of the attributes are never used like background check, shadow, interview, experience, etc. In this case where these fields seem important but are never used t is important to find out why and if they are still needed. If they aren’t They too should be removed.

Adding Functions for the dbShifts.php

We are to make here, a set of five functions that are used by a larger function in the book called get_shift_name_from_id. These five functions are to attain the month, day, year, start time, and end time of the shift whose id gets passed into each function. The reason why this is a bit silly is because the ID actually contains all of the desired information. An id is setup like this: 12-24-11-9-3; containing the month then day then year then start time then end time. These attributes are all delimited by the “-” character, so rather than running a query on the database to essentially do the same thing, we can, without running a query, run the explode function on the list to get the attribute we want to return. Explode works by providing the delimiter as the first attribute and the string we wish to extract from as the second, an optional third attribute can express how many attributes we want returned into the array that explode will give us. So by exploding the id we are able to then extract the data each the from each area of the attribute. An example of the code is below.

// Gets the month from a shift id and returns it
function get_shift_month($id)
{
// $id contains month as the first attribute in a string delimited by -
$data = explode("-",$id);
// return attribute 0 (month) from the delimited string extracted into an array
return $data[0];
}

As part of the assignment we are also to run the unit test but I think as I said previously or a time ago, this is not so straight forward. As the current unit test don’t test these attributes I assume that this mean not only to run the unit tests but to also write new ones. Currently I am having trouble with getting RMH Homebase working as it was before. It seam that each time I work on it and then go back to it the home page for login does not want to load anymore. As it were I am also having problems running the until test but below is an example of what one of the tests might look like.

$shiftID = 1-30-12-9-3;
$this->assertEquals('1', get_shift_month($shiftID)

The benefit of extracting information this way is not taxing the database with unnecessary queries, the down side is that we can’t catch any errors to check and see if the id passed is valid and exists inside of the database.

Creating the Months Class

So broken down for us is a user request to add an option for viewing months as opposed to just weeks. Also in the book in chapter 6 is the constructor for the Months class where we find that we have the attributes; $id (Key for that month that is the first ay of the month), $dates (A list of all days in the month), $name (The name of month and the year), $weekday_start (the name of the weekday that begins the month), and $timestamp (The date of the last day of the month). These are the attributes of the class. Before we can access anything though we first need to create a database table and thus out database file for Homebase called dbMonths.php.

The first thing we need to do is write a function that creates the database table, so that when we run dbInstall.php, the table for months will too be installed. This database table needs to include the attributes above so the code for this looks like the following.

function setup_dbMonths() {
connect();
mysql_query(“DROP TABLE IF EXISTS dbMonths”);
$result=mysql_query(“CREATE TABLE dbMonths (id CHAR(8) NOT NULL, dates TEXT,
name VARCHAR(14), weekday_start VARCHAR(9),
timestamp DATETIME, PRIMARY KEY (id))”);
if(!$result)
echo mysql_error();
mysql_close();
}

This will install our table. The constructor from chapter 6 is lacking the fact that there is no insertion of this information into our database so the next thing that needs to be done is just that, make a functions that inserts new data into our table as well as delete and update information about a month. The best way of establishing how we should do this is by looking at how we insert into other database tables. The above setup is a modification of another table begin setup but with the values modifies for our purposes. Once we look through the other db”TABLE”.php files and see what functions they use, we are able to modify these for use with bdMonths table. The same can be said for the tests. As I am still trying to get Homebase working properly I cannot actually test these functions now. But it looks like when I do the everything else should be fairly straight forward. The good thing about jumping in and adding new functionality like this is we already have working models of other tables and how they are handled that we ca work from.

Conclusions

As I talked about before, databases are interesting to me and as a result I like php also. Working with the two is generally straight forward although I have had some issues with RMH Homebase working consistently. I will continue to work to get this running, but in the mean time would like to leave on a particular note. Often times with databases we need to make sure that we have a clear and consistent database. We may think something is going to be useful and then find out we never use it at all. Refactoring your database can be just as important as your code. The database is your backbone, and ensuring that it works properly is the important step to building a functional program, because a nice looking interface that does’t work is really just a pretty facade on a condemned building.

Until Next Time!

 








%d bloggers like this: