<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Developmentality</title>
	<atom:link href="http://developmentality.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://developmentality.wordpress.com</link>
	<description>Nick Dunn&#039;s thoughts on technology and programming</description>
	<lastBuildDate>Tue, 24 Jan 2012 19:49:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='developmentality.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Developmentality</title>
		<link>http://developmentality.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://developmentality.wordpress.com/osd.xml" title="Developmentality" />
	<atom:link rel='hub' href='http://developmentality.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Python Gotcha: Word boundaries in regular expressions</title>
		<link>http://developmentality.wordpress.com/2011/09/22/python-gotcha-word-boundaries-in-regular-expressions/</link>
		<comments>http://developmentality.wordpress.com/2011/09/22/python-gotcha-word-boundaries-in-regular-expressions/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 17:00:11 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876389</guid>
		<description><![CDATA[Avoid the same mistake I made - double up your backslashes for word boundaries in Python.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876389&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<h2 id="internal-source-marker_0.6836465846281499">TL;DR</h2>
<p>Be careful trying to match word boundaries in Python using regular expressions.  You have to be sure to either escape the match sequence or use raw strings.</p>
<h2>Word boundaries</h2>
<p><a href="http://www.regular-expressions.info/wordboundaries.html">Word boundaries</a> are a great way of performing regular expression searches for whole words while avoiding partial matches.  For instance, a search for the regular expression &#8220;the&#8221; would match both the word &#8220;the&#8221; and the start of the word &#8220;thesaurus&#8221;.</p>
</div>
<div><pre class="brush: python;">
&gt;&gt;&gt; import re
&gt;&gt;&gt; re.match(&quot;the&quot;, &quot;the&quot;)
# matches
&gt;&gt;&gt; re.match(&quot;the&quot;, &quot;thesaurus&quot;)
# matches 
</pre>
</div>
<div>
In some cases, you might want to match just the word &#8220;the&#8221; by itself, but not when it&#8217;s embedded within another word.</p>
<p>The way to match a word boundary is with &#8216;\b&#8217;, as described in the <a href="http://docs.python.org/library/re.html">Python documentation</a>.  I wasted a few minutes wrestling with trying to get this to work.</p>
</div>
<div><pre class="brush: python;">
&gt;&gt;&gt; re.match(&quot;\bthe\b&quot;, &quot;the&quot;)
# no match
</pre></p>
</div>
<p>It turns out that \b is also used as the backspace control sequence.  Thus in order for the regular expression engine to interpret the word boundary correctly, you need to escape the sequence:</p>
<div><pre class="brush: python;">
&gt;&gt;&gt; re.match(&quot;\\bthe\\b&quot;, &quot;the&quot;)
# match
</pre>
</div>
<p>You can also use raw string literals and avoid the double backslashes:</p>
<div><pre class="brush: python;">
&gt;&gt;&gt; re.match(r&quot;\bthe\b&quot;, &quot;the&quot;)
# match
</pre>
</div>
<p>In case you haven&#8217;t seen the raw string prefix before, here is the <a href="http://docs.python.org/reference/lexical_analysis.html">relevant documentation</a>:</p>
<div>
<blockquote>
<p dir="ltr">String literals may optionally be prefixed with a letter &#8216;r&#8217; or &#8216;R&#8217;; such strings are called raw strings and use different rules for interpreting backslash escape sequences.</p>
</blockquote>
<h2>Conclusion</h2>
<p>Make sure you are familiar with the escape sequences for strings in Python, especially if you are dealing with regular expressions whose special characters might conflict.  The <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html">Java documentation for regular expressions</a> makes this warning a bit more explicit than Python&#8217;s:</p>
<blockquote>
<p dir="ltr">The string literal &#8220;\b&#8221;, for example, matches a single backspace character when interpreted as a regular expression, while &#8220;\\b&#8221; matches a word boundary.</p>
</blockquote>
<p>Hopefully this blog post will help others running into this issue.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876389/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876389&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/09/22/python-gotcha-word-boundaries-in-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>
	</item>
		<item>
		<title>Car Talk Puzzler #5: The Perfect Square Dance</title>
		<link>http://developmentality.wordpress.com/2011/08/18/car-talk-puzzler-5-the-perfect-square-dance/</link>
		<comments>http://developmentality.wordpress.com/2011/08/18/car-talk-puzzler-5-the-perfect-square-dance/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 07:10:16 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[car talk]]></category>
		<category><![CDATA[combinations]]></category>
		<category><![CDATA[factorial]]></category>
		<category><![CDATA[itertools]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[permutations]]></category>
		<category><![CDATA[puzzler]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876375</guid>
		<description><![CDATA[Sally invited 17 guests to a dance party. She assigned each guest a number from 2 to 18, keeping 1 for herself. The sum of each couple's numbers was a perfect square. What was the number of Sally's partner?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876375&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>PUZZLER: The Perfect Square Dance! </strong></p>
<p>Sally invited 17 guests to a dance party. She assigned each guest a number from 2 to 18, keeping 1 for herself. The sum of each couple&#8217;s numbers was a perfect square. What was the number of Sally&#8217;s partner?</p></blockquote>
<p><a id="a6s1" title="Puzzler" href="http://www.cartalk.com/content/puzzler/transcripts/200842/index.html">Puzzler</a></p>
<p>The fifth in my <a id="ukdh" title="ongoing series of solving Car Talk Puzzlers" href="http://developmentality.wordpress.com/tag/car-talk/">ongoing series of solving Car Talk Puzzlers</a> with my programming language of choice.  I&#8217;m <a id="g00r" title="using Python again" href="http://developmentality.wordpress.com/2010/10/26/car-talk-puzzler-4-flipping-ages/">using Python again</a>, just like last time.</p>
<p>There are a few pieces to this.  The first is, how do we generate a list of all possible pairs that match the perfect square constraint?  With list comprehensions and a helper function this is easy.</p>
<div><pre class="brush: python;">
def perfect_square(n):
  return math.sqrt(n) == int(math.sqrt(n))

# range creates a list that's exclusive of last number.  Thus to go from 1 to n,
# use range(1, n+1)
guests = range(1, num_guests + 1)
# By enforcing the x# a whole bunch of equivalent pairs (e.g. (3,6) and (6,3)).
pairs = [(x,y) for x in guests for y in guests if x&lt;y and perfect_square(x+y)]
&gt;&gt;&gt; guests
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
&gt;&gt;&gt; pairs
[(1, 3), (1, 8), (1, 15), (2, 7), (2, 14), (3, 6), (3, 13), (4, 5), (4, 12), (5, 11), (6, 10), (7, 9), (7, 18), (8, 17), (9, 16), (10, 15), (11, 14), (12, 13)]</pre></p>
<div>OK great.  At this point I have 18 pairs; 9 of these pairs together form the correct setup.  Now, I could try to be very clever and use logic to deduce the correct pairs.  But I&#8217;m lazy and it&#8217;s a small problem, so I&#8217;m going to use brute force.  I&#8217;m just going to take all combinations of 9 pairs and test to see which one uses each guest exactly once.  Not only am I so lazy as to do it this way, I&#8217;m not even going to write code to calculate the combinations.  Instead, I&#8217;ll use the excellent <a id="ao7j" title="itertools" href="http://docs.python.org/library/itertools.html#itertools.combinations">itertools</a> package.</div>
<p><pre class="brush: python;">
&gt;&gt;&gt; itertools.combinations([1,2,3,4,5], 2)

# This is a sort of generator object which lazily returns the values as needed.
# To force them to all be evaluated at once, to see how this works,
# wrap the call in a list function.
&gt;&gt;&gt;list(itertools.combinations([1,2,3,4,5],2))
[(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)]
</pre></p>
</div>
<p>This performs exactly as how we would expect.  Note that I want combinations rather than permutations because the order does not matter.</p>
<div>As I mentioned earlier, I assume that a brute force solution is going to be fast enough.  Let me check my math here.  How many 9-element combinations taken from an 18-element set are there?</div>
<div style="text-align:left;">
<div id="attachment_369876381" class="wp-caption aligncenter" style="width: 266px"><a href="http://developmentality.files.wordpress.com/2011/08/nchoosek.png"><img class="size-full wp-image-369876381" title="N choose K formula" src="http://developmentality.files.wordpress.com/2011/08/nchoosek.png?w=600" alt="N choose K formula"   /></a><p class="wp-caption-text">N choose K formula - number of k element combinations from set of n elements</p></div>
</div>
<div style="text-align:left;"><a href="http://developmentality.files.wordpress.com/2011/08/combinations.png"><img class="aligncenter size-medium wp-image-369876382" title="Number of combinations" src="http://developmentality.files.wordpress.com/2011/08/combinations.png?w=300&#038;h=67" alt="Number of combinations" width="300" height="67" /></a></div>
<p>Yeah, I think we can handle checking 48620 combinations.</p>
<div>OK, but how do we know whether a given combination (9 pairs of numbers) match our criteria?  The easiest way is to check if the number of unique elements is the same as the number of guests; this indicates that each guest is used only once.  First we flatten our nested list of tuples into a single list, and then use a set to check uniqueness:</div>
<p><pre class="brush: python;">

def flatten(nested):
  &quot;&quot;&quot; Flatten one level of nesting.  Returns a generator object
  For instance:
  list(flatten([(1,3),(5,6)])) --&gt; [1,3,5,6] &quot;&quot;&quot;
  return itertools.chain.from_iterable(nested)

def all_guests_present_once(combination):
  &quot;&quot;&quot; Returns whether each guest is present once
  Combination is a list of tuples, e.g. [(1,5),(7,8)]
  &quot;&quot;&quot;
  flattened = list(flatten(combination))
  return len(set(flattened)) == len(flattened)

&gt;&gt;&gt; all_guests_present_once([(1,3),(4,5)])
True
&gt;&gt;&gt; all_guests_present_once([(1,3),(3,6)])
False
</pre></p>
<div>As you can see, I&#8217;m shortcutting a little bit and not checking for the perfect square aspect, since we already did that when constructing our set of pairs.</div>
<p>OK we&#8217;re ready to throw it all together.</p>
<p><pre class="brush: python;">

def dance_arrangement(num_guests):
  &quot;&quot;&quot;
  Returns a valid pairing for all guests if possible, else an empty set
  &quot;&quot;&quot;
  # Clearly you need an even number of guests to have everyone paired
  if num_guests % 2 == 1:
    return []
  else:
    # range creates a list that's exclusive of last number.  Thus to go from 1 to n,
    # use range(1, n+1)
    guests = range(1, num_guests + 1)
    # By enforcing the x    # a whole bunch of equivalent pairs (e.g. (3,6) and (6,3)).
    pairs = [(x,y) for x in guests for y in guests if x    # brute force search
    all_arrangements = itertools.combinations(pairs, num_guests / 2)
    return filter(all_guests_present_once, all_arrangements)
</pre></p>
<p>Running the program with num_guests = 18, we get</p>
<div><pre class="brush: python;">
[((1, 15), (2, 14), (3, 13), (4, 12), (5, 11), (6, 10), (7, 18), (8, 17), (9, 16))]
</pre></p>
</div>
<div>Tada!  Thus Sally&#8217;s partner was number 15.</div>
<div>I stumbled onto <a id="fpi5" title="this page" href="http://delphiforfun.org/programs/PerfectSquareDance.htm">this page</a> which also sought to solve this problem using programming; it ends with the question</div>
<div>&#8220;I wonder if 18 is unique as the total number of dancers which has a solution.  It should be easy to modify the program to check&#8221;</div>
<div>It is very easy to modify, and I checked.  I ran the program on all number of guests less than 20, and these are the results:</div>
<p><pre class="brush: python;">
8 [((1, 8), (2, 7), (3, 6), (4, 5))]
14 [((1, 8), (2, 14), (3, 13), (4, 12), (5, 11), (6, 10), (7, 9))]
16 [((1, 8), (2, 7), (3, 6), (4, 5), (9, 16), (10, 15), (11, 14), (12, 13))]
18 [((1, 15), (2, 14), (3, 13), (4, 12), (5, 11), (6, 10), (7, 18), (8, 17), (9, 16))]
</pre></p>
<p>As you can see, 8, 14, and 16 guests can also be paired up in this way.  Something to keep in mind the next time you are going to have a party.</p>
<div>
<p>Full sourcecode can be found on <a id="ka5-" title="Github" href="https://gist.github.com/1153553">Github</a>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876375/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876375&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/08/18/car-talk-puzzler-5-the-perfect-square-dance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/08/nchoosek.png" medium="image">
			<media:title type="html">N choose K formula</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/08/combinations.png?w=300" medium="image">
			<media:title type="html">Number of combinations</media:title>
		</media:content>
	</item>
		<item>
		<title>Arduino Cookbook review</title>
		<link>http://developmentality.wordpress.com/2011/07/29/arduino-cookbook-review/</link>
		<comments>http://developmentality.wordpress.com/2011/07/29/arduino-cookbook-review/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 07:39:01 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[oreilly]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876370</guid>
		<description><![CDATA[Some of you may have seen me post this on Twitter, but if not I&#8217;m linking here to my DZone book review of the Arduino Cookbook. Tl;dr version: I like it a lot. I&#8217;m looking forward to building some things with Arduino in the coming months.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876370&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://books.dzone.com/reviews/arduino-cookbook"><img class="aligncenter" title="Arduino Cookbook" src="http://cdn.dzone.com/sites/all/files/imagecache/book_review_125/images/reviews/arduino-cookbook.jpg" alt="" width="122" height="160" /></a><br />
Some of you may have seen me post this on Twitter, but if not I&#8217;m linking here to my <a title="Arduino Cookbook review on DZone" href="http://books.dzone.com/reviews/arduino-cookbook">DZone book review of the Arduino Cookbook</a>. Tl;dr version: I like it a lot. I&#8217;m looking forward to building some things with Arduino in the coming months.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876370&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/07/29/arduino-cookbook-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>

		<media:content url="http://cdn.dzone.com/sites/all/files/imagecache/book_review_125/images/reviews/arduino-cookbook.jpg" medium="image">
			<media:title type="html">Arduino Cookbook</media:title>
		</media:content>
	</item>
		<item>
		<title>Mule 3 Deployment Gotchas / Workarounds</title>
		<link>http://developmentality.wordpress.com/2011/06/10/mule-3-deployment-gotchas-workarounds/</link>
		<comments>http://developmentality.wordpress.com/2011/06/10/mule-3-deployment-gotchas-workarounds/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 16:00:21 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[mule]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[enterprise service bus]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876367</guid>
		<description><![CDATA[Mule 3 has many improvements over Mule 2, particular with the introduction of Flows. Unfortunately, deployment is a much tricker problem than it was in Mule 2, and the resources online are woefully inadequate. This post highlights some gotchas involved with deploying Mule 3 applications, and workarounds for each.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876367&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mulesoft.org/">Mule</a> is an open source <a href="http://en.wikipedia.org/wiki/Enterprise_service_bus">enterprise service bus</a> written in Java. I’ve worked with Mule 2.2 quite a bit but only recently have started to work with Mule 3. This post details some of the pains involved with the transition, none of which are well documented or hinted at in the <a href="http://www.mulesoft.org/documentation/pages/viewpage.action?pageId=26312744">Migration guide</a>.</p>
<h1 id="gotchasworkarounds">Gotchas/Workarounds</h1>
<h2 id="mule-ide-specific">Mule IDE specific</h2>
<p>The Mule IDE is really a misnomer &#8211; it’s not a standalone product, but instead an Eclipse plugin. See the <a href="http://www.mulesoft.org/documentation/display/MULEIDE/Mule+IDE+2.1+Installation+Guide">installation guide</a> for more information.</p>
<h3 id="xml-validation-warnings">XML validation warnings</h3>
<p>By default, Eclipse 3.5 will flag all sorts of spurious errors in your XML configuration file. See the <a href="http://blogs.mulesoft.org/overcoming-xml-validation-errors-in-eclipse-35/">blog post</a> for more details, but here’s the short version on how to solve it:</p>
<h2 id="general">General</h2>
<p>These issues exist whether you use the IDE to deploy the app or deploy the app via the command line.</p>
<h3 id="failure-to-launch-timeouts">Failure to launch / Timeouts</h3>
<p>Mule is configured via XML. You must declare the namespaces and schema locations in order to make use of the built-in Mule constructs. For instance, here’s a snippet of one of my Mule configurations:</p>
<div>
<pre class="brush: xml;">
&lt;mule xmlns=&quot;http://www.mulesoft.org/schema/mule/core&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns:spring=&quot;http://www.springframework.org/schema/beans&quot;
      xmlns:vm=&quot;http://www.mulesoft.org/schema/mule/vm&quot;
      xmlns:script=&quot;http://www.mulesoft.org/schema/mule/scripting&quot;
      xmlns:http=&quot;http://www.mulesoft.org/schema/mule/http&quot;
      xmlns:cxf=&quot;http://www.mulesoft.org/schema/mule/cxf&quot;
      xmlns:xm=&quot;http://www.mulesoft.org/schema/mule/xml&quot;
      xmlns:pattern=&quot;http://www.mulesoft.org/schema/mule/pattern&quot;
      xmlns:servlet=&quot;http://www.mulesoft.org/schema/mule/servlet&quot;
      xmlns:jetty=&quot;http://www.mulesoft.org/schema/mule/jetty&quot;
      xmlns:test=&quot;http://www.mulesoft.org/schema/mule/test&quot;
      xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
        http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
        http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
        http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd
        http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.1/mule-pattern.xsd
        http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd
        http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.1/mule-vm.xsd
        http://www.mulesoft.org/schema/mule/servlet http://www.mulesoft.org/schema/mule/servlet/3.1/mule-servlet.xsd
        http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.1/mule-test.xsd
        http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/3.1/mule-jetty.xsd&quot;
        &gt;
</pre>
</div>
<p>Make absolutely sure that the version of the xsd that you include matches the major version of mule that you’re using! If you accidentally place a 3.0 instead of a 3.1 in any of those entries, your app will mysteriously fail to launch and you’ll get a stack trace like the following:</p>
<pre><code>INFO  2011-06-09 17:21:20,015 [main] org.mule.MuleServer: Mule Server initializing...
INFO  2011-06-09 17:21:20,298 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO  2011-06-09 17:21:20,355 [main] org.mule.config.spring.MuleApplicationContext: Refreshing org.mule.config.spring.MuleApplicationContext@19bb5c09: startup date [Thu Jun 09 17:21:20 EDT 2011]; root of context hierarchy
WARN  2011-06-09 17:22:36,265 [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Ignored XML validation warning
java.net.ConnectException: Operation timed out
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
</code></pre>
<h2 id="deploying-via-command-line">Deploying via command line</h2>
<p>While it’s nice to be able to use an IDE to develop Mule applications, I prefer to deploy from the command line. This allows me to script the launch of the applications. Furthermore, this approach works in a headless (screenless) remote server, whereas the IDE approach will not. The basic way to deploy an app has changed from Mule 2.2 to Mule 3. It used to be that you would call <code>mule -config /path/to/your/config.xml</code>. Now you move your application to the <code>$MULE_HOME/apps</code> folder and run <code>mule</code>, which in turn will deploy all the apps in the <code>apps</code> folder. This can be very handy, especially when coupled with the <a href="http://www.mulesoft.org/documentation/display/MULE2USER/Hot+Deploying+Mule+Applications">Hot Deployment</a> features of Mule; you no longer need to have one terminal per mule app you’re running. From the article, “<a href="http://soa.dzone.com/articles/mule-3-new-deployment-model">Mule 3: A New Deployment Model</a>”, here are the ostensible steps you must take to deploy your application in this manner:</p>
<ul>
<li>Create a directory under: $MULE_HOME/apps/foo</li>
<li>Jar custom classes (if any), and put them under: $MULE_HOME/apps/foo/lib</li>
<li>Put the master Mule config file at: $MULE_HOME/apps/foo/mule-config.xml (note that it has to be named: mule-config.xml</li>
<li>Start your app with: mule -app foo</li>
</ul>
<p>While these instructions are correct, there are a <em>lot</em> of gotchas involved. Let me detail them below.</p>
<h3 id="relative-paths">Relative paths</h3>
<p>There is often a need to make reference to resources within your configuration file. For instance, you might need to <a href="http://developmentality.wordpress.com/2011/06/07/embed-a-jetty-file-server-within-mule-3-1-1/">configure an embedded Jetty webserver</a> and tell Jetty where its configuration file is located. When you do this, it’s crucial that you prepend relative paths in the XML configuration file with <code>${app.home}</code>.</p>
<p>The reason for this is that the current working directory in which you launch the <code>mule</code> process becomes the current working directory for all of your application configuration files. So if you have <code>mule-config.xml</code> in the root of your folder, and <code>conf/jetty.xml</code> in that same folder, then your reference to the <code>jetty.xml</code> should be <code>${app.home}/conf/jetty.xml</code>. Otherwise, if you just use <code>conf/jetty.xml</code> and launch mule from a folder that’s not the same as the root folder of your application, all of your paths will break.</p>
<h3 id="property-files-resources">Property files / Resources</h3>
<p>As the step #2 above says, you must jar up all of your compiled classes and include them in the lib folder of your project. If you don’t do this, you’ll get an exception when your component / custom classes are attempted to be instantiated.</p>
<p>What should be emphasized is that all resources that you reference from within your code must end up in the jar as well. By default, that won’t happen. You can use something like the solution presented in <a href="http://www.imrantariq.com/blog/?p=174">Ant Build: copy properties file to jar file</a> to get this to happen.</p>
<h3 id="unintentional-application-deletion">Unintentional Application Deletion</h3>
<p>When you deploy an app by copying a zip or folder into the apps directory and then running mule, Mule will launch it and then create a text file called ‘$APP_NAME-anchor.text’. If you delete this file, Mule will “undeploy this app in a clean way”. What isn’t noted by this is that it will delete the corresponding zip/folder. So be careful not to accidentally delete your whole project. (Not that I did that or anything).</p>
<h3 id="jdbc-drivers-problems">JDBC drivers problems</h3>
<p>One nice feature of the hot deploy process is that Mule will automatically load all of the jars in the <code>lib</code> folder and ensure that they’re on the classpath. Unfortunately there is an extremely annoying problem with JDBC drivers, in which they corresponding jar will be loaded correctly, but then will fail to be found at runtime.</p>
<p>At startup:</p>
<pre><code>Loading the following jars:
=============================
file:/opt/local/Mule/mule-standalone-3.1.1/apps/XMLPlayer/lib/mysql-connector-java-5.1.13-bin.jar
=============================
&lt;!-- snip --&gt;
WARN 2011-06-09 15:56:12,130 [http://XMLPlayer].connector.http.mule.default.receiver.2 org.hibernate.cfg.SettingsFactory: Could not obtain connection to query metadata
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/db
</code></pre>
<p>The exact same project works perfectly in the Mule IDE. The only <a href="http://forums.mulesoft.org/thread.jspa?messageID=15055&amp;#15055">solution I’ve found</a> is to copy the <code>mysql-connector-java-5.1.13-bin.jar</code> into <code>$MULE_HOME/lib/endorsed</code>. There is a similar <a href="http://mule.1045714.n5.nabble.com/mule-jira-Created-MULE-5351-JDBC-driver-found-but-is-not-loaded-td3348827.html">bug report</a> but it was closed for some reason. It most certainly does not work the way you would intuitively expect.</p>
<h1 id="conclusion">Conclusion</h1>
<p>Mule 3 has many improvements over Mule 2, particular with the introduction of <a href="http://ricston.com/blog/?p=816">Flows</a>. Unfortunately, deployment is a much tricker problem than it was in Mule 2, and the resources online are woefully inadequate for the task at hand. I hope this blog post helps some poor soul going through the same frustration I went through to get a Mule 3 application deployed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876367/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876367&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/06/10/mule-3-deployment-gotchas-workarounds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>
	</item>
		<item>
		<title>Embed a Jetty file server within Mule 3.1.1</title>
		<link>http://developmentality.wordpress.com/2011/06/07/embed-a-jetty-file-server-within-mule-3-1-1/</link>
		<comments>http://developmentality.wordpress.com/2011/06/07/embed-a-jetty-file-server-within-mule-3-1-1/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 16:00:55 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[mule]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876359</guid>
		<description><![CDATA[Learn how to embed a Jetty web server within a Mule 3.1.1 application, for the purpose of serving static content (images, files, etc)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876359&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post details how to embed a <a href="http://jetty.codehaus.org/jetty/">Jetty</a> webserver within Mule, such that static files hosted within your application are accessible to the outside world. The resources describing how to do this are <a href="http://www.mulesoft.org/documentation/display/MULE3USER/Jetty+Transport+Reference">few and far between</a>; I also found them erroneous. For some reason, any time I include a test:component element in my Mule configuration files, I get a timeout. By eliminating that piece, I got things to work.</p>
<p>These config files assume that both <code>jetty.xml</code> and <code>mule-config.xml</code> are located in the same folder, namely <code>conf</code>.</p>
<h1 id="mule-config.xml">mule-config.xml</h1>
<div>
<pre class="brush: xml;">
&lt;mule xmlns=&quot;http://www.mulesoft.org/schema/mule/core&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns:spring=&quot;http://www.springframework.org/schema/beans&quot;
      xmlns:http=&quot;http://www.mulesoft.org/schema/mule/http&quot;
      xmlns:xm=&quot;http://www.mulesoft.org/schema/mule/xml&quot;
      xmlns:jetty=&quot;http://www.mulesoft.org/schema/mule/jetty&quot;
      xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
        http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
scripting.xsd
        http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd
        http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/3.1/mule-jetty.xsd&quot;
        &gt;
        
  &lt;description&gt;
  This configuration uses an embedded Jetty instance to serve static content.
 &lt;/description&gt;


  &lt;jetty:connector configFile=&quot;${app.home}/conf/jetty.xml&quot; name=&quot;jetty_connector&quot; &gt;&lt;/jetty:connector&gt;
  &lt;!-- do not use localhost here or you will not be able to access the server except locally.--&gt;
  &lt;jetty:endpoint address=&quot;http://0.0.0.0:8080&quot; 
              name=&quot;jettyEndpoint&quot; 
              connector-ref=&quot;jetty_connector&quot;
              path=&quot;/&quot;&gt;
            
  &lt;/jetty:endpoint&gt; 

  &lt;model name=&quot;Jetty&quot;&gt;
    &lt;service name=&quot;jettyUMO&quot;&gt;
      &lt;inbound&gt;
        &lt;jetty:inbound-endpoint ref=&quot;jettyEndpoint&quot; /&gt; 
      &lt;/inbound&gt;
    &lt;/service&gt;
  &lt;/model&gt;
&lt;/mule&gt;
</pre>
</div>
<h1 id="jetty.xml">jetty.xml</h1>
<p>Modified from <a href="http://docs.codehaus.org/display/JETTY/Newbie+Guide+to+Jetty">Newbie Guide to Jetty</a>, namely changing class names (the classes in question are bundled with Mule 3.1.1, in the Jar file found in <code>$MULE_HOME/lib/opt/jetty-6.1.26.jar</code>).</p>
<div>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE Configure PUBLIC &quot;-//Jetty//Configure//EN&quot; &quot;http://www.eclipse.org/jetty/configure.dtd&quot;&gt;

&lt;Configure id=&quot;FileServer&quot; class=&quot;org.mortbay.jetty.Server&quot;&gt;
  &lt;Set name=&quot;handler&quot;&gt;
    &lt;New class=&quot;org.mortbay.jetty.handler.HandlerList&quot;&gt;
      &lt;Set name=&quot;handlers&quot;&gt;
        &lt;Array type=&quot;org.mortbay.jetty.Handler&quot;&gt;
          &lt;Item&gt;
            &lt;New class=&quot;org.mortbay.jetty.handler.ResourceHandler&quot;&gt;
              &lt;!--  Jetty 6.1.26, which comes with Mule 3.1, does not have this method --&gt; 
              &lt;!--&lt;Set name=&quot;directoriesListed&quot;&gt;true&lt;/Set&gt;--&gt;
              &lt;Set name=&quot;welcomeFiles&quot;&gt;
                &lt;Array type=&quot;String&quot;&gt;
                  &lt;Item&gt;index.html&lt;/Item&gt;
                &lt;/Array&gt;
              &lt;/Set&gt;
              &lt;!-- This folder maps to the root URL configured for this Jetty endpoint.  If I wanted to start serving content from the a folder named &quot;static&quot;, I would replace the . with &quot;static&quot;.--&gt;
              &lt;Set name=&quot;resourceBase&quot;&gt;.&lt;/Set&gt;
            &lt;/New&gt;
          &lt;/Item&gt;
          &lt;Item&gt;
            &lt;New class=&quot;org.mortbay.jetty.handler.DefaultHandler&quot; /&gt;
          &lt;/Item&gt;
        &lt;/Array&gt;
      &lt;/Set&gt;
    &lt;/New&gt;
  &lt;/Set&gt;
&lt;/Configure&gt;
</pre>
</div>
<p>A gist with both of these code snippets can be found <a href="https://gist.github.com/1011208">here</a>.</p>
<h1 id="conclusion">Conclusion</h1>
<p>With these two configuration files, you can launch an embedded instance of Jetty within your application, and use it to serve static content. Due to a limitation in the version of Jetty 6.1.26 which Mule 3.1.1 comes with, you cannot use the Jetty instance to list the contents of folders; instead the client must know the absolute path to the file. For my purposes this was not a problem.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876359&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/06/07/embed-a-jetty-file-server-within-mule-3-1-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Code4Cheap is destined for failure</title>
		<link>http://developmentality.wordpress.com/2011/05/31/why-code4cheap-is-destined-for-failure/</link>
		<comments>http://developmentality.wordpress.com/2011/05/31/why-code4cheap-is-destined-for-failure/#comments</comments>
		<pubDate>Tue, 31 May 2011 17:00:47 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code4cheap]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876353</guid>
		<description><![CDATA[There was a story on Hacker News recently about a user&#8217;s startup called Code4Cheap.  The site aims to connect programmers with those willing to pay for technical solutions. By allowing the buyers to set prices for their tasks directly rather than relying on a bidding process, it purports to have a simpler workflow than a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876353&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>There was a <a href="http://news.ycombinator.com/item?id=2506706">story</a> on <a href="http://news.ycombinator.com/">Hacker News</a> recently about a user&#8217;s startup called <a href="http://www.code4cheap.com/">Code4Cheap</a>.  The site aims to connect programmers with those willing to pay for technical solutions. By allowing the buyers to set prices for their tasks directly rather than relying on a bidding process, it purports to have a simpler workflow than a full-fledged freelance site like <a href="http://www.elance.com/p/landing/buyerE6.html">Elance</a> or <a href="https://www.vworker.com/">VWorker</a>.  The buyer sets the price and programmers are free to accept it or not.</div>
<div><a href="http://www.code4cheap.com/"><img class="aligncenter size-medium wp-image-369876354" title="Picture 91" src="http://developmentality.files.wordpress.com/2011/05/picture-91.png?w=300&#038;h=201" alt="" width="300" height="201" /></a></p>
<p>I was intrigued by the premise, but I&#8217;ve come to the conclusion that it is destined for failure.  The first reason is that the title contains the word &#8216;Cheap&#8217;.  Cheap has very negative connotations, including &#8220;of shoddy quality&#8221;.  Even the literal <a href="http://www.answers.com/topic/cheap">definition</a>, &#8220;purchasable below the going price or the real value&#8221; , presents real problems for the site.  Why?</p>
<p>The blog post <a href="http://behind-the-enemy-lines.blogspot.com/2011/05/pay-enough-or-dont-pay-at-all.html">Pay Enough or Don&#8217;t Pay at All</a> by <a href="http://www.blogger.com/profile/15283752183704062501">Panos Ipeirotis</a> sums it up perfectly:</p>
</div>
<div>
<blockquote><p>There are the social norms and the market norms. When no money is involved, the exchanges operate using social norms. Once you put a price on a task, it becomes part of a market norm. It can be measured and compared. … Instead of offering their priceless help, they were being valued as unskilled workers, like every other worker in the market. Money and altruism do not mix.</p></blockquote>
<p>A central tenet of the seminal book about the open source movement, &#8220;<a href="http://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar">The Cathedral and the Bazaar</a>&#8220;, is that the hacker culture thrives as a &#8220;gift culture&#8221; as opposed to an &#8220;exchange culture&#8221;.  (This chapter of the book is <a href="http://www.catb.org/~esr/writings/homesteading/homesteading/ar01s06.html">available online</a> if you&#8217;re interested in more).  Thus we see every day thousands of highly skilled people give away their time and programming effort, both in the open source community and in Q&amp;A sites like <a href="http://stackoverflow.com/">StackOverflow</a>.  In these instances, the currency consists of reputation and goodwill rather than money.<br />
One must pay a reasonable rate for programming expertise if he is to pay at all, and the current questions on the site are laughably complex for the amount of money that the posters are offering.  On top of that, the site takes a 30% cut out of any bounty that a buyer offers for a solution, further disincentivizing prospective programmers (i.e. a $50 bounty actually becomes $35).<br />
I applaud the creator for launching a product, but I&#8217;m afraid this one will not last, without some sweeping changes to the business model.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876353&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/05/31/why-code4cheap-is-destined-for-failure/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/05/picture-91.png?w=300" medium="image">
			<media:title type="html">Picture 91</media:title>
		</media:content>
	</item>
		<item>
		<title>What makes Google maps easier to read than its competitors?</title>
		<link>http://developmentality.wordpress.com/2011/05/24/what-makes-google-maps-easier-to-read-than-its-competitors/</link>
		<comments>http://developmentality.wordpress.com/2011/05/24/what-makes-google-maps-easier-to-read-than-its-competitors/#comments</comments>
		<pubDate>Tue, 24 May 2011 17:00:24 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[link]]></category>
		<category><![CDATA[information density]]></category>
		<category><![CDATA[information design]]></category>
		<category><![CDATA[labels]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[tufte]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876349</guid>
		<description><![CDATA[This isn&#8217;t a new link but one I&#8217;ve been meaning to bring to my readers&#8217; attention for awhile now.  Justin O&#8217;Beirne has posted an excellent analysis of how Google&#8217;s use of white outlines, label sizes, and label font weight enhance a user&#8217;s ability to find information on a Google map. Part one Part two Part [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876349&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t a new link but one I&#8217;ve been meaning to bring to my readers&#8217; attention for awhile now.  <a href="http://www.justinobeirne.com/">Justin O&#8217;Beirne</a> has posted an excellent analysis of how Google&#8217;s use of white outlines, label sizes, and label font weight enhance a user&#8217;s ability to find information on a Google map.</p>
<div class="wp-caption alignnone" style="width: 507px"><a href="http://www.41latitude.com/post/2072504768/google-maps-label-readability"><img title="Label classes" src="http://media.tumblr.com/tumblr_lcrf81czhi1qaznro.png" alt="" width="497" height="311" /></a><p class="wp-caption-text">Just one of the informative graphics from the article</p></div>
<ul>
<li><a href="http://www.41latitude.com/post/2072504768/google-maps-label-readability">Part one</a></li>
<li><a href="http://www.41latitude.com/post/2159061658/google-maps-label-reability-2">Part two</a></li>
<li><a href="http://www.41latitude.com/post/3183269217/google-maps-label-reability-3">Part three</a></li>
</ul>
<p>Interestingly enough, Bing changed its mapping visual style to respond to some of the complaints against it.  See O&#8217;Beirne&#8217;s post on the <a href="http://www.41latitude.com/post/2326795876/bing-maps-update-1">updates they made</a>.</p>
<p>The entire <a href="http://www.41latitude.com/">41latitude</a> website is excellent, but these articles in particular piqued my interest.  Hopefully you find them similarly enlightening</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876349&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/05/24/what-makes-google-maps-easier-to-read-than-its-competitors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>

		<media:content url="http://media.tumblr.com/tumblr_lcrf81czhi1qaznro.png" medium="image">
			<media:title type="html">Label classes</media:title>
		</media:content>
	</item>
		<item>
		<title>Hibernate + MySQL + Mac = Foreign Key Nightmares. A painless solution to a painful problem</title>
		<link>http://developmentality.wordpress.com/2011/05/23/hibernate-mysql-mac-foreign-key-nightmares-a-painless-solution-to-a-painful-problem/</link>
		<comments>http://developmentality.wordpress.com/2011/05/23/hibernate-mysql-mac-foreign-key-nightmares-a-painless-solution-to-a-painful-problem/#comments</comments>
		<pubDate>Mon, 23 May 2011 17:00:48 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[case sensitivity]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[strategy]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876342</guid>
		<description><![CDATA[Using MySQL on the Mac?  You'd better use lowercase table names, or you're in for a world of hurt.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876342&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>tl;dr summary: Avoid using mixed case table names when using MySQL on a Mac.  Use lowercase underscore separated table names instead.</p>
<p>I was using Hibernate to map my Java classes to MySQL tables and columns.  For most classes, inserts worked perfectly.  For other classes, I&#8217;d consistently get errors like</p>
<pre>- SQL Error: 1452, SQLState: 23000
- Cannot add or update a child row: a foreign key constraint fails</pre>
<p>By running the command</p>
<pre>show engine innodb status</pre>
<p>in my mysql window, I found following clue:</p>
<pre>110520 14:26:09 Transaction:
TRANSACTION 85B76, ACTIVE 0 sec, OS thread id 4530606080 inserting
mysql tables in use 1, locked 1
1 lock struct(s), heap size 376, 0 row lock(s)
MySQL thread id 3, query id 2175 localhost root update
insert into TableName (pk_Pdu) values (10)
Foreign key constraint fails for table `myproj`.`tablename`:
,
  CONSTRAINT `FKEC7DE11817B41BEB` FOREIGN KEY (`pk_Pdu`) REFERENCES `ParentClass` (`pk_Pdu`)
Trying to add to index `PRIMARY` tuple:
DATA TUPLE: 3 fields;
 0: len 8; hex 800000000000000a; asc         ;;
 1: len 6; hex 000000085b76; asc     [v;;
 2: len 7; hex 00000000000000; asc        ;;

But the parent table `myproj`.`ParentClass`
or its .ibd file does not currently exist!</pre>
<p>I knew for a fact the table existed; I was able to query it and it showed up fine. Something else must be going on.</p>
<p>I finally stumbled onto the answer by way of a <a href="http://stackoverflow.com/questions/5562033/need-assistance-with-uncanny-reproducible-mysql-error-1452-23000-foreign-key-c">StackOverflow post</a>:</p>
<blockquote><p>However, I did rename the tables all to lowercase and that did make a difference. A quick search indicates I should maybe setting lower_case_table_names = 1 since I am using InnoDB. On Mac OS/X it is 2 by default (and I failed to mention I&#8217;m using a new box which may be why it isn&#8217;t working locally).</p></blockquote>
<p>Sure enough, as soon as I renamed the table names to be all lowercase underscore separated, things worked perfectly. The default naming strategy in Hibernate names the tables in exactly the same way as the class names (e.g. in CamelCase as opposed to lower_case_underscore_separated). Fortunately the designers saw fit to make this naming convention overridable. All I had to do was add one line of code to fix my entire problem:</p>
<p><code><br />
Configuration config = new Configuration();<br />
// Name tables with lowercase_underscore_separated<br />
config.setNamingStrategy(new ImprovedNamingStrategy());</code></p>
<p>Thanks to this <a href="http://almaer.com/blog/hibernate-improvednamingstrategy">blog post on ImprovedNamingStrategy</a> for pointing the way. <a href="http://mattiasgeniar.be/2009/04/15/case-insensitive-table-and-column-names-in-mysql/">This post</a> also helped me find the problem.</p>
<h2>Conclusion</h2>
<p>If you&#8217;re using Hibernate and a MySQL database running on MacOSX, make sure that your table names are all in lowercase.  This can be accomplished by using the <a href="http://docs.jboss.org/hibernate/core/3.5/api/org/hibernate/cfg/ImprovedNamingStrategy.html">ImprovedNamingStrategy</a> class when configuring Hibernate.</p>
<p>This experience taught me a valuable lesson.  The first is, sometimes a problem can be caused by something that&#8217;s not directly your fault per se (i.e. I hadn&#8217;t incorrectly structured my Hibernate annotations, as I initially suspected), but rather due some quirk in the operating system or external tools you&#8217;re using.  The second is it&#8217;s crucial for cross platform libraries like Hibernate to provide the hooks for you to be able to swap out default behavior, precisely to be able to work around problems like these.  Thankfully Hibernate had built in just the hooks I needed to solve the problem.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876342/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876342&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/05/23/hibernate-mysql-mac-foreign-key-nightmares-a-painless-solution-to-a-painful-problem/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>
	</item>
		<item>
		<title>Unzip KMZ Files on a Mac using Springy</title>
		<link>http://developmentality.wordpress.com/2011/05/06/unzip-kmz-files-on-a-mac-using-springy/</link>
		<comments>http://developmentality.wordpress.com/2011/05/06/unzip-kmz-files-on-a-mac-using-springy/#comments</comments>
		<pubDate>Fri, 06 May 2011 18:47:19 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[google earth]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[kmz]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[springy]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876332</guid>
		<description><![CDATA[Springy can handle .zip files that the standard unzip utility on Mac cannot<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876332&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m learning about KML/KMZ files, where KMZ is basically a .zip file renamed as .kmz.  The problem is that these .kmz files cannot be opened using the default Mac unzip utility.  When you try to open the .zip file, it creates a new file called &lt;originalfile&gt;.zip.cpgz.  Opening the .cpgz file yields a copy of the original zip.</p>
<div id="attachment_369876333" class="wp-caption aligncenter" style="width: 583px"><a href="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-44-25-pm.png"><img class="size-full wp-image-369876333" title="Screen shot 2011-05-06 at 2.44.25 PM" src="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-44-25-pm.png?w=600" alt=""   /></a><p class="wp-caption-text">Mac OSX cannot handle unzipping the file</p></div>
<p>The solution is to use <a href="http://www.google.com/search?sourceid=chrome&amp;ie=UTF-8&amp;q=springy">Springy</a>, a zip utility for Mac (free trial, ~$20 to buy).  It handles the file perfectly:</p>
<div id="attachment_369876334" class="wp-caption aligncenter" style="width: 610px"><a href="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-44-55-pm.png"><img class="size-full wp-image-369876334" title="Screen shot 2011-05-06 at 2.44.55 PM" src="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-44-55-pm.png?w=600&#038;h=163" alt="Open with Springy" width="600" height="163" /></a><p class="wp-caption-text">Open with Springy</p></div>
<div id="attachment_369876335" class="wp-caption aligncenter" style="width: 610px"><a href="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-45-50-pm.png"><img class="size-full wp-image-369876335" title="Screen shot 2011-05-06 at 2.45.50 PM" src="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-45-50-pm.png?w=600&#038;h=416" alt="Springy handles KMZ fine" width="600" height="416" /></a><p class="wp-caption-text">Springy handles KMZ fine</p></div>
<p>Edit: Found an alternative approach <a href="http://forums.macrumors.com/showthread.php?t=178295">here</a>.  Basically, rename the file .rar instead of .zip and the Unix unzip utility can handle it.</p>
<p>I&#8217;ve written a script to incorporate this; find it as a <a href="https://gist.github.com/959880">gist here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876332/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876332/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876332/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876332/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876332/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876332/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876332/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876332/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876332&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/05/06/unzip-kmz-files-on-a-mac-using-springy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-44-25-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-05-06 at 2.44.25 PM</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-44-55-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-05-06 at 2.44.55 PM</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-06-at-2-45-50-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-05-06 at 2.45.50 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>Visor &#8211; Mac OSX shortcut to launch Terminal</title>
		<link>http://developmentality.wordpress.com/2011/05/05/visor-mac-osx-shortcut-to-launch-terminal/</link>
		<comments>http://developmentality.wordpress.com/2011/05/05/visor-mac-osx-shortcut-to-launch-terminal/#comments</comments>
		<pubDate>Fri, 06 May 2011 00:02:05 +0000</pubDate>
		<dc:creator>i82much</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[keyboard shortcut]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[visor]]></category>

		<guid isPermaLink="false">http://developmentality.wordpress.com/?p=369876326</guid>
		<description><![CDATA[Visor is a great way to free up some desktop real estate, allowing you to summon your terminal window at any time.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876326&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My friend <a href="http://twitter.com/#!/pvencill">Paul</a> showed me a very nice application to quickly launch Terminal.  It&#8217;s called <a href="http://visor.binaryage.com/">Visor</a>, and it&#8217;s very useful if you&#8217;re a programmer.</p>
<div id="attachment_369876327" class="wp-caption aligncenter" style="width: 538px"><a href="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-05-at-7-53-20-pm.png"><img class="size-full wp-image-369876327" title="Visor screenshot" src="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-05-at-7-53-20-pm.png?w=600" alt="Visor screenshot"   /></a><p class="wp-caption-text">Visor allows you to pop up your terminal window at any time</p></div>
<p>After installing it, your terminal hides until being summoned via a keyboard hotkey.  At that point, it pops into view from the top of the screen (though this can be customized if you desire).  I find it really declutters my desktop, as I no longer need to devote screen real estate to the terminal.  Instead, it&#8217;s hidden until I need it.</p>
<p>Due to the way it&#8217;s packaged (as a <a href="http://www.culater.net/software/SIMBL/SIMBL.php">SIMBL</a> plugin that modifies the Terminal app itself), it is unobtrusive, incorporating its settings into the Terminal app itself as opposed to requiring a separate app in your dock or quick launch bar.  It&#8217;s simple and works flawlessly.  Can&#8217;t ask for much more in a piece of free software.</p>
<div id="attachment_369876329" class="wp-caption aligncenter" style="width: 610px"><a href="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-05-at-7-59-49-pm.png"><img class="size-full wp-image-369876329" title="Visor preferences" src="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-05-at-7-59-49-pm.png?w=600&#038;h=479" alt="Visor preferences" width="600" height="479" /></a><p class="wp-caption-text">Visor preferences</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/developmentality.wordpress.com/369876326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/developmentality.wordpress.com/369876326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/developmentality.wordpress.com/369876326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/developmentality.wordpress.com/369876326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/developmentality.wordpress.com/369876326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/developmentality.wordpress.com/369876326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/developmentality.wordpress.com/369876326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/developmentality.wordpress.com/369876326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=developmentality.wordpress.com&amp;blog=11843141&amp;post=369876326&amp;subd=developmentality&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://developmentality.wordpress.com/2011/05/05/visor-mac-osx-shortcut-to-launch-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e02b8faa542c9c11816a3fd5ea9c4d5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">i82much</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-05-at-7-53-20-pm.png" medium="image">
			<media:title type="html">Visor screenshot</media:title>
		</media:content>

		<media:content url="http://developmentality.files.wordpress.com/2011/05/screen-shot-2011-05-05-at-7-59-49-pm.png" medium="image">
			<media:title type="html">Visor preferences</media:title>
		</media:content>
	</item>
	</channel>
</rss>
