Archive for the ‘portland’ Category

Unmasking SMUG: Part One

Friday, September 11th, 2009

If you live in the Portland, Maine area, and you use Twitter, you have probably heard of SMUG.  For the uninitiated, SMUG stands for “Social Media Usability Gurus.”  It’s a parody blog, Twitter account, and Facebook profile page that mocks so-called Social Media experts.  The owner of the account is not afraid of offending anyone, including local internet micro-celebrities and social media aficionados.

SMUG keeps his real-life identity a secret.  I imagine that it’s so he can hurl his snarkiness without fear of retribution.

The first SMUGup

On September 9, SMUG hosted the first ever “SMUGup.”  The big draw was that SMUG would finally reveal himself/herself/itself to the attendees.  I was in attendance, and like most of the people I spoke with, was skeptical that we would actually get to see the real SMUG.  As it turns out, our skepticism was warranted.

Disappointment

SMUG was not revealed.  We were greeted with a bevy of professionally produced low-grade swag (pens, business cards), posters, programs, and surveys.  And we were shown a video, allegedly a live feed of SMUG addressing the attendees:

Clues to SMUG’s true identity

Has SMUG grown too careless?  The recent event revealed many clues about the perpetrator.  The first clue is what I’ll be addressing in today’s post.  SMUG, or an agent of SMUG, disguised his voice in the video address, but it seems like he used a simple pitch adjustment.  If you want to adjust the pitch back, well, there’s an app for that.  So I took the liberty of adjusting the pitch on the audio.  Unfortunately, I can’t identify the voice – it must be someone I don’t know very well.  But perhaps one of my astute readers (and I know there are a lot of you!  Hi, mom!) can figure it out.

Without further ado, I present to you, the unaltered voice of SMUG.

Why I Am Doing This

I don’t have any problem with SMUG.  Although he/she/it has been a little caustic with me on Twitter, he’s been a lot worse to other folks.  I find the whole thing pretty funny.  I think a lot of the “experts” have no idea how desperate they look while trying to cash in on something they barely understand, and SMUG puts them in their place.  But I love a challenge.  I think it takes cojones to think you can pull off hiding in plain sight, in the tiny world of our small city’s social media community.

Part of me is reluctant to even try to figure this out, because it might ruin the fun for me and for everyone else.  But I also think SMUG needs to be knocked down a peg, and shown that it’s not that easy to hide behind an anonymous account.  He can’t hide forever.

Sign at my favorite coffee shop

Sunday, June 1st, 2008

I love this sign at my favorite coffee shop in Monument Square in downtown Portland:


I took it with my phone, so it’s kinda blurry… it reads: “For optimum lid fit – Line up the Sipper Hole and Beverage Order Circles.”

Who is running that horrible Hibernate query? Find out with comments

Sunday, June 1st, 2008

The Dreaded Search Function
I’ve worked at several jobs where the users have asked for a general-purpose search function in their application. It’s the sort of thing where people want the ability to search on, e.g., all customers with a last name that starts with SM, or all of the customers with a balance greater than 1000.00, etc.

If you can resist the request to build such a thing, then by all means, don’t implement it. End-users have a knack for creating queries which will bring your database to its knees, no matter how clever you think you are with indexing or UI design.

If you must do it, you’ll want to keep a close eye on how its used from the outset for when the inevitable nightmare query is run. One way to do this is by using Hibernate’s comments feature.

Use Comments to Hunt them Down
My colleague Matt Brock implemented something like this where we work. Suppose you have a general method for creating an HQL query in a DAO class, the method could look like this:

protected Query createQuery(String hql) {
return getSession().createQuery(hql).setComment(getUsername());
}

Next, make sure Hibernate’s SQL logging and comment logging is enabled in your hibernate.hbm.xml (warning – this log can get pretty huge):

<hibernate-configuration>
  <session-factory>
      <property name="show_sql">true</property>
      <property name="use_sql_comments">true</property>
.
.
.

Your log will now contain the users who are executing each query, like this:

Hibernate: /* johndoe */ select customer0_.customer_id as col_0_0_, customer0_.cust_company_name from CUSTOMER customer0_ where (customer0_.customer_id=12136 or customer0_.customer_id=16884 or customer0_.customer_id=11150 or customer0_.customer_id=155 or customer0_.customer_id
=27265 or customer0_.customer_id=697 or customer0_.customer_id=4133 or customer0_.customer_id=248 or customer0_.customer_id=2550 or customer0_.customer_id=8449)

One caveat: this may not work with stored procedures – SQL Server, in particular, will get nasty if you try to execute a stored procedure with Hibernate comments attached to it.

Happy Hibernating!


© 2010 Mike Desjardins. All Rights Reserved.