englishteeth.co.uk

… the weblog of Ian “English Teeth” Robinson
  • rss
  • Home

Site Updates

Ian | March 31, 2008

It looks like a successful upgrade to WordPress version 2.5 missing out RC2 entirely!

Not really sure what is different to RC1, but if I’m told to upgrade, I’m pretty easily swayed.

I’m more pre-occupied with my parallel change of theme to Freshy2 with the customisation plug-in. There’s loads of options to play with, but I still don’t quite know…

Comments
No Comments »
Categories
miscellaneous
Tags
plugins, themes, wordpress
Comments rss Comments rss
Trackback Trackback

Groovy

Ian |

So I can now say that I’ve had my first real project exposure to groovy!

Groovy

In this instance it was occupying the space where AWK or SED scripts might have been found in the past. It seems to sit quite naturally here; extending what you might want to do from an ANT script in a consistent/familiar syntax.

It could do much more, pretty much whatever Java can, though I’m not sure I’d be comfortable extending it’s project footprint too much.

Personally, I like the in built mark-up support… (But I’m funny that way.)

import groovy.xml.MarkupBuilder

def myXMLDoc = new MarkupBuilder();

    myXMLDoc.customer {
    	title(id:"001", "Mr");
    	forename("New");
    	surname("Customer");
    	address(type:"home"){
    		number("295");
    		addressLineOne("Fictitious Road");
    		addressLineTwo("");
    		town("Fake Town");
    		county("Notashire");
    		postCode("NO1 5NA");
    	}
    }

The above, in what seems to be a convenient and concise format, gives the following structure:

<customer>
   <title id='001'>Mr</title>
   <forename>New</forename>
   <surname>Customer</surname>
   <address type='home'>
     <number>295</number>
     <addressLineOne>Fictitious Road</addressLineOne>
     <addressLineTwo></addressLineTwo>
     <town>Fake Town</town>
     <county>Notashire</county>
     <postCode>NO1 5NA</postCode>
   </address>
</customer>

Whether this is truly useful or just an interesting diversion remains to be seen, at least for me. But, this is a great deal more workable than native Java alternatives.

The homepage for groovy can be found here and a first contact introduction to it can be found here.

Comments
No Comments »
Categories
development
Tags
groovy, java, xml
Comments rss Comments rss
Trackback Trackback

Messing about on the water

Ian | March 30, 2008

Last Easter we were involved in an accident that wrote off our car. It wasn’t very pleasant and marred what had been nice weekend visiting the family. This year we took a different tack and headed for the water; sort of ignoring that the accident happened en route and our chosen destination of the Norfolk Broads was still a few hours drive in Bank Holiday traffic.

So from arriving on Friday to leaving on Monday, I spent the weekend driving. However, it was driving a floating caravan at a maximum of 6 miles per hour and a very relaxing way to while away ones time.

Sunny on minute...

This year Easter was early (apparently due to the falling of the first Sunday after the first full moon following the Spring equinox). Combine this with a rather quirky front hitting the UK at the same time and it made for some interesting weather variations…

Snowing the next

We got it all. Wind, rain, sun, snow, hail and all could be within minutes of each other. The nights were cold, manoeuvring could get a little tricky, but the pubs were friendly, the scenery was lovely and the pace was refreshingly slow.

Comments
2 Comments »
Categories
miscellaneous
Comments rss Comments rss
Trackback Trackback

Thick and fast.

Ian | March 26, 2008

I upgraded to Wordpress 2.5-RC1 just before the Easter break and I have been getting acquainted with the new administration pages.

But before I get a chance to formulate a proper opinion, let alone a post, here comes Release Candidate 2!

RC1 seems great, can’t see any reason not to go with RC2.

Does that contradict a “if it’s not broke, don’t fix it” ethos?

Comments
No Comments »
Categories
miscellaneous
Comments rss Comments rss
Trackback Trackback

Simple URIReslover

Ian | March 25, 2008

I don’t mind admitting that despite it being pretty straight forward, I have been caught out by this more than once. So, in an attempt to prevent that Doh! moment again in the future…

The scenario revolves around an XSL Stylesheet that references another resource, be it an XML file for lookups, another stylesheet or whatever. Everything works a treat when processed locally, but blows up when invoked in its Java context. “Can not load requested doc:” or something similar.

This is where brain failure kicks in and I can’t think where the resource should be and waste time moving files around, changing references and trawling the web. In fact the reason the document cannot be found is simply because I haven’t told the transformer where, or more acurately how, to look for it!

The following is a simple reslover that looks on the class path for the missing file.

	public class ResourceResolver implements URIResolver {

		private static final String RESOURCE_PREFIX = "resource://"; 

		public Source resolve(String href, String base)
				throws TransformerException {
			if (!href.startsWith(RESOURCE_PREFIX))
				return null;
			try {
				if (log.isDebugEnabled()) {
					log.debug("Resolving stylesheet resource: " + href);
				}
				String resource = href.substring(RESOURCE_PREFIX.length());
				ClassLoader loader = getClass().getClassLoader();
				InputStream is = loader.getResourceAsStream(resource);
				return new StreamSource(is, resource);
			} catch (Exception ex) {
				throw new TransformerException(ex);
			}
		}
	}
Comments
No Comments »
Categories
development, software
Tags
java, xml, xslt
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Author

Ian Robinson is a relatively agile software engineer interested in things both sides of the object relational divide and beyond.

Categories

  • development (37)
  • miscellaneous (28)
  • music (7)
  • software (19)

What I'm Doing...

  • @noelfielding11 why are you in watching telly!? in reply to noelfielding11 2010-04-16
  • What was so good about Nick Drake? These "artists" are covering, music is spot on but no effect at all. Totally lacking the goose pimples. 2010-04-16
  • Some Ginger bloke's on telly covering Nick Drake in a mediocre style. 2010-04-16
  • More updates...

Posting tweet...

Powered by Twitter Tools.

Blogroll

  • Dan North
  • Dave Astels
  • Dave Wood
  • eirikso.com
  • Matt Raible
  • Object Mentor Blog
  • The Ancient Art of Programming
  • The Wisdom of Ganesh

Tags

active-mq architecture bauhaus css db eclipse esb festivals freesat gorm grails groovy hd hibernate htpc java jboss jms junit links mce media center mini music oracle osgi patterns pirsig plugins satellite soa software spring sql struts2 testing themes tools tv vmc web wordpress xml xpath xslt
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox