Saturday 24 September 2011

Using Git Diff

Having never performed a Git Diff on Tags I thought I'd give a simple demonstration of what to do. We currently use fab for tagging and deploying Git projects at work and all in all it seems to do it well, its the first deployment aid which I have seen whilst using Git and as we transition from sub version to Git it fills the gap until proper release and deployment scripts can be written.

Get the current history for the project you want to diff version.
git hist



Get the git tag commit hash's 

tag v10 = 8df952f
tag v11 = 1ed9472

Diff the versions:

git diff 8df952f..1ed9472

You how should be presented with the diff between those git commits.

Tuesday 20 September 2011

List Object Array Matcher

I've been dealing with lots of large batch object arrays recently and when writing a unit test I found there's is no built in Object array matcher as part of the current Hamcrest matchers package so I made a simple one earlier.

Wednesday 14 September 2011

Using iText to create QRCodes

Recently I have been playing around with iText trying to determine how to stamp a QRCode on to dynamically generated Pdfs.

Its simple to create a QRCode using iTexts built in BarcodeQRCode .class but stamping this on to a PDF is alittle bit unusual and I am unable to find an alternative as it stands.

First you must either create a button in code or place the button on your template which is being stamped, I've called mine barcode_button and I placed this on my template in the correct position and size.

Next you must get hold of your button, create your QRCode and the set the button image to be you QRCode you created, then finally replace the button on the PDF with the new one.
When you finalise the document and close it you will end up with a nice QRCode where the button once sat.


Further examples of creating QRCodes with iText can be found @ http://itextpdf.com/examples/iia.php?id=156

Sunday 11 September 2011

Thoughts and Ramblings

I've been busy pretty much every weekend for the last 6 weeks, either visiting friends, family or knee deep in jobs around the flat. Unfortunately this has left me no time for coding which hurts, but on the bright side, over the last few weeks due to the journey time when travelling around England it has allowed me to catch up on some good reading. I have had a reading list either on-line or on paper for some time and this time has allowed me to nail through some good books and hopefully in-turn allowed me to try some new ideas and improve my overall agile practices. My reading list is available on git-hub @ https://github.com/jamesemorgan/reading-list

Agile Software Development, Principles, Patterns, and Practices


Blog: http://cleancoder.posterous.com/
Author: Robert C. Martin


This a great book in general. I've read it in bits over the last few years and after reading several of the chapters again it is full of useful and well documented code examples. I especially like the chapter on patterns, it demonstrate some of the classic and not so often used patterns demonstrating how and when to not use and use them. I've also read some other work by Uncle bob, Clean Code: A Handbook of Agile Software Craftsmanship , which is another great read and one I would recommend to other software engineers.

 

 Practices Of an Agile Developer

Web: http://pragprog.com/book/pad/practices-of-an-agile-developer
Authors:



Ship It

 

Web: http://pragprog.com/book/prj/ship-it
Authors: