Monday, February 7, 2011

API Design for iHale

Many people in the technology field will be familiar with the term application programming interface (API).  They are the essential building blocks of every program that have been created by previous programmers to save you the hassle of reimplementing commonly used classes.  APIs provide all programmers with standardized methods and classes to act as an interface between different programs.

Some qualities of good API design:
  • Modular.
  • Reusable.
  • Easy to use.
  • Difficult to misuse.
  • Powerful to do what it needs to do.
  • Easy to expand.

iHale

iHale top-level architecture
It's always exciting to get a chance design a system from the ground up, which is exactly the opportunity that has been offered to our software engineering class.

But where do we begin?

The Scope
For this particular system there are few design requirements that we must fulfill.  Our system has to interact with sensors for all of the house devices.  We decided to model the system by having a main system which manages different environments that contain different devices.  In our current Restlet API design, we tried to create resource objects to be sent across HTTP to issue commands to "actuators" (i.e. - turn lights on and off) and to be able to accept data from "sensors".

Generalizing the problem
Because we don't know exactly what type of hardware we are working with, we created a highly abstract API for our initial design.  We felt that actuators and sensors are pretty similar, so we have them both extend a parent class called Device.  The idea behind this design choice is to allow for these different resources to have their own unique ID numbers that is generated using a static variable that increments itself every time a device is created.  This provides a simple way to reference a specific device that will not be confused with another.

Though we don't know exactly what sensors the device will be talking to, we know that we will be using REST to send data between the iHale system and the devices.  Therefore we have to have a way to send GET and PUT request methods at the least.  How we handle the requests at the moment, we're unsure.  The main thing is that we let the users with the parameters they need to provide and what they can expect in return.

"Through Fire and Flames"
Our group met a few times over a week and spent a few good hours drawing up different designs, shooting down the bad ideas and keeping the good ones.  But even after all the time that was spent on our design, in its current state I feel like we're going to have to end up redoing it.  Why?

We were so focused on creating everything from the ground up, generalizing and abstracting that I think we got a little carried away.  What we forgot to do is to look at the existing APIs for the systems we are using.  Namely, Restlet's API which already provides the Resource class.  Instead of creating a class that already sort of exists!  Apart from saving us the time of coding an entirely new class, it would allow for even more compatibility with Restlet and its pre-existing methods!

Thoughts
Even though I think our first API design was perfect, it was a great experience in software design.  It pushed us to step back and view every part of the system, and even future expansions of the project.  While it is good to be able to think abstractly about the system, you want to keep yourself grounded and work within your scopes (in our case the services we are using).  Fortunately for us the API is in the early stages of development, so its good for us to catch our mistakes now instead of later.

You can check out Team Maka's latest API distribution here.

Saturday, January 29, 2011

Berkeley DB and Persistency



Berkley DB is the first non-relational database I've had the pleasure of working with.  It is a It has options to scale up to hundreds of terabytes.  Though it is written in C, it provides API bindings for PHP, Java, Perl and Ruby just to name a few.


Embedded Database
Berkley DB is an embedded database, but what does that mean?  It means that it must be integrated with an application that needs to access stored data.
One such weakness of embedded databases is the fact that it only supports one user (the application).  But is that entirely bad?  Not necessarily.  Using another service, Restlet, we can integrate the two together to provide multiple user access to centralized data storage!


Kata 1: Timestamp as secondary index 
The first distribution provided the user with three options: GET, PUT, DELETE.  The task that was given was to implement a timestamp that could be used as a secondary index for each data entry.

get-timestamp: returns the Contact with the given timestamp, if such a Contact exists.
get-range: returns the set of Contacts with timestamps between two specified values. 

Implementing the new options was actually much easier than I thought it would be.  The BerkleyDB API provides very helpful examples that can make implementation an easy processes.

Completed
Time spent: 2 hours


Kata 2: Wicket, REST, Berkley DB: A match made in heaven
Wicket Interface
Although I can agree with the name of this kata, there were a few nuances that plagued me throughout the duration of this kata.  It is important to know how the three interfaces interact with each other before diving into this system.  I already mentioned Berkley DB a little, so I want to talk about the other two components to this application.

Wicket
This is your user front end.  Using markup language to create forms, textfields and buttons, along with Wicket tags, it allows you to create a structured program over stateless HTTP.

It's a very tough gap that wicket tries to accomplish, and I think it does a pretty good job at it.  The one thing I haven't gotten down is the implementation of sessions.  Though I feel I came pretty close to understanding the principle, I could not get the sessions to work properly.  Wicket allows for developers to create Session objects.  Sessions have various applications depending on what you need.  In this application we implement sessions in order to create concurrency.  If you have many users trying to PUT and GET contacts from a centralized database, you want to make sure that people get what they asked for and not what someone else queried.

Restlet
This is the essential median between Wicket and BerkleyDB.  BerkleyDB is designed to only allow for one person to update/query the database at a time.  We add a Restlet layer on top of BerkleyDB in order to regulate all requests that are coming into the server.  The good thing is that you won't have to worry about dirty reads, when a user requests data that is being modified by another user, because restlet will sequence the read/writes to the database.  Another great thing about Restlet is that it can allow for multiple people to access the database (even though it is designed for one).  In future implementations you could have many users/devices sending requests to the server as long as you can implement a Restlet layer on top of those devices to interact with the Restlet layer that handles the server's requests.

Not Completed
Time spent: 10 hours+


Download my kata distribution here.

Sunday, January 23, 2011

Java Virtual Machine Heap

I came across an issue regarding memory allocation, and decided it would be in my best interests to how the Java Virtual Machine (JVM) manages it's memory space.
JVM is comprised of three memory segments: heap memory, non-heap memory, and the code for itself.
Heap Memory

A JVM heap is allocated at the start-up of every program.  By default the initial heap size is 2MB and the max heap size is set to 64MB.  But, in the event that your program needs more memory you can initialize it to have more using:

%java -Xmsn

Specifies the initial size of the memory allocation pool.   This  value  must  be  a  multiple  of 1024 greater than 1 MB.  Append the letter  k  or  K  to indicate  kilobytes,  the letter m or M to indicate megabytes, the letter g or G to indicate gigabytes, or  the  letter  t or T to indicate terabytes. The default value is 2MB. Examples:
  • -Xms6291456
  • -Xms6144k
  • -Xms6m
Likewise, we can set a maximum heap size using:

%java -Xmsn

Heap Dump Snapshots

There are a couple of commands you can use to obtain a view of your program's heap. The first one being Java's tool, HPROF, which enables CPU, heap, or monitor profiling.  The second command is the Java Heap Analysis Tool (JHAT).

%java -Xrunhprof:format=b, file=snapshot.hprof Classname
%jhat snapshot.hprof

Without formatting the snapshot, HPROF will return the heap dump in a text file.  But because sifting through possibly 40k+ lines of text, we can format the dump so that it easer to browse, as well as make use of Object Query Language (OQL).

After running these two commands, you can view the heap file by opening up your browser and going to http://localhost:7000.


JConsole
Overview tab
This is a tool that was included in JDK 5.0 and later distributions.  It provides the user with a GUI for monitoring specific data such as memory and thread usage.

Some useful tabs that are provided: Overview, Memory, Threads, Classes, and the VM Summary.  You can adjust the time frames for even more specific analysis.

Tuesday, January 18, 2011

Restlet Katas

As a follow up to the Wicket Katas, our class was presented another one for Restlet.
If you would like to follow along with this kata, the base system is located here.

Kata 1: Time Resources

Add three new resources called "hour", "minute" and "second" that return the current hour, minute and second.
  • Write unit tests for each of these resources and make sure they pass, and make sure you can run them both from within Eclipse and using Ant.  
  • Make sure the DateClient system accepts these parameters. 
  • Ensure that "ant -f verify.build.xml" passes with no errors.  

We are provided with two jar files, one for the client and one for the server.  By running both in 2 sessions windows, you can see how the client and server interact with each other.  By default the client sends a GET request to the server to retrieve a certain resource defined by the parameters: <host> <resource>.

When the request is sent from the client side, you will see in the server window how the server accepts the request, as well as the response (whether the resource was returned, or not).

This demonstrates the basic request-response relationship between client and server in the REST architecture.


Kata 2: Logging

By default, Restlet logs data about each request to the command line using the Java Logging API.  Read a tutorial (and/or google) to get familiar with the API, then do the following:
  • define a ~/.dateservice/logging.properties file that enables the user to specify (among other things) that the logging information should go to a file, not the command line.
  • tell the restlet-dateservice application to read and use the logging properties file in  ~/.dateservice/logging.properties.

Using Java's FileHandler class we can designate a properties file that can be stored on the server side to create and append logs to an external file.  This is a very useful kata because it shows that can change the server's properties on the fly.

This blog post was also very helpful when trying to set up the REST server and the properties file.

Kata 3: Authentication

The current restlet-dateservice system performs no authentication.  Check the user guide (and/or google) for guidance, then implement HTTP Basic authentication for all the resources in the restlet-dateservice system.  To simplify things, all resources should be available as long as the requesting system uses HTTP Basic authentication and passes the username "guest" and password "pw". (You can hardcode that password into both the client and server sides of the system if you like.)

This kata makes use of Restlet's ChallengeAuthenticator class, allowing the user to define a Map of entries (username/password) to allow access to the server.  When an inbound request is detected, the browser will prompt the user authentication when trying to contact the server.

Kata 4: Wicket

For this Kata, create a new client for the DateService server that is a web application using Wicket rather than a command line application.  The web application should bring up a single page with a single form that requests what aspect of the date (year, month, day, hour, minute second) the user desires. When the user submits the form, the web application uses Restlet to obtain the appropriate information from the DateService server, then presents the results to the user in the page.  

The web application should be placed in its own package.  Note that you will have to modify the build.xml file to include Ivy-based retrieval of the Wicket libraries. 

Modify the jar.build.xml to build a third jar file called restlet-dateservice-webapp.jar containing just the client classes and libraries required to run the web application.  

Make sure to provide a JUnit test case for your web application, and that 'ant -f verify.build.xml' passes without errors. 

In this final kata, we have to create a wicket application to act as the user of the Restlet server.  The application does the same thing as the first kata, and sends a GET request to the server and waits for a response.  When it receives a response from the server, we can assign it to a label.

Using a session, we can initiate a new page session with the updated label object which will be the server's response depending on which resource was requested.

Thoughts 
I think these katas were good to introduce us to the REST architecture.  There's a bit of research that is needed and it can be quite a large time investment, but I think understanding how the architecture works is mandatory for dynamic web programming.  At the time of this post I have not been able to complete the final kata because of this error when I try to send a GET request from the client-side:

INFO: A recoverable error was detected (1001), attempting again in 2000 ms.
GET http://localhost:8112/dateserver/year: Response 1001: Cannot allocate memory

Google shows that a 1001 response indicates a connection issue and it does not seem that my requests are being received by the server.

Tuesday, December 14, 2010

Decathlon Design 2.0

Last month I made a post about designing the layout for a system that would be used by teamhawai‘i's entry into the Solar Decathlon.  For our final project of the semester we've worked on transferring the project from Balsamiq Mockup to HTML.

For our project our group implemented Wicket, CSS, JavaScript and Ajax to give our web app the look that we would like it to have before we add the functionality (a project for next semester.)  For this assignment we were evaluated on three prime directives:

1. The system successfully accomplishes a useful task.

 I believe that our system will help users of teamhawai‘i's house with a fun and simple interface to easily obtain data regarding the house's functions.  I think our group tried to push the design to be fairly interactive, and to allow the user to take control of the system when needed.  The house functions may be a trivial for this assignment, but they're there to set the base to build off of for future development.

2. An external user can successfully install and use the system.

Our system is packaged and ready for distribution.  Download the latest version from our site's downloads section and be sure to read the installation guide to avoid any problems.  The system is completely compressed into a .jar file, and it contains almost everything needed to run the web app locally on the host's computer (you need java installed on the system to run the .jar.)  Once you've downloaded our latest distribution, navigate to the directory the .jar file is located in Terminal or command prompt and type the command: %java -jar filename to run the app.  Ant will go through the build process to create all the class files and set up Jetty to act as the web server.  After the installation process is completed the user will be prompted to visit the URL where they can view the web page.

3. An external developer can successfully understand and enhance the system.

Our code is well documented to help any new developers understand the program's layout.  This was pretty much the first time anyone in our group has actually tried web programming, but we tried to document our HTML because there are probably a few coding conventions we didn't follow there.  The pages are pretty modular.  To add a new page to the project, a developer just needs to extend the base page and provide a side bar.  We look towards improving the layout of the system to allow it to be more modular and to include better CSS rules to make everything more consistent.

Final Thoughts

Overall, this was a great experience.  I've been meaning to get into web development, and this project gave me a little taste of it.   From a software development standpoint, this exposed me to working with a group on a program.  We ran into a few problems including: inconsistent file versions, variable names and different coding conventions our group ran into during the development process, but we were able to fix most of them.  There's a lot of work that goes into working in a group project, but I believe the most important factor is to always have open lines of communication with your group members.

Tuesday, November 30, 2010

Wicket Katas

Code katas from a programing perspective are exercises in programming that help you to refine your skills, and we were given a few to sharpen our Wicket programming skills.  Here are some of the examples that were modified in this exercise.  Below I have provided you the links to all of the original files and the corresponding exercise that go along with them.  You can download my files here.


Example 1: Hello, World!  (Original)
Kata 1A:  25 minutes  ✔
Add a new line to the page that says, "In one week, the time will be <time>", where <time> is replaced by a timestamp one week later than the timestamp that now appears on the page.
Kata 1B: 10 minutes  
✔
Add a button to the page labelled "Refresh".  After pushing the button, the times update themselves.
Kata 1C: 20 minutes  
✔
Wicket, by default, runs in "Development" mode, but production systems should run in "Deployment" mode.  Override the getConfigurationType() method so that Example01 now runs in Deployment mode.


The katas ifor example one were not that bad.  I think the hardest part was trying to find the right methods to format the time to add a week.  Othere than that, everything seemed pretty straightforward.


Example 2: Links, Lists, Forms, Tables  (Original)


Kata 2A:  40 minutes  ✔
Add an additional link on the home page that says, "Go to image page".   Create this page, which should display an embedded image.  This image should be G-rated.  It should be in a .jpg file stored with the system, not retrieved from the web.

Kata 2B:  2 hours 30 minutes  ✘
Add a button on the home page with the label, "Make font bold".  After the user pushes it, all the text on the page should become bold, and the button label should change to "Make font italic".  When the user pushes that button, all of the text should change to italic and the button label should change to "Make font normal".  Pushing that button changes the text back to its original state and the button label should now say "Make font bold".

General Idea: Find a dynamic way to insert corresponding bold and italic HTML tags at the front and end of the document.  

I particularly had some trouble with this task.  The first approach I tried was one that I would use in PHP, which involved having a conditional of some sort that would allow a certain Wicket tags to appear under certain conditions.  This isn't how Wicket works though.  Tags must be in place before the page is loaded or else it will throw some nasty syntax errors saying that either the tag has been created, but it cannot find a variable, or vice-versa.  So this idea was not going to work.

Another idea I had was to dynamically change the data that was being assigned to the label using StringResourceModels.  I have a feeling that this is the 'correct' way to do it, but implementing these objects was a little bit beyond my current Wicket knowledge.  My current understanding of these objects is that under certain conditions, the data that is displayed can change, whether it's being passed a certain type of object, or by using get methods on the object to return data corresponding to the current state of the object.

The third idea I thought was to create every label and button, and adjust their visibility via the Component.setVisible() method.  Unfortunately I had some trouble with my buttons setting these values to true or false for some reason.  It would seem that every time the page is reloaded it will reinitialize the boolean values to their default values, which didn't help much.

The last pitch effort for this task was to just create 3 static web pages and link them all together and have the corresponding tags and buttons on each page, but I felt that would not really accomplish the assignment from a developer standpoint, even though it would yield the correct output (except the pages would all be different).

Kata 3A:  8 minutes  ✔
Add a new tab called "Image" that takes the user to a page containing an embedded image (your choice, G-rated).  It should be in a .jpg file stored with the system, not retrieved from the web.


This exercise was very simple.  It involves one method call to fetch an image and display it to the screen.  Creating the link to the new page was also very easy since it is the same code as the other 4 pages.

Kata 4A:  10 minutes  ✔
Add a new cheese called "Velveeta", which costs $0.25/lb.


Kata 4B:  30 minutes  ✔
Add a "country" field to the billing address that appears when checking out.   The country field should provide a drop-down menu with a selection of 5 countries. 


The first one was fairly simple.  You just have to add another item to the list, and you can easily follow the format of the other listed items.


Adding the select form was slightly difficult not because of the difficulty of the coding, but the amount of methods you had to create.  Many of them were get/set methods to ensure that the address objects were getting all the info needed to make a shipment.  I enjoyed this one, since it involved a bit of tracing.
Kata 6A:  2 minutes  ✔
Get rid of the blue columns that appear when displaying the website. These are for development, not deployment purposes.
Kata 6B:  3
 minutes  ✔
Place the image underneath the form, not to the right. 
Kata 6C:  ✘
It is often convenient for web applications to consult a properties file when starting up in order to get configuration values.  An easy way to do this is with the standard Java Properties mechanism.  (See Java in a Nutshell for details on properties file manipulation.)   For this Kata, modify your Example06 system to read in a file (if present) located in ~/.example06/configuration.properties.


The first two were by far the easiest out of all the katas, requiring you to disable some CSS code, as well as move an image into another div.  But the same cannot be said of the last kata.  I wish I had more time to figure this one out.


Thoughts
I think it may help that I've been recently trying to teach myself PHP, but the flow between PHP and Wicket have some similarities.  I think I could get kata 2B down once I learn how to use more of Wicket's API, but it's always fun to have some dynamic coding for web apps where you have your higher languages spitting out HTML code that will be interpreted not just as characters.  I think these exercises helped to sharpen not only my Wicket skills, but also my general web development capabilities.  Working with services like Jetty help you realize how all the components of a web server come into play to take in user input, interpret it, and give back the expected results.  I will try to update this blog as I complete the last two of these exercises that eluded me.

Thursday, November 18, 2010

Wicket Chart

For this week's assignment we were exposed to a Apache Wicket,  which which is a web application framework that allows you to do web programming in Java.

Initial Thoughts
This was the first time I had ever heard of Wicket.  As a novice web developer, it reminded me a lot of PHP.  Similar to PHP, Wicket uses a model-view-controller (MVC) architecture.   Wicket interacts with an application server (in my case I am using Jetty) which then uses Java code that is on the web server to handle the Wicket requests.  The server returns the output which is viewed by the user.

From a development standpoint, I feel it can be a very slow process waiting for Java code to compile, whereas working with a scripting language like PHP gives immediate results.  But being able to have the strength of a full programming language behind your web application allows for many options that are not available to scripting languages.

Wicket Chart (Download)

This was my first web application I've created using Wicket.  The idea is to allow the user to modify a Google visualization (in this case a GoogleOMeter) through the web application.

Setup
  1. Open up the directory and run the command: %ant -f build.xml
  2. Once the installation is complete run the command: %ant run
  3. Open a web browser and go to the url: http://localhost:7070/Wicket-Chart

Once the program you have Jetty running, you're ready to view the web application.  It is a single web page that will have a form filled with preset values.  After modifying the field values, you can view the changes to the graph by clicking the 'Submit' button at the bottom of the form.  This will refresh the page and update the fields and image to reflect the changes.

Testing
There are a few simple checks that my program covers when the user inputs.  My program will check to make sure that the user has filled in the values.  If the fields are left empty, they should default to 0.  Another check I implemented was to check to make sure that the min value was indeed smaller than the max value.  In the case that this test fails the min and max value will be set to 0 and 100 respectively.  If the value does not fall between the min and max value it will be assigned to one of the ends.

The final feature that my program provides the user is an automatic scaling system.  Google restricts their images to:
  • 1 px ≤ width/height ≤ 1000 px
  • width * height ≤ 30000 px
If an image is too large, Google will usually throw an error that looks like this:
Usually the user would get an invalid image, but I tried to implement a simple check that will scale images down to an acceptable range, while keeping the dimensions proportional.

Thursday, November 11, 2010

Decathlon Design

This week I was able to create a few mock up pages for the Solar Decathlon system that our software engineering class is currently working on.  Initially we worked on our designs individually before we were assigned to groups of three or four students.  As I mentioned in an earlier post my background is in print layout and design working for our school's newspaper.

Initial thoughts
Main Menu
The key to working together as a team is to always have some an line of communication with every member.  Working in a group is nothing new to me, and working with a couple friends made this group experience even more enjoyable.  Being comfortable enough with your team to present 'off-the-wall' ideas without fear of being judged harshly allows the group to come up with some ideas that you wouldn't normally come up with on your own.  I must admit that I was also relieved to be working in a group because that meant that the work load would be spread out, which would allow me to focus on what I like to do, layout design.
When our group first formed, we decided to take a look at the mockups we had come up with individually and tried to take all the ideas we liked and tried to merge them into one system.  We had decided to start with my layout as a base design, which has since gone through some redesign.  For the most part I was to deal with most of the graphical aspects of our program, as my team would put as much content and functionality as they could on each page.

Design choices
Energy menu
As a group we had a general idea of what we wanted to include in the system.  I think the most challenging part of this assignment was how it should be displayed to the user.  For me, the design had to be both intuitive and innovative.  Throughout the past week I would always be pitching lines like "How cool would it be if we did... " or "I have an idea!  It's a little out there, but I think it's pretty good."  Many of these ideas didn't make it too far, but a few of them were accepted by my team.

As a computer science major, when you think of visualizing data you'll probably think of something like a bar chart or line graph.  While these types of visualization do a good job at presenting the user with information, they're not very enjoyable to look at.  For this project I have tried to come up with ways to present the user with data visualizations that they could provide the user with information they needed, be visually appealing, and if at all possible, be interactive with the user.  One of these ideas was the visualization I came up with for our energy menu which can be seen above.

Another important design aspect is to be consistent.  You don't want to have your users to be navigating to your system and then suddenly the entire layout changes and they don't know where to find anything anymore.  On all of the pages a constant menu bar is there to tie all the pages together.  The menu bar contains a widget and 4 main menu buttons.  On the left side of the page you have a submenu bar that corresponds to the current main menu that you are located in.

Project management
While working in a group, we used a combination of Subversion and Google Project Hosting which can find at: http://code.google.com/p/solar-decathlon-teamhawaii-2.  This setup worked out quite well as literally takes seconds to share your files with the entire team.


This project was an Issue Driven Design Project, which meant as issues came up, we would create a task in the Issues section of our Google Project, from there team members would try to handle the issues, whether it was to update files or create new pages.  Even though there are only three of us working on this project, having the issues down somewhere can be good because you can just check to see if there's anything that needs work on instead of having to remember it.

Thoughts so far
I think we worked very well as a group this past week.  There are a few more designs that I would like to come with in the next week.  I am also looking forward to programing these systems and have been trying to create designs that implement many of jQuery UI's.


********************************************************************************


Updates

As a group we put on the finishing touches to our mock up.  We ended up adding only a couple new pages: the Scheduler and Settings menus.

The design concept behind the scheduler was to allow the user to create a new event a simply as possible.  We want to incorporate the same 'drag' utility that has been provided throughout the entire program to allow the user to automate tasks with just a few simple clicks.

Scheduler
The scheduler also would have a chart that corresponds to the time period currently being viewed.  It will allow the user to predict how much energy is going to be used during that time period, and should have a general idea of the stress it would put on the system.  It could turn into a game of balancing tasks to make sure the house never takes on more than it can handle.  We'd like the graph's color represent the house's current load, green being a safe condition, and red being a high load.  By clicking on the graph we hope to allow the use to modify tasks near that time frame.

Settings Menu
In addition to the current functions available in the settings menu, I think there should be a 'snapshot' that can save the variables of the house's current state.  Then at any time the user could revert to the saved states with a single click.  This could apply to many different situations including things like a power save mode to a nice dining mode.  It would really be up to the users to set the house up exactly how they'd like it to be every time they use the snapshot feature, but the possibilities are endless.

Thursday, October 28, 2010

User Stories

An important aspect of designing a system is to put yourself in the place of a user of the system.  What is important user may be different than what is important to a designer.  With that respect, you must always keep your users in mind because they are ultimately the ones who will be impacted the most by the design.

For the Solar Decathlon, it is important to always keep the goal of the competition in mind which is to design, build, and operate a solar powered house that is cost-effective, energy-efficent, and attractive.  Here are some problems I hope to address while developing some software for the competition.

Maintenance of the system

Since the house must be solar powered, it is important to maintain system and to make sure that you are getting the most out of each component.  As a user, you may not be thinking about what condition your battery is in as it wears over time.  This feature is already provided by laptops, which warn the user when power levels are low or to get their battery serviced.

While keeping a watch on your battery's condition it would also be a smart idea to keep track of the condition of the solar cells themselves.  You could measure the condition of the cells with the ratio Amount of Energy Trasfered / Amount of UV Radiation Exposed.  While this info may not be exciting to the user, it is a very simple measurement that can be taken to provide the user with the information needed to maintain their house properly.  While on the idea of panel condition, solar cells degrade at a slow rate (about 20% over 25 years), and it may not necessarily to monitor the output of each individual cell, but rather to see which cells are actually functioning.  Since the solar encasing for the house is designed to go around the house, as opposed to conventional solar panels that sit on top of the roof, they may be more prone to physical damage as opposed to wear over time.

The aquaponics system seems to be another integral part of teamhawai‘i's house.  I believe monitoring the water conditions would be a crucial aspect to the competition.  For aquaponics there are three major fields you want to monitor: water temperature, pH levels, and electrical conductivity.  By providing the user with this data, they can respond to problems with their system before problems scale out of control.

Apart from the solar energy and aquaponic system, the two water tanks play another important role in the house by both providing water and storage for grey-water, as well as providing some heating capabilities to the house with the latent energy that is absorbed and released by the heat-insulating material that is contained within the tanks.  So it goes without saying that monitoring temperature and water levels would be important to the user.  But what does it mean to provide these readings to the user?  The user shouldn't have to do any calculations of their own when they try to take a warm shower or want to cool down the internal temperature of the house.  So why not implement a system that uses these data values to help the user manage their energy consumption?  A graph projecting future power levels based on tasks that the house is providing wouldn't be too far of a stretch.

Attractiveness

After all the maintenance systems are established we can get into the fun things that would make any user want to buy the house.  One that I thought of applied to the aquaponics system.  Keeping a mini database of the current plants being grown, and of the fish that are in the tank would be a nice educational touch to the system as a whole.  Like a mini aquarium / plant nursery that could display info on the organisms that are part of the system.

We want a system that is easy to manage.  Computers that are incorporated (i.e. display panels) to the structure of the house would be a nice touch to provide user ease of use.  And like most technologies today, having mobile devices (i.e. smart phones) would have to be essential.  These technologies could allow the user to manage the house at a few simple clicks, whether at home or not.  For example setting the temperature of the house on your way home from work.

Finding a way to network your house in a way that services are aware of each other is another important feature I think that should be incorporated into a 'smart house'.  What I mean is, I would like the systems to communicate with each other.  The first thing I can think of is say you want to turn down the temperature of the house, but doing so would cause you to exceed the amount of energy that has been generated because of other tasks that are being preformed around the house.  It may be possible for the house to arrange task priorities, and to maybe turn down energy usage in some areas where it's not as important in order to delegate power for the new task.

I believe the air conditioning system should also be smart.  There should probably be some software that can keep the house at a certain set temperature in the most efficient way possible.  Taking readings from both internal and external ambient air temperatures as well as humidity levels would be essential.  Based on these readings the system could pump out air at certain times to keep the system cool without the user having to worry about it.

Tuesday, October 26, 2010

WebsiteUsabilityReview

Today, it seems like just about anyone can create create their own website in a few minutes with the help of a startup wizard.  Whether people know it or not, there are conventions and standards that they should followed when designing page layouts.

My Background: Ka Leo
Dummy layout for kaleo.org home page
I've recently became interested in web development this past summer after working as the design editor for over the past year at Ka Leo O Hawai‘i, the University of Hawai‘i at Mānoa's student-driven newspaper.  This semester I made finally the transition from print to web.  Though I have never really had a focus in web development, I thought it wouldn't be too far of a leap to go from print to web.  Though it is a slow process, we've drafted a new layout for the website that we hope to have up and running in the next couple weeks.

Challenges
While creating a website in itself is a task, creating a news site has more restrictions.  There's a lot of research that you need to put in before you make a site.  Before you even draft out a page, it is good to know who you're users are:
  • What browsers are they viewing the page with?
  • What is their screen resolution?
  • What operating system are they using?
  • What do they want to out of your site?
You can use an application like Google Analytics to do the information gathering on your current site so you can make adjustments to server your users in the future.

What's in a page?
There are many things to take into account when creating the layout for your website.  But the most important thing is to server your users.  People come to your site for a reason, and it is your job to make it an easy and enjoyable experience.

"Keep it simple, Stupid!"
A well-known saying in the programming community, but it has many more applications than that.  You want a site that is easy to navigate with high affordability.  If people come to your site and leave within a few minutes because they couldn't find what they were looking for, the only thing your site accomplished was to wasting their time.

The Information Age
Websites are not static documents.  They can be updated on an hourly basis to provide the most up-to-date content for their users.  This is what makes news sites extremely effective in comparison to their printed counterparts.  When people view your web site they want the most recent information.

"The Good, the Bad and the Ugly"
College Publisher

Good: College Publisher
College Publisher provides hosting for many college newspapers across the nation.  Their home page has a very simple layout with easy a simple tabs for navigating the site.  The "What Can You Do Here" towards the middle of the page provide simple icons to grab attention and useful links to help new users discover what services the site provides.

Good: jQuery
jQuery
jQuery, like College Publisher, also provides a top bar for navigating the site.  It uses whitespace effectively to provide a very simple layout to forward you to four project sites.  They've decided to stick with an analogous color scheme: yellow, green and blue, which is very easy on the eyes and entertaining.





Bad: Yes English School
Yes English School
I remember seeing this site a few months ago, and I must say they made some improvements.  I know they're going for a very artistic layout, but their site overall is not very helpful.  Their logo is not very easy to read with the rainbow bullseye behind the text.  The cursive font they use for each section is not very easy to read.  On top of that their site does not offer much insight to what the lessons are like.  They only provide their prices.






Ugly: Evolution and the Nature of Science Institutes
Evolution and the Nature of Science Institutes
At first I thought I was looking at a page from ten years ago, but I see that it was recently updated it 2 days ago.  Not to mention the site takes about 24 scrolls to hit the bottom of the page.  On average you should hit the bottom of a page in about two to three scrolls at most.  No one is ever going to read to the bottom of the page in one sitting.

Friday, October 15, 2010

RoboHosting

This week we delved into the world of content management systems (CMS) and Subversion.   Although I've never used one for developing my own programs, it wasn't very hard to learn being used to downloading patches.  It's a nice change to get a glimpse of the development side for once.

Task 1: Download and install an SVN client.
I decided to use SmartSVN, a GUI for Subversion.  The installation process was very simple, and I can easily checkout the source files I want access to.
SmartSVN graphical user interface.
Task 2: Checkout/modify/commit an existing system.
The project we had to modify was robocode-pmj-dacruzer, a sample bot created by our professor to help us learn everything from automated builders (Apache Ant), automated quality assurance tools (Checkstyles, PMD, FindBugs), code coverage tools (JaCoCo), to CMS this week.

I was able to successfully import the project via SmartSVN, modify the documentation, and commit the changes.  I made sure to build and verify to the project both before and after making any changes to any of the files to avoid confusion if an error occurred during the process.

My change was very minor which involved inserting a line of documentation to better explain the function of the findbugs.build.xml file:

"Build fails if findbug detects an error."

Task 3: Create a new system hosted at Google Projects.
The the final task was to upload the most recent version of our robocode robots onto Google Code.  Like most of Google's products, setting up a project home was very simple following the online instructions.  You can explore my project home: robocode-agh-cakebot for a project description, source download, developer and user guides, as well as view any changes that have been made to the code.

Project Home: http://code.google.com/p/robocode-ahg-cakebot/