Tuesday, March 24, 2009

ICS 499: Scoreboard building

Introduction
The Devcathlon implementation continues and will consume my blog until May. I have taken charge of Decathlon's Scoreboard and the design is going slower than I expected. My knowledge with html and css design is limited but is getting stronger with the development of Devcathlon.

The Scoreboard
The scoreboard UI is simple in design, not too many elements that take up the screen. The left third of the page contains overall Devcathlon information.
  • On going match scores.
  • Links to Match breakdown(to be added later).
  • Team information.
    • List of team members.
The rest page of the page contains the details of a chosen match. Within the Match Details page one can see the breakdown of a match.
  • Time remaining in match
  • Team picture
  • Team name
  • Team score
  • Telemetry chart
  • Team win-loss record(to be added later)
The telemetry chart will be most ambitious part of the design. Because I am not sure how to access the data from Hackystat without having to login with every refresh of the scoreboard. I may need to design my own chart utilizing the sensor data. For those unfamiliar with Hackystat. The telemetry chart is a visual representation of the collected Hackystat sensordata. The sensor data includes development time, build and commit counts, coverage, etc. The hope is have a tab menu where a user can view a telemetry chart for dev time, commits, builds, and coverage.

The Next Step
The next phase or milestone of the development is to implement functionality to the scoreboard.
  • An invoked Event will put points on the board.
  • Display ongoing matches in the Match Scoreboard with current scores.
There is a lot that needs to be done to have a working prototype by April 20. So I will be working continuously until the Scoreboard is fully functioning.

Sunday, March 22, 2009

ICS 499: Dreamweaver and Devcathlon

Introduction
As a member of Devcathlon's Matches and Scoreboard design team I am taking on the scoreboard portion of the development. To aid with the implementation I decided to use Dreamweaver because I thought it would be easier to deal with the graphics involved with the scoreboard. Also, I thought it would be helpful to my future career to have experience using a tool like Dreamweaver.

Using Dreamweaver
When the team got the specifications I had played with Dreamweaver for about a hour. So my Dreamweaver experience is extremely limited and my hope for quickly coming up with a decent scoreboard design was dashed.
I chose Dreamweaver because the graphic intensive of the scoreboard and I know the program is quite powerful when working with image heavy pages. My ultimate goal is for the Devcathlon score to look like a sport's scoreboard. Just about everything on the Yahoo scoreboard is dynamic and I would love for Devcathlon to have the same function.

With Dreamweaver I can build a page.
  • With tabbed menus.
  • Set the background color black.
  • Set the font color white.
  • Set the positioning for just about everything on the page through css.
The nice thing about Dreamweaver is not having to hand code the style sheet. Through an interface I can add or edit CSS properties. The CSS interface is a handy thing to have especially if there was a forgotten element or if the style sheet is loaded with code. Conclusion
I like Dreamweaver I think its a powerful tool and is quite handy in building web pages. However, there is a learning curve and takes a few days to come up with decent results.

Devcathlon: Dreamweaver and Wicket

Introduction
The team is working on the full development of Devcathlon. Thus far, the developers have been taking baby steps getting acquainted with the framework for Hackystat and Wicket.

The Development
I am working on the Matches and Scoreboard team which includes. With Robin I am working on the scoreboard task of the design. John A and John Z are working on the Matches part of the development. The leadership decided to complete the UI first which makes sense. Because in order to implement the back-end of Devcathlon Wicket needs to be able to communicate with html script.

Coding Tasks as of Wednesday March 16
  • Started the scoreboard UI implementation.
  • Started the scoreboard Wicket implementation.
  • Added the Hall of Fame page to the system.
Non Development Tasks
  • Team meeting on March 21.
The team should be meeting more often to eliminate more issues from the board much of the communication is through chat and email.

Commits and DevTime
Dev time
Commits

Owned and Closed Issues
The goal with the scoreboard UI is to achieve a scoreboard that is cool and visually pleasing, thanks to Yahoo for the idea. Dreamweaver
I am using Dreamweaver to develop the scoreboard UI and the design has been slow going. I have not had the time to fully explore Dreamweaver so it has been a lot of design for a hour research for two hours. But I am learning quickly and managed to implement a skeleton of the scoreboard UI. I will talk about the learning and using of Dreamweaver in ICS 499 blog.

Conclusion
I am having a slow start with the development due to my issues with Dreamweaver however, I am confident that I can bang something concrete by the end of the week.

Sunday, March 15, 2009

ICS 499: Wicket

Introduction
This week the Devcathlon team got reacquainted with Wicket. The assignment was to add and modify menu bars to make the page dynamic. Wicket is a nifty framework that works hand in hand with Java to develop web applications. As neat as Wicket may seem, it does have a dark underbelly that makes development somewhat unpleasant.

Wicket and Java
After spending a week working with the assignment I see the strength of Wicket and how nice it works with Java. With Wicket I was able to make changes to the menu tabs without having to adjust every html tag. Part of the assignment had us working with html files. Its a pain in the butt having to edit all files containing html scripts its tedious and boring. Using Wicket reduces the repetition that comes with html tag.

Wicket Issues
Over the week as I developed the menu tabs I noticed the structure and syntax in Wicket to be strange. It is difficult keep track the difference between a Model, Component, and Property. I do have the Wicket In Action book but when searching for needed information under 5 minutes a book is not helpful. For example, while implementing the tab highlight I had trouble trying to figure out if I should use SimpleAttributeModifier or AttributeModifier. The documentation never made clear why the SimpleAttributeModifier should be instead of the AttributeModifier. By the Wicket documentation needs a lot of work. For a framework I found the Wicket API to be poorly written and lacking in detail for much of the methods. One should not be afraid of using Wicket because of I have mentioned. The Wicket framework works quite well, having implemented the DueDates system.

Conclusion
The learning curve for Wicket is quite steep I would spend a lot of time familiarizing oneself about Models and Properties. A book would be really helpful with the learning process however, I do not want to be one that says one book is better than the other.

Thursday, March 12, 2009

Working with Menu Tabs, Wicket, and CSS

Introduction
A huge element to the Devcathlon system is its dynamic pieces. Because ICS 414 is Java-centric, the team is using the Wicket framework to develop the web segment of Devcathlon. The class was given an exercise to highlight menu tabs using css, html, and wicket.

Code
I have a limited background working with css and html. With this assignment I am getting a lot of hands on experience with setting up links and adjusting the page's layout.

<ul id="subnav-3">
      <li><a href="test-submenu5.html">submenu5</a></li>
      <li><a href="test-submenu6.html" class="active">submenu6</a></li>
      <li><a href="test-submenu7.html">submenu7</a></li>
    </ul>

add(new Link("SubMenu6Link") {
      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to FormPage. */
      @Override
      public void onClick() {
        setResponsePage(new SubMenu6Page());
      }
    });
...
With Wicket and a small addition of script on the html side I added three sub-menus to Menu 3.
  • Add three links via html.
  • Add three new sub-menu links via Wicket.
  • Clicking on a sub-menu tab will link to the selected page.
  • css handles the tabs' construction.
The code is redundant so don't worry if you feel you are missing something. If you have not worked with Wicket before it does take some time to get acquainted with the code's syntax and structure.

The page's header "Example 05" had to be reduced from h1 to h3. However, by decreasing the size of the header the layout of the sub-menus gets altered. So the sub-menu positioning in css needs to be adjusted.
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 : inline;
 left : 10px;
 position : absolute;
 top : 66px;  <--- To adjust the positioning of the sub-menus, I had to play with the numbers. 
}
Ten sub-menus had to be added to menu 3 which was not a difficult task. It should be noted Wicket has issues with having 10 or menus. Eclipse was complaining about something with the code. I had commented out the code for sub-menu 14 to see if I had implemented the first nine sub-menus correctly. After removing the comments from sub-menu 14 everything seem to work fine and could not figure out what changed so I left the code in its current state.

The most difficult part of the assignment is highlighting a menu tab that is active. Anytime there is a menu with sub-menus its difficult to tell which menu is working. So when a tab is chosen the name is embolden to highlight the working page. Making additions to the code is fairly simple with html and css.
#menu a.active {
  font-weight : bold;
}

<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>
  <li id="nav-3"><a href="test-menu3.html">menu3</a>
</ul>
Conclusion
Making changes to a web page using only html and css can be time consuming and tedious. By spending some time learning the Wicket framework editing a web page will be much less of hassle.

Updated Version
Daniel's version of the menu bars.

Task 5
The code for adding sub-menus 5,6, and 7.
      <ul id="menu">
        <li id="nav-1"><a wicket:id="Menu1Link" href="#">Menu1</a></li>
        <li id="nav-2"><a wicket:id="Menu2Link" href="#">Menu2</a>
          <ul id="subnav-1">
            <li><a wicket:id="SubMenu1Link" href="#">SubMenu1</a></li>
          <ul id="subnav-2">
            <li><a wicket:id="SubMenu2Link" href="#">SubMenu2</a></li>  
          </ul>
          </ul>
          
        </li>     
        <li id="nav-3"><a wicket:id="Menu3Link" href="#">Menu3</a> 
          <ul id="subnav-3">
            <li><a wicket:id="SubMenu5Link" href="#">SubMenu5</a></li>
          <ul id="subnav-4">
            <li><a wicket:id="SubMenu6Link" href="#">SubMenu6</a></li>
          <ul id="subnav-5">
            <li><a wicket:id="SubMenu7Link" href="#">SubMenu7</a></li>

body.section-1 #menu li#nav-1 a, body.section-2 #menu li#nav-2 a, body.section-3 #menu li#nav-3 a, body.section-4 #menu li#nav-4 a { background : White; border-bottom : 1px solid White; color : #3366CC; cursor : default; } #menu #subnav-1, #menu #subnav-2, #menu #subnav-3, #menu #subnav-4, #menu #subnav-5 { display : none; width: 90%; } body.section-2 #menu ul#subnav-1, body.section-3 #menu ul#subnav-3 { display : inline; left : 10px; position : absolute; top : 66px; } body.section-2 #menu ul#subnav-2, body.section-3 #menu ul#subnav-4, body.section-3 #menu ul#subnav-5 { display : inline; left : 88px; position : absolute; top : 0px; } body.section-2 #menu ul#subnav-1 a, body.section-2 #menu ul#subnav-2 a, body.section-3 #menu ul#subnav-3 a, body.section-3 #menu ul#subnav-4 a, body.section-3 #menu ul#subnav-5 a { background : White; border : none; border-left : 1px solid #3366CC; color : #3366CC; line-height : 10px; margin-right : 4px; padding : 5px 10px 5px 10px; text-decoration : none; cursor : default; }
Task 6 & 7
Code for adding 10 sub-menus to 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>
          <ul id="subnav-4">
            <li><a wicket:id="SubMenu6Link" href="#">SubMenu6</a></li>
          <ul id="subnav-5">
            <li><a wicket:id="SubMenu7Link" href="#">SubMenu7</a></li>
          <ul id="subnav-6">  
            <li><a wicket:id="SubMenu8Link" href="#">SubMenu8</a></li>
          <ul id="subnav-7"> 
            <li><a wicket:id="SubMenu9Link" href="#">SubMenu9</a></li>
          <ul id="subnav-8"> 
            <li><a wicket:id="SubMenu10Link" href="#">SubMenu10</a></li>
          <ul id="subnav-9">
            <li><a wicket:id="SubMenu11Link" href="#">SubMenu11</a></li>
          <ul id="subnav-10"> 
            <li><a wicket:id="SubMenu12Link" href="#">SubMenu12</a></li>
          <ul id="subnav-11"> 
            <li><a wicket:id="SubMenu13Link" href="#">SubMenu13</a></li>
          <ul id="subnav-12">
            <li><a wicket:id="SubMenu14Link" href="#">SubMenu14</a></li>
          </ul>
          </ul>
          </ul>
          </ul>
          </ul>
          </ul>
          </ul>
          </ul>
          </ul>
          </ul>

//Java code snippet
add(new Link("SubMenu14Link") {
      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to FormPage. */
      @Override
      public void onClick() {
        setResponsePage(new SubMenu14Page());
      }
    });
In the css file menu.css, I added 7 more subnav tags to deal with the new submenu tabs.

Task 8
Thanks to John Ly for solving for this little nugget. I would have never have thought of using 'get("Menu1Link")' to add an attribute to the link tag.
public Menu1Page() {
   
   add(new WebMarkupContainer("body") { 
     private static final long serialVersionUID = 1L;
     @Override
     public boolean isTransparentResolver() { 
       return true; 
       } 
     @Override
     protected void onComponentTag(ComponentTag tag) { 
       tag.put("class","section-1");
     }
   });
   
   get("Menu1Link").add(new SimpleAttributeModifier("class", "active"));
  }
The above code calls on the active tag in menu.css to make a given tab bold anytime a user clicks on it.

Tuesday, March 3, 2009

Developing an Event: Commit Often

Introduction
The Devcathlon team gets to play with real Events this week. The implemented Events are the scoring mechanisms in Devcathlon. I was given the CommitOften Event, which was a tricky little nugget to crack.

Commit Often
The Commit Often event tracks the ratio of DevEvents to a commit. Any change made to source code is a DevEvent and is sent as SensorData. Commit Often scores the Event by doing the following.
  • Look back at a given time and retrieve DevEvent data.
  • Capture and store a file name in an ADT.
  • Keep a running count of each occurance of the file name.
  • If a Commit was made within 10 DevEvents a score of 0 is returned.
  • If a Commit has not occured in more than 10 and less than 20 DevEvents a score of -10 is returned.
  • If a Commit has not occured in more than 19 DevEvents a score of -20 is returned.
The idea of Commit Often is to get developers to not spend too much time on writing code and regularly making commits. So everyone involved with the project has an opportunity to work on the code.

Digging for DevEvents
The fun part of Hackystat is digging for data. In order to get extract DevEvents a little trial and error is required. I spent about a day trying to display the data from the DevEvent. However, with the implementation, the trouble I experienced was not with the API rather it was the time at which the unit test was creating DevEvents. I was passing into the makeDevTimeData method the current time thus, the DevEvents had a timestamp that is one hour ahead. Below is the correct the code snippet which creates DevEvents oneHour backwards.
int oneHour = 60;
    XMLGregorianCalendar developTime = Tstamp.incrementMinutes(Tstamp.makeTimestamp(), -oneHour);
    
    this.makeDevTimeData(owner, project, developTime, 100);
The problem with the DevEvents being created one hour ahead is the CommitOften implementation does a check one hour backwards. You can see the problem I was having with not being able to retrieve DevEvent data. The application cannot retrieve information that is not present. So I wasted a day trying to fix what was not broken. I wonder if professional developers encounter this phenomena?

Conclusion
It is nice to get my hands dirty working with a new API, troubleshooting, and resolving code issues. I have to wonder if my implementation is correct even though my unit test passes all of its tests. The team will see when the Events are actually invoked.

ICS 499: Healthcare Software and Devcathlon development

Introduction
Last week the 414 team was given real Devcathlon Events to implement. I am starting send out my resume to employers and noticed that hospitals have a need for software developers. I have no idea what health care applications look like and since I am applying to a hospital I figure I should find out what is being developed.

Health Care Applications
I know the health care system requires the storage and retrieval of patient information. So a background in databases is important and I feel confident I can apply what I learned in ICS 321(databases).
The program on the right appears to be a diagnosis application developed using the .NET framework. After doing a Google search on health care software I found a lot of companies like using .NET for application building. I suppose I should be learning the .NET framework in the near future. Without having seen source code for a health care computer application I am not sure what to expect but I am sure the programs use the same structure and syntax as any other piece of software.

Event Development
I was assigned the Commit Often Event this week. Developing the application was a little easier compared to coding the Starter Event. I could have finished the assignment a lot sooner had I applied the unit test properly. I had set the time for the makeDevTimeData method to run forward. The DevTimeData needs to be created with time set backwards. Because Commit Often has a requirement to look back one hour and look for DevTime/Commit data. I got to implement a HashSet and HashTable where the HashSet collects file names and the HashTable track the number of occurrences of a DevEvent/filename. John Ancheta implemented an overridden makeDevTimeData method allowing it to take in a file name as an argument. I was able to assure CommitOften.java was able to read more than one file.

Development Rundown
  • Monday-Saturday, 3/2 - 3/7
    • Implemented CommitOften and TestCommitOften. I think I lost over 50 points for not making commits within the given number of DevEvents. However, I made up some ground by performing unit tests and verifying before making every commit. I estimate my score to be 15 points.

  • Sunday 3/8: Blog work.