Monthly Archives: February 2016

Clean Coder Chapters 2-3

In the reading for Chapters 2-3 I read about knowing when and how to say yes and that it is okay to say no. The biggest thing that I took from this reading that I hope to use in my professional career is to not make promises or say yes to something I know will not get done or not be finished on time. It is better to be honest and tell the manager or boss that you won’t be able to do a task. I hope to be more upfront with people as stated in the yes chapter where he mentions what commitment sounds like. There is no uncertainty and there is no hesitation. I believe that after the readings there is a clearer understanding for myself what saying yes and no really means and when to chose to say either of them. It is the simple words yes and no we use everyday but as a professional in your field you need to know it means more than just a work to make someone happy, you gave them a commitment that you are expecting much like you are expecting your co workers to do their part in the project.

From the blog CS@worcester – Greg Tzikas by Greg Tzikas and used with permission of the author. All other rights reserved by the author.

Setting up Environments suck, a lot.

Really, it does. It usually goes one of two ways. Scenario One: You are starting a new project  and all the perfect little tools and programs you’ve been using get tossed out the window for a new dev kit or a new compiler. Everything that you’ve had set up for months is just tossed out because the new project you are doing doesn’t use a single thing from you’re last project. Scenario Two: (The one I just had to go through.) You join a project that has been going on for a while, they tell you how they set up their environments, but its never quiet the same. Stuff gets updated, freeware they used gets removed, maybe a component or two now conflict as they have different versions, and one of them, the one that is vital to the project hasn’t been updated in months and all current downloads are busted.

Sounds like a blast, right? So you improvise, trying to get substitutes working, but the thing is most of the team has everything set up just right, and having them try to help you troubleshoot just a slightly different program than the one they had never goes anywhere. But you mange to get to the right setup eventually, or one that’ll do. So here is what I did: Cloned a project from OpenMRS, a very large opensource program my CS class is working on. Easy enough, github is a rather well polished program that is easy and simple to use. Once I got the massive collection of files onto my computer I started to get a JDK setup for it. The initial suggestion was IntelliJ. That sure as hell didnt work. After a couple of days fiddling with it, most of the class gave up on it and moved back to the tried and true eclipse program. Its solid enough and everyone is very comfortable with it, so it was a good choice. Next on list of programs I need for this project was Maven. Cool, Ive used it before, had it setup perfectly a few years back. Since then Ive had a few wipes on my laptop, so I had to get it working again. Of course, the second time wasnt as easy, in the end I figured out I had misspelled one of my environment paths for it, such a silly mistake cost me hours of confusion and annoyance. Then end was in sight! All i needed to do was get the command mvn jetty:run to work and the battle was over. And mvn failed to launch. guess who also didnt have MySQL installed. Also did have that at one point, but hey my computer likes to fail every so often once I mess with settings and things that shouldn’t be messed with. At least SQL was painless to install. Tried that magic command again, and this time it was a success! The battle with setting up my environment was over, I have conquered the mighty beast and got everything running correctly. At least until my next project in 6 or 7 months…

From the blog CS@Worcester – dkayak by Code Complications and used with permission of the author. All other rights reserved by the author.

The Clean Coder – Chapter 2 and 3

I continue to enjoy reading this book and am gaining a lot of useful knowledge to further my career and mold myself into a professional developer. The topic of Chapter 2 is something I have difficulty with – Saying No. Management always wants to squeeze as much work as possible out of their developers in the shortest possible time frame, and often they may have unrealistic expectations. It is detrimental to oneself as well as the company if one can not assert their position that a particular task can not be completed by the timeline management has laid out. Saying no can be difficult, but doing so early can prove to be beneficial by managing expectations of what is possible.

The topic of Chapter 3 – Saying Yes is obviously the opposite of saying no. However, a lot of the lessons from Chapter 2 still apply. One must present themselves as a professional and assert their positions, but also be realistic with what they are capable of. If a developer can complete an assigned task, then they should have the confidence to say so. They should be willing to commit to the task at hand and never shy away from their responsibility.

I look forward to continuing my reading and applying what I’ve read to help achieve my career goals.

From the blog cs-wsu – Spencer Leal by spencerleal and used with permission of the author. All other rights reserved by the author.

OpenMRS Setup

OpenMRS was not too difficult to setup, but there were a few bumps that I encountered. Cloning the code from GitHub was easy enough, but getting it into IntelliJ was a challenge. IntelliJ was not recognizing any packages or other imports, but a friend was able to help me find a way to add the packages to the scope of the program. After that, all code compiled, and all tests passed that were able to be run. However, I ended up moving over to the Eclipse environment as it works better for the purposes of the project. Importing into eclipse was easier, but did not have all the settings needed, so I had to install a few eclipse add ons such as Maven Integration, a better version control interface, and server options in case debugging in eclipse is needed. Next I set up the legacy ui by adding a module to the openmrs project webapp, and after it built and ran, I was able to view the ui in a local instance in a web browser. The sample data that can be viewed is rather odd however. I could find only 2 people in the sample data set and they were at positions 100 and 101. No other index has a person created. Not sure if this was purposeful or an accident, but I can atleast see what the database looks like and how it works.

From the blog shatos by shatos and used with permission of the author. All other rights reserved by the author.

OpenMRS Setup

OpenMRS was not too difficult to setup, but there were a few bumps that I encountered. Cloning the code from GitHub was easy enough, but getting it into IntelliJ was a challenge. IntelliJ was not recognizing any packages or other imports, but a friend was able to help me find a way to add the packages to the scope of the program. After that, all code compiled, and all tests passed that were able to be run. However, I ended up moving over to the Eclipse environment as it works better for the purposes of the project. Importing into eclipse was easier, but did not have all the settings needed, so I had to install a few eclipse add ons such as Maven Integration, a better version control interface, and server options in case debugging in eclipse is needed. Next I set up the legacy ui by adding a module to the openmrs project webapp, and after it built and ran, I was able to view the ui in a local instance in a web browser. The sample data that can be viewed is rather odd however. I could find only 2 people in the sample data set and they were at positions 100 and 101. No other index has a person created. Not sure if this was purposeful or an accident, but I can atleast see what the database looks like and how it works.

From the blog shatos by shatos and used with permission of the author. All other rights reserved by the author.

Setting up OpenMRS

Initially getting OpenMRS running was not that difficult, but connecting it to MySQL and installing the Legacy UI was a little more challenging. To Install OpenMRS, I simply cloned the repository to my machine. Initially I had tried importing the project into IntelliJ, but was having difficulty properly configuring JUnit to work with IntelliJ, so I switched to Eclipse. After importing the project, I used the command line to navigate to the directory the repository was in and ran mvn clean install. I then navigated to the webapp subdirectory and ran mvn clean install and then mvn jetty:run to get OpenMRS running whereupon I tried connecting it to my MySQL instance.

I had initially thought that I already had MySQL installed correctly, but I had to re-download an older version and the correct command line utilities to get it to run. I started MySQL from the command line using sudo /usr/local/mysql/support-files/mysql.server start

After starting MySQL the Database correctly connected to OpenMRS, but I still needed to get the Legacy UI. I cloned the Legacy UI repository, navigated to that directory, and ran mvn clean install. I then copied the legacy-ui-snapshot-1.0.omod to my ~/.OpenMRS/modules directory and everything was working!

From the blog cs-wsu – Spencer Leal by spencerleal and used with permission of the author. All other rights reserved by the author.

Setting up my OpenMRS Environment

To begin working on the OpenMRS project, me and my assigned team had to set up our work environment on our computers, which proved to be no simple task. Here is the list of steps I took in order to get it working on my computer.

  1. Checked the list of prerequisites we needed locally for OpenMRS
    • Java 1.7 or higher
    • Maven
    • MySQL 5.6
    • Git
    • Java IDE (I used IntelliJ IDEA)
  2. Clone the “openmrs-core” Github repository locally
  3. Run “mvn clean install” in the openmrs-core directory on the command line
    • Everything built fine
  4. Run “mvn jetty:run” in the openmrs-core/webapp directory on the command line
    • Wait for the message saying it is running
  5. Go to http://localhost:8080/openmrs and follow the instructions
    • I setup the database with demo data
  6. Clone the “openmrs-module-legacyui” Github repository locally
  7. Run “mvn clean install” in the openmrs-module-legacyui directory on the command line
  8. Copy the file “openmrs-module-legacyui/omod/target/legacyui-{version}-SNAPSHOT.omod” ON WINDOWS put into APPDATA/OpenMRS/modules
  9. Redo step 4 and refresh the page until the legacyUI loads

 

From the blog cs-wsu – mmoussa7wsu by mmoussa7 and used with permission of the author. All other rights reserved by the author.

Chapter 1- Clean Coder

This was a interesting chapter to read and was mainly all about professionalism.  It made me really think about what he was saying.  According to the author it is important to go above and beyond the normal 40 hours of work and instead take about 20 yours a week to help yourself develop professional.  This could be learning a new type of programming language, maybe working on a home computer issue but one way or another learn something new that will make yourself more marketable.  The other big part that the chapter talked about was testing and making sure that the you do lots of good quality testing to make your code and software more flexible and reliable.  This means to not only do some good testing at the end but instead you need to make sure that you are doing lots of testing throughout the development process.  This part struck me in particularly because I am going into the software quality assurance position.  This means that I am going to be one of the main people in charge of looking out for bugs and errors before the software gets released to the general public.  It is important so that you have a quality product so that the company has a good reputation for delivering high quality and highly efficient products.  Overall the chapter has given me some interesting things to think about before going into my professional career.

From the blog CS@Worcester – dperry2blog by dperry777 and used with permission of the author. All other rights reserved by the author.

Clean Coder Chapter 2-3

Robert C. Martin’s textbook Clean Coder: A Code of Conduct for Professional Programmers gives useful insight to being a professional programmer. After reading chapter 2 and 3 of Clean Coder, you can begin to understand the big responsibility a programmer or a team has when they say they “can” or “cannot” do something. When you are completing your tasks on a deadline, other people are relying on your work to be correct and functional. Accepting the task and saying you “can” do it, is not something that should be taken lightly. Sometimes there has to be compromise in order to release something that is acceptable. If there is something that simply “cannot” be done, then speak up and say what you actually achieve. A professional must fully stand behind his acceptance of a task, and be able to complete it. In order to be a professional in the workplace, you must have your own opinion on when and how something can be completed. These two chapters are all about the responsibility that every professional programmer must have.

From the blog cs-wsu – mmoussa7wsu by mmoussa7 and used with permission of the author. All other rights reserved by the author.

Setting Up OpenMRS Core

This task seemed fairly simple at a glance, detailed instructions, clear screenshots, and a group of classmates doing it together; what could be so difficult? To start off I had cloned the openmrs-core repository from github into my eclipse workspace. After doing so I had imported it as a git project from a local repository. After doing so I needed to convert the project into a maven project. After doing so I was able to run the project as maven clean then maven install with build success! Doing this was just the beginning. Next was to get it to work on command line and be able to run the UI for the EMR that we will soon be creating modules for. After getting into the top level of my openmrs-core directory I ran mvn clean install with another build success. Next I needed to download MySQL in order to have access to storing patient information and to also import the demo data that was given to test the EMR. After installing MySQL and then moving one level down into the webapp folder I ran mvn jetty:run. This connected me to the jetty server where I could see the UI. After going to the EMR setup I had found out that the UI was not  installed with the latest version of OpenMRS. I had to clone another git hub repository with the UI and run mvn clean install from command line to create an .omod file. This was then moved to my appdata directory inside the modules directory of OpenMRS. Finally! The last step was to go back into webapp and connect to the jetty server. I was now able to sign into the EMR and get OpenMRS core working. All that is left is to find out what tickets need to be worked on in the Radiology module.This was very time consuming as the project instructions were out of date or missing some information that would have helped along the way. The OpenMRS project is a great tool to help people around the globe and I hope to contribute meaningful work to this project!

From the blog CS@worcester – Greg Tzikas by Greg Tzikas and used with permission of the author. All other rights reserved by the author.