Archive for the ‘Uncategorized’ Category

Halloween Costume Decoration/Construction

Monday, October 4th, 2010

The majority of the individual pieces are done.  There are a few ‘technical’ pieces left that can wait a while: the main focus now is sticking everything together and decorating it.  We’ve been making some good progress on this, once we decided how we were actually going to decorate everything.

So here’s the new ‘construction’ burndown.  It shows those components (made of several pieces) that are complete.

Halloween Costume Scope Change

Sunday, September 26th, 2010

As with most (all?) projects, we learn something new along the way.  This happened this morning with the Halloween Costumes.  There’s one component that needed a bit of a redesign and that means new pieces.  So, I’ve frozen the burndown image in the previous post and will include a new updating one here.  This new image reflects the need for a previously unexpected 8 reenforcement pieces.  I had a stellar preparation day yesterday and even did some construction where it made sense (composing components from the pieces).  My mind is starting to think about how we are actually going to do the decoration that will bring the costumes to life: decorate before or after construction?

Interesting to note that the way my spreadsheet was set up, when I upped the total number of pieces it gave me a negative velocity.  That obviously can’t be the case.  The velocity shouldn’t change downward because of the new work, I’m am still completing work at a similar rate to previous: there’s just more work to do now.  I fixed up my spreadsheet so that velocity is appropriate (the number of pieces ‘done’) and the remaining work has gone up too.  The day is still young(ish) and if I choose I could make a concerted effort to bring the project back onto the previous schedule, or I can have a chat with the PO about pushing the schedule or reducing scope.  As it is I’ve started with plenty of time and effort cost is only my time (and I’m enjoying the work).

The more I do, the more pumped I get that this is going to be a seriously awesome costume!

Halloween Costume Burndown

Tuesday, September 21st, 2010

My Halloween costume this year is going to be epic.  We gave everyone a chance last year, but the return of something on the level of paper mache Pinky and The Brain must be seen this time around.

The (secret) costumes I’ve selected (plus other friends) requires a whole bunch of ‘pieces’.  We’re in the prep phase so we’ve got piles of inventory building up.  This isn’t very lean, but I thought at least we try a little agile.  Note that the total number of pieces may go up at any point as we refine the design.

So, here’s the burn-down for the preparation phase – still got a ways to go!

Piece Burndown Snapshot

Vi learnings

Sunday, May 17th, 2009

Here are a few useful vi keystrokes I learned the other day (from colleagues and from the help system):

Searching without case-sensitivity – global switch:

:set ignorecase

Searching without case-sensitivity  – for a single pattern:

prefix the pattern with \c

Searching backwards:

? (rather than /)

Search again in the opposite direction:

N (rather than n)

Nothing too thrilling, but it makes using vi that little easier.

Adding an auxiliary enchancer to OpenJPA

Tuesday, December 2nd, 2008

A while back I attempted to create a visualization of the relations that OpenJPA creates between the Java classes that it enhances – the intent was to help better understand a particularly intertwined persistent object graph and see if I couldn’t figure out why we were getting a few strange problems.

The initial approach I took was a hilarious trip into the land of sed, perl and graphviz.  It kinda looked like it worked, but didn’t actually :P

Time passed……more time passed……I learned more……more time passed…….and then I had the wacky notion of tying directly into the Enhancer that OpenJPA uses to create the persistence enabled classes.  I haven’t done the visualization yet, but this is what I learned about actually tying in an AuxiliaryEnhancer.

1. Create the AuxiliaryEnhancer

The following code is the minimal you will need.  Enter this and then compile – you will need OpenJPA and serp on your classpath.

package com.ij;

import org.apache.openjpa.enhance.PCEnhancer.AuxiliaryEnhancer;
import serp.bytecode.BCClass;
import serp.bytecode.BCMethod;
import org.apache.openjpa.meta.ClassMetaData;

public class Grapher implements AuxiliaryEnhancer {

    public void run(BCClass bc, ClassMetaData meta) {
        System.out.println("Running Enhancement");
    }

    public boolean skipEnhance(BCMethod m) {
         System.out.println("skipEnhance?");
         return false;
    }
}

2. Register the enhancer using jar based services

This is something I was only barely aware off – registering concrete implementations of services through jar file meta-data.

  • Create a file in a META-INF/services/ directory called org.apache.openjpa.enhance.PCEnhancer$AuxiliaryEnhancer
    • Note the dollar sign! That one caught me out for a while: I couldn’t decide whether the dot notation or the dollar notation should be used to reference the nested class.
  • This file should simply contain the fully qualified name of the Enhancer you wrote: com.ij.Grapher
  • Jar this directory and the class file up and you should end up with a jar listing like this
ivan-jensens-computer:jar ivanjensen$ jar tvf ../grapher.jar
     0 Tue Dec 02 21:56:42 PST 2008 META-INF/
    60 Tue Dec 02 21:56:42 PST 2008 META-INF/MANIFEST.MF
     0 Tue Dec 02 21:54:28 PST 2008 META-INF/services/
    16 Tue Dec 02 21:30:44 PST 2008 META-INF/services/org.apache.renamed.openjpa.enhance.PCEnhancer$AuxiliaryEnhancer
     0 Tue Dec 02 21:55:16 PST 2008 com/
     0 Tue Dec 02 21:55:38 PST 2008 com/ij/
   771 Tue Dec 02 21:55:38 PST 2008 com/ij/Grapher.class
   465 Tue Dec 02 21:54:46 PST 2008 com/ij/Grapher.java

3. Add the new jar file to the enhancer classpath

I did this by adding my jar file to the classpath element of my ant script – pretty simple.

4. Re-enhance your classes

Re-enhance your classes and you will see the System.out.println statements all over your console.

 [openjpac] skipEnhance?
 [openjpac] skipEnhance?
 [openjpac] Running Enhancement
 [openjpac] skipEnhance?
 [openjpac] skipEnhance?
 [openjpac] skipEnhance?
 [openjpac] skipEnhance?
 [openjpac] skipEnhance?
 [openjpac] skipEnhance?
 [openjpac] skipEnhance?

One thing I noticed about this: I had to delete my persistent classes and re-enhance, only then would the ‘run’ method be called.  The skipMethod is called whether I delete the classes or not.  I don’t know what that means yet, but I’m sure I am about to find out.

Notes:

I was actually using a patched version of OpenJpa 1.0.1 (for various, non-amusing, reasons), but the patches shouldn’t affect this tutorial.

Software Engineering Radio – fantastic podcast

Sunday, August 24th, 2008

About two months ago I stumbled on the Software Engineering Radio podcast, and in my opinion it’s one of the best techy podcasts out there (anyone knows any different?).

There are currently 107 podcasts available and the 13 I’ve listened to (and listened to again) have been worth their virtual weight in gold.  There are a lot of interviews about many, many topics and the interviewees really know there stuff.

SE-Radio is an invaluable resource for the professional software developer.

The Ultimate Commit Token

Thursday, April 24th, 2008

I’ve rarely had to use a commit token.  The teams I’ve worked in generally edit unrelated source items as much as is possible.  Over the years I’ve read about various amusing items being used as commit tokens: rubber ducks, action figures, hats and little flags, to name a few.  The general idea is that you should physically have the token to be allowed to commit – meaning there are no updates made to the source repository so your changes will go in cleanly.

It is possible that this could be side-stepped though – Mr Naughty Committer might pretend to be holding the Pokémon and commit – how can the source repository be expected to know where Pikachu is at any given moment??

However, one of my colleagues had a great idea the other day – ‘The Ultimate Commit Token”.  Simply appropriate one of those single use password setups with a single key fob.  You could try borrowing it from your corporate VPN setup – I’m sure they wouldn’t miss it.

The Ultimate Commit Token!

Wire your pre-commit script into the server-side element and have the fob floating between developers.  Et Voila! One very annoying, yet extremely effective commit token!!!

I know, I know, it’s not very exotic looking, but fear not!  I reckon it would look natty glued to the back of Spud Of Nine.

Spud Of Nine

Hello World

Saturday, February 9th, 2008

It does for for programming, it’ll do for blogging – Hello World!