Moving GIT project between repository hosting systems [Problem with large files]

One specific problem encountered during the process of moving Git project from Google Code to GitHub was the large file. Firstly the large file was not in the current version but was somewhere in the history. Size of the file was around 450MB. What we needed to do was to first remove that large file from the Git history and to rescue our project we found BFG Repo-cleaner ( It introduces itself to be an alternative to git-filter-branch which is faster, simpler and easy to use. Continue reading

Date Time API – Java 8

Package java.time has been introduced in Java 8 forming the main API for dates, times, instants and duration. The Date-Time API uses the calendar system defined in ISO-8601 as the default calendar. Some classes in the Date-Time API are intended to represent machine time, and others are more suited to representing human time. All the classes under this package are immutable and thread-safe. Further the following packages: Continue reading

Generate random test data using DataFactory

Unit testing, integration testing or any other testing requires input data. And to generate this input data which is close to the real world format example x.getAddress() returns “Crescent Services located at 1085 Cloveridge Boulevard” could be a quite a task if one has to write some code to generate it randomly. To make the testing easier one has to make use of some library which would give all the data required. There might be other libraries available but my personal choice is DataFactory. Straightforward and simple to use, many helpful methods like fetching a random date between a range, getDateOfBirth(), getEmailAdress() and so on,

Andrew Gibson himself has written a good article on java.dzone

Recension av Clean Code: A Handbook of Agile Software Craftsmanship

Clean Code är skriven av Robert C. Martin, även känd som Uncle Bob. Han har arbetat som mjukvaruutvecklare sen 70-talet, är engagerad i agil utveckling och en förespråkare av testdriven utveckling. På denna länk finns kod utvecklad av Uncle Bob: Där finns bland annat FitNesse som tas upp som exempel i boken. Continue reading

Data validation made simple using Bean Validator

There are many validation frameworks out there. But the one that we are going talk about is Bean Validation API (JSR 303).  With Annotations and a simple API it is quite straight forward to express constraints on data; objects. The implementation’s that I have come across are from Apache and Hibernate. An example say’s more than 1000 words as mentioned on Hiberate Validator site.

public class Car {

   private String manufacturer;
 Continue reading 

JFocus 2013 PM

Continued from JFocus 2013 AM

When we had attended the web sockets / web service hands-on lab, I went on to the next session, Simon Ritter had a 3½ hours session about the raspberry pi.

To sum up, the raspberry pi is a credit card sized computer with 512 MB memory, 1 GHz ARM Cortex. It has powerful (compared to its size) graphics capabilities, that makes it possible, to run HDMI. It is built to run Linux and there is a lot of different distributions, but there is an Android build in the making.

The interesting part here is the graphics processor built in the processor. Since this was a lab and everyone could not bring a screen and keyboard and mouse to the lab we used our laptops, accessing the Linux build through VNC, and in this case the VNC client was running the graphics on the CPU.

Now this is normally not a problem but since the hands-on lab was about implementing Java FX on the raspberry pi platform and learning about how to use a small powered CPU and Graphics processor with Java FX that can be quite demanding, this proved to be a minor flaw in the course.

Given that the demonstration was about how powerful the GPU was and the VNC client did not access the GPU, the demonstration failed.

The course about Java FX was rich and I learned a lot about another way of using the Java FX, but in general bad execution made several of the attendants to leave the class room.

JFocus 2013 AM

I was so fortunate to attend to jFocus this year. Though it was this sprint I wanted to wrap up the year by going through the events I attended.

The first course I attended was a Hands-on Lab where we looked through Websockets and Webservices, two subjects that I am personally interested in. The main examples lets us make and run a basic website called movieplex. The main page is a template website that is connected with basic html to a web service.

When we went through the lab, some of the technology was so new that we needed to download the newest versions of glassfish the application server we used, and the newest version of java 7.

The Lab was separated in to two parts, first part was building the web service, going through the basic of JAX-RS and the second part was connecting to the web service to the web socket.

The connection of the web socket to the web service, was painless and with minimal effort, just adding a few lines of code to the project.
I have included the project files, if you are interested in trying out the lab yourself.

javaee7-hol page_white_acrobat lab-guide page_white_acrobat