Tuesday, May 12, 2009

Always room for Improvements and New Lessons

The journey of the Devcathlon Team, the ICS 414 class, has come to an end. Through out the entire semester, the team has been working on a project called the Devcathlon Developer Game. The Devcathlon Game is a game, for developers, based on the sensors used in Hackystat. We have built this game project from the ground up; from researching on what makes a good game, to implementing a working version for all to play. All our research and hard work has finally paid off.


A New Set of Eyes

After finalizing a beta version of the game our professor, Professor Johnson, uploaded it onto a working server for further testing. Having the game run on the server for a few days; I asked my co-workers, Joy Nishida and Bret Ikehara. Both co-workers work at Star Degree as web designers, so they’re input would be good for the game project. Following they’re viewing of the game and me explaining the purpose of the game, they gave me some really good input. Here is a list of things they thought might help improve the game and what I caught what might not be working properly:


  • On the match panel for creating a match and managing a match, it would help if the name of the matches where bold or in a different color text.

  • The match panel in Creating a Match and Match Managing section displays all matches; using pagination to minimize the size of the list, so the user does not have to scroll up and down the screen.

  • It seems that the most developer points section in the Hall of Fame is not working properly.

  • The most team wins section in the Hall of Fame is not working properly; it is displaying all the teams in a match and showing every match in the game.

  • The events in creating and managing a match have not descriptions for them.

  • The match panel in the Manage section should display only matches that the team the user is owner of, is participating in.

  • The win to lose is recording a match where both teams have negative score as loses, but should record the team with the least negative score as a win.

  • When being invited to participate in a match, it would help when the user logs in to notify that user there is an invite for a match; such as how the team invite works.



After reviewing what my co-workers had to say about the game and from what I noticed in the version running on the server; that there is still much more room for improvement. Some of the problems were solved easily, such as making match names stand out; but the other problems, with such so little time left, seemed to far to be fixed. It’s a good thing that this is an open source project, so that other programmer can maybe improve the game or implement the fixes I mentioned earlier.


Obtaining New Knowledge

Working on this project, first as a team leader then later as the project leader, has been a very good experience. Not only did I get to better understanding on how Java works, but also gained good programming habits. Programming habits such as; starting early, meeting dead lines, committing to the project repository often, and keeping testing of the code high. Also from independent researching, I learned how a web page combined with Cascading Style Sheets (CSS) and Java Script can be used to make a web page display and do really cool things.

Aside from learning good programming habits, and understand or learning new computer languages. I also obtained the knowledge to becoming a good leader and colleague. As a leader, I had to lead by example and also guide to the team to success. Its not as easy as it sounds, not every team gets a long easily. The team had its share of problems, from not communicating well to having a big ego. I as a leader had to resolve such issues and provided long term solutions so that the problem would not occur again.

Being a leader has its set back, for me it was the amount of stress it gave me. Some members would not start working on a task till last minute or would not complete a task at all, which made me nervous at times. I would pick up their slack and try to start on the task for them or finish it. Also with the stress accumulating, I would at times lose my nerve and say things to members that might offend them.


Conclusion
This whole experience, of working on the project, has been very good. I got to work with many different types of personalities, each member unique in their way, that it has prepared me for what to come in the future. It has also enlightened my comprehension of programming languages and programming habits. There are many things that I have experienced; but the main one, that seems to be priceless, is being a good leader.

Monday, May 11, 2009

ICS 499: This is just the Beginning

This semester has been a very enlightening one; I was able to work on one of the biggest on going projects in my college career and also obtain life long experiences that will come in handy in the near future. Through out the semester, I have been working on a project called the “Devcathlon Game”; which is an online game for program developers.


On the journey towards completion of the project; I have obtained many valuable new skills and experiences that, I am very sure, will benefit me in the future. Some of the new skills I acquired are; further understandings on Java, new knowledge of how Wicket works and its compatibility with other web designing languages, and learning on how to use and utilize the Yahoo User Interface (YUI). Another skill I came by on is using a new program called Dream Weaver, how it makes web designing easier to do and understand.


An experience I gained from working on the Devcathlon development team is how to be a good programmer. With what the Devcathlon’s events are based, I saw it as a must to practice the principles of those events. The experience, in my opinion that stood out, was learning to be a good leader. During the beginning of the project’s implementation, I served as Team MS’s leader; which consist of Daniel Arakaki, John Ancheta, and John Zhou. Having these three team members, made managing the team easy; because each member did what they were told to do and were dedicated to finishing a task on or before its dead line. I also worked with another person that is apart of the overall development team; Anthony Du, who was the leader of Team UT.


Towards the end, the project leader, John Ancheta, had to step down from his position; due to personal issues. Seeing this as an opportunity to step up, I took the vacated position. Managing three members to managing the whole project, which consist of 7 members, was very difficult. I had to over see both team’s issues, resolve any conflicts between members, and also to implement my part of the program. The experience I gained from being a team leader, a project leader, and picking up leadership in the middle of a project is having good management and self control.


Every project in production has problems; from these problems is where I gained those new skills and experiences. At times some members wouldn’t do their job on time which would slow process of development, so I would either set a concrete deadline or talk to that member. Another situation was when a member of the project was not communicating with the others and made major changes to many files without notifying anyone. A majority of the members in the project had tension towards that member that made changes. I as the leader had to stay neutral, resolve the conflict between the members, and come up with a solution so that the same problem would not occur again.


Being a project member, a team leader, and a project leader has been very educational. I learned on what it takes to be a good leader, to always be open minded to new ideas from others, and to be a dedicated/hard worker. With the new skills and experiences in my pocket and starting a new journey in life, this is just the beginning of things to come.

Sunday, May 3, 2009

ICS 499: Beta versions always have problems

This past week marked the climax peak of the mountain for the Devcathlon development team. We accomplished a majority of the Devcathlon system, from creating a team to a full functional scoreboard. We presented our accomplishment to our professor, Prof. Johnson, and got his approval for a test run.


Following the presentation, the class discussed of what steps to take next. As class leader I proposed the same idea Prof. Johnson had; which was to fix some last minute detailing and have him upload the system to the test server. Later once the Devcathlon is up and running, test some of the functionalities. The class all agreed to the proposal of the next step and also agreed to begin writing the developer and user wiki documentations for the Devcathlon Project Page.


When I received an email from Prof. Johnson that Devcathlon was installed and running; I immediately precede to the test website (Devcathlon Test Server). I quickly logged in and created a team, then waited till the next for the other members of the class to log in and join a team. Once everyone was settled with logging in and there was two teams in the system; I next tried to create a match and “BANG” nothing happened. Of all parts of the system not to function, my part, the creation of matches between teams.


Trying to narrow down the problem was kind of hard with out any console output. I then emailed the professor requesting him to send me what the program was printing out to the console on the server. In his reply, the console output printed that there was an invalid value for the hour field. I had a feeling that it might be the date inputs, due to how I wrote the method to handle those inputs. I wanted the user not have to worry about inputting anything other than a date, month, and a year. The crazy thing is that we, the Devcathlon Development Team, are able to create matches on our local machines.


Over the past few days I rewrote the method that handles the input dates; not to pass in a static 24 hour, but to use the hour the user creates the match. Hopefully that will solve that problem, and no other functional problems will occur down the line. These things are expected to happen, since Devcathlon is still in its beta phase.

Monday, April 20, 2009

ICS 499: It’s not easy being King

For this past week on the Devcathlon journey to success, I was recently appointed leader of the class. Being the leader of the class project is never easy; I was recently the leader for Team MS, which consisted of 4 members including me. Now as the class leader I will be over seeing 7 other people.


Delegating the work

From leading 3 members to 7 members was a real hard job; at first I took it as a good opportunity to step up, and I had planned what and where everyone will be working on. I distributed the tasks and got approvals from the two team leaders, Anthony and Daniel; also everyone acknowledge what they were to do. Since Anthony’s team was mostly finished with they’re part of the system, I decided to pair a member of Anthony’s team with a member in Daniel’s team. So with everyone having a task to complete and everyone teaming with each other, I thought things would get finished faster.


Issues

During the week some issues occurred, mainly the lack of communication. One part was due to a member of the class rewriting parts of a file, which another people were working or dependent on. This cause a lot of conflictions when uploading files that has been worked on into the repository. I tried to solve this dilemma by sending out an email to the class saying, “If you are going to rewrite someone else’s file, please notify that person”, in efforts to have better communication between members. Some people actually followed what the email said to do and some didn’t.


Another problem that happened was when a person broke the Continuous Integration build, that person at times would not fix it right away. The Continuous Integration is like our traffic light; unless that light is green the project can not move along, and if it’s red everyone slows down or stops until it is green again. The last problem that occurred in my first week as the leader was people taking to long on accomplishing something. When I assigned the tasks for members to do, I also assigned an expected time for that task to be accomplished. For things that should only take one night of work, it ended up taking 2 – 3 nights of work. I tried to stay on their backs asking, “When will it be done?” and “We need your stuff working now”. Eventually they got their task done, but behind schedule.


Conclusion

My reign as the leader has been a tough week; not only do I have to worry about my tasks to do, but worry about others finishing their parts as well. I also learned from this past week experience that the team should communicate better, and I highly recommend pair programming; because you have an extra pair of eyes to help you and it’s always good to get a fresh perspective. As the leader one thing I was open to do, was to listen to everyone’s frustrations towards other members in the class. Listening to other’s inputs about other members helps me see who would be best paired up together and what should a person do in the project. The hardest parts for me though, is maintaining a neutral aspect towards everyone in the class; Wow its not easy being the King……

Monday, April 13, 2009

ICS 499: Road to Redemption

After a gruesome past week of our class’s previous implementation of the Devcathlon, we were finally making really good progress. Development started moving along when two members of the class, who were assigned to implement the initialization file, finished and instructed the rest of the class members on how to use that file.


The part of the Devcathlon I am in charge with is the Match Manager, which has the ability to create a match and reconfigure matches already in the system. With the help of initialization file, I was able to retrieve most of the data needed within the system; data such as, teams the user is owner an owner of, the user’s opposing teams, and a list of events related to the match. Everything was moving along fine until I realized that I did not only need a list of events that a match has, but also the list of all the events that are in the system. I haven’t overcome this problem just yet, I have been researching on ways to pull up all the events in the system.


I also saw that in order to create a match, the user must enter an end date for that match. The end date is in a format called the XMLGregorianCalendar; which looks like “1969-07-16T00:00:00”, Year-Month-DateTHour:Minutes:Milliseconds. Having the user to enter a date in that format seems unfriendly; so rather than using the unfriendly format, the user would enter the typical Month/Date/Year format. I haven’t quit figured out yet on the parsing of the end date input, all the approaches I took seem to have crash the system. The simplest way I got it to work was having three different input fields, one for month, one for date, and one for year; but still seemed a little lame having three input fields instead of one.


For this new week of development, I look to solving the list of events problem and the end date problem for a match. I also look to implement a way to retrieve the description of each event and have it display on the web interface. The road to accomplishment seems so far yet so close, but for now this is our road to redemption in the eyes of our client.

A match's configuration page.

Creating a new match page.

Monday, April 6, 2009

ICS 499: What is a leader?

This week on the continuation of the Devcathlon, the teams faced a major reconstruction.  The class leader, John Ancheta, pitched an idea to the team leaders, Anthony Du and I, of concentrating most of our efforts to producing the scoreboard for the Devcathlon.  John explained to us why we should put our efforts on to the scoreboard and temporarily abandon what other members have been working on.  He made a lot of sense and we both agreed to this idea. 

 

I have to say with all members throwing in ideas to improve the look of the scoreboard helped, plus we all saw what parts of the Devcathlon related to each other.  For instance the scoreboard would derive its information from the matches and teams section.  With everyone’s mind set on making the scoreboard, we all lost focus on the true goal for this week’s accomplishment, which was to get real data to display. 


John proposed this idea to our professor, which plays the role of our client, and the result was a “NO”.  With the disapproval of everyone working on the scoreboard, everyone simply continued working on their respective sections.  Through the week, Anthony presented to the class a very good idea of using wicket panels; using this feature would save time in designing new sections of a page and help organize pages better. 

 

Conclusion

I have to say that it’s been a busy week for everyone, especially for the leaders; but that’s no excuse.  We should have been on the ball more, a lot of the work was done late into the week; because of our scoreboard idea wasn’t pitched to our professor earlier.  With the disapproval late into the week not a lot of things were done.  I as a team leader will take the blame, I should have assigned tasks for members to do while we wait for the approval.  All we can do now is pick ourselves up and “Keep moving forward” (Walt Disney).

Monday, March 23, 2009

ICS 499: Wicket, CSS, and JavaScript

This week I finally get to implement all the web features I have been researching and practicing in creating, into the Devcathlon.  Not only do I get to use my web programming knowledge, I also get to practice my leadership skills by becoming the team leader.  I will be leading Team MS, which consist of John Ancheta, John Zhou, and Daniel Arakaki.  Our team will be charged with implementing the Matches and Scoreboard sections of the Devcathlon. 

 

As I mentioned in my earlier blog, that I implemented the Expand and Collapse feature into the Scoreboard Manager section.  A big problem I had when implementing this feature was that the Devcathlon uses wicket, which some people would say is an alternative to JavaScript.  The page, Scoreboard Manager, I am working on is a child of a base page.  So when I was adding in the JavaScript and CSS into the User interface part of the system, I wasn’t sure where to add it; to the base page or to the page I was working on.  So I took a chance and added the files to both pages. 

  

At first no changes appear, no part of the feature I was implementing showed.  After hours of thinking and tracing CSS tags, I finally figured out what was causing the problem; it was a CSS BODY “class” tag,  My original development of the Expand and Collapse did not include wicket, so it was using the body as a container; but, with wicket the body was established only in the base page.  So with out causing any harm to other team members or to the other teams mock up implementation, I used a DIV tag as the container. 

 

Once the whole container problem was eliminated, finding which file to add the CSS and JavaScript too was no problem.  It actually, as I thought, belonged to the Scoreboard Manager page.

  

Conclusion

Incorporating CSS and JavaScript into wicket child seemed like an easy task, but for me it was mind bending; another problem I took lightly.  Now I know what to look for and where it would be; if it’s a CSS problem, using Dreamweaver really helps to finding what to change.  I also still have many features in my web arsenal, such as the slider bar and tooltip.  Those features, I know, will be used somewhere down the line in the development process.  

A common goal

This week the class has finally started on the first mile stone development of the Devcathlon, a game which we have been designing since the beginning of the semester.  The class was split into two teams; one handling the User and Team sections (Team UT) of the game, the other handling the Matches and Scoreboard section (Team MS).  I am a member and team leader of Team MS, which also consist of John Ancheta (Class Leader), John Zhou, and Daniel Arakaki.

  

For our team, we split our sections into two; having two members tackling a section.  I, along with Daniel, will be handling the Scoreboard section.  After having an initial meeting, on March 20th, of the leaders, Anthony Du (Team UT), John Ancheta (Class Leader), and I; we all decided, since the a deadline of having something to show our professor was approaching early, to create a web mockup of all the sections and sub sections. On Saturday, the 21st, I immediately informed the rest of the group of the plan. 

 

Issues:

Add match to scoreboard

Delete match from scoreboard

 

Note: These two issues relate to the same page.

 

Packages:

 

Scoreboard Manager

 



The Scoreboard section, I was in charge of implementing the Scoreboard Manager section.  I took this opportunity to finally show some of the JavaScript and CSS I’ve been working on for my ICS 499 course, which all relates to the development of the Devcathlon. 

 



It took me quit awhile to implement the Expand and Collapse feature, at first having trouble adjusting the positioning of parts to the middle of the screen.  Using Dreamweaver helped a lot to narrow done which part I had to adjust, also what CSS file to edit.

  



Going back and forth, from using Dreamweaver to using Eclipse, a lot of my development time was not picked up.  Development time is only recorded in Eclipse using the Hackystat sensors. 

  

Conclusion

I have to say this web mockup really looks good, from members of both teams.  I know were in for a rough ride, once we start implementing all the java.  It’s a good thing both teams are willing and ready to work towards this immense common goal.

Monday, March 16, 2009

ICS 499: Wanna see my Calendar?


This week I have taken a further step into learning to use Dream Weaver and the Yahoo User interface.  In my other class, ICS 414, we for the past week we have been implementing the web user interface for our project, the Decathlon.  I recently remembered something my professor said about the user interface, “It would be cool to have a calendar, where you can select a date”.  With what he said in mind, I proceeded to learn on creating a calendar for the Dev-UI (Devcathlon User Interface).

 

Using Dream Weaver to implement a page was hard at first, but with a lot of help from online video tutorial by users on You Tube, everything ran smoothly.  When I used Dream Weaver to open up an example calendar from the YUI package, it easily traced   all the CSS and JavaScript that was being imported into the page.  With the tracing made easier, I was able to extract what I needed from the package and upload it to a Google Project page I made, “Dev-UI-Test”, instead of uploading a the huge YUI package.  I also uploaded my own implementation of the YUI tooltip into the project page as well. 

  

The calendar.

The calendar can be useful in the Devcathlon when; the user wants to select a time interval for a match or view events that have happened in a match, the user would then click on the button and a calendar pops out.  The user would then select a date from the calendar and hit the select button; the date would automatically fill in the date text box. 

 

The calendar idea is pretty useful, in ways of helping the user and making the interface look cooler.  Also using Dream Weaver cut my work in half by helping me find what exactly I needed.  I tried to create a test server through Dream Weaver; but it seems I need an add-on from Adobe, which I’m still trying to get a hold of from a friend.  Right now a lot of the things don’t work when it comes to processing the inputs, but stay tuned into my project page for some useful YUI widgets.  Next over the few days, I’m going to try to implement the slider bar and display the increments of the slider bar’s position.  Till next time…….

Put it on my TAB


This week the class has taken its first dive, for the semester, into using the wicket framework.  In our previous semester, during our last project, we took a head rush into learning the Java Wicket framework; so this was just a simple refresher.  A long with the memory jogger of wicket, we were also given the task to learn some more CSS and HTML editing techniques. 

 

The Tasks

Our professor has given us pre-written HTML and CSS pages that contain menu tabs and submenu tabs.  The pages were split into two groups, one being written statically in HTML and CSS, the other was using the wicket technique.  Our first task was to add a new menu tab, along with 3 new submenu tabs; in both groups.  This task was easily done; only adding a few lines of HTML code, which basically mimicked code that was pre-written for menu 2.  It was also easily done thru wicket adding a few lines of JAVA and HTML code.

 

HTML CODE:

<li id="nav-3"><a href="test-menu3.html">menu3</a>

            <ul id="subnav-3">

      <li><a href="test-submenu1.html">submenu5</a></li>

      <li><a href="test-submenu2.html">submenu6</a></li>

      <li><a href="test-submenu1.html">submenu7</a></li>

    </ul>

  </li> 

WICKET CODE:

HTML for menu 3:

<li id="nav-3"><a wicket:id="Menu3Link" href="#">Menu3</a>

            <ul id="subnav-3">

                        <li><a wicket:id="SubMenu5Link" href="#">SubMenu5</a></li>

            <li><a wicket:id="SubMenu6Link" href="#">SubMenu6</a></li>

            <li><a wicket:id="SubMenu7Link" href="#">SubMenu7</a></li>

          </ul>

</li>

JAVA code for menu 3 and  submenu 5

add(new Link("Menu3Link") {

      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to FormPage. */

      @Override

      public void onClick() {

        setResponsePage(new Menu3Page());

      }

    });

    add(new Link("SubMenu5Link") {

      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to FormPage. */

      @Override

      public void onClick() {

        setResponsePage(new SubMenu5Page());

      }

    });

New menu and submenus

The next task was then to add 10 submenus, instead of just 3 submenu tabs. 


The next task was to doodle with the CSS positioning of the submenus, for this task I mainly used the static HTML group of pages.  What I first learned that the positioning was absolute, which made it bound to its coordinates.  So when you change the size of the header, in the example its labeled “Example 5”, the submenus are at a fixed position. 


Absolute positioning with a different sized header.


I attempted to try to change the positioning from absolute to relative, changing the positioning meant also changing the coordinates also.  I also changed the display settings from inline to block.  At first it looked like it worked but I then saw that there was a gap between both the menu 2 and menu 3 tabs.  

 

CSS CODE:

body.section-1 #menu ul#subnav-1,

body.section-2 #menu ul#subnav-2,

body.section-3 #menu ul#subnav-3,

body.section-4 #menu ul#subnav-4 {

            display : block;

            left : -152px;

            position : relative;

            top : 20px;

}

Using the relative positioning, but with a flaw.


The final task was to improve the look of the menu and submenu tabs.  To do this, we were to make a selected menu item’s font bold and also the selected submenu item.  After researching through the internet for possible solutions, the only easy fix I found was to use the link active property.  The active property meant that when a link is active, that link would then take the CSS properties along with it. 

My first attempt on using the active property only made the link bold when it was clicked, then the boldness would disappear.  Proceeding a few hours of contemplation, it seemed the solution was to make an active class for the links.

 

CSS CODE:

#menu a.active {

            font-weight: bold;

}

HTML CODE for menu 2:

<ul id="menu">

  <li id="nav-1" ><a href="test-menu1.html">menu1</a></li>

  <li id="nav-2"><a href="test-menu2.html"  class="active">menu2</a>

    <ul id="subnav-2" name="subnav-2">

      <li><a href="test-submenu1.html">submenu1</a></li>

      <li><a href="test-submenu2.html">submenu2</a></li>

    </ul>

  </li>

HTML CODE for submenu 1:

<ul id="menu">

  <li id="nav-1"><a href="test-menu1.html">menu1</a></li>

  <li id="nav-2"><a href="test-menu2.html"  class="active">menu2</a>

    <ul id="subnav-2">

      <li><a href="test-submenu1.html" class="active">submenu1</a></li>

      <li><a href="test-submenu2.html">submenu2</a></li>

    </ul>

  </li>

Bold selected menu item and submenu item.


Conclusion

This task was a good refresher to the wicket framework and a good workout to our CSS and HTML knowledge.  There was a lot of copying and pasting of code, which made a lot of it redundant.  Overall this was good trick, making tabs through CSS and HTML alone.  I'm not to sure if i would consider some of the task done, but I know i did finish implementing the new menu and submenu tabs, along with improving the look task.  Adjusting the positioning of the tabs taskI did not finish, but came close and found the flaws. I’m pretty sure that there is a way to do this, without making the mistakes I got; maybe if we grouped the menu div outside of the body, but that maybe to advanced web editing for us.  

Here is my copy of the Example 5 wicket, html, and css implementation.

Monday, March 9, 2009

ICS 499: Playing with a new Toy

For my ICS 499 independent studies class, I’ve been working on the Devcathlon web user interface.  In the past weeks I’ve been reading up on incorporating JavaScript, the Yahoo User Interface (YUI), and Ajax with web pages.  So far it’s been a rough independent journey diving into these languages and widgets, without any guidance or knowledge what so ever. 

  

During this past week I have recently obtained a copy of Adobe Creative Suite 4, to help with the web user interface development.  For the past few weeks I have been using either textpad or eclipse to do most of my code editing.  These IDEs (Intergraded Development Environments) aren’t bad to use, but I needed something better.

 

Using Dreamweaver CS4, you can use the split view to see both the HTML page code and the actual page; instead of having to switch from window to window, unless you have multiple screens.  With this split view capability, you’re able to get a glance of the changes you make to the HTML, JavaScript, and CSS codes.  Also in the actual page view, when you click on an item on the page, the piece of code that handles that item is instantly located; beats scrolling up and down lines of code. 

 

There are more features of the latest edition of Dreamweaver, such as inserting items.  When you insert an item into a page, Dreamweaver creates the code for the user; making web implantation easier.  Plus the JavaScript behavior for that item is also written for the user. 

  

Inserting a jump menu item into a form, and adjusting it's settings.


The jump menu added to the page.


There is still much more learn on how to harness this powerful web editing tool. Adobe has published web tutorial videos to help on using Dreamweaver, along with more online tutorial forums.  My next mission in using Dreamweaver is on how to set up a test server and incorporate external widgets, such as YUI. I’m pretty sure there are a forums that instruct me how to do this.


Sunday, March 8, 2009

A Better Understanding

Intro

This week we, the class, continue with the development of the Devcathlon Events.  Just like the previous week’s assignment, we were all given an event to implement; but this time we would be working in groups of two. 


The Task

I was teamed up with Philip to build the event named “Keep the Repository Clean”.  Here is our event description:

Keep the repository clean

Summary: Penalize (or award) developers for committing code that fails (or passes) a continuous integration build.

This event requires that Build sensor data is generated from the continuous integration server, and that CI build sensor data has a special property associated with it (such as Type=continuous.integration). This is to distinguish continuous integration Build sensor data from local builds (for which frequent failure is to be expected.) Note that the specific tag to be checked for could be a configurable property for each match.

PAR-1: Wakeup every 60 minutes. If there is any CI Build sensor data that does not have a successful Result type, then assign -5 points. Note that you get a deduction of a maximum of -5 points no matter how many times you fail the build during the interval.

Rationale: If you commit code that fails the build, you shouldn't be penalized further for any additional commits you make trying to fix the failing build as long as you do them right away (within an hour of the original failing commit). However, if you wait more than an hour to try to fix it, then you should incur additional penalties.

PAR-2: Wake up every 1 day. If there are successful CI Build events during that day, then assign +5 points.

Rationale: Reward developers for passing continuous integration builds. Note that this is relatively easy to "fake", as there is no verification in the design of this PAR that any actual work was done before kicking off the build. We could look for threshold churn values to ensure that there was nontrivial editing, at least.

For this event we were able to split it up into two sections; one being for Par-1 and the other being for Par-2, I was in charge of implementing Par-2.  Making Par-2 at first was not so difficult, being that it was just like the previous event I developed.  The similarity of this event, with my previous one, was that I was obtaining data from the daily project build; the difference was I also had to get data from the daily project commit. 

 

Problems and Fixes 

Getting the data from the daily project build was easily obtained.  I simply copied lines of code from my previous file to get the data.  Then when implementing the code to get the commit data, which is similar to obtaining code for build data, I hit a brick wall.  For some reason I was not able to get any sort of data.  

After hours of trying to get hold of the data and reviewing the hackystat component documentations; with no avail, I was not able to find a solution.  I decided to get external help, from other members of the Devcathlon development team by posting a topic in the devcathlon-discuss group; there you can see all development issues that have arisen in our journey to completion. 

With posting a topic on the discussion board and uploading a file for the members to see what was happening, the solution came within hours.  The problem was solved by John Ly; he saw the method of making commit data was missing a property.


The makeCommitData issue I had:

protected void makeCommitData(User owner, Project project, XMLGregorianCalendar timestamp)

  throws Exception {

    String host = getSensorBaseHost();

    String email = owner.getEmail();

    SensorBaseClient client = new SensorBaseClient(host, email, email);

    SensorData data = new SensorData();

    data.setOwner(email);

    data.setTool("Ant");

    data.setSensorDataType("Commit");

    data.setResource(users + project.getName() + foo);

    data.setTimestamp(timestamp);

    data.addProperty("linesDeleted", "10");

    client.putSensorData(data);

  }

The chunk of code, above, was missing the line “data.addProperty(“linesAdded”, “10”).  Once John had pointed that out to me and uploaded a new file to resolve my issue, I had another minor setback in my development.  From the commit data I was also trying to get the sum amount of lines added and deleted, in other words the amount of churn made. 


The issue of getting the amount of churn from commit data was easily resolved by creating a new makeCommitData method which takes in lines added and deleted as inputs (parameters) as well. 

The new makeCommitData method:

protected void makeCommitData(User owner, Project project, XMLGregorianCalendar timestamp,

      String linesAdded, String linesDeleted) throws Exception {

    String host = getSensorBaseHost();

    String email = owner.getEmail();

    SensorBaseClient client = new SensorBaseClient(host, email, email);

    SensorData data = new SensorData();

    data.setOwner(email);

    data.setTool(ant);

    data.setSensorDataType("Commit");

    data.setResource(users + project.getName() + foo);

    data.setTimestamp(timestamp);

    data.addProperty("linesAdded", linesAdded);

    data.addProperty("linesDeleted", linesDeleted);

    client.putSensorData(data);

  }

Along with creating a new method, I also had to make a small minor change to avoid a PMD error.  Apparently PMD does not like it when you use the same thing more three times in a row, in my case was the string Ant.  So I resolved this by making a variable and having each method that used string Ant, refer to the variable I made.  With all the issues resolved I was able to finish my part of this event implementation a head of schedule. 

 

Conclusion

Unlike my previous works, I started this one as soon as possible.  Also my team, Philip and I, were fortunate that our event had a big resemblance to our previous events for the Devcathlon; which made things easier on us.  The only major setback I had, was not being able to get commit data.  Before getting the resolution; I had added the line of code which would fix the problem, but commented it out.  I guess I was afraid of tampering with that section of the code, but good thing I got a second opinion from John.  After viewing more parts of the system, I now have a better understanding of things.  

Saturday, February 28, 2009

Starter Events: The Ride of a Lifetime

This week we, the class, were entrusted with an extension to finish implementing the events of the starting events for the Devcathlon.  There are ten different starter events; I was chose to create the “Everyone Builds” event.  

Event Specifications:

Summary: Give points for everyone building.

PAR: Wakeup once per day. Determine if everyone built at least once during that day, and award 10 points if everyone built. Award 0 points if at least one person built, and deduct -10 points if no one built.

 

Decay/Incentives: Award 10 bonus points for 7 straight days with everyone building every day.

 

This event seemed easy to do when I first read about it, to be honest I took this assignment very lightly.  I procrastinated at first; thinking, from the previous assignment, since I read most of the documentation and understood it.  So when I started to implement the event, I was shocked.  It covered things I never read about.  I was at a loss, but I couldn’t give up.  Unfortunately, on the due date, I could not complete the production of the event; then a miracle happened.  Our professor, seeing that a majority of the class did not complete the other events, extended the dead line. 

With an extended dead line, it was time to redeem myself.  After taking care of some personal obligations; I charged at the assignment, as if it was a 10 ft. wave without hesitation.  Even though with some helpful notes, provided by our professor, this wave was still pounding the life out of me.  With some support from my other peers, Daniel and John Ly, the wave didn’t seem so big. 


Wipe out

One part of the wave that kept pulling me under, was finding data for every member in the team.  It took sometime, reading of the documentation, and helping from others; but I eventually over came that problem.  Then when I though I was in the clear, and BOOM! A huge error occurred, and it seemed a lot of people in the class were getting the same problem.  I isolated the problem, and it was when I tried to pull data from a day ago.  Later our professor addressed the problem and created away to grab data from a day ago, without getting the error.  (All the events that occurred during the development)

 

Getting a Lifesaver

Once that whole error issue was out of the way, all I had to do was ride that wave back to shore. Following the resolution, on my testing of my functions to decide whether to give bonus points, just regular points, or no points at all failed.  After long hours of thinking, it finally came to me at 4 AM; talk about a wake up call.  I noticed when a user or users produces data in day it is recorded; and being able to get access to the recorded data, I was able to find the amount of user or users.  Implementing a way to get that data, all my test cases started worked without any failures or errors.


 Conclusion

One thing I’m really upset about, is that I took this event lightly.  I know I could have finished this implementation days before the extended date, instead of hours; but like a friend of mine told me, “Learning a complex new thing takes time, so approach it prepared”.  Remembering that, like my wave analogy, I shouldn’t have procrastinated and rush into the assignment untrained.   Also I’m not to sure of the consistency of my way of getting the number of users for the day idea, but I’ll be sure to look further into it over the upcoming weekend.

Wednesday, February 25, 2009

Devcathlon: Creating the events

This week we continue the development of the Devcathlon game, we were assigned with implementing the starter events for the game. The event i chose to program was the "Build Everyday" event. This event will check if each team thats participating in a match and look at each team member within those teams, to see if everyone has done a build for the day. If no one has built, the team is deducted points; if everyone has built at least once that day, the team receives points; if only one person of the team built for that day, there will be no distribution of points; and lastly, if the team has a consecutive 7 day build streak, then the team is awarded bonus points.

I had a lot of trouble implementing this new event, one of the biggest was checking for the seven day streak. I never got to fully test my bonus method; during the last minutes of the assignment, things just didn't want to work anymore. Also another problem was, I lost track of finding more than one team members build data. I haven't completely solved this problem yet; I have written steps to find each member, but i just need to find the right methods within the Devcathlon.

Conclusion
This was a very challenging and complex assignment. Complex, not in the file i implemented, but complex in the size of the entire program. Also i should have uploaded my code more often, but I was always afraid of breaking the build on the Hudson server, which checks our file for errors. This has been an overall good experience and I will continue on the completion of my event, just need to work out the fixes for the bonus and finding each members build data.

Screen cast
The screen cast the professor has provided for the Hackystat and the Devcathlon are great. I can download them and always refer to it when I forget how to retrieve different types of sensor data. The only problem I see is when a line of code runs off the screen, I would have to try to guess what it is; but the good thing is, I can always rewind it to hear him explain what he's typing out. I wish to see many more tutorial screen casts.

Wednesday, February 18, 2009

A taste of Java from Hackystat

 This week we finally got to get a taste of Hackystat, and it taste a lot like Java.  The class was given the task to create two simple functions to retrieve data from the hackystat server.

 

For our first task, the java function was to retrieve sensor data for everyday of November 2008.  At first, I presumed the task to be a fairly simple, with the help of our professor’s web cast video tutorials. Later when coding the function, I hit a brick wall; having trouble getting to the month of November, for data retrieval.  I later then broke down that wall by just basically inputting the XMLGregorianCalendar date statically for a start date. 

  

Just when I thought when I was in the clear, I fell in a ditch; I couldn’t get the correct data I wanted from the server.  I then proceeded to read the Javadocs for the Hackystat program.  Spending hours and hours of reading through the documentations, I finally burned out my eyes.  After taking a break from reading and staring at code, the answer just occurred to me.  Having input the start date statically, I just simply ran a loop with the number of days in November and statically inputting those days in the start date.  Finally all the data showed for each day of November, and also for the second part of that task; the total for the month of February 2009.

  

The second task was to retrieve sensor data from the server, just like the first task; but the catch was to have a user input the desired month and year.  I wasn’t able to accomplish this task, due to having been stuck for so long on the first one. 


Wow, the hackystat program is bigger than I thought.  Unfortunately I wasn’t able to finish the second task, as I mentioned earlier.  I spent much of my time on reading the program documentations to resolve the first task.  I was looking in all the right places, but not thinking out of the box.  I guess that can happen when you stare and think of the same problem for to long.  A professor once told me “even Einstein needed a break”.  The good thing from looking over so much of the documents was learning more of the internal functionality for the program.  This teaches me a lesson though, not to slack off or take a simple task so lightly, and to take a break when needed. 


My code for task one:




import java.math.BigInteger;
import javax.xml.datatype.XMLGregorianCalendar;
import org.hackystat.sensorbase.client.SensorBaseClient;
import org.hackystat.sensorbase.resource.projects.jaxb.ProjectSummary;
import org.hackystat.sensorbase.resource.sensordata.jaxb.SensorDataIndex;
import org.hackystat.sensorshell.SensorShellProperties;
import org.hackystat.utilities.tstamp.Tstamp;

/**
* This class will retrieve data instances from the hackystat server for everyday in the month of
* November 2008. Also will retrieve the total of data instances for Feburary 2009.
*
* @author robin
*/
public class DailySDI {

public static void main (String[] args) throws Exception{

String host = "http://dasha.ics.hawaii.edu:9876/sensorbase";

// get user info
SensorShellProperties properties = new SensorShellProperties();
String user = properties.getSensorBaseUser();
String password = properties.getSensorBasePassword();

SensorBaseClient client = new SensorBaseClient(host, user, password);
String project = "Default";

System.out.println("===Data for November 2008===");

for (int i = 1; i < 31; i++) {

// Set start and end time stamp for november
String startTime = "2008-11-0" + i +"T00:00:00.000-10:00";
String endTime = "2008-11-0" + i +"T24:00:00.000-10:00";
XMLGregorianCalendar start = Tstamp.makeTimestamp(startTime);
XMLGregorianCalendar end = Tstamp.makeTimestamp(endTime);

// Retrieve data instances from hacky stat for specific days
ProjectSummary summaryNov = client.getProjectSummary(user, project, start, end);
BigInteger totalNov = summaryNov.getSensorDataSummaries().getNumInstances();
String dateAndTotal = String.format("%s/%s: %s", summaryNov.getStartTime().getMonth(),
summaryNov.getStartTime().getDay(), totalNov);
System.out.println(dateAndTotal);
}

// set start and end for feburary
XMLGregorianCalendar febStart = Tstamp.makeTimestamp("2009-02-01T00:00:00.000-10:00");
XMLGregorianCalendar febEnd = Tstamp.makeTimestamp();

// get sensor data for feburary
SensorDataIndex febData = client.getProjectSensorData(user, project, febStart, febEnd);
int febDataSize = febData.getSensorDataRef().size();
System.out.println("Feburary 2009 Data Sensors: " + febDataSize);
}
}


Monday, February 16, 2009

ICS 499: Learning the Yahoo User Interface

In my efforts to improve the web user interface for the Devcathlon, I have spent an extra amount of time on researching the use of Java Script.  There are a number of things I want to implement onto the user interface; but as a novice in web scripting, I will have to take small steps.  As I mentioned in my last blog, I have been researching on inserting a progress bar and a pop up box (Yahoo UI tooltip).


Have you seen my Tooltip

After downloading the YUI package from Yahoo, I realized I was in for a long ride.  The package was filled with a lot of useful and complicated things.  So as I searched for an example of the tooltip, that’s located in the container folder and apart of the container class.  It was fairly simple to understand what was going on; basically when the mouse is hovered over a specific item on a page, a pop up box will appear with text inside.  There is a simple HTML attribute that will do this as well, the “alt” attribute.  Unlike the “alt” attribute, what the YUI tooltip with the Java Script does is; the programmer can not only set the inside text, but also set how long the pop up box will appear and disappear. 


Also the inside text messages can be set by a Java Script function, where it becomes more dynamic.  One way I saw the dynamic text messages was at my work place, Star Degree’s website.  Setting the pop up box with dynamic text messages gets more complicated.  The programmer would have the Java Script function access a database with all the information; this is where AJAX and Java Script inter twines with each other.  Another cool thing with the YUI tooltip was setting some CSS to make the pop up box to your liking. 

 

 

This tooltip has round corners, this was possible by manipulating the CSS and adding in the corners into the CSS folder. 


Finding a progress bar

Another improvement to the Devcathlon user interface I researched on was a progress bar.  When I Googled some examples of a progress bar, the results given was not what I wanted.  Many of the examples showed a download progress bar, but what I wanted was actually a page loading image.  An image that would appear when an action was made, like after pressing a link, then disappear when the page for that link was done loading. 

 

After hours of researching, I found that YUI also has this feature; but was called a loading panel, also apart of the container class. The loading panel not only shows the animated loading image, but also grays out the web page.  When I was done looking at the YUI loading panel example and narrowing down what was needed, I proceeded to implement my own version.  After many attempts to have a web page load just like the example did, nothing worked.  I then assumed that the web page that uses the loading panel must be on an online server.  My assumptions were correct, I test this by loading a web page onto my works server and everything worked. 

 

Conclusion

I realized after researching these two web page improvements was not easy at all.  A good thing I found was the Yahoo UI has many great features to use for a website, and a good API to make researching easy.  Also a lot of the hard Java Script is pre-written; a programmer can also add in new Java Script functions to work with the YUI.  In an effort to possibly write and understand, Java Script and YUI; I have obtained a copy of these two books “Learning the Yahoo User Interface” and “Head First JavaScript”.  Both books were highly recommended by one of the web programmers from my work.  

Monday, February 9, 2009

ICS 499: Taking my first step into Java Script

In my ICS 414 class, I will be participating in developing a game called Devcathlon.  The Devcathlon is a game that will help programmers gain good programming habits, by the help of the hackystat system.  The hackystat system uses sensors, which are installed into the programmers system, to follow what the programmer does.  So, also for this semester, I am taking ICS 499, which is an independent study course.  I will be using the Devcathlon game as a guide for my 499 course. 

 Learning to Walk

During the first and second development stage of the Devcathlon game, the class has been working on creating a web user interface.  So far the interface was fairly simply, the class mainly worked on creating possible event and concepts for the game and not really focusing on the look of the interface.  As a part of my 499 class, I chose to help “beef up” the interface. 

 

At first I looked at what everyone contributed to creating pages, so far the only thing that made it look really good was the tab drop down menus.  So as I observed, I thought of adding in a collapse and expand feature.  Initially having only a little knowledge in web programming, I only knew a few html tags, this task seemed difficult.  I researched on the internet on how to implement this new feature, and the results I got was to learn Java Script.  After reading through the w3scools tutorial website, I had a better understanding on what the code meant and did. 

 

I continued on my search for this new feature, this time with some java script knowledge. In which I found a good example in a forum, called webmasterworld.  In here I found what I needed to implement the collapse and expand feature.  After tracing the coded the forum provided and a few foul ups, with inserting the code into the Devcathlon pages, the feature finally worked. 

Web page when not expanded

When expanded.


Conclusion

During my research for this feature I found a very useful tool, called firebug.  Firebug is an add-on to the Firefox web browser, and helps web developers trace the code in a section of any website.  This tool will be very useful to find the next feature I will be looking to implement into the Devcathlon pages.  My next feature will be either one or both; an on load progress window or bar, and using Yahoo’s user interface widget tooltip feature.