Joined October 2012
·

Ben Doerr

Charlottesville, VA
·
·
·

Posted to Avoid Ctrl-C MySQL Woops over 1 year ago

@joni Thats great. Just added it. Thanks.

Posted to Groovy tricks for easy API calls over 1 year ago

You totally can!

I 'personally' like the extra call to getContent() (standard JDK) and then getText() (Groovy JDK InputStream) since it makes reading the code a bit easier for those who haven't memorized a lot of the Groovy JDK yet. I think many developers, myself included, seeing Url.getText() would think that it returns the url itself as a string.

Posted to Easier Java object initialization over 1 year ago

Double Brace initialization is great for readability in my opinion. It allows the eyes to note that an object has been allocated and instantiated, then skip over configuration of the object until it's needed.

Posted to Duplicate results withCriteria over 1 year ago

@andreitr I jumped the gun. Taking a look at the src you are right. It also looks like you can accomplish what you want by just doing createCriteria().list {} rather than withCriteria since the list method sets DISTINCT_ROOT_ENTITY. Good tip though for when you are working with withCriteria.

Posted to Duplicate results withCriteria over 1 year ago

You can abstract away the resultTransformer by specifying uniqueResult: true:

def objs = Model.withCriteria(uniqueResult: true) { ... }

Awesome, I'll take a look at it. Although <tab> for completion might be a bit for me to get used to. I come from a heavy IDE background so <C-Space> is where my muscle memory is at.

Posted to CommandT for vim over 1 year ago

I've always wondered the pros and cons of Command-T vs Ctrl-P plugins.

Why have the extra method for address? Just rename c1 to address.

Achievements
322 Karma
23,317 Total ProTip Views