Friday 16 September 2011

Released a New Open Source Library

For a while it has slightly or mildly annoyed me how clunky creating random data can be.
You see all manner of approaches from Importing CSV files and XML to loading up JSON objects and the like.
What I have wanted was a library that allows random or specific generation into your Java POJO domain model which you then simply persist using your preferred storage layer (Hibernate, JPA, Neo4j) etc.
DBUnit is fantastic and I have often used http://www.generatedata.com to generate XML files to upload through DBUnit.

Well know I sctarched that itch over the last day to create the aptly named

random-data-generator - http://code.google.com/p/random-data-generator

In short, see the project page as it explains most of how it works. It is a library for use in your code for "seeding" objects with random data.

Enjoy.

Thursday 15 September 2011

Love *Nix

I Still love *nix after all these years. It only took me 1 minute to convert lines like


1880,"Mary",0.072381,"girl"

to what I wanted.

$ grep \"girl\" baby-names.csv | head | cut -d, -f2 | sed 's/"//g;s/$/,F/g'
Mary,F
Anna,F
Emma,F
Elizabeth,F
Minnie,F
Margaret,F
Ida,F
Alice,F
Bertha,F
Sarah,F

Current 5 booksmarks @ del.icio.us/pefdus