Wednesday, April 20, 2011

A new light

So after discussing a little more with Dr. Bowring, I changed the complexDataObject so that it contains a static arrayList of complexDataObjects and anytime one is created it is added to the array. The insertion is sorted to allow faster sorting using a comparator class. So after all that is done, the methods become a lot easier. For public boolean supportsView(String view) I do a search through the static arrayList for a object that has title of the string view. Returns true if the view is found else returns false. For public String[] getSupportedViews() I had to modify it to return an arrayList instead of an array and then I created a copy of the static arrayList of complexData and then return it.

Monday, April 18, 2011

Java.lang.Reflect

Thanks to Dr. Bowring I was able to find a much nicer way to implement my two methods for the complexObsHandler and complexData object. Reflection is a feature in the Java programming language. It allows an executing Java program to examine or "introspect" upon itself, and manipulate internal properties of the program. For example, it's possible for a Java class to obtain the names of all its members and display them. So after googling I was able to find some sample code and a tutorial on oracle to find all the instances of the class using reflect, now I just need to implement them into Openmrs which has given me some trouble but I'm confident I will get it done.

Thursday, April 7, 2011

Still trying to fix my bug

So after trying to fix my bug I realized I needed to get a little more info on exactly what the openMRS team wanted. I view a discussion on the mailing list , I was a little more informed but I still didn't feel I had the information I needed to accomplish the task, so I started reading what the Complex obs handler actually did at the openMRS wiki. After carefully reading I have much better understanding of  the obs handler and its actually an interface. So in order to create the method to getSupportViews()  I'm thinking  need to find a way to have java return classes that implement the obs handler. As for   supportsView(String view), I was planning on using getSupportViews() to create a list of views and then search through that list for the view pass as the parameter if the view is found return true else it returns false.So now that I have a plan its time to try implementing, wish me luck.

Tuesday, April 5, 2011

Ok lets fix another bug

So after so carefully reconsideration, Each member of my team carefully selected a bug/feature for each of us to fix. I choose Trunk-2136. The feature is to add two methods to the complex obs handler object. One method verifies that a view is supported by the handler. The other returns a list of all the supported views in an object. I have begun to experiment with these a little bit and they seem conceivable so hopefully I will be able to produce some results.

Tuesday, March 29, 2011

POSSCON

    Last Friday was the last day of POSSCON but I was still very excited to attend. Not only did we eat good, I learned so much today. The first workshop I went to was with John Diamond about open source gaming. Designing games has always been something that I have wanted to do so I was finally able to learn about it a bit more. John began his discussion talking about blender, an open source program that is used for character development. I also learned about MD5 which is format that allows models to be animated by the use of an internal skeleton. Generally two files are needed to make a functional MD5 model; md5mesh and md5anim. He demoed the characters for his game, Alien Arena. He even taught us about rendering and shading techniques that he and his team used. I was briefly able to ask him some questions about what I should do to get started developing games. He told me I should definitely know C and/or C++. I still learning C and haven't really done any C++ so no im more eager to learn them. He also told me I didn't have to just settle for using the quake engine I could even use Epic Megagames' udk as a base engine so I could develop many different types of games. Lunch was the best, there was so much food and all you could drink soda it was like heaven. After that I went an sat in a workshop with John "Mad Dog" Hall about the History Of Linux. It was quite interesting and he brought up very interesting point about why software patents should not exists and I did learn a lot from his talk about Linux development.

Wednesday, March 16, 2011

POSSCON 2011!

So next  Friday is my classmates and I will be attending POSSCON 2011. I'm really looking forward to it and its also in my home town so I was able to invite my parents and some friends so hopefully they will attend. One person I really want to meet is John Diamond. Mr. Diamond is is the CEO and lead developer of COR Entertainment LLC and is a senior developer at Orange Technologies Inc. He codes and does the artwork for the games he designs. Gaming is one of my favorite hobbies and I always wanted to design games for a living. When I meet him I would hope to ask him "how can I get my foot into the world of game designing?", "Is there any specific programming language that I need to be familiar with?", and "What is your favorite part of designing games before the project is complete?". I would also like to meet David Trask to see how open source is taught is at other schools. John "Mad Dog" Hall also seems like an intere
Preview
sting person to meet since I'm just learning to use/getting use to linux. So I look forward to asking him about linux.

Tuesday, March 15, 2011

Time to work

So for a couple of weeks my team and I had some technical problems, but now all those problems are gone(at least the ones on my end). Instead of using tomcat to run a web server I could have used eclipse to do it, so that worked out a lot better than trying to configure tomcat(Major thanks to the guys on the IRC). So now we gathered together to create a timeline for what we wanted to do for the rest of the semester. The time line can be found here.

Wednesday, February 23, 2011

Chapter 7 Exercises

The chapter 7 exercises kind of tied in with some of the things I had been learning in operating systems so I was excited to combine the two together to do these assignments.  


7.2.2: For this exercise, I had to create hello.c.punct and hello.c and you use the unix diff -U command to test the output. With the -U the diff command output is...


--- hello.c.punct       2011-02-23 13:48:18.000000000 -0500
+++ hello.c     2011-02-23 13:50:01.000000000 -0500
@@ -5,6 +5,6 @@
 #include <stdio.h>
 int main() {
-    printf("Hello, World.\n");
+    printf("Hello, World!\n");
     return 0;
 }
while the output without the -U looks something like this:
8c8
<     printf("Hello, World.\n");
---
>     printf("Hello, World!\n");

7.8: The next assignment was to create a file  that represents a new file, foo being created with the contents bar. So first I needed to copy the original bar files into bar.c.original and then edit bar.c. to contain the new patch information. The I used the command $ diff -u bar.orig.c bar > foo.patch which created a patch file with the contents of bar.

7.9: This assignment was to patch the echo command from the coreutils project so that it echoes out arguments in reverse order. Although this assignment was not hard since there is a walkthrough in the TOS book I still took my time  and read the directions very carefully. After I download the necessary files, it was time to edit echo.c. After making a copy of echo.c, I went and edited the statements that needed to be fix and created the patch. Of course after making the patch I had to test it and it worked!!!. I felt so accomplished.

Tuesday, February 22, 2011

Finding a needle in a haystack

Implementing a fix for our bug doesn't seem like it would be to hard but first we just had to located where to implement our fix. After searching tons of .java,.js, and .jsp files. I finally came across two files that might help with shortPatientForm.jsp contained the code that deal with prefered identifiers so this was probably the best way to look.


code:
for (var x = 0; x < inputs.length; x++) {
            var input = inputs[x];
            if (input && input.name == 'identifier' && input.type == 'text') {
                input.name = 'identifiers[' + index + '].identifier';
            }
            else if (input && input.name == 'preferred' && input.type == 'radio') {
                input.name = 'identifiers[' + index + '].preferred';
                input.id = 'identifiers[' + index + '].preferred';
            }




I suppose that  a loop can be added to test if the user has not clicked the preferred check box and has more than one identifier and If the user has not clicked preferred they will not be able to add/update a patient.
    

Thursday, February 10, 2011

Solving a bug

"A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways." 
Keeping this in mind, my team and I set out to find a bug that would be simple for us to attempt to fix. Our project has been open for about 7 years so we had tons of bugs to dive into. One "bug" I found was for Timezone Support, but going with the definition above  I wouldn't actually consider this a bug however as it seems more like a feature that should be added but it seems like it would be easily implemented by my team since both mysql and Java have way to deal with timezones. Unfortunately this is not really a bug so my search continued. Bobby was able to find an interesting bug, where we would need to implement some sort of code to make users select a preferred identifier. There is also is TRUNK-222 in the introductory tickets, where if a patient only has 3 letters in their name you can search for them without knowing his family or middle name, which may or may not be simple for us to fix I have not actually looked at the code so it would be hard to judge. When I tried this bug myself, it seems to have been fixed with the newest version but this is not documented.

Tuesday, February 8, 2011

More Bugs, More Problems.



For openMRS, joining the bug tracker was very simple and straight forward. Searching through the bug logs was quite simple too, I was able to find the oldest open bug relatively easily it took time to derive the way the bugs were divided though. Bugs are given 3 different typings,Could, Should, and Must. The oldest bug under the could category is trunk-333.The oldest "should" bug is trunk-330. Both bugs have a severity level 3 so they are not a the top of the list of things to do but one team are looking into fixing trunk-333 and as of now trunk-330 is not assigned to anyone.

Reproducing a bug
After searching through the bugs  I found trunk-1702 .The problem was that ConceptService#saveConceptNameTag() does not save changes to the object rather it returns an existing object from the database. There is no other method to update ConceptNameTag either. My assignment was to see if I could reproduce the bug in the current build, OpenMRS 1.8. Despite my best efforts I was not able to reproduce the bug no matter how I tried, this bug has been fixed since version 1.6 so the original fix still does hold. I emailed Rafal Korytkowski to see if there are any steps that could be taken to reproduce the bug, he is pretty active so he should get back to me sometime soon.

Bug Triaging
For bug Triaging I chose 5 different bugs...

1. Trunk-1975-The BinaryDataHandler "getObs" method creates a complex obs where the data component is a FileInputStream. The getObs method leaves this input stream open when it returns the obs so that other methods (such as the ComplexObsServlet) can access the stream.
However, if the stream is not explicitly closed, the lock on the file is never released until the webapp is restarted. 
This ticket needs a severity level of 4 becauses if this project is going to be use by people who are not computer savvy, then they may/will not know how to explicitly close the stream. This ticket is well documented.
2. Trunk-1955 With this bug if you start to type Miriam and then back space it and type James Arbaugh, it yields results for "Mi". While this is bad, the severity level of this a lot lower than the first bug but it is necessary to fix. It is written well a  and definitely needs to be addressed.
3. Trunk-1963  this bug is a bit more confusing for me, maybe because I am new to OpenMRS or its the way its written. The original poster should probably reword this issue so that the severity level can be determined.
4. Trunk-201 this is an ideal bug report. The user provides not only what the bug does, the user tell you the exact steps used to reproduce this bug which will be very helpful when others try to fix it. The severity level should probably be about 3.
5.Trunk-2003 This bug is interesting because when a user adds a new patient address or name or identifier and they get sent back to the form after validation errors. The steps to reproduce it are very simple and its severity level is moderately high.

Sunday, February 6, 2011

Success well kind of...

After the last class meeting on Thursday, I sat down at my computer and started working with much more vigor than I had before. Before attempting to reinstall ubuntu on to my machine, I sat down and took a great look a the ubuntu docs to learn some commands that I should become familiar with and even figure out how to get the wireless network working so I wouldn't have to carry an Ethernet cord everywhere I went.  It was a relatively simple fix that I had overlooked many times before, but now that ubuntu was reinstalled it was time to attempt to build openMRS again. After using windows for all my life I was some what intimidated by the openMRS installation process in ubuntu, but I was quite easy. Thanks the google, installing all of the necessary software to run openMRS was a lot smoother than when I attempted the installation on windows. Sure there were errors here and there but the overall experience was ten times better. So after installing all the software it was time to download the code and build the project. Downloading the code was a very straight forward and simple process, but once I tried to build the project in eclispe it did fail so I will have to do a little more work on that but overall I would say I was pretty successful.

Thursday, February 3, 2011

Creating Executable Binary Code

Our next mission was to take the Freeciv source code and convert it to executable binary code. As with most things this semester, The process of turning source code into executable binary code can be extremely complicated and frustrating, but luckily i'm always for a challenge. I learned there are 5 main steps to building a project:
1.Compiling the code 
2.Linking object files and libraries 
3.Determining Build Dependencies
4.Testing the Build Results 
5. Packaging and Deploying

Also thanks Build automation tools, we don't have to do all these things by hand. I also learned many things that can help me with building the openMRS project.  For instance I was having trouble building openMRS so this quote stood out to me... "As you proceed through the build process, you may see many of the same errors; you may see completely different errors. No matter what happens, keep calm and carry on. Read the instructions. Don't expect to understand every word. Read logs carefully and thoughtfully. Google is your friend. Ask for help."


One of the first step was to install the gcc compiler since FreeCiv is written in C and had be done in Linux or UNIX.  Next gmake had to be installed. Installing gmake taught me a very important lesson of always, always read the instructions. This will probably be the most important thing I have ever learned because the building process can be overwhelming for anyone. After finally gathering and installing all of the prerequisites it was time to configure the project. Unfortunately  me and ubuntu/virtualbox have not quite come together just yet so I was not able to successfully configure the project, however I'm still attempting to configure the project and will update when possible.

Monday, January 31, 2011

Its tool time!!!

    Building OpenMRS was a bit of a challenge. In order to build the project several different resources along with source code was necessary. First things first I had to reinstall a Java Development Kit(JDK) which was simple and straight forward. 
   The next step was to set up a mysql server on my machine, since OpenMRS stores its records with mysql. I have use mysql before but I never actually had to set up a server so I consulted this site, which I thought would help make this process a lot easier. Setting up the server actually gave my a few errors even after I followed the prompts exactly so I will come back to that later.
   For Now i'm downloading the Subclipse, a plugin that integrates Subversion/SVN into Eclipse and Apache Maven, an open source build system that manages dependencies as well as trying to resinstall the mysql server.

Thursday, January 27, 2011

Ubuntu

So my next big challenge is learning to use ubuntu which isn't required to build the project but I figured I should probably learn to use it some time, So here goes nothing. Side note I can't believe I made it all the way to senior year and never had to learn how to use it but I digress. Downloading Ubuntu now hopefully I will have better luck building it than I did on windows.

Subversion Update

 After a couple of mins downloading tortoise, I was able to successfully install and connected to the test repository. I messed around and tried uploading some files,downloading, and even making changes to files. Everything checked out so far. Tortotise even adds commands to the explorer menus so all you have to do is right-click on files and add them the repository which could prove to be very helpful in the future.  Setting up a server was not as hard as I thought it would be at first. After look at this page, I tried the first three under the windows section. The first two didn't want to cooperate but the third one, VisualSVN Server was a lot easier to set up it was quick and relatively painless. Its also very beginner friendly and easy to use. Using both Visual SVN and tortotise I was successfully able to create my own repository server

Subversion Fun

   Although I was some what familiar with how subversion works thanks to my time with Dr. Boetje in CSCI 362, I had not actually used it.  Since I've never used subversion before I figured I would log into the cirdles playground and just start pressing buttons and get a hang of subversion, sadly that wasn't the case. For some reason resnet didn't really like the server but that was no problem I went to the Computer Science lab and got much better results with cwwpa, but I still had a lot to learn. After logging the cirdles playground, I was able to visit all the folders currently in the repository. I was able to download/read these files but I couldn't do anything else with them so my next step was to download TortoiseSVN. After the download I will continue blog about my experiences with subversion

Wednesday, January 26, 2011

Bugs Bugs everywhere...

 My team has finally begun to look deeply into the openMRS project. We found out some interesting info about where this project all began. OpenMRS started in 2004 as a effort to store medical records in a way which makes it easy to summarize and analyze. This project was founded  by  Regenstrief Institute and Partners In Health. OpenMRS is currently used in several different countries such as South Africa, Kenya, Rwanda, Lesotho, Zimbabwe, Mozambique, Uganda, Tanzania, Haiti, India, China, United States, Pakistan, the Phillipines, and many other places. Although this project  is far along in development my team and I quickly found a list of all the bugs that currently need fixing. One bug in particular we looked at was Add startDate and stopDate to Relationships, which is a simple "love bug" as some like to call it.
here is the description:

Relationships should support effective start and end dates.
Changes to data model:
  • add relationship.start_date
  • add relationship.end_date
Changes to domain objects:
  • add Relationship.startDate
  • add Relationship.endDate
Changes to API (needs further thought):
  • add a variant of the getRelationshipsByPerson method with a Date effectiveDate parameter?
  • add a variant of the getRelationships method with two Date parameters (for a range)?
Changes to UI (personRelationships portlet)
  • Currently-active relationships should be shown above closed relationships
  • If an existing relationship has date bounds, show them (in small text)
  • Change the add relationship popup to allow an optional start date
  • The [x] which currently pops up a delete function should give you the option of closing vs deleting
Hopefully we will be able to successfully fix and get this bug implemented.

Thursday, January 20, 2011

Joining openMRS

On Tuesday, my team and I all joined openMRS's mailing list as well as their IRC channel. So far the IRC has been pretty dead for the most part. There was one person who was having trouble building openMRS and it took him about 15 mins so its not to dead but its not as active as I thought it would be. The Mailing list was was very interesting though. There are many bugs that need fixing and building the project can be a task, but the others working on this project are pretty so nice from what i've seen and they are always willing to help. Many forums I've been apart of often flame users for not using the search function for the forum, but the people on OpenMRs are very friendly. I read "The Cathedral and the Bazaar" and found it to be a very interesting piece. One key thing that stuck with me after reading this piece was you should never try to reinvent the wheel unless you absolutely have too, you should instead take the wheel and make it better.

Monday, January 17, 2011

And now the Fun Begins

Last Thursday 01/13 all the teams began looking at H/FOSS open source projects.  I was kind of intimidating at first because of how many different projects there were, but after diving in and look at many different sites my team and I were able to find many different projects. One project that stood out to me was  Project Possibility. Project Possibility  is a nonprofit organization dedicated to creating groundbreaking open source software for persons with disabilities. Since I team is Team Handicapped I figure it make since that we did a project on software to help the disabled. Project Possibility is made up of several applications  all developed in java. Which is a language everyone in my team is familiar with.

Tuesday, January 11, 2011

Day One

 Its only Day one and i'm really excited to learn about open source projects. Plus i'm all set to go to POSSCON 2011. Going to read, "Teaching Open Source", now.