Monday, April 9, 2012

Day Thirty One: Software Development Chapter 7

Today's assignment is to read chapter 7 in the Software Development textbook. This chapter focuses on developing the database modules of RMH Homebase and introduces several new concepts, such as database design principles and software security. As with my previous posts, I will make a brief outline of this chapter for future reference. Doing so will prepare me for the next assignment and will provide a useful tool for studying.

7.1 Design Principles and Practice

  • Database: a collection of data organized in a particular way for efficient computerized storage and retrieval
  • Persistence: data in a database persists beyond the life of the program or programs that access those data
  • Relational model: relational databases can be stored as a collection of two-dimensional tables
7.1.1 Database Creation
  • The database must first be created and initialized
7.1.2 Connecting the Program to the Database
  • mysql_connect($host, $user, $password)
    • connnects the program with the database server
  • mysql_select_db($database, $connected)
  • mysql_error()
  • mysql_close()
  • mysql_query($query)
7.1.3 Tables
  • Attribute: a column of a table that has a unique name and a data type
7.1.3.1 Table Naming Conventions
  • "Use names that unify classes and instance variables with their corresponding database tables and column headings"
7.1.4 Normalization and Keys
  • Normalization: a strategy for designing tables so that they support general-purpose querying and ensure data integrity
  • Primary key: a unique identifier
7.1.5 Backup and Recovery
  • modern DBMS systems can just use an "export" command
7.2 Working with a Database

Three important types of actions
  1. The table must first be created
  2. Individual rows of the table can then be retrieved, added, deleted, or changed (updated)
  3. The table can be removed from the database, or dropped, in which case all its data are also lost
The rest of this section is primarily example commands 

7.3 Database Security and Integrity

A secure database accomplishes all of the following goals:
  • It prevents unauthorized or accidental disclosure, alteration, or destruction of data.
  • It prevents unauthorized or accidental access to data considered confidential to the organization or individual who owns the data.
  • It ensures data integrity, so that the data stored in the database are always valid and accurate.
7.3.1 Database-Level Permissions

Four levels of access
  1. Server level: privileges that apply to all databases on the server
  2. Database level: privileges that apply to all tables in a particular database on the server
  3. Table level: privileges that apply to all columns of a particular table in the database
  4. Column level: privileges that apply to an individual column of a table in the database
7.3.2 User-Level Permissions

7.3.3 Controlling Concurrency

MySQL uses table locking to ensure database integrity when several users (sessions) are accessing the database at the same time.

7.4 Adding New Software Features: Database Impact


Day Thirty: Day 2 of POSSCON

Keynote:
Scott McNealy gave a lot of important information regarding open source's advantages over proprietary software. Open source software (OSS) is safer than proprietary code: "What if the Trojan horse was made of glass?" is the question he asked. OSS code is higher quality because engineers know that their code will be visible to everyone. OSS has zero barrier to entry and zero barrier to exit: the barrier to exit in proprietary software is generally ten times the barrier to entry. This is known as vendor lock-in.

Big Picture: Open Security:
This presentation frightened me a little because it revealed a process that I had not considered. Many process control systems are based on old software. As this old software is integrated with the rest of the system and connected to the Internet, the system becomes open to many potential threats. I trust that the government and the private sector will adequately test these systems and fix any vulnerabilities, but no software is perfect.

Education: Open Source in Art:
Carl Twarog talked about the Sonic Plaza and its importance to East Carolina University. The Sonic Plaza itself looks pretty amazing, but I was more impressed by Mr. Twarog's approach to research and development. He mentioned that it is important to include artists in the R & D process because they bring advantages, such as free association, originality, and progress/progression, to the table. I agree with this argument because I have found myself stuck in a programmer's mindset when a different mindset offered a better solution.

BOF: Linux:
The conversation focused on licenses and patents. Mr. Hall did not suggest that people use any particular type of license but urged businesses to have a plan before making any such decisions. His argument against over-patenting primarily focused on the pianoforte and the harpsichord. When the pianoforte (piano for short) was invented, there was no music written for it and no customer demand. The inventor's solution to this problem was the make the blueprints available to manufacturers. This open approach made the piano popular, but some patents on modern pianos force manufacturers to make strange design decisions in order to avoid legal issues.


This is where it gets crazy. I missed the keynote speech and the next presentation after the BOF because I talked with Mr. Hall for about two hours. I did more listening than talking, but I learned a lot about patents, IPv6, and standards (ogg vs. mpeg-4).


Big Picture: Making an Existing Software Project Open Source: How and Why with AOL as a Case Study:
I did not realize that so many big companies had dedicated OSS branches. AOL was the company used in this case study, but other proprietary companies, such as Microsoft, have similar programs. A lot of work goes into adapting proprietary software for the open source world; however, the advantages of open sourcing software can far outweigh the costs in some circumstances.

We all left early at this point

Day Twenty Nine: A Recap of POSSCON

POSSCON is over, and now it's back to work. I posted my schedule and mentioned the three people with whom I wanted to speak, but there were some slight changes. I will post an overview of the first day and post an overview of the second day later.

Day 1

Keynote: Open Source - Now and in the Future:
Larry Augustin talked about the three major groups involved with pushing open source forward: management, technologists, and educators. He also mentioned that mobile, social, and cloud are the three key words in the industry at the moment. Augustin is a proponent for open source, but he was not afraid to admit that the best solution might end up being proprietary software, depending on the circumstances.

Education: Here We Come, Ready or Not: Undergraduate Software Engineering Practicum in Open Source:
I was very pleased with Dr. Bowring's presentation. I contemplated going to a different event because I did not want to waste time hearing about something that I already knew; however, the summary of CSCI 362 and 462 helped bring it all together for me.

Demo: Benefitfocus Technology:
Don Taylor spoke at an ACM meeting at CofC before, but I wanted to learn more about their platform-as-a-service (PaaS) model. Their use of metadata driven architecture to minimize the footprint is a really interesting concept. Some of the design is still a little over my head, but it is easier to comprehend the second time around.

BOF Session - Securing Cyberspace with Open Source Software:
Several of my classmates were present with me during this lunch/discussion. I honestly felt a little out of place because everyone else, aside from my classmates, were very familiar with security and relevant open source software. The speakers kept us engaged in the conversation by asking our opinions on certain matters. These security specialists rarely get a chance to know how "young people" think, and our input had some value in this regard.

Keynote: Big Data, Hadoop and Open Source:
I have heard the term "Big Data" used before, but until Dr. Brodsky gave his keynote speech, I was not very sure what the term meant. I took a Data Mining class, so many of the ideas were not unfamiliar. The main point that I took out of this presentation is that unstructured data is measured by volume, variety, and velocity.

Education: Google Summer of Code and Google Code-In:
Google's Summer of Code program sounds like a great opportunity to get involved in the open source community and make some money in the process. I spoke with Carol Smith after her presentation and asked her if there are any other opportunities for non-students. I am still eligible for Summer of Code, but I will likely be working during that time. She offered to pass my resume along if I saw any interesting jobs on Google's job page.

Technical: Introducing C++11:
This presentation was definitely a little over my head; however, I did learn about some cool new features in C++11. There are new core language features, such as concurrency, move semantics, auto, lambdas, and a range-based for loop. There are new library features, such as containers, regular expressions, and smart pointers.

Big Picture: Changing the Face of Open Identity in Ecommerce:
I really enjoyed this talk. Jonathan Leblanc suggested that people get rid of the annoying registration forms and use other available profile systems instead. Here are some statistics that he mentioned: "23% of customers abandon carts when asked to register" and "45% left a site when they couldn't remember their password." I spoke with Mr. Leblanc afterwards and asked him how to avoid irrelevant information. The example I gave was this: A friend wants a new laptop but does not know much about hardware; he asks you to look for possible laptops within his price range online; the website assumes that you are interested in laptops. Mr. Leblanc admitted that this kind of situation can be a problem, but measurements taken over long periods of time can address this issue and help make an accurate personality profile. Just like people, these profiles must be able to adapt to an individuals changing needs and interests.

Tuesday, March 27, 2012

Day Twenty Eight: Preparation for POSSCON

I will be attending POSSCON with the rest of my classmates on March 28 and 29. In preparation for this event, I have developed a schedule for the events that I will attend. This is necessary because some time slots have multiple presentations.

March 28
9:00 - 9:15        Welcome
9:15 - 9:50         Keynote: Open Source - Now and in the Future
10:00 - 10:45     Demo: Open Sourcing: From Within Your Company, For Your Company
11:00 - 11:45     Education: Working Laterally: Restructuring K-12 Education Based on Open...
12:00 - 1:00       Lunch
1:00 - 1:45         Keynote: Big Data, Hadoop and Open Source
2:00 - 2:45         Big Picture: Open Source: Licenses & Communities
3:00 - 3:45         Demo: How GitHub Uses GitHub to Build GitHub
4:00 - 4:45         Big Picture: Changing the Face of Open Identity in Ecommerce
4:45 - 5:00         Wrap Up 

March 29
9:00 - 9:15         Welcome
9:15 - 10:15       Keynote
10:30 - 11:15     Education: Some People Hate Fun: Protecting 3D Printing and Open Hardware...
11:30 - 12:15     Education: Open Source in Art
12:15 - 1:30       Lunch
1:30 - 2:15         Keynote: Let's Talk About Cloud - The State of the Industry, OpenStack and APIs
2:30 - 3:15         Big Picture: Starting a New Open Source Project: The Project Lifecycle and How...
3:30 - 4:15         *Tie between Education and Demo*
4:30 - 5:00        Big Picture: Predictions & Trends for Open Source in the Enterprise in 2012
5:00 - 5:15        Wrap Up

We are also supposed to pick three presenters to talk with during free time. Scott McNealy is an obvious choice, though he may be very busy. Dan French has an interesting position as Superintendent of Schools; it would be nice to get some insight as to how he sees public schools interacting with technology in the future. Jonathan LeBlanc also sounds like a very interesting individual. The social side of technology has always intrigued me. These are my three choices as of now, but this decision is subject to change based on presentations. If I see a presentation that particularly interests me, I might decide to spend some of my time in discussion with that speaker instead. 


Monday, March 26, 2012

Day Twenty Seven: More Work with RMH Homebase


Exercise 6.1:
This is a very simple exercise that involves adding setters and getters for employer, contact person, and contact phone variables in the Person class.
Note: This exercise does not mention implementing a "status" variable, but it is necessary for the next few exercises. I went ahead and included the variable in this exercise.

Initialize the variables:

private $employer;           // name of current employer
private $contact_person;    // name of a contact Person
private $contact_phone;    // phone of the contact Person
private $status;          // a Person may be "active" or "inactive"

Make the setters:

function set_employer ($name) {
    $this->employer = $name;
}
function set_contact_person ($name) {
    $this->contact_person = $name;
}
function set_contact_phone ($phone) {
    $this->contact_phone = $phone;
}
function set_status ($status) {
    $this->status = $status;
}

Make the getters:

function get_employer () {
    return $this->employer;
}
function get_contact_person () {
    return $this->contact_person;
}
function get_contact_phone () {
    return $this->contact_phone;
}
function get_status () {
    return $this->status;
}

Exercise 6.2:
This exercise involves updating Person's constructor to implement status, employer, contact, and contact phone. The unit test, testPerson.php, also needs to be updated.

Modify the constructor with the new variables:


/**
 * constructor for all persons
 */
function __construct ($f, $l, $a, $c, $s, $z, $p1, $p2, $e, $t,
    $bg, $in, $sh, $con, $whe, $exp, $mot, $spe,
    $av, $sch, $hist, $bd, $sd, $pubn, $myn, $privn, $pass
    $status, $employer, $contact, $contact_phone) {
        $this->status = $status;
        $this->employer = $employer;
        $this->contact_person = $person;
        $this->contact_phone = $contact_phone;
        ...
}


Include the variables in the unit test:



//I need to make an object to test. This is just dummy data.
 $myPerson = new Person("Taylor","Talmage","928 SU","Brunswick","ME",04011,
 2074415902,2072654046,"ttalmage@bowdoin.edu","applicant,volunteer,sub","no","no","no","", "", "", "", "", "Mon9-12, Tue9-12, Wed12-3", "", "", "02-19-89", "03-14-08","this is one of my notes","this is a cool note","this is another note","Taylor2074415902", "active", "McDonalds", "Ronald McDonald", 8034563452);



Test getters and setters:


$this->assertTrue($myPerson->get_employer() == "McDonalds");
$myPerson->set_employer("Burger King");
$this->assertTrue($myPerson->get_employer() == "Burger King");


$this->assertTrue($myPerson->get_contact_person() == "Ronald McDonald");
$myPerson ->set_contact_person("The King");
$this->assertTrue($myPerson->get_contact_person() == "The King");

$this->assertTrue($myPerson->get_contact_phone() == 8034563452);
$myPerson->set_contact_phone(8035467654);
$this->assertTrue($myPerson->get_contact_phone() ==  8035467654); 


$this->assertTrue($myPerson->get_status() == "active");
$myPerson->set_status("inactive");
$this->assertTrue($myPerson->get_status() == "inactive");



Exercise 6.3:
This exercise asks how set_status could be implemented in order to error check the values provided to the method. Since a valid value for status can only be "active" or "inactive", it would be easy to set up a Boolean expression for error checking.

function set_status ($value) {
    if ($value == "inactive" or $value == "active") {
        $this->status = $value;
    }
    else {
        echo (""active" or "inactive" are the only valid inputs for status");
    }
}

Exercise 6.4:
This exercise involves removing mutators that are not called in any part of the code. As is stated in the book, none of the setters for the Person class are ever called because a new Person object is created every time information is changed; however, the book suggests that we leave these methods intact for reasons that will be discussed in future chapters. All of the getter methods are called at some point in the code base.

Monday, March 19, 2012

Day Twenty Two - Twenty Six: Condensed Update

The focus this week has been on our FOSS project rather than individual assignments. There is not much to say here that is not on my group's wiki page. I can briefly mention the work that I have done individually, but four separate blog posts would just be a waste of everyone's time. This post is a condensed version of what I have been working on over the past week.

Release Candidate 2 (RC2) was released on March 2 and further refines features that were added in RC1. All of the recent changes can be tracked here on XBMC's github page. RC2 quickly fixed a few major bugs, such as video lag, that were present in RC1. It is clear that the developers rapidly respond to problems that are readily defined in the bug tracker and on the forums. RC1 and RC2 were released only a week apart. The first order of business during our first group meeting after spring break was to catch up and compile the latest release from source. A weekly release schedule can eat up a lot of our time: it takes over an hour to compile on my poor little netbook. Speaking of my netbook, Ubuntu 12.04 is running nicely, and all of my previous problems appear to be fixed with this latest update. The newest kernel includes a fix for the back light problems that most netbook users are having.

It is crazy to think about how much XBMC has changed since we first started working on this project. When I first mentioned XBMC to my group earlier this semester, I was using Dharma on my desktop. Now, we are three beta releases and two release candidates into Eden. The pace is pretty hectic, and any contributions in this project are welcome to take some of the stress off of the developers. Matt and I replied to the Xbox 360 controller bug report, and offered to help fix the problem now that it has been discovered by the developers. CrystalP asked for us to test the changes and submitted a pull request (PR) on github. Git has a high learning curve. My experience with SVN last semester was pretty straight forward, but Matt and I had some trouble figuring out how to actually implement a PR in Git. There are a couple of Stackoverflow questions and various blogs that suggest possible solutions, but there are so many conflicting answers. Cherry-pick seems to be the best command to pull in a patch from a single commit. The process is very convoluted, and, unfortunately for our group's contribution (fortunately for the entire XBMC community), CrystalP went ahead and implemented the PR. At least we contributed to the conversation and gave the bug the push it needed to be fixed for Eden.

Jason's bug was also fixed by a developer while he was looking though the code for possible solutions. I let David borrow my netbook to test more LIRC bug reports, but these reports seem to be very hardware specific. He has not had much luck replicating bugs that deal with LIRC. It is difficult to keep up with such a fast-paced community with everything else that is going on this semester. We have decided to continue working on any bugs that come our way, but we need to refocus some of our effort to areas where we can contribute more. In our next meeting, we will come up with a schedule for our poster and find a couple of important pages on XBMC's wiki that need to be updated. Much of their wiki was designed for Dharma, and they desperately need some updates in order to be ready for Eden's release. From now on, I will focus my blog posts that are not dedicated to individual assignments on possible bug fixes to discuss with my group or specific pages on the wiki that needs to be updated. I hope this condensed post is more informative then three or four scattered posts.

Tuesday, February 28, 2012

Day Twenty One: Reflection and Review

Our current assignment is to read two articles from opensource.com and blog our response to these articles.

Sebastian Dziallas' article, How to Teach Undergrads How to Become Open Source Contributors Without Writing Any Code, caught my attention because it involves a different approach to teaching open source. As a computer science major, it makes sense to include coding as part of the core open source experience in a software engineering class; however, not all contributors to open source projects are programmers. Chapter 8 in Teaching Open Source describes the importance of documentation and technical writing. There are many opportunities to contribute to these vibrant open source communities outside of the realm of coding, but it seems as though very few classes offer a glimpse into this alternate perspective.

Dziallas' Release Engineering course started as somewhat of an experiment, and it developed into a highly educational experience. From his descriptions, projects went better than expected, and students were given the chance to see Tom Callaway, the Fedora Engineering Manager, talk in person about some of the same issues that Dziallas mentioned in class. I would like to see more opportunities for people to branch out and explore the world of open source. Dziallas mentions that he has been working with Fedora since he was 16. I am only beginning my adventure at the age of 21, but I am glad to have this opportunity.


Another article that sparked my interest is Anthony Biller's A Cure for the Common Troll. I mentioned much earlier in my blog that I read tech-blogs, such as engadget and gizmodo, on a daily basis. I have not seen as much mention of it lately, but, for a while, lawsuits concerning patent infringements dominated the headlines. Samsung and Apple battled it out constantly over, what is in my opinion, trivial matters. The authors of these posts and many of the readers pointed out that this incessant bickering is a common marketing scheme to help fill the coffers when business is slow.

The trolls that Biller mentions go above and beyond the previously mentioned form of trolling. "Patent trolls," as he calls them, hold patents to technologies and manufacturing processes that they will probably never use. Some trolls make six to seven digit figures based on abusing the patent system alone. Apple has been known to patent anything and everything that they can, but the real patent trolls have no real plans with these patents other than threatening other companies and making an absurd amount of money in the process. I am not a big legal buff and do not understand all of Biller's suggested solutions, but his first solution seems to plug a major loophole in the patent system. Without vague "umbrella" patents that cover every possible domain, patent trolls would have a much harder time abusing the system.