2006-05-31

Employment For The Luddites

I had no idea my in-laws or my parents could write for Wired magazine.

Yes, this post is a thinly veiled attempt to get everyone off of my back for being a logical father.

2006-05-29

Worst Dad Ever

We live near a military base (well, the Army War College), which means there is endless stream of temporary residents in our town. Typically, the military families are here 10 to 24 months. This means that our kids have an endless stream of temporary friends.

In first grade our youngest son made the mistake of becoming best friends with a military kid.

me:“Are you sure you wanna be so close to someone who is leaving forever when school is over?”
son:“I'm sure. I don't mind.”
(head):“Right. We'll see how you feel in June.”
The emotional train-wreck started in late May and continued well into the following school year. My favorite part was the externalization of his depression. It seemed like he would pick a family member at random (usually his younger sister), and then focus his anger/sadness onto that person.
son:“This is the worst school year ever. I have no friends and my only friend doesn't live here anymore.”
(head):“Duh! I told ya so. Can I do the 'I told ya so' dance now?”
me:“Sorry, that really sucks.”

For me to be a 'nice person', I usually have to do the opposite of what I'm thinking. That's weird...nary a bother.

OK, I'm sure you know where this is going.

It happened again. My son (now in fourth grade) became best friends with another military kid. Here we go.
me:“This is bullshit. What a jackass. We even reminded him what happened last time.”
sherry:“We just have to be there when he falls and help him back up.”
me:“Sorry. I've got better things to do.”
sherry:“You're a heartless jackass. Why can't you show some compassion?”
me:“I did show compassion THE FIRST TIME. Remember? I was there?”

I only have enough emotional scaffolding for one stupid mistake. Of course my wife doesn't see it that way. She is prepared to support (coddle) my son through another multi-month train wreck.

The crying has already started. He must know not to come to me, which is good, because there is no way he's gonna cry on my cold, hard shoulder.

2006-05-26

The Apple Doesn't Fall Far From The Jackass

I was watching the first X-Men movie with my kids. Just after the scene where Rogue was forced to use Magneto's machine, my daughter asked:
daughter:“Why does she have a white streak in her hair?”
son:“Sometimes, when someone experiences something extremely traumatizing, they get spots of gray hair.”
(head):“Thanks for steppin' on my line.”
daughter:“Is he right dad?”
me:“yup.”
As I continued to watch the movie, I could feel her looking at me.
daughter:“Then what happened to you dad?”


Snarky...just like someone else I know.

2006-05-22

Wake Up Hibernate

Editor's Note: This post is not about bears and their sleeping habits. Tommy and millhousethecat, you can stop reading now. Really, stop reading.

I finally had the chance to use Hibernate on a recent project. Hibernate is a full-featured and popular API, but it has some problems. Here are my grievances.

Step away from the thesaurus


I feel like it was designed by pompous thesaurus-loving assholes. If you want to query a table and bring back just one column, what do you do? Oh, well that's simple. Add a Projection. Huh? I never would have guessed that. By coming up with crazy names for simple operations, the creators of Hibernate have taken away something very important. Developers new to Hibernate can't discover and learn it by doing (coding). The API is not in touch with reality. Let's go to the javadoc for the Projection interface:
"An object-oriented representation of a query result set projection in a Criteria query. Built-in projection types are provided by the Projections factory class. This interface might be implemented by application classes that define custom projections."

Good job Gavin King. Use the word you are defining in the definition. If I didn't have someone helping me with Hibernate, it would have taken me hours to discover this feature.

Reflection is cool...sometimes


A major selling point for Hibernate is that you don't have to change your object hierarchy in order to get persistable objects. What the hell does that mean? Usually ORM's require the user to subclass some PersistableObject in order for the object to be persistable. This is usually too restrictive for mature code-bases. With Hibernate, any POJO can be persistable. How do they that? -- Reflection my friend.

Reflection is cool until you need to do some debugging. Let's say a private instance variable is being set, and you want to know who/what is setting it. OK, put a breakpoint on the setter for the instance variable in question and see what happens. When Hibernate changes the value, you'll see nothing. Hibernate stealthily sets the value using reflection and the debugger is clueless. OK, put a watch on the instance variable. That will do the trick, right? Wrong. The same thing happens, Hibernate changes the variable and the debugger has no idea the value changed.

Lazy initialization error


This is infuriating for the first-time user. Hibernate only fetches things when it absolutely needs to. By default it's...well...lazy.

For example (pseudo code):
get session
fetch someObject from the session
close session

someObject.getAValue() --->  Boom!
Lazy Initialization Exception

There are three fixes to this problem:

  1. Leave the session open while you are accessing the object values.

  2. Configure Hibernate to not use lazy initialization.

  3. Stop using Hibernate. :)

There are more things that bug me about Hibernate, but I'm tired of typing and I'm sure you're tired of reading. Is anyone still reading?

2006-05-13

The Mouthpiece

The sleep doctor told me to get an Adjustable Mandibular Advancement Device. This is a fancy name for a mouthpiece that pulls the lower jaw (mandible) forward to create a more open airway.

I went to the dentist and they made molds of my mouth, which they turned into clay castings. If you ask nicely, they'll give you your castings.

From the castings, they created a plastic mouthpiece.

This changes everything. The results are spectacular. I don't have to wear the CPAP mask anymore.


It's annoying to wear, but compared to the CPAP mask, it's nothing.

It's really easy to clean. I just soak it in a cleaning solution for a few hours. I use gasoline. The fumes help me fall asleep faster.

The best part? I get to sleep with my wife again!

The worst part? My wife got used to...err...being single. She keeps crying out in the middle of the night "Oh Sweettea! Post another comment on my blog!" Hmmm, no problems there.

2006-05-09

The Fast and the Curious

My oldest son and I went to a car show this weekend. The "Custom Import Tuner Show." This car show is very popular with the younger crowd (I think the average age was 18 or 19). I guess that's why my son was so interested in going. I was hoping to see some fast and furious "race babes", like Suki (yup she's the one in the photo). No luck. Nobody even came close to lookin' like her. Maybe the movie industry unrealistically portrays women.

I was surprised to see a high concentration of disabled guys. I'm not sure why.

I saw a Nissan Skyline for the first (and probably only) time in my life. The Skyline is only available in Japan.

They had a bikini contest. It was too crowded to get close enough to see...or drool. After they (I'm not sure if there were official judges) had chosen the winner, the crowd started chanting "Show your tits. Show your tits." Judging by the crowd's reaction, I don't think any tits were shown...or maybe it was sour grapes.

Just after the bikini competition, they had a burnout competition. Nothing that interesting. Lots of tire smoke. One of the cars had an engine fire. For this event the crowd was even worse, so I wasn't able see any of the action. I held my son up above my head a few times to give him a peek. He didn't seem that impressed.

While the crowd was waiting for the various events to begin, the social order started to break down. A girl in the grandstands would stand up, and the guys would start shouting. They would ready their cameras, camera-phones, or camcorders with one hand and twirl their Mardi Gras beads with their other hand. The shouting would get louder and louder and finally erupt (climax) when the girl flashed her breasts. Then, she would get showered with beads.

Good family fun.

2006-05-05

A Beautiful Spring Lunch

It was beautiful spring day. I thought I'd eat outside during my lunch break. After all, the building that houses my office provides a wonderful outside dining area. It's a brick patio with picnic tables, shade trees, and, oh right, smoke. Tons of secondhand smoke.

This is just in from the Department of This is Completely Logical so Shut Up: The entire and only outside dining area is a designated smoking area.

Great I'll enjoy my turkey-on-wheat sandwich with a side of hydrogen cyanide please. And maybe some heart disease.

<TheFamilyGuy>
















































It was worse than that time Rob Schneider was the host at Red Robin.
me:“Yeah, ah, party of five. Non-smoking.”
Rob:“OK. Name?”
me:“Mann. How long is the...”
Rob:“Mr. Mann! The Mannerator.”
me:“Right. How long...”
Rob:“Man-o-lan-a-ding-dong!”
me:“...is the wait?”
Rob:“The Sandman. Wants to know how long the wait is. Can't hold up the Mann family.”
me:“Alright kids, we're goin' to McDonalds.”
Rob:“Micky-Dees! The Manolition-Mann. Takin' the kids to McDonalds.”


</TheFamilyGuy>

2006-05-04

You Write The Headline

"Man gives up masturbation for one year. Testicle explodes, killing four people."

"Man attempts to smuggle 147lbs of cocaine in right testicle."

"Man regrets decision to ignore his inguinal hernia."

Anyone? Help me out here.

2006-05-02

INTJ

In an effort to better understand me, Charlie found this article: Caring for Your Introvert.

The article really hits the spot. After reading it I didn't feel like such a freak.
"In contrast, after an hour or two of being socially "on," we introverts need to turn off and recharge. My own formula is roughly two hours alone for every hour of socializing."

Yup. That's about right. For me, just replace "recharge" with "play Quake."

The article was written to help extroverts comprehend that not everyone is the same as them. I don't think Charlie paid much attention while reading it. I think he just thinks it's funny, which it is, but it's loaded with valuable information. He continues to not understand that I don't see the point of small talk. Or that slapping me on my shoulder somehow goes from not acceptable to acceptable, if you just do it enough times.

2006-05-01

Freakonomics

I just finished reading Freakonomics. I really enjoyed it. It was easy to read and difficult to put down. I imagine the average reader, which I am not, could read this book over the course of two weekends.

The authors of Freakonomics meander from topic to topic like ADD kids in a toy store. It's annoying at first, but by the third chapter, I was OK with it.

Why did I like it? I'm for any book that challenges "conventional wisdom," and this book does so in every chapter.

Here's one example concerning safety. Most people focus on normal things:

Guns -- If your child wants to play at a friend's house, you may want to know if the friend's parents have guns.
Car seats -- Buy the most expensive car seat for your child. Never buy a used car seat. Make sure the car seat is installed correctly.
Flying -- Flying is safer than driving. That's what I tell myself when the plane prepares for a landing. It makes me feel better.

The conventional wisdom is usually fed to us by the media, and the media loves/needs shock-value. This books ignores shock-value and analyzes data.

Guns -- A child accidentally shot by his best friend makes for a better headline than a child drowning a pool. When the data is analyzed, it's revealed that it's about 100 times more dangerous to send your child to a house with a swimming pool than it is to send your child to a house where both the parents have guns.

Car seats -- "The data show that car seats are, at best, nominally helpful", the author writes. Again, sighting that basic backyard pool safety is a much wiser investment.

Flying -- When you account for the number of hours the average person spends in plane vs. a car ..."The per-hour death rate of driving versus flying, however, is about equal. The two contraptions are equally likely (or, in truth, unlikely) to lead to death."

If you looking for a book that contains mathematic and economic rigor, this is not the book to read. Instead I would recommend The Music of the Primes. If you looking for a book that explores a singular theme, you might want to pick up a copy of The History of Salt.