<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Eric Wendelin's Blog</title>
	
	<link>http://eriwen.com</link>
	<description>Programming productively with open-source tools</description>
	<lastBuildDate>Fri, 26 Jun 2009 17:43:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<geo:lat>39.929566</geo:lat><geo:long>-104.949317</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/EricWendelin" type="application/rss+xml" /><feedburner:emailServiceId>EricWendelin</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Introducing GroovyRTM: A Groovier way to Remember The Milk</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/ybWPXY2YHbc/</link>
		<comments>http://eriwen.com/groovy/introducing-groovyrtm/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 10:00:28 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=866</guid>
		<description><![CDATA[I have always wanted to give something back to the wonderful creators of the <a href="http://www.rememberthemilk.com">Remember The Milk</a> to-do list service. It has been a great tool for me the past couple years by helping me keep organized. Thank you, RTM crew!

Over the last couple months I've been taking a bit of spare time to write something that I hope all of us can benefit from: <a href="http://kenai.com/projects/groovyrtm">GroovyRTM</a>

<h2>What is GroovyRTM?</h2>
GroovyRTM allows you to easily take advantage of the <a href="http://www.rememberthemilk.com/services/api/">Remember The Milk REST API</a> using any language on the JVM. In short, you can now write apps for Remember The Milk without having to worry about all the HTTP transaction stuff, error handling, etc. As its name implies, it's written in Groovy, which made it much easier to write and test.


Related posts:<ol><li><a href='http://eriwen.com/groovy/groovy-shell-scripts/' rel='bookmark' title='Permanent Link: Get groovy for better shell scripts'>Get groovy for better shell scripts</a></li><li><a href='http://eriwen.com/groovy/crush-images-with-groovy/' rel='bookmark' title='Permanent Link: Crush images on the command-line with Groovy'>Crush images on the command-line with Groovy</a></li><li><a href='http://eriwen.com/groovy/groovy-categories/' rel='bookmark' title='Permanent Link: Using Groovy Categories to override operators'>Using Groovy Categories to override operators</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I have always wanted to give something back to the wonderful creators of the <a href="http://www.rememberthemilk.com">Remember The Milk</a> to-do list service. It has been a great tool for me the past couple years by helping me keep organized. Thank you, RTM crew!</p>
<p>Over the last couple months I&#8217;ve been taking a bit of spare time to write something that I hope all of us can benefit from: <a href="http://kenai.com/projects/groovyrtm">GroovyRTM</a></p>
<h2>What is GroovyRTM?</h2>
<p>GroovyRTM allows you to easily take advantage of the <a href="http://www.rememberthemilk.com/services/api/">Remember The Milk REST API</a> using any language on the JVM. In short, you can now write apps for Remember The Milk without having to worry about all the HTTP transaction stuff, error handling, etc. As its name implies, it&#8217;s written in Groovy, which made it much easier to write and test. <img src="http://eriwen.com/images/groovyrtm.png" style="display: block; margin: 0 auto;" alt="Remember The Milk + Groovy = GroovyRTM" /></p>
<h2>How can I use it?</h2>
<p>To get started, you&#8217;ll need 3 things:</p>
<ol>
<li>Download <a href="http://kenai.com/projects/groovyrtm/downloads">groovyrtm-all.jar</a> from the project on <a href="http://kenai.com">kenai.com</a></li>
<li>Request an <a href="http://www.rememberthemilk.com/services/api/keys.rtm">API key</a> (you&#8217;ll probably want an RTM account to test it with, too)</li>
<li>Create a <em>RtmService.properties</em> file as explained in the project <a href="http://kenai.com/projects/groovyrtm/pages/Home">Wiki</a></li>
</ol>
<p>Just how easy is it? Suppose you want to write a little Java app that adds a new task:</p>
<pre class="brush: java">
import org.eriwen.rtm.*;

class MyGroovyRtmTest {
    public static void main(String[] args) {
        RtmService groovyrtm = new RtmService();
        groovyrtm.tasksAdd(&quot;Try GroovyRTM!&quot;);
    }
}
</pre>
<p>It&#8217;s that easy! Now, it&#8217;s a little deceiving because the first time your app runs you have to allow it access via the RTM website. The best part is&#8230; it&#8217;s open source! You can check out the source with Mercurial:</p>
<pre class="brush: bash">
hg clone https://kenai.com/hg/groovyrtm~mercurial groovyrtm
</pre>
<h2>Awesome! Can I help?</h2>
<p>Of course! Get the code, give me suggestions, use it and tell me what you think. I am willing to add people to the project that show me their interest and some good Groovy code. Just hit up the <a href="http://kenai.com/projects/groovyrtm/forums/forum">forum</a> or use my <a href="http://eriwen.com/contact/">contact form</a> for questions or suggestions.</p>
<p>If you think it&#8217;s cool but you can&#8217;t use it, help me get it out there by digging it or voting on your favorite aggregator. </p>


<p>Related posts:<ol><li><a href='http://eriwen.com/groovy/groovy-shell-scripts/' rel='bookmark' title='Permanent Link: Get groovy for better shell scripts'>Get groovy for better shell scripts</a></li><li><a href='http://eriwen.com/groovy/crush-images-with-groovy/' rel='bookmark' title='Permanent Link: Crush images on the command-line with Groovy'>Crush images on the command-line with Groovy</a></li><li><a href='http://eriwen.com/groovy/groovy-categories/' rel='bookmark' title='Permanent Link: Using Groovy Categories to override operators'>Using Groovy Categories to override operators</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=ybWPXY2YHbc:O0CgtXp4VO0:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=ybWPXY2YHbc:O0CgtXp4VO0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=ybWPXY2YHbc:O0CgtXp4VO0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=ybWPXY2YHbc:O0CgtXp4VO0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=ybWPXY2YHbc:O0CgtXp4VO0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=ybWPXY2YHbc:O0CgtXp4VO0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=ybWPXY2YHbc:O0CgtXp4VO0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=ybWPXY2YHbc:O0CgtXp4VO0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=ybWPXY2YHbc:O0CgtXp4VO0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/ybWPXY2YHbc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/groovy/introducing-groovyrtm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eriwen.com/groovy/introducing-groovyrtm/</feedburner:origLink></item>
		<item>
		<title>Effective bash shorthand</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/0ifKRhLK5V4/</link>
		<comments>http://eriwen.com/bash/effective-shorthand/#comments</comments>
		<pubDate>Fri, 29 May 2009 08:00:32 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=811</guid>
		<description><![CDATA[<img class="img-left" src="http://eriwen.com/images/keyboard_shell.jpg" alt="" />Let me tell you how to maximize your productivity on the Bourne Again SHell while minimizing your effort. <strong>bash has a ton of tricks and shortcuts</strong> that allow you to command it with little effort, and I intend to show you the features that help me day in and day out.

Today I'm going to explain the use of features like history, brace and file expansion, and other tricks by example and give you references for later. 

<h2>Master your history</h2>
Those who don't know their history are doomed to repeat it. This is arguably one of the best productivity enhancing features of any shell.

You can check your history with the <code>history</code> command, which prints your entire history by default. Alternatively, you can filter the list with:
[bash]
history 10  # prints last 10 entries
history &#124; grep cmd  # searches history for cmd
[/bash]
Each entry has a number, which you can then execute with <code>!&#60;number&#62;</code>

Now suppose I want to copy a file to a directory and then change to that directory. The quick way to do that with history is:
[bash]
cp myfile.txt my/directory/path
cd !$  # cd my/directory/path
[/bash]

or if I forget to run a command as super-user:
[bash]
vi /etc/fstab  # oops!
sudo !!  # sudo vi /etc/fstab
[/bash]



Related posts:<ol><li><a href='http://eriwen.com/tools/grep-is-a-beautiful-tool/' rel='bookmark' title='Permanent Link: grep is a beautiful tool'>grep is a beautiful tool</a></li><li><a href='http://eriwen.com/productivity/aliases-and-functions/' rel='bookmark' title='Permanent Link: Using aliases and command-line functions for speed'>Using aliases and command-line functions for speed</a></li><li><a href='http://eriwen.com/productivity/crontab-for-automation/' rel='bookmark' title='Permanent Link: Start using crontab for automation'>Start using crontab for automation</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="img-left" src="http://eriwen.com/images/keyboard_shell.jpg" alt="" />Let me tell you how to maximize your productivity on the Bourne Again SHell while minimizing your effort. <strong>bash has a ton of tricks and shortcuts</strong> that allow you to command it with little effort, and I intend to show you the features that help me day in and day out.</p>
<p>Today I&#8217;m going to explain the use of features like history, brace and file expansion, and other tricks by example and give you references for later. </p>
<h2>Master your history</h2>
<p>Those who forget history are doomed to repeat it. This is arguably one of the best productivity enhancing features of any shell.</p>
<p>You can check your history with the <code>history</code> command, which prints your last 500 commands (or so) by default. Alternatively, you can filter the list:</p>
<pre class="brush: bash">
# Print last 10 entries
history 10

# searches history for cmd
history | grep cmd
</pre>
<p>Each entry has a number, which you can then execute with <code>!&lt;number&gt;</code></p>
<p>Now suppose I want to copy a file to a directory and then change to that directory. The quick way to do that with history is:</p>
<pre class="brush: bash">
cp myfile.txt my/directory/path
cd !$  # cd my/directory/path
</pre>
<p>or if I forget to run a command as super-user:</p>
<pre class="brush: bash">
vi /etc/fstab  # oops!
sudo !!  # sudo vi /etc/fstab
</pre>
<p>to execute the last command starting with &quot;mount&quot;, since I don&#8217;t want to type it all out:</p>
<pre class="brush: bash">
# Previously...
mount 192.168.0.100:/my/path/to/music /media/music

# Later...
!mount
# Repeats last mount command
</pre>
<p>Note that I <strong>often (but not always) prefer <code>Ctrl-R</code></strong>, which will search history as you type. As an added bonus you can view the command before executing it.</p>
<p>Other examples:</p>
<pre class="brush: bash">
eric@sawyer:~$ echo foo -a bar baz
foo -a bar baz
eric@sawyer:~$ echo !:3-4
bar baz
eric@sawyer:~$ !-2 #2nd-to-last command
foo -a bar baz
eric@sawyer:~$ ^ba^ya #replace 1st &quot;ba&quot; with &quot;ya&quot;
foo -a yar baz
eric@sawyer:~$ !^:p #MUCH cooler than &quot;echo ...&quot; ;)
foo
eric@sawyer:~$ !?bar #Last command containing &quot;bar&quot;
foo -a bar baz
eric@sawyer:~$ !:gs/ba/ya #replace all &quot;ba&quot; with &quot;ya&quot;
foo -a yar yaz
</pre>
<h3>Quick reference</h3>
<table>
<tbody>
<tr>
<td><code>!!</code></td>
<td>expands to the last command and all arguments</td>
</tr>
<tr>
<td><code>!-3</code></td>
<td>3rd-to-last command and all arguments</td>
</tr>
<tr>
<td><code>!^</code></td>
<td>first argument of the last command in history</td>
</tr>
<tr>
<td><code>!:2</code></td>
<td>2nd argument of the last command</td>
</tr>
<tr>
<td><code>!$</code></td>
<td>last argument of the last command</td>
</tr>
<tr>
<td><code>!*</code></td>
<td>all arguments of the last command, but not the command itself</td>
</tr>
<tr>
<td><code>!42</code></td>
<td>expands to the 42nd command in the history list</td>
</tr>
<tr>
<td><code>!foo</code></td>
<td>last command beginning with &quot;foo&quot;</td>
</tr>
<tr>
<td><code>!?baz</code></td>
<td>last command containing &quot;baz&quot;</td>
</tr>
<tr>
<td><code>^foo^bar</code></td>
<td>last command with the <em>first</em> occurrence of &quot;foo&quot; replaced with &quot;bar&quot;</td>
</tr>
<tr>
<td><code>!:gs/foo/bar</code></td>
<td>last command with <em>all</em> occurrences of &quot;foo&quot; replaced with &quot;bar&quot;</td>
</tr>
<tr>
<td><code>&lt;any_above&gt;:p</code>&nbsp;&nbsp;</td>
<td>prints command without executing</td>
</tr>
</tbody>
</table>
<p><a href="http://eriwen.com/downloads/history_cheatsheet.pdf">Download as PDF</a></p>
<h3>Helpful .bashrc entries for history</h3>
<p>Copy and paste these into <code>~/.bashrc</code></p>
<pre class="brush: bash">
# Don&#039;t put duplicate lines in the history
export HISTCONTROL=ignoredups
# Ignore successive duplicate entries.
export HISTCONTROL=ignoreboth

# Store a lot history entries in a file for grep-age
shopt -s histappend
export HISTFILE=~/long_history
export HISTFILESIZE=50000

# No reason not to save a bunch in history
# Takes up several more MBs of RAM now, oOOOooh
export HISTSIZE=9999

# Ignore dupe commands and other ones you don&#039;t care about
export HISTIGNORE=&quot;&amp;:[ ]*:exit&quot;
</pre>
<h3>Another neat trick with .inputrc</h3>
<p>If you are still particularly fond of the up and down arrows, copy and paste the following into a <code>~/.inputrc</code> file. This will allow you to start typing a command and then hit the up-arrow to search backwards through your history for commands starting with what you typed. I prefer other methods usually but this is pretty cool, huh?</p>
<pre class="brush: bash">
&quot;\eOA&quot;: history-search-backward
&quot;\e[A&quot;: history-search-backward
&quot;\eOB&quot;: history-search-forward
&quot;\e[B&quot;: history-search-forward
&quot;\eOC&quot;: forward-char
&quot;\e[C&quot;: forward-char
&quot;\eOD&quot;: backward-char
&quot;\e[D&quot;: backward-char
</pre>
<h3>Further reading</h3>
<p>Peteris Krumins has an excellent write-up called <a href="http://www.catonmat.net/blog/the-definitive-guide-to-bash-command-line-history">The Definitive Guide to Bash Command Line History</a> which goes in-depth on many of the above topics, should you crave more bash history goodness. </p>
<h2>Brace expansions</h2>
<p>No shorthand list would be complete without the (in)famous brace expansions. Basically, they allow you to specify part(s) of an command to repeat substituting different values of a set within braces. Let me show you what I mean:</p>
<pre class="brush: bash">
# Quickly make a backup
cp file.txt{,.bak}
# Equivalent to &#039;cp file.txt file.txt.back&#039;
</pre>
<p>This is obviously very useful to prevent having to repeat parts of files or directory paths. </p>
<p>Suppose I wanted to make a template folder structure, I could make most of the directories I need with:</p>
<pre class="brush: bash">
mkdir -p {src,test}/com/eriwen/{data,view}
</pre>
<p>This will expand every combination so I end up with src/com/eriwen/data, src/com/eriwen/view, test/com/eriwen/data, and so forth. Being able to create a template directory structure with one line is a big time saver!</p>
<h2>Better filename expansion</h2>
<p>I'm sure you often use the * operator to match files beginning or ending with something, but bash goes far beyond that. It should be noted, though, <strong>at some point a good <code>find | grep</code> is more powerful and useful</strong>. See <a href="http://eriwen.com/productivity/find-is-a-beautiful-tool/">Find is a beautiful tool</a> for more information.</p>
<p>In addition to wildcards with <code>*</code>, you can use <code>?</code> to match any single character. You can also limit matching to certain characters with <code>[]</code>. For example:</p>
<pre class="brush: bash">
ls
# prints &quot;myfile netbeans.conf netbeans-6.5rc2 netbeans-6.5 netbeans-6.7 src&quot;
ls netbeans-6.?
# matches &quot;netbeans-6.5 netbeans-6.7&quot;
ls netbeans-6.[1-5]*
# matches &quot;netbeans-6.5rc2 netbeans-6.5&quot;
</pre>
<h3>.bashrc entries for better filename expansion</h3>
<pre class="brush: bash">
# Include dot (.) files in the results of expansion
shopt -s dotglob
# Case-insensitive matching for filename expansion
shopt -s nocaseglob
# Enable extended pattern matching
shopt -s extglob
</pre>
<h2>cd shorthand</h2>
<p>There are a couple quick tricks to change to oft-used directories. For example:</p>
<pre class="brush: bash">
# Lame way to go home
cd ~

# The cool way
cd
</pre>
<p>You can also switch to the previous directory with <code>cd -</code> like so:</p>
<pre class="brush: bash">
pwd  # prints /home/eriwen/src
cd /my/webserver/directory

# Do something...

cd -
# Now I&#039;m back in /home/eriwen/src
</pre>
<p>To get more advanced with this, try <a href="http://eriwen.com/bash/pushd-and-popd/">mastering your directory stack with pushd and popd</a>. </p>
<h2>Conclusion</h2>
<p>Effective use of history, brace expansions, and other shortcuts will to save you a lot of time. However, <strong>nothing is more productive than no typing</strong>. <a href="http://eriwen.com/productivity/crontab-for-automation/">Automating things</a> is best where possible. If you can't automate, <a href="http://eriwen.com/productivity/aliases-and-functions/">use smart aliases</a>. </p>
<p>I know I did not cover tilde expansions, shell parameter expansions or <a href="http://beerpla.net/2008/12/22/mastering-the-linux-shell-bash-shortcuts-explained/">bash key commands</a>. You will want to check those out as well, but I find them less useful than what I've covered here. </p>
<p>Have any quick shortcuts you love? Share them in the comments!</p>


<p>Related posts:<ol><li><a href='http://eriwen.com/tools/grep-is-a-beautiful-tool/' rel='bookmark' title='Permanent Link: grep is a beautiful tool'>grep is a beautiful tool</a></li><li><a href='http://eriwen.com/productivity/aliases-and-functions/' rel='bookmark' title='Permanent Link: Using aliases and command-line functions for speed'>Using aliases and command-line functions for speed</a></li><li><a href='http://eriwen.com/productivity/crontab-for-automation/' rel='bookmark' title='Permanent Link: Start using crontab for automation'>Start using crontab for automation</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=0ifKRhLK5V4:ICqE_ze8KB8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=0ifKRhLK5V4:ICqE_ze8KB8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=0ifKRhLK5V4:ICqE_ze8KB8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=0ifKRhLK5V4:ICqE_ze8KB8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=0ifKRhLK5V4:ICqE_ze8KB8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=0ifKRhLK5V4:ICqE_ze8KB8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=0ifKRhLK5V4:ICqE_ze8KB8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=0ifKRhLK5V4:ICqE_ze8KB8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=0ifKRhLK5V4:ICqE_ze8KB8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/0ifKRhLK5V4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/bash/effective-shorthand/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://eriwen.com/bash/effective-shorthand/</feedburner:origLink></item>
		<item>
		<title>Using Groovy Categories to override operators</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/E7l2kld5ki4/</link>
		<comments>http://eriwen.com/groovy/groovy-categories/#comments</comments>
		<pubDate>Thu, 14 May 2009 15:25:38 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=793</guid>
		<description><![CDATA[I recently ran into a case where I was violating the <abbr title="Don't Repeat Yourself">DRY</abbr> principle by having to encode part of a string every time I added to it. After some digging I found the solution: <a href="http://docs.codehaus.org/display/GROOVY/Groovy+Categories">Groovy Categories</a>.

<h2>A bit of Groovy background</h2>
A couple key features of <a href="http://groovy.codehaus.org/" title="Groovy programming language">Groovy</a> are that everything is an object and that operators are just syntactic sugar for calling methods on the objects. What's cool about this is that with Groovy you can override the default behavior of these operators for certain classes. For example, <code>4 + 2</code> in Groovy really means <code>4.plus(2)</code>

<h2>How to implement/override operators in Groovy</h2>
Groovy allows you to override a LOT of stuff, including final methods and operators. If I want to override a method on the <code>String</code> class, all I need to do is:



Related posts:<ol><li><a href='http://eriwen.com/groovy/crush-images-with-groovy/' rel='bookmark' title='Permanent Link: Crush images on the command-line with Groovy'>Crush images on the command-line with Groovy</a></li><li><a href='http://eriwen.com/groovy/groovy-shell-scripts/' rel='bookmark' title='Permanent Link: Get groovy for better shell scripts'>Get groovy for better shell scripts</a></li><li><a href='http://eriwen.com/groovy/introducing-groovyrtm/' rel='bookmark' title='Permanent Link: Introducing GroovyRTM: A Groovier way to Remember The Milk'>Introducing GroovyRTM: A Groovier way to Remember The Milk</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a case where I was violating the <abbr title="Don't Repeat Yourself">DRY</abbr> principle by having to encode part of a string every time I added to it. After some digging I found the solution: <a href="http://docs.codehaus.org/display/GROOVY/Groovy+Categories">Groovy Categories</a>.</p>
<h2>A bit of Groovy background</h2>
<p>A couple key features of <a href="http://groovy.codehaus.org/" title="Groovy programming language">Groovy</a> are that everything is an object and that operators are just syntactic sugar for calling methods on the objects. What&#8217;s cool about this is that with Groovy you can override the default behavior of these operators for certain classes. For example, <code>4 + 2</code> in Groovy really means <code>4.plus(2)</code></p>
<h2>How to implement/override operators in Groovy</h2>
<p>Groovy allows you to override a LOT of stuff, including final methods and operators. If I want to override a method on the <code>String</code> class, all I need to do is:</p>
<pre class="brush: groovy">
String.metaClass.plus {
    //It is a special term for the argument passed (if there is only 1)
    String stringToEncode = it
    //delegate is a special term for the caller of the method
    delegate &lt;&lt; URLEncoder.encode(it, &#039;UTF-8&#039;)
}

String first = &quot;my delegate &quot;
String second = &quot;twitter @eriwen&quot;
//prints &quot;my delegate twitter+%40eriwen&quot;
println first + second
</pre>
<p>Notice that it (intentionally) only encodes the second <code>String</code>. Check out the list of <a href="http://groovy.codehaus.org/Operator+Overloading">operators and associated methods</a>. This is great, but I need to restrict this to code blocks I so choose. That&#8217;s where Groovy Categories come in.</p>
<h2>Overriding with Categories</h2>
<p>Groovy Categories allow you to add functionality to any class at runtime. This means that you can add in methods to final classes (like <code>java.lang.String</code>). In this case I just want to override a method instead of adding one.</p>
<pre class="brush: groovy">
class MyUtils {
  //Takes 2 java.lang.Strings and returns a String - TYPES ARE OPTIONAL
  static String plus(String first, String second) {
    //Concatenates the Strings and returns
    first &lt;&lt; URLEncoder.encode(second, encoding)
  }
}

//my other class in another file...
import MyUtils

class MyOtherClass {
  String first = &quot;first&quot;
  String second = &quot;to be encoded&quot;
  use (MyUtils) {
    // This will now encode value
    list &lt;&lt; first + second
  }
}
</pre>
<p>Note that Groovy defaults to <code>GString</code>s, so you can&#8217;t just use <code>def actuallyMyString</code>. </p>
<p>How would you make this even <em>more</em> Groovy? Enjoy!</p>


<p>Related posts:<ol><li><a href='http://eriwen.com/groovy/crush-images-with-groovy/' rel='bookmark' title='Permanent Link: Crush images on the command-line with Groovy'>Crush images on the command-line with Groovy</a></li><li><a href='http://eriwen.com/groovy/groovy-shell-scripts/' rel='bookmark' title='Permanent Link: Get groovy for better shell scripts'>Get groovy for better shell scripts</a></li><li><a href='http://eriwen.com/groovy/introducing-groovyrtm/' rel='bookmark' title='Permanent Link: Introducing GroovyRTM: A Groovier way to Remember The Milk'>Introducing GroovyRTM: A Groovier way to Remember The Milk</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=E7l2kld5ki4:S9XSKtNHSS4:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=E7l2kld5ki4:S9XSKtNHSS4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=E7l2kld5ki4:S9XSKtNHSS4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=E7l2kld5ki4:S9XSKtNHSS4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=E7l2kld5ki4:S9XSKtNHSS4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=E7l2kld5ki4:S9XSKtNHSS4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=E7l2kld5ki4:S9XSKtNHSS4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=E7l2kld5ki4:S9XSKtNHSS4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=E7l2kld5ki4:S9XSKtNHSS4:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/E7l2kld5ki4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/groovy/groovy-categories/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://eriwen.com/groovy/groovy-categories/</feedburner:origLink></item>
		<item>
		<title>Talking Selenium on Faceoff</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/O7ZDL5byzys/</link>
		<comments>http://eriwen.com/tools/talking-selenium-on-faceoff/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:43:00 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=779</guid>
		<description><![CDATA[<img class="img-left" src="http://eriwen.com/images/faceoff.png" alt="Faceoff Show logo">I was interviewed by <a href="http://nixtutor.com">Mark Sanborn</a> and <a href="http://jaderobbins.com">Jade Robbins</a> on the <a href="http://faceoffshow.com">Faceoff Podcast</a>. 

Restrain yourself from making fun of my geeky voice and focus instead on the awesomeness of <a href="http://seleniumhq.org">Selenium</a>, a fantastic web-application testing tool. I talk about what Selenium is, some features and uses, and speculate on possible future extensions.

The interview starts at the 12th minute or so. That said, I have learned a lot from these guys and think you'd benefit from giving their podcast a listen.

<a href="http://faceoffshow.com/2009/05/12/episode-16-green-to-the-selenium-scene/">Check it out!</a>


Related posts:<ol><li><a href='http://eriwen.com/firefox/firecookie/' rel='bookmark' title='Permanent Link: Firefox extension to watch: Firecookie'>Firefox extension to watch: Firecookie</a></li><li><a href='http://eriwen.com/firefox/backup-firefox/' rel='bookmark' title='Permanent Link: A quick way to backup a Firefox extension or profile'>A quick way to backup a Firefox extension or profile</a></li><li><a href='http://eriwen.com/firefox/firefox-add-ons-for-productivity/' rel='bookmark' title='Permanent Link: Firefox add-ons for productivity'>Firefox add-ons for productivity</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="img-left" src="http://eriwen.com/images/faceoff.png" alt="Faceoff Show logo">I was interviewed by <a href="http://nixtutor.com">Mark Sanborn</a> and <a href="http://jaderobbins.com">Jade Robbins</a> on the <a href="http://faceoffshow.com">Faceoff Podcast</a>. </p>
<p>Restrain yourself from making fun of my geeky voice and focus instead on the awesomeness of <a href="http://seleniumhq.org">Selenium</a>, a fantastic web-application testing tool. I talk about what Selenium is, some features and uses, and speculate on possible future extensions.</p>
<p>The interview starts at the 12th minute or so. That said, I have learned a lot from these guys and think you&#8217;d benefit from giving their podcast a listen.</p>
<p><a href="http://faceoffshow.com/2009/05/12/episode-16-green-to-the-selenium-scene/">Check it out!</a></p>


<p>Related posts:<ol><li><a href='http://eriwen.com/firefox/firecookie/' rel='bookmark' title='Permanent Link: Firefox extension to watch: Firecookie'>Firefox extension to watch: Firecookie</a></li><li><a href='http://eriwen.com/firefox/backup-firefox/' rel='bookmark' title='Permanent Link: A quick way to backup a Firefox extension or profile'>A quick way to backup a Firefox extension or profile</a></li><li><a href='http://eriwen.com/firefox/firefox-add-ons-for-productivity/' rel='bookmark' title='Permanent Link: Firefox add-ons for productivity'>Firefox add-ons for productivity</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=O7ZDL5byzys:_H4YHXMExxc:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=O7ZDL5byzys:_H4YHXMExxc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=O7ZDL5byzys:_H4YHXMExxc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=O7ZDL5byzys:_H4YHXMExxc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=O7ZDL5byzys:_H4YHXMExxc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=O7ZDL5byzys:_H4YHXMExxc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=O7ZDL5byzys:_H4YHXMExxc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=O7ZDL5byzys:_H4YHXMExxc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=O7ZDL5byzys:_H4YHXMExxc:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/O7ZDL5byzys" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/tools/talking-selenium-on-faceoff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eriwen.com/tools/talking-selenium-on-faceoff/</feedburner:origLink></item>
		<item>
		<title>7 things you should do with Ubiquity instead</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/guDCR1wYmfI/</link>
		<comments>http://eriwen.com/firefox/use-ubiquity-instead/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 11:00:38 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=689</guid>
		<description><![CDATA[<img class="img-left" src="http://eriwen.com/images/ubiquity.png"/>The days of the traditional web where we have to "go" somewhere to do something are ending. <a href="http://labs.mozilla.com/projects/ubiquity/">Ubiquity</a> is a Mozilla Labs project that is a bit like a command-line for the web. It is powerful because it allows you to use a bunch of common web-tools without leaving the pages you actually care to visit.

One really cool thing about Ubiquity is that you don't have to type "add-to-calendar blah blah". If you type "add", Ubiquity will figure out what you want so you just have to type: "add beer with David Walsh at 9pm" and it will figure it out. <strong>If you have text selected, just type "this"</strong> and it will insert the selected text into that part of the command. 

<h2>Get started with Ubiquity</h2>
While using <a href="http://getfirefox.com" title="Firefox web browser">Firefox</a>, download the <a href="https://ubiquity.mozilla.com/xpi/ubiquity-latest.xpi">Ubiquity Firefox extension</a>. Once you have it, you can install extra commands by clicking any of the command links above. You can summon Ubiquity with Ctrl-Space by default, but this is easily changed. That's all!



Related posts:<ol><li><a href='http://eriwen.com/tools/wikify-yourself/' rel='bookmark' title='Permanent Link: Why every programmer should have a Tiddlywiki'>Why every programmer should have a Tiddlywiki</a></li><li><a href='http://eriwen.com/productivity/aliases-and-functions/' rel='bookmark' title='Permanent Link: Using aliases and command-line functions for speed'>Using aliases and command-line functions for speed</a></li><li><a href='http://eriwen.com/firefox/firefox-add-ons-for-productivity/' rel='bookmark' title='Permanent Link: Firefox add-ons for productivity'>Firefox add-ons for productivity</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="img-left" src="http://eriwen.com/images/ubiquity.png" alt="Ubiquity logo"/>The days of the traditional web where we have to &#8220;go&#8221; somewhere to do something are ending. <a href="http://labs.mozilla.com/projects/ubiquity/">Ubiquity</a> is a Mozilla Labs project that is a bit like a command-line for the web. It is powerful because it allows you to use a bunch of common web-tools without leaving the pages you actually care to visit.</p>
<p>One really cool thing about Ubiquity is that you don&#8217;t have to type &#8220;add-to-calendar blah blah&#8221;. If you type &#8220;add&#8221;, Ubiquity will figure out what you want so you just have to type: &#8220;add beer with David Walsh at 9pm&#8221; and it will figure it out. <strong>If you have text selected, just type &#8220;this&#8221;</strong> and it will insert the selected text into that part of the command. </p>
<h2>Get started with Ubiquity</h2>
<p>While using <a href="http://getfirefox.com" title="Firefox web browser">Firefox</a>, download the <a href="https://ubiquity.mozilla.com/xpi/ubiquity-latest.xpi">Ubiquity Firefox extension</a>. Once you have it, you can install extra commands by clicking any of the command links above. You can summon Ubiquity with Ctrl-Space by default, but this is easily changed. That&#8217;s all!</p>
<h2>Ubiquity is better to&#8230;</h2>
<ol>
<li><strong>Manage your calendar</strong> &#8211; Adding an event to your Google Calendar should be painless in every situation. The <em>add-to-calendar</em> and <em>check-calendar</em> commands let you do so easily.</li>
<li><strong>Update your status</strong> &#8211; Ubiquity comes with <em>tweet</em>, but you can grab an <a href="http://benatkin.com/ubiquity/tweet/">enhanced tweet command</a>. There are commands for <a href="http://grantrules.com/ubiquity/facebook.html">Facebook</a>, <a href="http://www.bjtitus.net/ubiquity/friendfeed.html">FriendFeed</a>, and <a href="http://maloki.net/projects/pingfm-ubiquity/">ping.fm</a> as well.</li>
<li><strong>Share links</strong> A lot of sites provide links so you can share links. If not, though, you can do so easily using the <em>digg</em> (built-in), <a href="http://urdna.org/ubiquity/reddit-this">reddit</a>, <a href="http://foyrek.com/stumbleupon.html">stumbleupon</a>, <a href="http://gist.github.com/7516">delicious</a>, <a href="http://eriwen.com/extras/dzone.html">dzone</a> and other places.</li>
<li><strong>Shorten URLs</strong> &#8211; You can shorten links in-line by selecting it and using <em>tinyurl</em> (built-in), <a href="http://arunsonnet.googlepages.com/ubiquityis.gdcommand">is.gd</a>, <a href="http://ubiquitycommand.appspot.com/trim">tr.im</a> and <a href="http://www.hurl.ws/">hurl</a></li>
<li><strong>Read languages you don&#8217;t know</strong> &#8211; Gone are the days you &#8220;go&#8221; to <a href="http://translate.google.com/">Google Translate</a>. Now you just highlight some text on a web page, call up Ubiquity, and type translate this to English (or whatever). </li>
<li><strong>Manage your to-do list</strong> &#8211; I use <a href="http://www.rememberthemilk.com" title="To-do list manager">Remember the Milk</a> to manage to-do lists that my whole family can share. Now there&#8217;s a <a href="http://gist.github.com/24258">remember the milk command</a> so it&#8217;s always just a keystroke away.</li>
<li><strong>Lookup programming APIs</strong> &#8211; Very often I find myself having to look up available methods or something. This is faster using specific searches like those for the <a href="http://www.cse.ucsd.edu/users/jnguy/java.html">Java API</a>, <a href="http://www.vwelch.com/ubiquity/pydoc.html">Pydoc</a>, or <a href="http://erikvold.com/tools/ubiquity/jquery/jquery.cfm">jquery</a>. You can also do things like <a href="http://linkout.googlepages.com/validate.html">W3C site validation</a></li>
</ol>
<h2>What next?</h2>
<ol>
<li>Watch <a href="http://labs.mozilla.com/projects/ubiquity/">Aza Raskin&#8217;s video intro</a> to Ubiquity. Seeing it in action is much cooler than just reading.</li>
<li>Check out <a href="https://wiki.mozilla.org/Labs/Ubiquity/Commands_In_The_Wild" title="ubiquity command list">other Ubiquity commands</a></li>
<li>Write your own command. <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial" title="Ubiquity developer tutorial">Instructions</a>. It&#8217;s so easy, I could do it!</li>
</ol>
<p><strong>Bonus:</strong> I wrote you a command :) Here&#8217;s a <a href="http://eriwen.com/extras/dzone.html" target="_blank">dzone command</a>, since I couldn&#8217;t find one out there. Enjoy!</p>
<p>Share your favorite Ubiquity commands in the comments!</p>


<p>Related posts:<ol><li><a href='http://eriwen.com/tools/wikify-yourself/' rel='bookmark' title='Permanent Link: Why every programmer should have a Tiddlywiki'>Why every programmer should have a Tiddlywiki</a></li><li><a href='http://eriwen.com/productivity/aliases-and-functions/' rel='bookmark' title='Permanent Link: Using aliases and command-line functions for speed'>Using aliases and command-line functions for speed</a></li><li><a href='http://eriwen.com/firefox/firefox-add-ons-for-productivity/' rel='bookmark' title='Permanent Link: Firefox add-ons for productivity'>Firefox add-ons for productivity</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=guDCR1wYmfI:ZHqZjYNFvkM:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=guDCR1wYmfI:ZHqZjYNFvkM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=guDCR1wYmfI:ZHqZjYNFvkM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=guDCR1wYmfI:ZHqZjYNFvkM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=guDCR1wYmfI:ZHqZjYNFvkM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=guDCR1wYmfI:ZHqZjYNFvkM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=guDCR1wYmfI:ZHqZjYNFvkM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=guDCR1wYmfI:ZHqZjYNFvkM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=guDCR1wYmfI:ZHqZjYNFvkM:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/guDCR1wYmfI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/firefox/use-ubiquity-instead/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://eriwen.com/firefox/use-ubiquity-instead/</feedburner:origLink></item>
		<item>
		<title>Guest post on caching and .htaccess</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/hGHHQtmTlWQ/</link>
		<comments>http://eriwen.com/tools/guest-post-on-caching-and-htaccess/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 13:52:52 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=717</guid>
		<description><![CDATA[I've written a guest post titled <a href="http://davidwalsh.name/yslow-htaccess">Improve your YSlow grade using htaccess</a> over at the <a href="http://davidwalsh.name">David Walsh Blog</a>. 

In it, I explain a bit about how browser caching works, how setting headers can affect caching and what you can use in your .htaccess file (or Apache httpd.conf) to maximize it. 

<a href="http://davidwalsh.name/yslow-htaccess">Go check it out!</a>


Related posts:<ol><li><a href='http://eriwen.com/javascript/text-size-prefs/' rel='bookmark' title='Permanent Link: Guest Post: Save Text Size Preference Using MooTools and PHP'>Guest Post: Save Text Size Preference Using MooTools and PHP</a></li><li><a href='http://eriwen.com/javascript/change-text-size-onclick-with-javascript/' rel='bookmark' title='Permanent Link: Guest Post: change text size onclick with JavaScript'>Guest Post: change text size onclick with JavaScript</a></li><li><a href='http://eriwen.com/firefox/my-firefox-setup/' rel='bookmark' title='Permanent Link: 8 steps to my personal Firefox setup for productivity'>8 steps to my personal Firefox setup for productivity</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a guest post titled <a href="http://davidwalsh.name/yslow-htaccess">Improve your YSlow grade using htaccess</a> over at the <a href="http://davidwalsh.name">David Walsh Blog</a>. </p>
<p>In it, I explain a bit about how browser caching works, how setting headers can affect caching and what you can use in your .htaccess file (or Apache httpd.conf) to maximize it. </p>
<p><a href="http://davidwalsh.name/yslow-htaccess">Go check it out!</a></p>


<p>Related posts:<ol><li><a href='http://eriwen.com/javascript/text-size-prefs/' rel='bookmark' title='Permanent Link: Guest Post: Save Text Size Preference Using MooTools and PHP'>Guest Post: Save Text Size Preference Using MooTools and PHP</a></li><li><a href='http://eriwen.com/javascript/change-text-size-onclick-with-javascript/' rel='bookmark' title='Permanent Link: Guest Post: change text size onclick with JavaScript'>Guest Post: change text size onclick with JavaScript</a></li><li><a href='http://eriwen.com/firefox/my-firefox-setup/' rel='bookmark' title='Permanent Link: 8 steps to my personal Firefox setup for productivity'>8 steps to my personal Firefox setup for productivity</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=hGHHQtmTlWQ:Nmy56icjsW4:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=hGHHQtmTlWQ:Nmy56icjsW4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=hGHHQtmTlWQ:Nmy56icjsW4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=hGHHQtmTlWQ:Nmy56icjsW4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=hGHHQtmTlWQ:Nmy56icjsW4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=hGHHQtmTlWQ:Nmy56icjsW4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=hGHHQtmTlWQ:Nmy56icjsW4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=hGHHQtmTlWQ:Nmy56icjsW4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=hGHHQtmTlWQ:Nmy56icjsW4:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/hGHHQtmTlWQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/tools/guest-post-on-caching-and-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eriwen.com/tools/guest-post-on-caching-and-htaccess/</feedburner:origLink></item>
		<item>
		<title>Python first impressions</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/tJI36EzbG9I/</link>
		<comments>http://eriwen.com/python/first-impressions/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 11:00:52 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=621</guid>
		<description><![CDATA[A few days ago I got my first <a href="" title="The Python Language">Python</a> project. I'd like to share references I've found, and what I like or dislike about the language. I hope to give insight to would-be Python dabblers and ideas to current Pythoneers.

<h2>Good resources I've found</h2>
I have found some good resources online for Python and <a href="http://www.jython.org/" title="The Jython language">Jython</a>, but I know I didn't find them all so if you Python-istas could put some in the comments I'd be very grateful :)
<ul style="margin-left: 3em; list-style-type: upper-roman;"><li>The somewhat famous <a href="http://dirtsimple.org/2004/12/python-is-not-java.html">Python is not Java</a> article</li>
<li><a href="http://www.python.org/doc/" title="Python APIs">Python Documentation Index</a></li>
<li><a href="http://docs.python.org/">Python 2.6.1 Docs</a></li>
<li><a href="http://www.angelfire.com/tx4/cus/notes/python.html">Python Language Notes</a> by <a href="http://www.angelfire.com/tx4/cus/index.html">Chris Rathman</a></li>
<li><a href="http://www.jython.org/Project/">The Jython Project</a></li></ul>



Related posts:<ol><li><a href='http://eriwen.com/groovy/groovy-shell-scripts/' rel='bookmark' title='Permanent Link: Get groovy for better shell scripts'>Get groovy for better shell scripts</a></li><li><a href='http://eriwen.com/groovy/groovy-categories/' rel='bookmark' title='Permanent Link: Using Groovy Categories to override operators'>Using Groovy Categories to override operators</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://eriwen.com/images/python.png" alt="Python logo" class="img-left"/>A few days ago I got my first <a href="" title="The Python Language">Python</a> project. I&#8217;d like to share references I&#8217;ve found, and what I like or dislike about the language. I hope to give insight to would-be Python dabblers and ideas to current Pythoneers.</p>
<h2>Good resources I&#8217;ve found</h2>
<p>I have found some good resources online for Python and <a href="http://www.jython.org/" title="The Jython language">Jython</a>, but I know I didn&#8217;t find them all so if you Python-istas could put some in the comments I&#8217;d be very grateful :)</p>
<ol>
<li>The somewhat famous <a href="http://dirtsimple.org/2004/12/python-is-not-java.html">Python is not Java</a> article</li>
<li><a href="http://www.python.org/doc/" title="Python APIs">Python Documentation Index</a></li>
<li><a href="http://docs.python.org/">Python 2.6.1 Docs</a></li>
<li><a href="http://www.angelfire.com/tx4/cus/notes/python.html">Python Language Notes</a> by <a href="http://www.angelfire.com/tx4/cus/index.html">Chris Rathman</a></li>
<li><a href="http://www.jython.org/Project/">The Jython Project</a></li>
</ol>
<h2>What I like so far</h2>
<p>I like that a lot of common operations are very easy. Take for example:</p>
<pre class="brush: python">
# 3 Hellos in Python
hellos = &#039;Hello &#039; * 3
</pre>
<p>as opposed to </p>
<pre class="brush: java">
// 3 Hellos in Java
String hellos = &quot;&quot;;
for (int i = 0; i &lt; 3; i++) {
    hellos += &quot;Hello &quot;;
}
</pre>
<p>There are a bunch of other features that come to mind, like <em>string formatting</em>, <em>list manipulation</em>, and <em>variable and default-valued arguments</em>. Oh, and of course <em>closures</em> are very straightforward (many thanks to <a href="http://www.hvergi.net/">Arnar</a> for a <em>real</em> closure example):</p>
<pre class="brush: python">
def outer(your_name):
    title = random.choice([&quot;Mr&quot;, &quot;Mrs&quot;, &quot;Miss&quot;])

    def greeter(greeting):
        print greeting, title, your_name

    return greeter

g = outer(&quot;Eric&quot;)  # invoke it

# g now contains a reference to the inner
# function, but as it references variables
# from the local scope of outer, the invocation
# data has been stored in a closure
# Execution of outer is finished, but g can
# still reference its local variables through
# the closure:

g(&quot;Hi&quot;)  # prints &quot;Hi Miss Eric&quot; :D
</pre>
<p>I could go on and on, but you really ought to read the <a href="http://docs.python.org/">documentation</a> to see all of its features. Actually there&#8217;s not all that much to it!</p>
<h2>Troubles I have with it</h2>
<p>I wish I could find more documentation with simple code examples. I&#8217;m sure there are a bunch of blog posts out there but it&#8217;d be nice if there were more included with the documentation.</p>
<p>Passing arguments by reference doesn&#8217;t seem to be possible, which is fine, but different. I&#8217;m not totally used to the lack of curly braces, but I like the fact that you <em>must</em> have good formatting to have runnable Python. I was surprised to learn that Python is <em>strongly typed</em> which in some way I think is odd because it seems like it&#8217;d be simpler if it was weakly typed. </p>
<pre class="brush: python">
a = &quot;17&quot;
b = 25
print a + b  # Nope!
</pre>
<p>One last thing is classes. I&#8217;m not sure I have my head around how they really work in Python. I&#8217;m sure I&#8217;ll get the hang of it soon.</p>
<h2>Conclusion</h2>
<p>Overall I&#8217;m thoroughly impressed with the language. There almost seems to be a Zen-like aura around Python code that is written with the simplicity the language creators intended.</p>
<p>Obviously I still have a lot to learn, so please help me out if you have some advice in the comments!</p>


<p>Related posts:<ol><li><a href='http://eriwen.com/groovy/groovy-shell-scripts/' rel='bookmark' title='Permanent Link: Get groovy for better shell scripts'>Get groovy for better shell scripts</a></li><li><a href='http://eriwen.com/groovy/groovy-categories/' rel='bookmark' title='Permanent Link: Using Groovy Categories to override operators'>Using Groovy Categories to override operators</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=tJI36EzbG9I:K7EpvNYOi1E:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=tJI36EzbG9I:K7EpvNYOi1E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=tJI36EzbG9I:K7EpvNYOi1E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=tJI36EzbG9I:K7EpvNYOi1E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=tJI36EzbG9I:K7EpvNYOi1E:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=tJI36EzbG9I:K7EpvNYOi1E:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=tJI36EzbG9I:K7EpvNYOi1E:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=tJI36EzbG9I:K7EpvNYOi1E:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=tJI36EzbG9I:K7EpvNYOi1E:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/tJI36EzbG9I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/python/first-impressions/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		<feedburner:origLink>http://eriwen.com/python/first-impressions/</feedburner:origLink></item>
		<item>
		<title>JavaFX for the Java developer presentation</title>
		<link>http://feedproxy.google.com/~r/EricWendelin/~3/mfVkGaSS5Rs/</link>
		<comments>http://eriwen.com/javafx/javafx-for-the-java-developer/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 11:00:43 +0000</pubDate>
		<dc:creator>Eric Wendelin</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://eriwen.com/?p=601</guid>
		<description><![CDATA[I gave a talk this last Tuesday at the <a href="http://boulderjug.org/" title="Boulder Java Users Group homepage">Boulder JUG</a> on the topic of <em>JavaFX for the Java developer</em>. My audience and I both learned a lot from the experience. 

<strong><a href="http://eriwen.com/jfx/html/all.html" title="JavaFX for the Java developer slides">Check out the slide deck</a></strong>

<h2>What I covered</h2>

<ol><li>What is JavaFX and why do you care?</li>
<li>Comparisons between Java and JavaFX syntax</li>
<li>JavaFX language features</li>
<li>Building a sample application</li>
<li>Platform support</li></ol>



Related posts:<ol><li><a href='http://eriwen.com/javafx/javafx-syntaxhighlighter/' rel='bookmark' title='Permanent Link: How to add JavaFX to SyntaxHighlighter'>How to add JavaFX to SyntaxHighlighter</a></li><li><a href='http://eriwen.com/javafx/holiday-fun-with-javafx/' rel='bookmark' title='Permanent Link: Holiday fun with JavaFX'>Holiday fun with JavaFX</a></li><li><a href='http://eriwen.com/opinion/what-i-wanted-to-know/' rel='bookmark' title='Permanent Link: What I wanted to know before I left college: A programmer reflects'>What I wanted to know before I left college: A programmer reflects</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I gave a talk this last Tuesday at the <a href="http://boulderjug.org/" title="Boulder Java Users Group homepage">Boulder JUG</a> on the topic of <em>JavaFX for the Java developer</em>. My audience and I both learned a lot from the experience. </p>
<p><img src="http://eriwen.com/images/javafxtalk.jpg" style="float:left; margin: 0 36px 4px 0;"/><strong><a href="http://eriwen.com/jfx/html/all.html" title="JavaFX for the Java developer slides" target="_blank">Check out the slide deck &raquo;</a></strong></p>
<h2>What I covered</h2>
<ol>
<li>What is JavaFX and why do you care?</li>
<li>Comparisons between Java and JavaFX syntax</li>
<li>JavaFX language features</li>
<li>Building a sample application</li>
<li>Platform support</li>
<li>Additional resources</li>
</ol>
<h2>How I approached the talk</h2>
<p>I took <a href="http://fredjean.net/2009/01/15/groovy-unit-testing-presentation" title="Groovy Unit Testing presentation">Fred Jean&#8217;s advice</a> and used the <a href="http://github.com/pragdave/codex/tree/master" title="Codex presentation system">Codex</a> presentation system which is a Ruby gem that adds to Eric Meyer&#8217;s <a href="http://meyerweb.com/eric/tools/s5/" title="Simple Standards-Based Slide Show System">S5</a>. Unlike Fred, though, I opted to use Mercurial to keep track of versioning. </p>
<p>To get some good practice for my talk <strong>I hosted a brown-bag discussion</strong> at Sun. This was a good idea because it made sure I was prepared fairly early and I got good feedback from my co-workers. Hopefully they learned something as well. I ended up about 20 minutes short during my brown-bag so I added 10 more slides (which hardly helped&#8230; I talked much too fast). </p>
<h2>What I would change</h2>
<p>Since I ran so short at BJUG, I&#8217;d probably try to talk about more JavaFX language features and explain them in greater detail than I did. Making jokes during the presentation seemed to go over very well and I might throw in a couple more. </p>
<p>If you missed my talk, you can <a href="http://eriwen.com/jfx/html/all.html" title="JavaFX for the Java developer slides" target="_blank">Check out the slides</a>. I hope the speak about this again at the <a href="http://denverjug.org">Denver JUG</a> later this year. Hope to see you there!</p>


<p>Related posts:<ol><li><a href='http://eriwen.com/javafx/javafx-syntaxhighlighter/' rel='bookmark' title='Permanent Link: How to add JavaFX to SyntaxHighlighter'>How to add JavaFX to SyntaxHighlighter</a></li><li><a href='http://eriwen.com/javafx/holiday-fun-with-javafx/' rel='bookmark' title='Permanent Link: Holiday fun with JavaFX'>Holiday fun with JavaFX</a></li><li><a href='http://eriwen.com/opinion/what-i-wanted-to-know/' rel='bookmark' title='Permanent Link: What I wanted to know before I left college: A programmer reflects'>What I wanted to know before I left college: A programmer reflects</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EricWendelin?a=mfVkGaSS5Rs:SE597cpq7O0:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/EricWendelin?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=mfVkGaSS5Rs:SE597cpq7O0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=mfVkGaSS5Rs:SE597cpq7O0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=mfVkGaSS5Rs:SE597cpq7O0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=mfVkGaSS5Rs:SE597cpq7O0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=mfVkGaSS5Rs:SE597cpq7O0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=mfVkGaSS5Rs:SE597cpq7O0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EricWendelin?a=mfVkGaSS5Rs:SE597cpq7O0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EricWendelin?i=mfVkGaSS5Rs:SE597cpq7O0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EricWendelin/~4/mfVkGaSS5Rs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eriwen.com/javafx/javafx-for-the-java-developer/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://eriwen.com/javafx/javafx-for-the-java-developer/</feedburner:origLink></item>
	</channel>
</rss>
