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

<channel>
	<title>Ted Naleid &#187; Uncategorized</title>
	<atom:link href="http://naleid.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://naleid.com/blog</link>
	<description>Groovy, Grails and OS X tips and tricks</description>
	<lastBuildDate>Wed, 16 Jun 2010 17:38:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grails build-test-data 1.1 released with new buildLazy functionality</title>
		<link>http://naleid.com/blog/2010/04/04/grails-build-test-data-1-1-released-with-new-buildlazy-functionality/</link>
		<comments>http://naleid.com/blog/2010/04/04/grails-build-test-data-1-1-released-with-new-buildlazy-functionality/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 19:13:44 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=178</guid>
		<description><![CDATA[Version 1.1 of the build-test-data plugin has just been released.
It adds a new buildLazy method that will only create a new object graph if it can&#8217;t find an existing object that matches the build criteria specified.
Example:

    def a = new Author&#40;firstName: &#34;Ray&#34;, lastName: &#34;Bradbury&#34;&#41;
    a.save&#40;&#41;
    assert [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.1 of the <a href="http://bitbucket.org/tednaleid/grails-test-data/wiki/Home" onclick="pageTracker._trackPageview('/outgoing/bitbucket.org/tednaleid/grails-test-data/wiki/Home?referer=');">build-test-data plugin</a> has just been released.</p>
<p>It adds a new buildLazy method that will only create a new object graph if it can&#8217;t find an existing object that matches the build criteria specified.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">def</span> a <span style="color: #669966;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Author<span style="color: #669966;">&#40;</span>firstName: <span style="color: #aa0000;">&quot;Ray&quot;</span>, lastName: <span style="color: #aa0000;">&quot;Bradbury&quot;</span><span style="color: #669966;">&#41;</span>
    a.<span style="color: #006600;">save</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #cc66cc;">1</span> <span style="color: #669966;">==</span> Author.<span style="color: #663399;">count</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">// Author table already has Ray Bradbury in it, finds existing record</span>
    <span style="color: #000000; font-weight: bold;">def</span> bradbury <span style="color: #669966;">=</span> Author.<span style="color: #006600;">buildLazy</span><span style="color: #669966;">&#40;</span>lastName: <span style="color: #aa0000;">&quot;Bradbury&quot;</span><span style="color: #669966;">&#41;</span>  
    <span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #cc66cc;">1</span> <span style="color: #669966;">==</span> Author.<span style="color: #663399;">count</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">assert</span> bradbury.<span style="color: #006600;">firstName</span> <span style="color: #669966;">==</span> <span style="color: #aa0000;">&quot;Ray&quot;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">def</span> newAuthor <span style="color: #669966;">=</span> Author.<span style="color: #006600;">buildLazy</span><span style="color: #669966;">&#40;</span>lastName: <span style="color: #aa0000;">&quot;Moore&quot;</span><span style="color: #669966;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #cc66cc;">2</span> <span style="color: #669966;">==</span> Author.<span style="color: #663399;">count</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span> <span style="color: #808080; font-style: italic;">// creates a new record, no existing &quot;Moore&quot; author previously</span></pre></div></div>

<p>I find this particularly useful for building testing data in the grails console.  It allows me to do some quick setup of new objects and then concentrate on creating the code that I actually want to try out.  Without buildLazy, I was always commenting out my creation code so that multiple executions of the test script didn&#8217;t create multiple copies of the same data (and potentially hit unique constraints issues that I had to screw around with).  </p>
<p>Now, I no longer need to worry about commenting out the creation code after running it the first time.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> u <span style="color: #669966;">=</span> User.<span style="color: #006600;">buildLazy</span><span style="color: #669966;">&#40;</span>ssn: <span style="color: #aa0000;">&quot;123-456-7890&quot;</span><span style="color: #669966;">&#41;</span> <span style="color: #808080; font-style: italic;">// User.ssn has unique constraint</span>
u.<span style="color: #006600;">foo</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span>
u.<span style="color: #006600;">bar</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span>
u.<span style="color: #006600;">baz</span><span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span></pre></div></div>

<p>Before buildLazy I&#8217;d need to comment out the user creation and replace it with a user.findBySsn.  Now buildLazy does the creation and later finding for me.  I can concentrate on making foo/bar/baz do what I want them to (the reason I opened the console in the first place).</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2010/04/04/grails-build-test-data-1-1-released-with-new-buildlazy-functionality/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updated grails autocomplete script for zsh</title>
		<link>http://naleid.com/blog/2010/03/02/updated-grails-autocomplete-script-for-zsh/</link>
		<comments>http://naleid.com/blog/2010/03/02/updated-grails-autocomplete-script-for-zsh/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:22:28 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=166</guid>
		<description><![CDATA[A couple of years ago, I created a grails auto-completion script for bash and zsh.  
Since then, I&#8217;ve completely abandoned bash, in favor of zsh (which I consider to be the superior shell) and I&#8217;d been getting annoyed at a few issues in the last grails autocomplete script.
I finally got motivated to make some [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago, I created a <a href="http://naleid.com/blog/2008/03/25/autocomplete-grails-script-names-in-bashzsh/">grails auto-completion script for bash and zsh</a>.  </p>
<p>Since then, I&#8217;ve completely abandoned bash, <a href="http://naleid.com/blog/2009/05/13/shared-zshrc-file/">in favor of zsh</a> (which I consider to be the superior shell) and I&#8217;d been getting annoyed at a few issues in the last grails autocomplete script.</p>
<p>I finally got motivated <a href="http://bitbucket.org/tednaleid/shared-zshrc/src/tip/zshrc_grails_compinstall" onclick="pageTracker._trackPageview('/outgoing/bitbucket.org/tednaleid/shared-zshrc/src/tip/zshrc_grails_compinstall?referer=');">to make some enhancements to it</a>.  Including support for grails 1.2 plugin scripts (1.2 moved the plugins into the ~/.grails directory), and support for test class name autocompletion (very useful for <code>grails test-app</code>).</p>
<p>To get it working (assuming you&#8217;re using zsh), you can either add the contents of <a href="http://bitbucket.org/tednaleid/shared-zshrc/src/tip/zshrc_grails_compinstall" onclick="pageTracker._trackPageview('/outgoing/bitbucket.org/tednaleid/shared-zshrc/src/tip/zshrc_grails_compinstall?referer=');">my zshrc_grails_compinstall</a> to your .zshrc file, or you can switch over to using <a href="http://naleid.com/blog/2009/05/13/shared-zshrc-file/">my full zshrc setup</a>, which has a number of nice features that I&#8217;ve collected over the years.  I&#8217;ll also continue to update this as I think of new tricks.</p>
<p>After getting it installed, just type &#8220;grails&#8221; followed by a space and then hit tab.  It will show you a list of all of the potential grails scripts for the application that you&#8217;re in.  It&#8217;s aware of the version of the current app, as well as it&#8217;s application name based on the contents of application.properties, and also will include any scripts for the plugins you have installed in that app in <code>~/.grails/GRAILS_VERSION/projects/APP_NAME/plugins</code>  (in addition to the scripts in <code>./scripts</code>, <code>$GRAILS_HOME/scripts</code> and <code>~/.grails/scripts</code>).</p>
<p>After you choose your script (such as <code>grails test-app</code> hit space again and it will show you all of the test classes, with the full package for the class, under your test directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2010/03/02/updated-grails-autocomplete-script-for-zsh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using iWork Numbers.app AppleScript to Sum Columns For All Tables on a Sheet</title>
		<link>http://naleid.com/blog/2010/02/07/using-iwork-numbers-applescript-to-sum-columns-for-all-tables-on-a-sheet/</link>
		<comments>http://naleid.com/blog/2010/02/07/using-iwork-numbers-applescript-to-sum-columns-for-all-tables-on-a-sheet/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:45:08 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=157</guid>
		<description><![CDATA[Overall, I&#8217;m pretty happy with Numbers.app (part of Apple&#8217;s iWork suite) as a replacement for Excel.  It&#8217;s considerably cheaper and has lots of user interface tweaks to make it more pleasant to work with.
One of these changes is that each sheet can actually have multiple tables on it, and these can be arranged independently [...]]]></description>
			<content:encoded><![CDATA[<p>Overall, I&#8217;m pretty happy with Numbers.app (part of Apple&#8217;s iWork suite) as a replacement for Excel.  It&#8217;s considerably cheaper and has lots of user interface tweaks to make it more pleasant to work with.</p>
<p>One of these changes is that each sheet can actually have multiple tables on it, and these can be arranged independently on the same page.  This prevents the problem that happens in excel where you have multiple sets of data you want to see at the same time, but the cell/row sizing for one set of data affects the data in the other set that happens to be on the same row.</p>
<p>I&#8217;ve been leveraging this for a one-off personal project and I had a need to sum up all of the data in the 2nd column on all of the tables within a particular sheet.</p>
<p>This brought me to <a href="http://developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html" onclick="pageTracker._trackPageview('/outgoing/developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html?referer=');">AppleScript</a>, Apple&#8217;s scripting language that&#8217;s used to drive applications.<br />
<span id="more-157"></span><br />
You can write scripts in the AppleScript editor (found in /Applications/Utilities).  In there, you can look up the commands and objects that a particular program makes available by going to File->Open Dictionary and then finding the application that you want to script.</p>
<p>I&#8217;ve done a little work in AppleScript in the past, but always recoil from it when I&#8217;m done.  It&#8217;s so damn wordy in what appears to be an attempt to make it more &#8220;friendly&#8221; when it really just makes it harder to remember the right syntax to get something done.  It probably just has <a href="http://www.youtube.com/watch?v=dCud8H7z7vU" onclick="pageTracker._trackPageview('/outgoing/www.youtube.com/watch?v=dCud8H7z7vU&amp;referer=');">&#8220;too many notes&#8221;.</a></p>
<p>Regardless, here&#8217;s the script that I came up with to sum up all of the values in the 2nd column (Column B) for all of the tables on the currently active sheet and then insert the result onto the 2nd column of a table named &#8220;Totals&#8221; (which must previously exist).</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Numbers&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">document</span> <span style="color: #000000;">1</span>
		<span style="color: #ff0033; font-weight: bold;">set</span> total <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">0</span>
		<span style="color: #ff0033; font-weight: bold;">set</span> totalTable <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">0</span>
		<span style="color: #ff0033; font-weight: bold;">tell</span> sheet <span style="color: #000000;">1</span>
			<span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> j <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> tables<span style="color: #000000;">&#41;</span>
				<span style="color: #ff0033; font-weight: bold;">try</span>
					<span style="color: #ff0033; font-weight: bold;">tell</span> table j
						<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">not</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Totals&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
							<span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> k <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> rows
								<span style="color: #ff0033; font-weight: bold;">set</span> total <span style="color: #ff0033; font-weight: bold;">to</span> total <span style="color: #000000;">+</span> <span style="color: #000000;">&#40;</span>value <span style="color: #ff0033; font-weight: bold;">of</span> cell <span style="color: #000000;">2</span> <span style="color: #ff0033; font-weight: bold;">of</span> row k<span style="color: #000000;">&#41;</span>
							<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
						<span style="color: #ff0033; font-weight: bold;">else</span>
							<span style="color: #ff0033; font-weight: bold;">set</span> totalTable <span style="color: #ff0033; font-weight: bold;">to</span> j
						<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
					<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
				<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
			<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
			<span style="color: #ff0033; font-weight: bold;">tell</span> table totalTable
				<span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;total = &quot;</span> <span style="color: #000000;">&amp;</span> total <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; total table = &quot;</span> <span style="color: #000000;">&amp;</span> totalTable
				<span style="color: #ff0033; font-weight: bold;">set</span> value <span style="color: #ff0033; font-weight: bold;">of</span> cell <span style="color: #000000;">2</span> <span style="color: #ff0033; font-weight: bold;">of</span> row <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">to</span> total
			<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
		<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span></pre></div></div>

<p>I needed this ability as the number of tables on this sheet will change quite frequently depending on what I&#8217;m doing with it, and the values in the 2nd column of each of these tables will also get frequently modified and I need to easily know the sum across all of the tables.</p>
<p>To actually execute the script within Numbers.app, there are a couple of ways to do it.  It doesn&#8217;t appear that Numbers has it&#8217;s own script directory (normally, it would be under ~/Library/Application Support/iWork/Numbers/Scripts), but you can add it to your own User Scripts directory at ~/Library/Scripts.</p>
<p>If you want to access it through your menus, you can enable the global script icon up there by going into the AppleScript Editor preferences.  On the General tab, check the box that says &#8220;Show Script menu in menu bar&#8221;.</p>
<p>If you&#8217;re using LaunchBar or Quicksilver, you can also add this directory to their catalog as a place to search.  Then it&#8217;s as easy as cmd-space and the name of the script to execute it (both apps also allow you to set up keyboard shortcuts too).</p>
<p>In all, it feels hacky, and I&#8217;m sure it could be improved if I actually knew what the hell I was doing in AppleScript, but as I said, it&#8217;s a one-off that I need for a fairly particular problem.</p>
<p>I should probably take a little more time to learn more about AppleScript (or look more closely at a bridge to a language that I find a bit more palatable).  Being able to script the applications that I use can be very useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2010/02/07/using-iwork-numbers-applescript-to-sum-columns-for-all-tables-on-a-sheet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updated wordpress</title>
		<link>http://naleid.com/blog/2009/09/06/updated-wordpress/</link>
		<comments>http://naleid.com/blog/2009/09/06/updated-wordpress/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 15:38:48 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=62</guid>
		<description><![CDATA[I&#8217;ve just switched hosting providers from slicehost to a reserved EC2 instance.  I also upgraded from a really old version of wordpress to wordpress 2.8.4.  I&#8217;ve been meaning to do this for a while now, but wanting to avoid yesterday&#8217;s worm prompted me to do it this weekend rather than next.
Let me know [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just switched hosting providers from slicehost to a reserved EC2 instance.  I also upgraded from a really old version of wordpress to wordpress 2.8.4.  I&#8217;ve been meaning to do this for a while now, but <a href="http://wordpress.org/development/2009/09/keep-wordpress-secure/" onclick="pageTracker._trackPageview('/outgoing/wordpress.org/development/2009/09/keep-wordpress-secure/?referer=');">wanting to avoid yesterday&#8217;s worm</a> prompted me to do it this weekend rather than next.</p>
<p>Let me know if you see any issues or broken links.</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2009/09/06/updated-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SelectorGadget makes CSS selectors really simple</title>
		<link>http://naleid.com/blog/2009/02/26/selectorgadget-makes-css-selectors-really-simple/</link>
		<comments>http://naleid.com/blog/2009/02/26/selectorgadget-makes-css-selectors-really-simple/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 04:51:43 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=45</guid>
		<description><![CDATA[Today I&#8217;ve run across a few mentions of SelectorGadget.  First when John Resig tweeted about it and now it&#8217;s at the top of Hacker News.
It&#8217;s worth all the attention it&#8217;s getting.  It makes working with CSS selectors, and especially scraping websites, dead simple.  This is the gateway into
The kind of information that [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve run across a few mentions of <a href="http://www.selectorgadget.com/" onclick="pageTracker._trackPageview('/outgoing/www.selectorgadget.com/?referer=');">SelectorGadget</a>.  First when <a href="http://twitter.com/jeresig/status/1255411573" onclick="pageTracker._trackPageview('/outgoing/twitter.com/jeresig/status/1255411573?referer=');">John Resig tweeted about it</a> and now it&#8217;s at <a href="http://news.ycombinator.com/item?id=496350" onclick="pageTracker._trackPageview('/outgoing/news.ycombinator.com/item?id=496350&amp;referer=');">the top of Hacker News</a>.</p>
<p>It&#8217;s worth all the attention it&#8217;s getting.  It makes working with CSS selectors, and especially scraping websites, dead simple.  This is the gateway into</p>
<p>The kind of information that it gives you can be fed into jQuery (or other CSS selector aware API&#8217;s like nokogiri or hpricot for Ruby or beautiful soup for Python) to easily get the right syntax for querying the DOM.</p>
<p>Check out the author&#8217;s screencast on the front page.  He very quickly demonstrates how easy it is to use SelectorGadget to modify the scope of the intended selector.</p>
<p>P.S. if anyone is aware of any Groovy/Java parsers that can take CSS 3 selectors, I&#8217;d love to hear about them.  Some quick googling isn&#8217;t showing anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2009/02/26/selectorgadget-makes-css-selectors-really-simple/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>StackOverflow.com</title>
		<link>http://naleid.com/blog/2008/09/23/stackoverflowcom/</link>
		<comments>http://naleid.com/blog/2008/09/23/stackoverflowcom/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 04:22:26 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=28</guid>
		<description><![CDATA[I&#8217;m pretty impressed with the community that&#8217;s forming over at StackOverflow.com (Jeff Atwood and Joel Spolksy&#8217;s new developer focused Q&#038;A startup).
I just asked a fairly detailed question about working with mercurial.  Something that wasn&#8217;t (obviously) covered on the mercurial wiki, through googling, or in the mercurial handbook, and got a quality answer back in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pretty impressed with the community that&#8217;s forming over at <a href="http://stackoverflow.com" onclick="pageTracker._trackPageview('/outgoing/stackoverflow.com?referer=');">StackOverflow.com</a> (<a href="http://codinghorror.com" onclick="pageTracker._trackPageview('/outgoing/codinghorror.com?referer=');">Jeff Atwood</a> and <a href="http://joelonsoftware.com" onclick="pageTracker._trackPageview('/outgoing/joelonsoftware.com?referer=');">Joel Spolksy</a>&#8217;s new developer focused Q&#038;A startup).</p>
<p>I just asked a <a href="http://stackoverflow.com/questions/125272/using-mercurial-whats-the-easiest-way-to-commit-and-push-a-single-file-while-le" onclick="pageTracker._trackPageview('/outgoing/stackoverflow.com/questions/125272/using-mercurial-whats-the-easiest-way-to-commit-and-push-a-single-file-while-le?referer=');">fairly detailed question</a> about working with <a href="http://www.selenic.com/mercurial/wiki/index.cgi/Mercurial" onclick="pageTracker._trackPageview('/outgoing/www.selenic.com/mercurial/wiki/index.cgi/Mercurial?referer=');">mercurial</a>.  Something that wasn&#8217;t (obviously) covered on the mercurial wiki, through googling, or in the <a href="http://hgbook.red-bean.com/" onclick="pageTracker._trackPageview('/outgoing/hgbook.red-bean.com/?referer=');">mercurial handbook</a>, and got a quality answer back in only 8 minutes.  That&#8217;s fantastic for a general purpose development website and is a great start after only being open for a couple of weeks.</p>
<p>They&#8217;ve started up an interesting reward/karma system over there where they award badges (similar to achievements on Xbox360) for a bunch of different positive behaviors.   A nice little token system that&#8217;s paired with <a href="http://stackoverflow.com/questions/18557/how-does-stackoverflow-work-the-unofficial-faq#119554" onclick="pageTracker._trackPageview('/outgoing/stackoverflow.com/questions/18557/how-does-stackoverflow-work-the-unofficial-faq_119554?referer=');">&#8220;power-ups&#8221;</a> at different point levels.  It&#8217;s easy to get the first few badges with just a little participation on the website, and I can see how certain personality types that are common in engineers would get big rewards out of collecting these.</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2008/09/23/stackoverflowcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubiquity &#8211; interesting looking command line for Firefox</title>
		<link>http://naleid.com/blog/2008/08/26/ubiquity-interesting-looking-command-line-for-firefox/</link>
		<comments>http://naleid.com/blog/2008/08/26/ubiquity-interesting-looking-command-line-for-firefox/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 02:24:59 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[quicksilver]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=27</guid>
		<description><![CDATA[Just ran across Ubiquity over on on waxy.  
It&#8217;s an alpha Firefox plugin that&#8217;s attempting to be a command line for the internet.  It reminds me a little of yubnub, but quite a bit more powerful as it&#8217;s available on every page and is context sensitive.
Essentially, it has a set of built in [...]]]></description>
			<content:encoded><![CDATA[<p>Just ran across <a href="http://www.azarask.in/blog/post/ubiquity-in-depth/" onclick="pageTracker._trackPageview('/outgoing/www.azarask.in/blog/post/ubiquity-in-depth/?referer=');">Ubiquity</a> over on on <a href="http://waxy.org/links/" onclick="pageTracker._trackPageview('/outgoing/waxy.org/links/?referer=');">waxy</a>.  </p>
<p>It&#8217;s an alpha Firefox plugin that&#8217;s attempting to be a command line for the internet.  It reminds me a little of <a href="http://yubnub.org/" onclick="pageTracker._trackPageview('/outgoing/yubnub.org/?referer=');">yubnub</a>, but quite a bit more powerful as it&#8217;s available on every page and is context sensitive.</p>
<p>Essentially, it has a set of built in commands (that you can add to an extend) and it&#8217;s aware of the current browser context, so if you have something highlighted, it can act on that subset of the current page.</p>
<p>Previously, I&#8217;ve been a heavy user of <a href="http://www.mozilla.org/products/firefox/smart-keywords.html" onclick="pageTracker._trackPageview('/outgoing/www.mozilla.org/products/firefox/smart-keywords.html?referer=');">Firefox smart keywords</a>, which allow you to assign aliases to bookmarks and type the aliases in the location bar.  I&#8217;ve created smart keywords that allow me to search wikipedia, amazon, imdb and the dictionary.  Ubiquity has all of these, plus a lot more built-in.</p>
<p>I&#8217;ve only been using it for a little bit, and there are some rough edges, but I think that there is quite a bit of promise here as well and thought that there might be a few other keyboard jockeys out there that would appreciate what Ubiquity is trying to do. </p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2008/08/26/ubiquity-interesting-looking-command-line-for-firefox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pitfalls with Mercurial, ZSH and SSH</title>
		<link>http://naleid.com/blog/2008/07/29/pitfalls-with-mercurial-zsh-and-ssh/</link>
		<comments>http://naleid.com/blog/2008/07/29/pitfalls-with-mercurial-zsh-and-ssh/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 04:43:57 +0000</pubDate>
		<dc:creator>tednaleid</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naleid.com/blog/?p=26</guid>
		<description><![CDATA[I ran into a couple of issues trying to clone a mercurial repository over ssh tonight.  I&#8217;m documenting the solutions here in case they&#8217;re useful for anyone else (or me when I forget what I did in 6 months :).
The first issue was that I&#8217;m running ssh on a non-standard port and the repository [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a couple of issues trying to clone a mercurial repository over ssh tonight.  I&#8217;m documenting the solutions here in case they&#8217;re useful for anyone else (or me when I forget what I did in 6 months :).</p>
<p>The first issue was that I&#8217;m running ssh on a non-standard port and the repository does not reside in my home directory.<br />
<span id="more-26"></span><br />
The <a href="http://hgbook.red-bean.com/hgbookch6.html#x10-1240006.5" onclick="pageTracker._trackPageview('/outgoing/hgbook.red-bean.com/hgbookch6.html_x10-1240006.5?referer=');">Mercurial Documentation on using SSH</a> does document how to use mercurial with unusual ssh locations, but it&#8217;s not obvious in the &#8220;hg -v help clone&#8221; documentation.  You will want to use a <code>ssh://</code> format URI and also need to make sure to use a &#8220;//&#8221; if you want to use an absolute path to your repository.</p>
<p>This example shows how to ssh to port 9292 on example.com as user &#8220;ted&#8221; and get to a repository that&#8217;s located at /export/repos on that server.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">hg <span style="color: #660033;">-v</span> clone <span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>ted<span style="color: #000000; font-weight: bold;">@</span>example.com:<span style="color: #000000;">9292</span><span style="color: #000000; font-weight: bold;">//</span>export<span style="color: #000000; font-weight: bold;">/</span>repos</pre></div></div>

<p>If you don&#8217;t use a &#8220;//&#8221; it assumes that the location of the repository is relative to the user&#8217;s home directory.</p>
<p>The &#8220;-v&#8221; (verbose) parameter is also useful for debugging what&#8217;s going on as it will show you the SSH command that it&#8217;s running under the covers.</p>
<p>The second issue was that after entering the above command and typing in my password, I&#8217;d see this error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">remote: <span style="color: #c20cb9; font-weight: bold;">zsh</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found: hg
abort: no suitable response from remote hg<span style="color: #000000; font-weight: bold;">!</span></pre></div></div>

<p>This seemed strange as I knew I had mercurial installed on my remote computer (that&#8217;s how the repository got there in the first place).  I&#8217;ve got mercurial installed under <code>/usr/local/bin</code> which is a directory that&#8217;s added to my PATH environment variable in my .zshrc file (I&#8217;m using the <a href="http://www.zsh.org/" onclick="pageTracker._trackPageview('/outgoing/www.zsh.org/?referer=');">ZSH shell</a>instead of the default bash shell that most people use on OSX).</p>
<p>It turns out that under the covers, mercurial is executing a command like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> ted<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #660033;">-p</span> <span style="color: #000000;">9292</span> <span style="color: #ff0000;">&quot;hg -R /export/repos serve --stdio&quot;</span></pre></div></div>

<p>When ssh is directly executing a command on a server instead of logging in, that&#8217;s called &#8220;non-interactive&#8221; mode and it doesn&#8217;t source your .zshrc file (I&#8217;m assuming that a similar thing happens in bash).  To fix this for ZSH, you can create a .zshenv file that WILL get executed by both interactive and non-interactive shells commands and put your PATH in there. </p>
<p>I&#8217;m assuming that a similar thing happens in a bash shell (and other shells as well), so if you&#8217;re seeing that the &#8220;hg&#8221; command can&#8217;t be found, make sure that you can execute a command like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> foo<span style="color: #000000; font-weight: bold;">@</span>bar.com <span style="color: #ff0000;">&quot;hg help&quot;</span></pre></div></div>

<p>If it says &#8220;command not found: hg&#8221;, then you don&#8217;t have the correct path for a non-interactive shell.</p>
]]></content:encoded>
			<wfw:commentRss>http://naleid.com/blog/2008/07/29/pitfalls-with-mercurial-zsh-and-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
