<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mike Desjardins&#039; Series of Tubes &#187; portland</title>
	<atom:link href="http://www.mikedesjardins.net/content/category/portland/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikedesjardins.net/content</link>
	<description>freelance software developer consultant in portland, maine</description>
	<lastBuildDate>Wed, 02 Feb 2011 00:14:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Unmasking SMUG: Part One</title>
		<link>http://www.mikedesjardins.net/content/2009/09/unmasking-smug-part-one/</link>
		<comments>http://www.mikedesjardins.net/content/2009/09/unmasking-smug-part-one/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 12:41:06 +0000</pubDate>
		<dc:creator>Mike Desjardins</dc:creator>
				<category><![CDATA[portland]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://mikedesjardins.us/wordpress/?p=253</guid>
		<description><![CDATA[If you live in the Portland, Maine area, and you use Twitter, you have probably heard of SMUG.  For the uninitiated, SMUG stands for &#8220;Social Media Usability Gurus.&#8221;  It&#8217;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, [...]]]></description>
			<content:encoded><![CDATA[<p>If you live in the Portland, Maine area, and you use Twitter, you have probably heard of SMUG.  For the uninitiated, SMUG stands for &#8220;Social Media Usability Gurus.&#8221;  It&#8217;s a <a href="http://smuggroup.com" target="_blank">parody blog</a>, <a href="http://twitter.com/SMUG_group">Twitter account</a>, and <a href="http://www.facebook.com/profile.php?id=100000159984125&amp;ref=ts" target="_blank">Facebook profile</a> 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.</p>
<p>SMUG keeps his real-life identity a secret.  I imagine that it&#8217;s so he can hurl his snarkiness without fear of retribution.</p>
<h2>The first SMUGup</h2>
<p>On September 9, SMUG hosted the first ever &#8220;SMUGup.&#8221;  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.</p>
<h2>Disappointment</h2>
<p>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:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/cb3J6nIJmeU&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/cb3J6nIJmeU&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h2>Clues to SMUG&#8217;s true identity</h2>
<p>Has SMUG grown too careless?  The recent event revealed many clues about the perpetrator.  The first clue is what I&#8217;ll be addressing in today&#8217;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&#8217;s an app for that.  So I took the liberty of adjusting the pitch on the audio.  Unfortunately, I can&#8217;t identify the voice &#8211; it must be someone I don&#8217;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.</p>
<p>Without further ado, I present to you, the unaltered <a href="http://mikedesjardins.us/static/audio/smug-address.mp3">voice of SMUG</a>.</p>
<h2>Why I Am Doing This</h2>
<p>I don&#8217;t have any problem with SMUG.  Although he/she/it has been a little <a href="http://twitter.com/SMUG_group/status/3847567172" target="_blank">caustic</a> with <a href="http://twitter.com/SMUG_group/status/3451142839" target="_blank">me</a> on Twitter, he&#8217;s been a lot <a href="http://twitter.com/SMUG_group/status/3514778088" target="_blank">worse</a> <a href="http://twitter.com/SMUG_group/status/3291945704" target="_blank">to</a> <a href="http://twitter.com/SMUG_group/status/3580294089" target="_blank">other</a> <a href="http://smuggroup.com/?p=31" target="_blank">folks</a>.  I find the whole thing pretty funny.  I think a lot of the &#8220;experts&#8221; 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&#8217;s social media community.</p>
<p>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&#8217;s not that easy to hide behind an anonymous account.  He can&#8217;t hide forever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedesjardins.net/content/2009/09/unmasking-smug-part-one/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://mikedesjardins.us/static/audio/smug-address.mp3" length="1021019" type="audio/mpeg" />
		</item>
		<item>
		<title>Sign at my favorite coffee shop</title>
		<link>http://www.mikedesjardins.net/content/2008/06/sign-at-my-favorite-coffee-shop/</link>
		<comments>http://www.mikedesjardins.net/content/2008/06/sign-at-my-favorite-coffee-shop/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 12:32:00 +0000</pubDate>
		<dc:creator>Mike Desjardins</dc:creator>
				<category><![CDATA[portland]]></category>
		<category><![CDATA[silly]]></category>

		<guid isPermaLink="false">http://mikedesjardins.us/wordpress/2008/06/sign-at-my-favorite-coffee-shop/</guid>
		<description><![CDATA[I love this sign at my favorite coffee shop in Monument Square in downtown Portland: I took it with my phone, so it&#8217;s kinda blurry&#8230; it reads: &#8220;For optimum lid fit &#8211; Line up the Sipper Hole and Beverage Order Circles.&#8221;]]></description>
			<content:encoded><![CDATA[<p>I love this sign at my favorite coffee shop in Monument Square in downtown Portland:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://mikedesjardins.us/blog/uploaded_images/052808_1504%5B00%5D-702634.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 404px; height: 538px;" src="http://mikedesjardins.us/blog/uploaded_images/052808_1504%5B00%5D-702630.jpg" alt="" border="0" /></a><br />I took it with my phone, so it&#8217;s kinda blurry&#8230; it reads: &#8220;<span style="font-style: italic;">For optimum lid fit &#8211; Line up the Sipper Hole and Beverage Order Circles</span>.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedesjardins.net/content/2008/06/sign-at-my-favorite-coffee-shop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who is running that horrible Hibernate query?  Find out with comments</title>
		<link>http://www.mikedesjardins.net/content/2008/06/who-is-running-that-horrible-hibernate/</link>
		<comments>http://www.mikedesjardins.net/content/2008/06/who-is-running-that-horrible-hibernate/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 11:32:00 +0000</pubDate>
		<dc:creator>Mike Desjardins</dc:creator>
				<category><![CDATA[portland]]></category>
		<category><![CDATA[silly]]></category>

		<guid isPermaLink="false">http://mikedesjardins.us/wordpress/?p=30</guid>
		<description><![CDATA[The Dreaded Search Function I&#8217;ve worked at several jobs where the users have asked for a general-purpose search function in their application. It&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold;">The Dreaded Search Function</span><br />
I&#8217;ve worked at several jobs where the users have asked for a general-purpose search function in their application.  It&#8217;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.</p>
<p>If you can resist the request to build such a thing, <span style="font-style: italic;">then by all means, <span style="font-weight: bold;">don&#8217;t implement it</span></span>.  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.</p>
<p>If you must do it, you&#8217;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&#8217;s comments feature.</p>
<p><span style="font-weight: bold;">Use Comments to Hunt them Down</span><br />
My colleague <a href="http://mattbrock.net/">Matt Brock</a> 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:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> Query createQuery<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> hql<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">return</span> getSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span>hql<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setComment</span><span style="color: #009900;">&#40;</span>getUsername<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next, make sure Hibernate&#8217;s SQL logging and comment logging is enabled in your hibernate.hbm.xml (warning &#8211; this log can get pretty huge):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hibernate-configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;session-factory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;show_sql&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;use_sql_comments&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
.
.
.</pre></div></div>

<p>Your log will now contain the users who are executing each query, like this:</p>
<p><span style="font-size:78%;"><span style="font-family:courier new;">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</span><br />
<span style="font-family:courier new;">=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)</span><br />
</span></p>
<p>One caveat: this may not work with stored procedures &#8211; SQL Server, in particular, will get nasty if you try to execute a stored procedure with Hibernate comments attached to it.</p>
<p>Happy Hibernating!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedesjardins.net/content/2008/06/who-is-running-that-horrible-hibernate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

