<?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>MPD &#187; tech</title>
	<atom:link href="http://blog.mpdaugherty.com/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mpdaugherty.com</link>
	<description>Mike&#039;s in China, doing tech stuff</description>
	<lastBuildDate>Tue, 24 Aug 2010 09:52:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.mpdaugherty.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/75d78ca4874576a82c347ee3ad1b0d45?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>MPD &#187; tech</title>
		<link>http://blog.mpdaugherty.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.mpdaugherty.com/osd.xml" title="MPD" />
	<atom:link rel='hub' href='http://blog.mpdaugherty.com/?pushpress=hub'/>
		<item>
		<title>Mac OSX &#8211; tabbing in forms and skipping select controls.</title>
		<link>http://blog.mpdaugherty.com/2010/08/12/mac-os-and-tabbing-in-forms-that-skips-select-controls/</link>
		<comments>http://blog.mpdaugherty.com/2010/08/12/mac-os-and-tabbing-in-forms-that-skips-select-controls/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 03:50:56 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=343</guid>
		<description><![CDATA[The fact that when I tab through a form on my Mac, it skips the drop downs, which forces me to use the mouse, has been bugging me for a long time.  I finally decided to try searching google for an answer and came upon this old, but still very relevant post by Tony Spencer: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=343&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The fact that when I tab through a form on my Mac, it skips the drop downs, which forces me to use the mouse, has been bugging me for a long time.  I finally decided to try searching google for an answer and came upon this old, but still very relevant post by Tony Spencer:</p>
<p><a title="Tab Skips Select Form Fields in Mac Browsers" href="http://www.tonyspencer.com/2006/05/02/tab-skips-select-form-fields-in-mac-browsers/">http://www.tonyspencer.com/2006/05/02/tab-skips-select-form-fields-in-mac-browsers/</a></p>
<p>Awesome.  The only difference between 2006 and now (Snow Leopard) is that in System Preferences, Keyboard and Mouse have been split into two separate menus, so you should go System Preferences &gt;&gt; Keyboard &gt;&gt; Keyboard Shortcuts to find the &#8216;All controls&#8217; radio button.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=343&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2010/08/12/mac-os-and-tabbing-in-forms-that-skips-select-controls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>JSLint&#8217;s &#8216;unexpected end of line&#8217; vs. JQuery style</title>
		<link>http://blog.mpdaugherty.com/2010/06/10/jslints-ambiguous-end-of-line-vs-jquery-style/</link>
		<comments>http://blog.mpdaugherty.com/2010/06/10/jslints-ambiguous-end-of-line-vs-jquery-style/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 09:21:12 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jslint]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=291</guid>
		<description><![CDATA[I recently added a script to run JSLint over any javascript files that were changed in my last batch of commits when I push changes to our main repository (if you&#8217;re interested, you can take a look).  Immediately, I had my feelings hurt when it started reporting a bunch of errors and warnings. Most of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=291&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently added a script to run JSLint over any javascript files that were changed in my last batch of commits when I push changes to our main repository (if you&#8217;re interested, you can <a title="gitsafepush script" href="http://gist.github.com/432727">take a look</a>).  Immediately, I had my feelings hurt when it started reporting a bunch of errors and warnings.</p>
<p>Most of them I agreed with, but the ambiguous end of line warning when the line was catching syntax that I had very purposefully used to increase readability (for me). <span id="more-291"></span> Basically, this warning appears if a line doesn&#8217;t end with an operator like &#8216;+&#8217; or &#8216;.&#8217; that indicates there&#8217;s another part required.  However, I like to use these operators at the beginning of a new line in order to make it easy to scan and see which lines are continuations.</p>
<p>For example, I would write my jQuery code like this:</p>
<pre class="brush: jscript;">
$(&quot;#someId&quot;).after(&quot;&lt;br /&gt;&quot;)
     .css(&quot;color&quot;,&quot;red&quot;)
     .show();
</pre>
<p>However, this will generate &#8220;<code>lint warning: unexpected end of line; it is ambiguous whether these lines are part of the same statement</code>&#8221; for the last two lines.  Instead, JSLint expects the code to be written like this:</p>
<pre class="brush: jscript;">
$(&quot;#someId&quot;).after(&quot;&lt;br /&gt;&quot;).
     css(&quot;color&quot;,&quot;red&quot;).
     show();
</pre>
<p>To me, this makes it too easy to not notice that methods like &#8216;css&#8217; and &#8216;show&#8217; are properties of an object and not just individual methods.  On the other hand, I wasn&#8217;t sure whether it would be a good idea to just ignore a warning from lint because it would look prettier.</p>
<p>Therefore, I talked it over with my coworker, <a href="http://www.the-xavi.com/">Xavi</a>, and he suggested we turn off the Lint check for this &#8216;error&#8217;.  In addition to us, pretty much the whole jQuery community agrees with our formatting.  As long as we pay attention to the other errors in Lint, we shouldn&#8217;t be writing code with missing semi-colons.</p>
<p>To fix this, I just added a configuration file with a single line: &#8220;-ambiguous_newline&#8221;.  Once I referenced the config file in our script, these errors stopped being reported.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=291&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2010/06/10/jslints-ambiguous-end-of-line-vs-jquery-style/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>mysql_connect and &#8216;No such file or directory&#8217;</title>
		<link>http://blog.mpdaugherty.com/2010/06/02/mysql_connect-no-such-file/</link>
		<comments>http://blog.mpdaugherty.com/2010/06/02/mysql_connect-no-such-file/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 00:49:40 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=272</guid>
		<description><![CDATA[I was working with a friend to get him started with PHP development on OSX, and we were stumped by a &#8216;No suck file or directory&#8217; error message for a long time.  It seemed to be coming from the following line: $this-&#62;linkid = @mysql_pconnect($host, $user, $password) or die(mysql_error()); At first, we didn&#8217;t understand it, because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=272&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was working with a friend to get him started with PHP development on OSX, and we were stumped by a &#8216;No suck file or directory&#8217; error message for a long time.  It seemed to be coming from the following line:</p>
<p style="padding-left:30px;"><code>$this-&gt;linkid = @mysql_pconnect($host, $user, $password) or die(mysql_error());</code></p>
<p>At first, we didn&#8217;t understand it, because it doesn&#8217;t look like PHP is trying to connect to a file there.  However, we eventually discovered that the file that wasn&#8217;t found was the MySQL socket.  Because he had used Ports to install MySQL instead of downloading the .dmg from mysql.com, he didn&#8217;t have the same default socket as most other people on the internet.<span id="more-272"></span></p>
<p>If you are also getting this error, follow the steps below to diagnose and fix it.</p>
<ol>
<li>Narrow down error to mysql_connect() or mysql_pconnect().</li>
<li>Make a phpinfo() page.  Look for &#8216;<strong>mysql.default_socket</strong>&#8216;, &#8216;<strong>mysqli.default_socket</strong>&#8216;, and &#8216;<strong>pdo_mysql.default_socket</strong>&#8216;.  Remember their value; this is where PHP is trying to connect to MySQL.</li>
<li>Start mysql.  Execute &#8216;<code>STATUS;</code>&#8216; and look for the &#8216;<strong>UNIX socket</strong>&#8216; value.  If doesn&#8217;t match the value from phpinfo(), that&#8217;s the culprit.</li>
<li>Open your php.ini file (which is also found on your phpinfo() page as &#8216;<strong>Loaded Configuration File</strong>&#8216;) and change all the occurrences of the incorrect socket location to the correct socket location from MySQL.</li>
<li>Restart Apache (on OSX: <code>sudo apachectl restart</code>) and try reloading your page.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=272&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2010/06/02/mysql_connect-no-such-file/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference with sed in-place editing on Mac OS X vs. Linux</title>
		<link>http://blog.mpdaugherty.com/2010/05/27/difference-with-sed-in-place-editing-on-mac-os-x-vs-linux/</link>
		<comments>http://blog.mpdaugherty.com/2010/05/27/difference-with-sed-in-place-editing-on-mac-os-x-vs-linux/#comments</comments>
		<pubDate>Thu, 27 May 2010 13:52:50 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=243</guid>
		<description><![CDATA[I ran into this problem about a month ago with a bash script that I was writing on my MacBook Pro.  For some reason, in place editing with &#8216;sed -i&#8217; just wouldn&#8217;t work, no matter what I did, and I couldn&#8217;t find any solution online. When running something like sed -i 's/before/after/' test.txt you get [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=243&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I ran into this problem about a month ago with a bash script that I was writing on my MacBook Pro.  For some reason, in place editing with &#8216;sed -i&#8217; just wouldn&#8217;t work, no matter what I did, and I couldn&#8217;t find any solution online.</p>
<p>When running something like</p>
<p><code>sed -i 's/before/after/' test.txt</code></p>
<p>you get the error  message <code>sed: 1: "test.txt": undefined label 'est.txt'</code>.</p>
<p>Eventually, it turned out to be because sed&#8217;s &#8216;-i&#8217; option takes a parameter to indicate what extension to add to the file name when making a backup.  For example,</p>
<p><code>sed -i '.bak' 's/before/after/' test.txt</code></p>
<p>leaves you with two files, &#8216;test.txt&#8217; and &#8216;test.txt.bak&#8217;, where &#8216;test.txt.bak&#8217; is the original version.  Unlike Ubuntu and other linux versions, on OS X, this extension parameter is required.  If you really know what you&#8217;re doing and don&#8217;t want a backup made, you need to provide an empty string &#8221;.</p>
<p>The correct way to run this command on OSX is</p>
<p><code>sed -i '' 's/before/after/' test.txt</code>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=243&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2010/05/27/difference-with-sed-in-place-editing-on-mac-os-x-vs-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>How to include git hooks in a repository AND still personalize your machine</title>
		<link>http://blog.mpdaugherty.com/2010/04/06/how-to-include-git-hooks-in-a-repository-and-still-personalize-your-machine/</link>
		<comments>http://blog.mpdaugherty.com/2010/04/06/how-to-include-git-hooks-in-a-repository-and-still-personalize-your-machine/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 14:04:05 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[my software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=226</guid>
		<description><![CDATA[In my new job as Director of Engineering at 25Lux.com, I&#8217;ve been dealing with a lot of the infrastructure parts of development that I mostly glossed over before because I always worked at a company that had everything set up for me.  It&#8217;s a good chance to think about in what kind of environment I&#8217;d [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=226&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my new job as Director of Engineering at 25Lux.com, I&#8217;ve been dealing with a lot of the infrastructure parts of development that I mostly glossed over before because I always worked at a company that had everything set up for me.  It&#8217;s a good chance to think about in what kind of environment I&#8217;d really like to develop.</p>
<p>It turns out that big part of my answer involves automating everything.  Part of my reasoning is that our team is very small now, so the more we automate, the more we can concentrate on just development.  Another part of my reasoning is that I&#8217;ve read a lot about continuous deployment lately and many of the principles like decreasing the time between developing a hypothesis and learning your answer make sense and can only be achieved through extensive automation.<span id="more-226"></span></p>
<p>To that end, I&#8217;ve decided that all the developers should have some common git hooks in their repositories that will do things like run tests, etc.  Moreover, since we&#8217;ll be spending a lot of time developing these hook scripts, I&#8217;d like them to be backed up and versioned as well &#8211; i.e. also in the repository.</p>
<p>Therefore, my first step was to create a folder in the repository called <code>/git_hooks/</code> and symlink <code>/.git/hooks</code> -&gt; <code>/git_hooks/</code>.  This way, any changes we make to the hooks will be automatically applied across all the developers&#8217; machines.</p>
<p>However, this has a downside in that everyone&#8217;s hooks become the same and they are unable to add their own (I, for example, might like to add a spell checker to my commit comments, but that would be annoying if someone didn&#8217;t like it).  To solve that problem, I created a <code>/git_hooks/personal/</code> directory which behaves just like the normal <code>/.git/hooks/</code> directory, and any hooks a developer adds in there get executed as part of the common hook.  Here&#8217;s the code I used as the base of all of our common hooks to make it work:</p>
<pre class="brush: bash;">
#!/bin/sh

# Check if the individual developer has his own hook
CMD_NAME=`basename $0`
if [ -f $GIT_DIR/hooks/personal/$CMD_NAME ]
then
  # If so, run it. $@ passes all the command line arguments passed to this function
  # If the personal hook fails, fail this one as well
  if ! $GIT_DIR/hooks/personal/$CMD_NAME $@
  then
    echo &quot;User hook '$CMD_NAME' failed&quot;
    exit 1
  fi
fi

exit 0
</pre>
<p>Finally, if any developer does decide to add their own hooks in <code>/git_hooks/personal/</code>, they should be sure to add a line containing &#8220;<code>/git_hooks/personal/*[^.sample]</code>&#8221; to the end of their <code>/.git/info/exclude</code> file so that git will ignore their customizations.</p>
<p>You can download this at <a href="http://gist.github.com/357538">http://gist.github.com/357538</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=226&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2010/04/06/how-to-include-git-hooks-in-a-repository-and-still-personalize-your-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>Staying Connected Overseas with Google Voice and Skype</title>
		<link>http://blog.mpdaugherty.com/2010/03/11/staying-connected-overseas-google-voice-skype/</link>
		<comments>http://blog.mpdaugherty.com/2010/03/11/staying-connected-overseas-google-voice-skype/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 16:17:26 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[travel]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[google voice]]></category>
		<category><![CDATA[overseas]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=211</guid>
		<description><![CDATA[When I first moved to China, I decided that I still wanted to stay connected to the US.  Part of that is keeping a US phone number that can both send and receive calls and text messages.  Luckily, thanks to products like Google Voice and Skype, doing so is now cheap and easy. If you&#8217;ve [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=211&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I first moved to China, I decided that I still wanted to stay connected to the US.  Part of that is keeping a US phone number that can both send and receive calls and text messages.  Luckily, thanks to products like Google Voice and Skype, doing so is now cheap and easy.<br />
<span id="more-211"></span><br />
If you&#8217;ve used Google Voice, you are already used to the idea of having a forwarding phone number &#8211; every time someone calls your Google Voice number, the call is forwarded to your regular phone.  My phone is in China, though, so it doesn&#8217;t work quite so easily; Google Voice does not support adding overseas phone numbers to an account yet.</p>
<p>When I first set up my Google Voice account, I was living in the US and used my US cell phone.  However, I cancelled my contract with AT&amp;T, so I didn&#8217;t even have that anymore.  If you&#8217;re in a similar situation and would like to continue to have a US-based phone while you&#8217;re abroad, feel free to follow along with my setup below.</p>
<p>My first step was to turn off SMS forwarding and enable &#8216;Do Not Disturb&#8217; mode so that while I had no physical phone, my calls and text messages would not be forwarded to some stranger who ended up with my old number.</p>
<p>To do that, you need to do two things in Google Voice.  First, make sure your messages are sent to your email.  Go to Settings-&gt;Voicemail &amp; SMS.  Within that tab, turn on Voicemail Notifications and SMS Forwarding.  Don&#8217;t forget to save your changes.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Forwarding Google Voice to Email" src="http://img.skitch.com/20100311-qm7ehy9qxyy8aef38j1ja897a5.jpg" alt="Forwarding Google Voice to Email" width="390" height="301" /><p class="wp-caption-text">Forwarding Google Voice to Email</p></div>
<p>Next, turn on Do Not Disturb mode to prevent calls from being forwarded to your old phone number.  This is under Settings-&gt;Calls.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Do Not Disturb" src="http://img.skitch.com/20100311-ehwfjpe5n5ydq89arcy8hay9wd.jpg" alt="Enabling Do Not Disturb in Google Voice" width="390" height="300" /><p class="wp-caption-text">Do Not Disturb</p></div>
<p>Now, you can send and receive text messages, and you can receive incoming calls.  All the calls go to voicemail, but at least you can get messages.</p>
<p>To start making and receiving calls again for real, you need to set up a Skype account with the ability to receive calls.  A basic skype account is free, but to receive calls in the US, it will cost you $18 for 3 months.</p>
<p>Once you have a basic Skype account set up, to add support for incoming calls, go to Account-&gt;View Account from the menu bar.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Skype - View Account" src="http://img.skitch.com/20100311-dmq3rysk8tsd96aewsm3ey39j.jpg" alt="Skype - View Account" width="390" height="335" /><p class="wp-caption-text">Skype - View Account</p></div>
<p>Now that you have your Skype account page open, you want to buy an &#8216;Online Number&#8217;.  Go to that tab and set up a number in the US.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Skype - Online Number" src="http://img.skitch.com/20100311-efrhiqm1dfqfhfw5j8tq3sj196.jpg" alt="Skype - Online Number" width="390" height="172" /><p class="wp-caption-text">Skype - Online Number</p></div>
<p>Once you have your new Skype number, go back to Google Voice and add it as a telephone &#8211; Settings-&gt;Phones-&gt;Add a new phone.  I call mine &#8216;Skype&#8217;.  You don&#8217;t want to receive SMS messages on this phone, because you&#8217;re already receiving them in your email, so choose &#8216;Home&#8217; as your phone type.  Make sure you&#8217;re signed into Skype right now.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Adding Skype Number to Google Voice" src="http://img.skitch.com/20100311-dysecjqi1te7gsew4q4up53u9j.jpg" alt="Adding Skype Number to Google Voice" width="390" height="194" /><p class="wp-caption-text">Adding Skype Number to Google Voice</p></div>
<p>You&#8217;ll receive a call on Skype asking you to input a two digit number.  You&#8217;ll have to open the digital keypad to input the number.</p>
<div class="wp-caption alignnone" style="width: 350px"><img title="Skype - Keypad Button" src="http://img.skitch.com/20100311-jghbrje9nk9sx5eb83np4smmhs.jpg" alt="Skype - Keypad Button" width="340" height="392" /><p class="wp-caption-text">Skype - Keypad Button</p></div>
<p>At this point, you should delete your old number in Google Voice and turn off &#8216;Do Not Disturb&#8217;, so that Google Voice begins forwarding your calls again.  If someone calls your Google Voice number, you will receive the call on Skype, as long as you are signed in.</p>
<p>What if you are not signed in, though?  Supposing you have a phone number in your current country, you can set up Skype to forward the call to your phone number.  To do this, you need to add some Skype credit and set up a forwarding number in the View Account page.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Skype - Adding Credit and a Forwarding Number" src="http://img.skitch.com/20100311-m1i3g2eub2as9se2p43gh5qycw.jpg" alt="Skype - Adding Credit and a Forwarding Number" width="390" height="166" /><p class="wp-caption-text">Skype - Adding Credit and a Forwarding Number</p></div>
<p>Now, if you are not signed into Skype, and someone calls your Google Voice number, the call will be forwarded to Skype, which will then forward it to your new phone number at regular Skype rates (for me, US-&gt;China is 2.1 cents/minute).</p>
<p>This is pretty good, but there&#8217;s one last optimization I made.  If you are worried about people calling who don&#8217;t know you&#8217;re out of the country and waking you up in the middle of the night, you can set up Google Voice to only ring your phone during the daytime in your timezone; otherwise, calls go straight to voicemail.  This has already saved me twice when my bank called to ask me some survey questions.</p>
<p>First, make sure your Google account is set up for the right time zone.  Go to Settings-&gt;Account and select your time zone from the drop down menu.</p>
<div class="wp-caption alignnone" style="width: 401px"><img title="Setting the Google Account Timezone" src="http://img.skitch.com/20100311-q825jxhrpabtwuu73tg98ifacs.jpg" alt="Setting the Google Account Timezone" width="391" height="155" /><p class="wp-caption-text">Setting the Google Account Timezone</p></div>
<p>Then, to set up a custom ring schedule for your phone, go to Settings-&gt;Phones-&gt;Skype and click the &#8216;Edit&#8217; button.</p>
<div class="wp-caption alignnone" style="width: 401px"><img title="Google Voice - Editing the Skype Phone" src="http://img.skitch.com/20100311-be62bcs34gu6gqh1yywp4uae7b.jpg" alt="Google Voice - Editing the Skype Phone" width="391" height="166" /><p class="wp-caption-text">Google Voice - Editing the Skype Phone</p></div>
<p>Finally, click &#8216;Show Advanced Settings&#8217; and go down to the Ring Schedule settings.  Here, you can get as fancy as you want.  I have mine set up to not ring from midnight until 6am on weekdays and from 1am to 7am on weekends.</p>
<div class="wp-caption alignnone" style="width: 400px"><img title="Google Voice - Custom Ring Schedules" src="http://img.skitch.com/20100311-qq7mtiwkb94m9jdq2cq44qe56f.jpg" alt="Google Voice - Custom Ring Schedules" width="390" height="292" /><p class="wp-caption-text">Google Voice - Custom Ring Schedules</p></div>
<p>That&#8217;s it!  You now have a US phone number that you can use anywhere in the world for about 2-3 cents per minute for voice and includes free, unlimited text messages.  To make a call, just use Google Voice as usual by calling your contact and selecting &#8216;Skype&#8217; as the phone to ring.  If you&#8217;re on you&#8217;re computer and are signed into Skype, you will get the call on Skype and won&#8217;t have to pay for it at all.  If you&#8217;re not near your computer, your cell phone will ring and you&#8217;ll pay Skype&#8217;s international rate.  Incoming calls work the same way.</p>
<p>Hope this helps someone!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=211&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2010/03/11/staying-connected-overseas-google-voice-skype/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-qm7ehy9qxyy8aef38j1ja897a5.jpg" medium="image">
			<media:title type="html">Forwarding Google Voice to Email</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-ehwfjpe5n5ydq89arcy8hay9wd.jpg" medium="image">
			<media:title type="html">Do Not Disturb</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-dmq3rysk8tsd96aewsm3ey39j.jpg" medium="image">
			<media:title type="html">Skype - View Account</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-efrhiqm1dfqfhfw5j8tq3sj196.jpg" medium="image">
			<media:title type="html">Skype - Online Number</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-dysecjqi1te7gsew4q4up53u9j.jpg" medium="image">
			<media:title type="html">Adding Skype Number to Google Voice</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-jghbrje9nk9sx5eb83np4smmhs.jpg" medium="image">
			<media:title type="html">Skype - Keypad Button</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-m1i3g2eub2as9se2p43gh5qycw.jpg" medium="image">
			<media:title type="html">Skype - Adding Credit and a Forwarding Number</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-q825jxhrpabtwuu73tg98ifacs.jpg" medium="image">
			<media:title type="html">Setting the Google Account Timezone</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-be62bcs34gu6gqh1yywp4uae7b.jpg" medium="image">
			<media:title type="html">Google Voice - Editing the Skype Phone</media:title>
		</media:content>

		<media:content url="http://img.skitch.com/20100311-qq7mtiwkb94m9jdq2cq44qe56f.jpg" medium="image">
			<media:title type="html">Google Voice - Custom Ring Schedules</media:title>
		</media:content>
	</item>
		<item>
		<title>Root access on Ubuntu server?</title>
		<link>http://blog.mpdaugherty.com/2009/11/01/root-access-ubuntu/</link>
		<comments>http://blog.mpdaugherty.com/2009/11/01/root-access-ubuntu/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:10:04 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.mpdaugherty.com/?p=173</guid>
		<description><![CDATA[I&#8217;m in the process of setting up my very first production server using Ubuntu, and I&#8217;ve ended up spending a lot of time reading about security online.  Since I&#8217;ve always let the ops team worry about setting up environments, etc., I&#8217;ve now learned that there are a lot of different concerns to think about. One [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=173&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of setting up my very first production server using Ubuntu, and I&#8217;ve ended up spending a lot of time reading about security online.  Since I&#8217;ve always let the ops team worry about setting up environments, etc., I&#8217;ve now learned that there are a lot of different concerns to think about.</p>
<p>One decision in particular is bugging me right now &#8211; how to secure the root account on my new machine? <span id="more-173"></span> So far, I&#8217;ve been doing a lot of the work by SSHing into the root account.  On the whole, this doesn&#8217;t seem so great, since it can be dangerous to use root day-to-day and always have the ability to delete anything on the system.</p>
<p>Ubuntu recommends that I create another user with sudo permission and use that day-to-day.  However, since Ubuntu also asks users for their own password when using sudo (rather than the root password), I feel this isn&#8217;t intrinsically any more secure than just having a root account.  In either case, a cracker would only have to find one password to take over the system.</p>
<p>So, my thought is to create a second user with sudo permission, change sudo to require the use of the root password, and disable remote logins for root.</p>
<p>Advantages:</p>
<ul>
<li>To gain access to root, a hacker would have to find the second username, that username&#8217;s password, and the root password.</li>
<li>Sudo provides logging of all executed commands.</li>
<li>Using the sudoers file, I could potentially mark some commands as offline to even the secondary user.  This could be useful to make sure the user can&#8217;t change the root password or access certain directories.</li>
</ul>
<p>Disadvantages:</p>
<ul>
<li>Since I don&#8217;t have local access to my machine, I&#8217;m worried about turning off SSH access to root.  What if something happens to the secondary user?  Would I be locked out?  I&#8217;m using Linode as my host, so I think I might actually be able to use their online Lish terminal to log in as root as if it were local access.</li>
<li>Every admin user would need to know the root password in order to use sudo.  I think this is ok because I&#8217;ll really only have one admin user, and that will be me.</li>
</ul>
<p>In all, I think that the advantages of my plan outweigh the disadvantages.  What do you think?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=173&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2009/11/01/root-access-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone Reference Errors</title>
		<link>http://blog.mpdaugherty.com/2009/02/28/iphone-reference-errors/</link>
		<comments>http://blog.mpdaugherty.com/2009/02/28/iphone-reference-errors/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 16:14:55 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[my software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://mpdaugherty.wordpress.com/?p=161</guid>
		<description><![CDATA[I&#8217;ve decided to give iPhone development a try.  I have a few ideas for cool mobile apps that I&#8217;d love to implement so that I can learn a new platform, a new language, and maybe make some money on the side&#8230;  However, I&#8217;ve remembered what I dislike most about programming &#8211; configuration. I started out [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=161&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to give iPhone development a try.  I have a few ideas for cool mobile apps that I&#8217;d love to implement so that I can learn a new platform, a new language, and maybe make some money on the side&#8230;  However, I&#8217;ve remembered what I dislike most about programming &#8211; configuration.</p>
<p><span id="more-161"></span></p>
<p>I started out trying interface builder and got a basic interface to show up pretty quickly, but it was rather confusing and I didn&#8217;t really know what was going on.  Next, I thought I should probably just go through the tutorials in my book (iPhone SDK Application Development by O&#8217;Reilly) so that I could get an overview of what&#8217;s actually possible with the iPhone.  That way, when I restart building my own apps it will be much faster because I&#8217;ll know what I&#8217;m doing.</p>
<p>However, I&#8217;ve now been trying to get the TextView example in Chapter 3 (Hello World) to work for almost a week!  I typed in all the code correctly (twice, into two separate projects), and it compiles fine, but all I get on the iPhone simulator is a black screen!  After a while, I found the debugger console button in XCode and realized I was getting the following errors:</p>
<p>warning: Unable to read symbols for &#8220;/System/Library/Frameworks/UIKit.framework/UIKit&#8221; (file not found).<br />
warning: Unable to read symbols from &#8220;UIKit&#8221; (not yet mapped into memory).<br />
warning: Unable to read symbols for &#8220;/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics&#8221; (file not found).<br />
warning: Unable to read symbols from &#8220;CoreGraphics&#8221; (not yet mapped into memory).</p>
<p>These frameworks are quite obviously linked in XCode (because the code completion works and the project compiles fine), but for some reason they don&#8217;t show up in the simulator.  After searching online, I&#8217;ve gotten to the point where I think it has to do with the way they&#8217;re referenced in XCode and that when running on the simulator, the application doesn&#8217;t actually compile all the references together; it just starts running without them, so you have to run it from within XCode.   Some people have also said that it had to do with breakpoints in code.  However, I&#8217;m running from within XCode and I don&#8217;t have any breakpoints, so I think it must be a file location configuration issue.  Now, I&#8217;ve had no luck finding any solutions online or by experimenting&#8230;</p>
<p>I&#8217;ll let you know how it works out; I&#8217;m not going to give up on this.</p>
<p>&#8212;- Update &#8211; March 1, 2009 &#8212;-</p>
<p>Well, the Hello World example started working&#8230;  First thing to note is that the &#8220;file not found&#8221; type warnings I noted above don&#8217;t actually seem to be related to the problem; now that it works, they still show up.</p>
<p>I fixed the blank black screen by cleaning all targets (in the Build menu), then rewriting Hello World to directly use a TextView instead of manually subclassing UIView myself.  Also, I didn&#8217;t allocate a window object; I just started using it and let the synthesize keyword work for me (before, I was trying to remove Interface Builder from the project, like it recommended in the book.  Here&#8217;s the code that first worked (I called the project &#8220;Arg&#8221; because I was so frustrated):</p>
<p>ArgAppDelegate.h:<br />
<code><br />
#import </p>
<p>@interface ArgAppDelegate : NSObject  {<br />
    UIWindow *window;<br />
	UITextView *textView;<br />
}</p>
<p>@property (nonatomic, retain) IBOutlet UIWindow *window;</p>
<p>@end<br />
</code></p>
<p>ArgAppDelegate.m:<br />
<code><br />
#import<br />
#import<br />
#import<br />
#import "ArgAppDelegate.h"</p>
<p>@implementation ArgAppDelegate</p>
<p>@synthesize window;</p>
<p>- (void) applicationDidFinishLaunching:(UIApplication *)application<br />
{<br />
	CGRect screenBounds = [ [ UIScreen mainScreen ] applicationFrame ];</p>
<p>	textView = [[MainView alloc] initWithFrame:screenBounds];<br />
	[window addSubview:textView];</p>
<p>	[window makeKeyAndVisible];<br />
}</p>
<p>- (void)dealloc {<br />
    [window release];<br />
    [super dealloc];<br />
}<br />
@end<br />
</code></p>
<p>This compiled fine and the text view showed up correctly, etc.  Next, I slowly changed the code one line at a time back to the original code, compiling at each step, to see if I could find the line that was causing the problem.  Unfortunately, I eventually came back to the original code and it worked&#8230;</p>
<p>ArgAppDelegate.h:<br />
<code><br />
#import </p>
<p>@interface MainView	: UIView<br />
{<br />
	UITextView *textView;<br />
}</p>
<p>@end</p>
<p>@interface ArgAppDelegate : NSObject  {<br />
    UIWindow *window;<br />
	MainView *myMainView;<br />
}</p>
<p>@property (nonatomic, retain) IBOutlet UIWindow *window;</p>
<p>@end<br />
</code></p>
<p>ArgAppDelegate.m:</p>
<p><code><br />
#import<br />
#import<br />
#import<br />
#import "ArgAppDelegate.h"</p>
<p>@implementation MainView</p>
<p>- (id)initWithFrame:(CGRect) rect {<br />
	self = [ super initWithFrame: rect ];</p>
<p>	if (self != nil) {<br />
		textView = [ [ UITextView alloc] initWithFrame: rect ];<br />
		textView.text = @"Hello, World!";</p>
<p>		[self addSubview:textView];<br />
	}</p>
<p>	return self;<br />
}</p>
<p>- (void)dealloc {<br />
	[ textView release ];<br />
	[ super dealloc ];<br />
}</p>
<p>@end</p>
<p>@implementation ArgAppDelegate</p>
<p>@synthesize window;</p>
<p>- (void)applicationDidFinishLaunching:(UIApplication *)application {<br />
	CGRect screenBounds = [ [ UIScreen mainScreen ] applicationFrame ];<br />
	CGRect windowBounds = screenBounds;<br />
	windowBounds.origin.y = 0.0;</p>
<p>	self.window = [ [ [ UIWindow alloc ] initWithFrame: screenBounds ]<br />
		autorelease<br />
				   ];</p>
<p>	myMainView = [ [ MainView alloc ] initWithFrame: windowBounds ];<br />
	[window addSubview:myMainView];<br />
    // Override point for customization after application launch<br />
    [window makeKeyAndVisible];<br />
}</p>
<p>- (void)dealloc {<br />
	[myMainView release];<br />
    [window release];<br />
    [super dealloc];<br />
}<br />
</code></p>
<p>main.m:</p>
<p><code><br />
#import </p>
<p>int main(int argc, char *argv[]) {</p>
<p>    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];<br />
    int retVal = UIApplicationMain(argc, argv, nil, @"ArgAppDelegate");<br />
    [pool release];<br />
    return retVal;<br />
}<br />
</code></p>
<p>I hope this helps somewhat to anyone having the same problem.  I found this incredibly frustrating and am not entirely happy about my solution here.  I still don&#8217;t really know why it happened in the first place, so I&#8217;m worried it will come up again in the future.  Let&#8217;s hope not!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/161/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=161&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2009/02/28/iphone-reference-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>Free Speeches Online</title>
		<link>http://blog.mpdaugherty.com/2008/02/24/free-speeches-online/</link>
		<comments>http://blog.mpdaugherty.com/2008/02/24/free-speeches-online/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 15:59:55 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://mpdaugherty.wordpress.com/?p=107</guid>
		<description><![CDATA[I just learned about this cool website: www.ted.com.  TED is an organization that asks famous/interesting people to give 20-minute speeches and records them.  Now, on their website, you can watch speeches that they&#8217;ve collected over the last 24 years.  A lot of this content is probably available on YouTube, but the signal-to-noise ratio is much [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=107&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just learned about this cool website: <a href="http://www.ted.com" title="TED" target="_blank">www.ted.com</a>.  TED is an organization that asks famous/interesting people to give 20-minute speeches and records them.  Now, on their website, you can watch speeches that they&#8217;ve collected over the last 24 years.  A lot of this content is probably available on YouTube, but the signal-to-noise ratio is much higher on TED because of the limited format and the high barrier to entry.</p>
<p>This morning, I watched a talk by J.J. Abrams, and yesterday I watched a theramin concert and a speech on aging by Aubrey de Grey (whom I&#8217;ve read about, but had never seen before).  If you have twenty minutes to spare, you should check it out.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mpdaugherty.wordpress.com/107/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mpdaugherty.wordpress.com/107/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=107&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2008/02/24/free-speeches-online/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
		<item>
		<title>Dancing for Engineers</title>
		<link>http://blog.mpdaugherty.com/2008/01/06/dancing-for-engineers/</link>
		<comments>http://blog.mpdaugherty.com/2008/01/06/dancing-for-engineers/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 04:51:07 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[dancing]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[my software]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[salsa]]></category>

		<guid isPermaLink="false">http://mpdaugherty.wordpress.com/2008/01/06/dancing-for-engineers/</guid>
		<description><![CDATA[Now here&#8217;s a topic I&#8217;ve been thinking about for a while. I started going to salsa dancing lessons fairly regularly this fall, but am having a hard time remembering the long sequences of complex moves that I learn in the MIT lessons (which are great, by the way). Even when I can remember them, it&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=102&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now here&#8217;s a topic I&#8217;ve been thinking about for a while.  I started going to salsa dancing lessons fairly regularly this fall, but am having a hard time remembering the long sequences of complex moves that I learn in the MIT lessons (which are great, by the way).  Even when I can remember them, it&#8217;s hard to do them on the dance floor with a girl who doesn&#8217;t also know what is coming, while staying on the beat, etc. etc.  So, at some point this fall, I thought to myself that there must be a better way to learn enough sequences of moves not to bore a good follower to tears.<span id="more-102"></span></p>
<p>As I thought about the problem, I realized that salsa dancing (and most partner dances) is really a finite-state machine.  We have X number of states (the positions that you end up in on beat 1), and transitions between the states (twirls, etc.).  Naturally, I thought of creating a diagram with states and transitions and tracing paths through the diagram to come up with new sequences.  This way, if I could memorize a few positions and all the different transitions between them, I could come up with lots of sequences on my own without ever having to memorize a two-minute series of steps.  Each set of steps would be at most 8 or 16 beats long.</p>
<p>Still, I didn&#8217;t know exactly what to call each state, what precisely is considered a transition, or most importantly, how to present this information in a usable manner.  Last week, I was again thinking about this and realized that since a finite-state diagram is also a directed graph, and the web is a directed graph, a webpage made perfect sense for a presentation mechanism.  Moreover, if I used a wiki, I could start adding pieces very easily, even if I don&#8217;t know the best terminology or have the perfect definition of each state.  Plus, other people can add their own moves to the wiki and eventually, we can all learn from each other.</p>
<p>Thus, yesterday morning, I started a new website: <a href="http://salsa.wikidot.com">salsa.wikidot.com</a>.   So far it&#8217;s not much; I have a few positions and moves described, and I plan to add more.  I feel a little bit like I shouldn&#8217;t actually be the one adding content, since I&#8217;m so new at dancing and don&#8217;t really know how to describe everything.  However, I also think that a lot of times we just need to start doing something even if we don&#8217;t know how, so there it is.  I have it set up so that it will be easy to add photos and videos of the steps if I ever get that far.  Should be fun.  Hopefully this helps someone someday.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mpdaugherty.wordpress.com/102/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mpdaugherty.wordpress.com/102/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mpdaugherty.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mpdaugherty.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mpdaugherty.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mpdaugherty.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mpdaugherty.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mpdaugherty.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mpdaugherty.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mpdaugherty.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mpdaugherty.com&amp;blog=1126752&amp;post=102&amp;subd=mpdaugherty&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mpdaugherty.com/2008/01/06/dancing-for-engineers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1789bf112f20b2b53047372a84803581?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Mike</media:title>
		</media:content>
	</item>
	</channel>
</rss>