Thursday, October 27, 2011

Blog Purpose

My blogging has been erratic and without purpose. There has been no reason behind any of the blog posts I've written. I want there to be a purpose and a future goal for my blogging. I've decided to work on my online presence. My goal is to create a professional persona to help me asses my strength and weaknesses of my programming capabilities.

The purpose of my blog is to showcase my learning. I will start detailing everything I'm working on.
  • Demonstrate my willingness and curiosity to continue increasing my programming knowledge.
  • Demonstrate I understand content related to programming.
  • Demonstrate my researching ability.
  • Demonstrate my writing ability.
  • Demonstrate my critical thinking ability.
  • Demonstrate my creativity.
  • Through my writing, develop and demonstrate my unique professional personality and character.
  • Develop and demonstrate my social media skills.
  • Begin developing my professional brand, not as a job-seeker in my field, but as a thought leader in my field.

My writing to this point has not clearly demonstrated any of these standards. One of my goals is to be able to clearly articulate in my writing what I'm working on so that everyone can understand. When I write what I'm working on, I want the newbie to the professional to understand what I'm explaining. I always hacking on something, whether it's Java or Rails or CSS and XHTML, I will have something to write about. It will take a lot of deliberate practice to get my writing to this point.

Wednesday, October 26, 2011

Apache Ivy

In researching Apache Ant and how to create a build.xml file, I discovered Apache Ivy. Apache Ivy is a dependency manager that can easily be integrated with Apache Ant.

The main and most frequent way to use ivy is from an ant build file. However, ivy can also be called as a standalone application. If you use ant version 1.6.0 or superior, you just have to add ivy namespace to your project (xmlns:ivy="antlib:org.apache.ivy.ant") attribute of your project tag, and you can call ivy tasks.
 <project name="sample" default="compile" xmlns:ivy="antlib:org.apache.ivy.ant"> 
The build will use Apache Ivy to download, install, and manage third party libraries of the different tools needed for the project. The retrieve task copies resolved dependencies anywhere you want in your file system. Below is an example of adding checkstyle to the project.
1:  <target name="install-checkstyle" description="Install checkstyle."> 
2: <ivy:retrieve module="checkstyle" organisation="com.puppycrawl" revision="5.4" pattern="${basedir}/lib/checkstyle/[artifact].[ext]" sync="true" conf="bundled" type="jar,report"/>
3: </target>

Tuesday, October 18, 2011

Build System

The build system is extremely important. It provides a standardized way for anyone to build the system. Users can build and test the system without an IDE. Developers can build and test the system using their IDE of choice. This automated build is helpful in preventing errors, testing, and deployment. Developing a robust build system can ease the process when maintaining a large and/or complex software system.

My build system will need to become a template. As a template, I can adapt it to any project I create. The build system will be modular and extensible to become as big or as small as needed. It will integrate any third party build tools. It will handle junit, checkstyle, and any other third party build tools that the build system requires. It will be able to download, install, and manage all third party libraries needed. It will support web application development.

Below is the beginnings of a build file. It contains two targets, clean and compile. It's very simple in what its doing. I am studying the Ant manual to learn how to integrate the third party build tools and libraries into the build system.

1:  <project default="default">
2: <description>
3: The build file.
4: $Id$
5: </description>
6:
7:
8: <property name="src.dir" location="${basedir}/src"/>
9: <property name="build.dir" location="${basedir}/build"/>
10:
11:
12: <target name="clean"
13: description="Delete build/ directory.">
14: <delete dir="${build.dir}"/>
15: </target>
16:
17: <target name="compile"
18: description="Compiles the code.">
19: <!-- Ensure that the build output dir exists. -->
20: <mkdir dir="${build.dir}/classes"/>
21: <!-- Now compile the system. -->
22: <javac srcdir="${src.dir}"
23: destdir="${build.dir}/classes">
24: </javac>
25: </target>
26: </project>

Thursday, October 13, 2011

Configuring My Java Build Environment

In my efforts to improve my programming skills, I have decided to get back into Java programming and building large projects. My previous involvement with a large Java project was seven years ago as a university of Hawaii student with the CLEW system. The Collaborative Educational Website (CLEW) was a web application development framework for collegiate department websites.

Environment Configuration

The current laptop I will be working on is a Toshiba Satellite A505 running on Windows 7 64-bit. It has a 1.60 GHz processor, 4 GB RAM, and over 100 GB of free space. My first step is to create a high quality Java software development environment. I downloaded and installed the Java 7 JDK and JavaDoc documentation. I added %java%/bin to my computers PATH variable. I downloaded and installed the Eclipse 3.6.2 IDE. I chose "Eclipse IDE for Java EE Developers" to work on the Java projects. To improve the performance of Eclipse, I modified some runtime options. Increase the heap space for Eclipse. I have at least 2GB RAM. In the eclipse.ini file, I changed -Xms=40m to -Xms=512m and -Xmx=512m to -Xmx=1024m.

To verify my configuration was working, I wrote a couple of basic programs in my eclipse IDE. I wrote the generic HelloWorld program that worked fine. I wanted to try something else so I searched online and found a simple program to implement called FizzBuzz. FizzBuzz is a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". I was able to implement a working FizzBuzz program. My initial configuration was working.

Build System

This is the point in my configuration where I am stuck. The build system I used for CLEW included apache ant, jakarta tomcat, junit, checkstyle, and other tools. Are these tools still relevant?

In my research for build tools, the top two I came across were Ant and Maven. Ant is open source, Java-based, extensible, and uses XML configuration files. Maven is project management technology that uses convention over configuration. Ant is still very popular and I am familiar with the Ant concepts. Every project requires an Ant build file, build.xml. Each build file is composed of targets. Each target is composed of tasks. And targets can have dependencies.

I downloaded and installed Apache Ant 1.8.1. I added %ant%/bin to my computers PATH variable.

Now What?

Next in configuring my Java build environment will be to include the different tools to help build a working project. I will look into junit, checkstyle, and other tools currently being adopted. When I get a build environment up and running, I will begin my Java programming.

Thursday, January 13, 2011

Learning by Doing

After graduating from the University of Hawaii, I fell into a programming funk. I didn't know what to do, how to get started, or where to get help. I felt like none of the courses I took prepared me to take a project from development through to distribution. I missed not having access to Professors, TA's, classmates, and friends. I finally took action and contacted my mentor for guidance.

His advice was to just start hacking. Do anything. Think of an idea and try to implement the program. Work by trial and error. If you encounter an error, try to figure it out with research and fix the problem. There is no better way to learn then to just do it.

I found the following on a website the echoes this sentiment.
Program. The best kind of learning is learning by doing. To put it more technically, "the maximal level of performance for individuals in a given domain is not attained automatically as a function of extended experience, but the level of performance can be increased even by highly experienced individuals as a result of deliberate efforts to improve." (p. 366) and "the most effective learning requires a well-defined task with an appropriate difficultly level for the particular individual, informative feedback, and opportunities for repetition and correction of errors." (p. 20-21) The book Cognition in Practice: Mind, Mathematics, and Culture in Everyday Life is an interesting reference for this viewpoint.
This concept of learning by doing would have been nice to have done while at UH. Looking back I feel my focus was more on completing assignments before the due date to get the best grade to pass the class to get to graduation. I didn't immerse myself into the subject to fully understand it and relate it to a real world problem. Because of this, I didn't have the right mindset or ask the right questions. I would've liked to learn by doing with the class, during class, with the professor giving feedback and correcting errors as he instructs. My ideal situation would've allowed more natural learning and less lecturing.

I've been thinking a lot about my student self. I feel I approached learning all wrong. I put more effort into getting through my courses then being in the moment and participating. I've come to realize my goals were geared towards doing what I needed to do to move up instead of understanding the material. It would've been amazing to be given a difficult task and allowed to fail without the consequence. My failure would have been an opportunity to teach me where I went wrong and how to correct the mistake for next time instead of failing me with no idea or explanation why my work was unsatisfactory and forced to retake the course.

It wasn't all bad. I had a few courses that allowed me to learn by doing. We worked on real world projects. I was able to receive informative feedback and correction on errors. In one of these classes I was introduced to pair-programming. Pair-programming is a great concept.

Over the past year of I've been learning a new programming language and hacking away implementing a variety of programs. I am gaining a deeper knowledge of Ruby on Rails, CSS, and XHTML. In this process I'm learning more about utilizing the MySQL database, how the MVC paradigm works, how to work with plugins and gems, authentication, uploading images and videos, dynamic select menus, and many more things. I am coming to the conclusion that a year of learning by doing has given me a better understanding then the majority of Computer Science courses I took at UH. Out of the 15 or more ICS courses I took during my time at UH, only two were helpful, ICS 413 and ICS 414.

I will be continuing my learning by doing. My current project is a web application using Rails. My ultimate goal is to get my webapp online. I also plan on getting back into Java development. My last foray with Java was using the Struts web application framework, eclipse, ant, tomcat, mysql, and cvs. I will be looking into what I need to develop with Java and if any of the preceding tools are still relevant.