Tuesday, August 28, 2012

How those Spring @Enable* Annotations work

Spring's Java Config is a great way to configure your application without writing a lot of configuration code.  One reason is those awesome @Enable* annotations that let you magically set up things like Transactions (@EnableTransactionManagement), Spring MVC (@EnableWebMvc) or timed jobs (@EnableScheduling) with a simple class level annotation on your configuration class. These simple statements provide a lot of functionality but their machinations are fairly obscure.  On the one hand, it's great to get so much functionality for so little work, but on the other hand, if you don't understand how something works it makes debugging and problem solving much harder.  I couldn't find any posts or documents that covered how those annotations work so I figured I would write up one based on the research I did while debugging.  I don't work for Spring and I didn't write any of this code so please post any corrections or improvements in the comments and I'll update the post.

Wednesday, May 23, 2012

In Place Editor Custom Binding for Knockout.js

I recently discovered knockout.js and was totally blown away. It does a great job of removing the need for (most) DOM manipulations which lets you focus on your data model and get complex UIs running with a minimal amount of code.  That said, those complex UIs are by default made up of simple widgets (input boxes, buttons, etc) and if you want more complex widgets (date pickers, inline editors, etc) you need to either find them elsewhere or roll your own.  Ryan Niemeyer gives a great explanation of how to create a date picker (or any custom binding) and I quickly incorporated it into my own site.  Since I also needed an inline editor I figured I would post my results so others could reuse and improve upon them.  The following code is very much based on the Custom Bindings article referenced above and the Jeditable inline editor.

Tuesday, May 15, 2012

Euphemisms: When Good Words Go Bad

A euphemism is a nice way of saying something not so nice.  The problem with euphemisms is that the more successful they are, the more likely they are to take on the not so nice meaning of the thing they're trying to be nice about.  Once this reversal happens, they transition from a euphemism to a synonym and a new euphemism must be created.  It's an interesting quirk of language that a word or phrase can be intended to mean one thing and then become so popular that it comes to mean something entirely different.

Tuesday, May 8, 2012

Pagination with Spring MVC, Spring Data and Java Config

Spring 3.1 has a lot of features for limiting the boiler-plate code you have to write for common functionality.  One great example is pagination.  Getting paged data from a database and presenting it to the user is one of those tasks that everyone seems to reinvent even though it's common functionality that is never specific to your business.  Spring Data provides some facilities to add pagination to your application with a minimal amount of code.  The documentation on this is pretty good and it includes some steps on how to set up both in the data tier and the web tier.  Unfortunately, the documentation is unclear in a few places (see below) and doesn't explain at all how to use a Java Config.  This post tries to fill those gaps.

Tuesday, May 1, 2012

I wrote A Facebook To GMail Syncing App

I wrote an app that syncs your Facebook Friends and GMail Contacts!  Actually, I rewrote an app that syncs your Facebook Friends and GMail Contacts.  The first version had some flaws.  But this version is new and improved.  Let me count the ways:

Tuesday, April 24, 2012

In which I accuse New Wave rockers "The Romantics" of defiling Rick James' Grave

Update: The below is officially facts because it is cited in Wikipedia.

In the low stakes world of accusing 80s rock bands of ripping off Rick James, few have the gumption to publicly post their assertions on the Internet.  What with the rabid fanaticism of "The Romantics" die-hards and the Internet's strict requirements for rock solid proof, no one is willing to touch this red hot topic with a serial mouse.  But people of the Internet, live in fear no more - for I shall lead you out of the dark as I raise my keyboard and shout for all to hear that The Romantics totally ripped off "Super Freak" in their modest 1983 hit "Talking in your sleep".

Wednesday, April 18, 2012

I find interesting things interesting

I'm fascinated by design in general and web design in particular.  The domain of Design always seemed complex and inaccessible to me even though as a professional programmer I do a particular kind of design on a regular basis.  Capital "D" Design has seemed to me like a far away land with it's own language, culture and secret societies that were all unapproachable to the lay person.  However, as I started to read and learn more about the process of Design it seems in many ways to be just like programming (a wild land I am nevertheless at home in).

Tuesday, April 10, 2012

Killing a Joke: Cannibal Joe's

I have no idea how professional comedy writers work, but for some reason I'm convinced that one of their favorite things to do is come up with a simple set up and then write 200 punchlines for it.  This isn't based on any facts or empirical research, other than sometimes in sitcoms you'll see a set up that every character in the room gets to riff on.  Also, it's something I like to do.  I think it's a fun mind exercise to see how many punchlines I can come up, especially when I'm bored.  Here's an example from a recent Facebook post that none of my friends seemed to care about. I like the last one the best.  Post your own slogans below!

Tuesday, April 3, 2012

I convinced 100s of people to give me their GMail passwords

Honestly, it wasn't intentional.  My goal was just to sync my Facebook Friends with my GMail Contacts.  I tried searching for an app that could do it, but I couldn't find one and so I figured this might be a good opportunity to learn a little about developing with Facebook & Google.  My only intention was to scratch an itch that had been bothering me for a little while, but then it got popular.

Friday, February 24, 2012

A Letter to Ari's kids about Ametropes

This letter was requested by my friend Ari in response to my previous letter.

Dear Jacob & Abby,

There are some things in this world that can be seen.  There are also some things that cannot be seen.  Unfortunately for you, your parents' compromised gene pools have likely condemned you to a life of stumbling around grasping for the latter.  But despair not!  There is a solution.  In 1784 God bestowed upon Man the means with which to focus the unseen and render it knowable.  He called them Glasses and were it not for them you may never have been born in the first place.  Glasses will undoubtedly become a fixture in your life just as they were the fixture that made your life.  You need to know and love glasses.  Fear and respect glasses.  Or at a bare minimum, don't pull them off your father's God damn face.  The man needs to see and you need to live.  You can accomplish those two goals by the simple act of not impairing your father's sight.  Also, don't stab him with them once you've got them.  That's just cruel.  Plus he can't find you to stop you so he's got to yell until Mommy comes.  And she's got better things to do than defend her husband from a toddler.  So be a sport and leave the damn glasses alone.

Uncle Doug

Thursday, February 23, 2012

A letter to my toddlers about women

Dear Tyler & Aidan,

There are some things in this world that can be known.  There are also some things that are unknowable.  Part of life is learning to accept that some things cannot be known.  You will find and rebel and eventually accept that much about women is simply unknowable.  It is frustrating and difficult and ultimately insurmountable.  Accepting it will be one of the great triumphs in your life.  But there is at least one thing about women that is knowable.  And that, is that you do not fuck with their hair.  If there is a woman that you like/respect/would enjoy ever seeing again, you are to compliment them on their hair and then shut the fuck up.  It is simple, but it is critical to your future happiness.  Women are not impenetrable magical sphinxes with mysterious vails and complex machinations.  They are human, with everything that entails.  So do yourself a favor, respect all women and show them that by at a bare minimum praising their hair and being quiet.  It is hard fought wisdom that is as true today as it will be when you care to remember it.  But for now, please stop pulling your mother's hair every time she gives you a hug.  I'm sick of hearing her complain about it.  Just give her a kiss and go away.


Wednesday, January 18, 2012

I hate Children's Music, but are my kids ready for Hip Hop?

A little while ago my friends at Urban Rhetoric, progenitors of all things cool, asked me to write a piece on being a parent and a fan of Hip Hop.  Below is a reprint of the original article.
Children's music is universally atrocious.   It is trite and tedious.  An endless sea of monotony that crushes ones humanity with unrelenting waves of banal tedium.  At first it laps gently at the shores of your sanity.  A barely felt current, swathing your new baby in passivity and lulling him to sleep.  Slowly it seeps into diaper changes and car rides, please touch museums and toy stores.  It's suddenly everywhere and you are caught in the swell of its undertow.  You gasp for Nas, Mos Def, Kanye, but it's too late, your lungs are already saturated with Three Blind Mice, Itsy Bitsy Spider and something called "Raffi". Children's music is devious.  It's born of  platitudes and gentle hell fire.  It's boring and insidious.  It is the incarnate soul of the devil.

Wednesday, January 11, 2012

Simple Photoshop Star Burst Effect


One effect that I really like, especially for a splashy or retro type feel, is the star burst effect.  I think the spinning color adds a lot of energy and can be a fun way to add a little pep.  There are many tutorials on the web but they seem to either be complicated or time consuming.  That said, the two linked above do provide additional flexibility.  The only advantage to this technique is that it is simple and fast.  So let’s start: