Monthly Archives: May 2010

Find the position of an element with JavaScript

Quirksmode provides a nice findPos() function to find the absolute position of an element on a page. If you need to find the position of the element relative to the viewport then you will also need to know the page’s current scroll position, which I found over at Stack Overflow.
Posted in JavaScript | Tagged , , , , | Comments closed

Google Guice AssistedInject example in Groovy

If you are using Google Guice to manage your object dependencies then you may find a situation where you have a constructor that has parameters required from Guice and some parameters from the calling code. For example, suppose you are creating a Book which requires a BookService and a name when it is created: class [...]
Posted in Groovy | Tagged , , , | Comments closed

Dependency injection with Groovy and Google Guice

I was looking for a lightweight dependency injection framework to use with Groovy and decided try out Google Guice. In this entry I am exploring version 2.0 without AOP. This is just a quick overview of Guice and there is probably quite a bit more I haven’t discovered yet. I need to give credit to [...]
Posted in Groovy | Tagged , , | Comments closed

Parsing HTML with Groovy and HTMLCleaner

HTML found on the web can sometimes be invalid and difficult to parse. There are several HTML cleaning utilities that convert this invalid HTML to valid XML which is easier to work with. Two of these are Tag Soup and HTMLCleaner. Tag Soup has a much nicer syntax when used with Groovy, but I decided [...]
Posted in Groovy | Tagged , , , , , | Comments closed

On moving to Ubuntu

I’ve been using Windows for all of my development career but in recent months I have found myself pushed to find an alternative OS. I decided to switch over to Ubuntu and so far I have been pretty happy with the experience.
Posted in Ubuntu | Tagged , | Comments closed