<?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>We Heart Code &#187; tip</title>
	<atom:link href="http://www.weheartcode.com/category/tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weheartcode.com</link>
	<description>A discourse on programming</description>
	<lastBuildDate>Thu, 12 May 2011 23:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Oracle Delete Taking a Long Time</title>
		<link>http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/</link>
		<comments>http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 02:16:15 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/?p=62</guid>
		<description><![CDATA[It may look like your delete statement is hung, but ff your table has foreign keys in another table without indexes on that column Oracle will full table scan that other table for every row that you&#8217;re deleting. Hopefully this saves someone some time. Bookmark to:]]></description>
			<content:encoded><![CDATA[<p> It may look like your delete statement is hung, but ff your table has foreign keys in another table without indexes on that column Oracle will full table scan that other table for every row that you&#8217;re deleting. Hopefully this saves someone some time.</p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/&amp;title=Oracle+Delete+Taking+a+Long+Time" title="Add 'Oracle Delete Taking a Long Time' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Oracle Delete Taking a Long Time' to Del.icio.us" alt="Add 'Oracle Delete Taking a Long Time' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/&amp;title=Oracle+Delete+Taking+a+Long+Time" title="Add 'Oracle Delete Taking a Long Time' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Oracle Delete Taking a Long Time' to digg" alt="Add 'Oracle Delete Taking a Long Time' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Oracle+Delete+Taking+a+Long+Time&amp;u=http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/" title="Add 'Oracle Delete Taking a Long Time' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Oracle Delete Taking a Long Time' to FURL" alt="Add 'Oracle Delete Taking a Long Time' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/&amp;title=Oracle+Delete+Taking+a+Long+Time" title="Add 'Oracle Delete Taking a Long Time' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Oracle Delete Taking a Long Time' to reddit" alt="Add 'Oracle Delete Taking a Long Time' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/" title="Add 'Oracle Delete Taking a Long Time' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Oracle Delete Taking a Long Time' to Technorati" alt="Add 'Oracle Delete Taking a Long Time' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/&amp;title=Oracle+Delete+Taking+a+Long+Time" title="Add 'Oracle Delete Taking a Long Time' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Oracle Delete Taking a Long Time' to Google Bookmarks" alt="Add 'Oracle Delete Taking a Long Time' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2010/01/16/oracle-delete-taking-a-long-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Luhn Digit Generation Oracle PL/SQL Implementation</title>
		<link>http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/</link>
		<comments>http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 11:27:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/?p=51</guid>
		<description><![CDATA[Here's how to generate a Luhn Mod-10 Check Digit. It's implemented as a function in oracle PL/SQL. I spent 2 hours looking for this online, then decided to implement it myself since it's not that hard. Anyway, I thought I'd post it here for the next person trolling google for it. This is useful for [...]]]></description>
			<content:encoded><![CDATA[<p>Here's how to generate a Luhn Mod-10 Check Digit. It's implemented as a function in oracle PL/SQL. I spent 2 hours looking for this online, then decided to implement it myself since it's not that hard. Anyway, I thought I'd post it here for the next person trolling google for it. This is useful for generating credit card numbers or any other place you need a check digit.</p>
<p>This algorithm works by doing the same thing as the validation algorithm, but shifted over one character (the equivalent of adding a zero to a number, generating the sum &#038; subtracting 10).</p>
<p><strong>*EDIT - there was a bug in this code, i just fixed it on 12/4/2009, the old code returned 10 instead of zero. It also was only working on even numbers, sorry about that! </strong></p>
<div class="syntax_hilite">
<div id="sql-2">
<div class="sql"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">FUNCTION</span> generate_luhn <span style="color:#006600; font-weight:bold;">&#40;</span>togen <span style="color: #993333; font-weight: bold;">IN</span> varchar<span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">RETURN</span> number<br />
<span style="color: #993333; font-weight: bold;">IS</span><br />
&nbsp; &nbsp; curval NUMBER := <span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; total NUMBER := <span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; everyother NUMBER := <span style="color: #cc66cc;">1</span>;</p>
<p>BEGIN<br />
&nbsp; <span style="color: #993333; font-weight: bold;">IF</span><span style="color:#006600; font-weight:bold;">&#40;</span><br />
&nbsp; &nbsp;togen <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NULL</span><br />
&nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span> then<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">RETURN</span> <span style="color: #cc66cc;">0</span>;<br />
&nbsp; end <span style="color: #993333; font-weight: bold;">IF</span>;</p>
<p>&nbsp; <br />
&nbsp; <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> reverse <span style="color: #cc66cc;">1</span> .. LENGTH<span style="color:#006600; font-weight:bold;">&#40;</span>togen<span style="color:#006600; font-weight:bold;">&#41;</span> loop<br />
&nbsp; &nbsp; curval:=SUBSTR<span style="color:#006600; font-weight:bold;">&#40;</span>togen, i, <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">IF</span> everyother = <span style="color: #cc66cc;">1</span> then<br />
&nbsp; &nbsp; &nbsp; &nbsp;everyother := <span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; &nbsp; curval := curval * <span style="color: #cc66cc;">2</span>;<br />
&nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">IF</span><span style="color:#006600; font-weight:bold;">&#40;</span>curval&gt; <span style="color: #cc66cc;">9</span><span style="color:#006600; font-weight:bold;">&#41;</span> then<br />
&nbsp; &nbsp; &nbsp; &nbsp; curval:=curval-<span style="color: #cc66cc;">9</span>;<br />
&nbsp; &nbsp; &nbsp; end <span style="color: #993333; font-weight: bold;">IF</span>;<br />
&nbsp; &nbsp; &nbsp;else<br />
&nbsp; &nbsp; &nbsp; &nbsp;everyother := <span style="color: #cc66cc;">1</span>;<br />
&nbsp; &nbsp; end <span style="color: #993333; font-weight: bold;">IF</span>;</p>
<p>&nbsp; &nbsp;<br />
&nbsp; &nbsp; total := total + curval;<br />
&nbsp; end loop;<br />
&nbsp; <span style="color: #993333; font-weight: bold;">IF</span> MOD<span style="color:#006600; font-weight:bold;">&#40;</span>total, <span style="color: #cc66cc;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color: #cc66cc;">0</span> THEN<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">RETURN</span> <span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; ELSE<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">RETURN</span> <span style="color: #cc66cc;">10</span> - MOD<span style="color:#006600; font-weight:bold;">&#40;</span>total, <span style="color: #cc66cc;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; END <span style="color: #993333; font-weight: bold;">IF</span>;<br />
END generate_luhn;<br />
/</div>
</div>
</div>
<p></p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/&amp;title=Luhn+Digit+Generation+Oracle+PL%2FSQL+Implementation" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Del.icio.us" alt="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/&amp;title=Luhn+Digit+Generation+Oracle+PL%2FSQL+Implementation" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to digg" alt="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Luhn+Digit+Generation+Oracle+PL%2FSQL+Implementation&amp;u=http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to FURL" alt="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/&amp;title=Luhn+Digit+Generation+Oracle+PL%2FSQL+Implementation" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to reddit" alt="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Technorati" alt="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/&amp;title=Luhn+Digit+Generation+Oracle+PL%2FSQL+Implementation" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Google Bookmarks" alt="Add 'Luhn Digit Generation Oracle PL/SQL Implementation' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2009/10/06/luhn-digit-generation-oracle-plsql-implementation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Capturing Uncaught Java Exceptions in a Bash Shell Script</title>
		<link>http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/</link>
		<comments>http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/#comments</comments>
		<pubDate>Wed, 13 May 2009 16:53:28 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/</guid>
		<description><![CDATA[I was burned one to many times by chaining dependent java programs together in a bash script. By default the java executable will return zero if the program exited manually, and 1 if there was an uncaught RuntimeException. Let's say test.sh runs a java program, we want to run it 3 times, but if it [...]]]></description>
			<content:encoded><![CDATA[<p>I was burned one to many times by chaining dependent java programs together in a bash script.</p>
<p>By default the java executable will return zero if the program exited manually, and 1 if there was an uncaught RuntimeException.</p>
<p>Let's say test.sh runs a java program, we want to run it 3 times, but if it fails during any of the runs we want to abort our run.</p>
<div class="syntax_hilite">
<div id="code-6">
<div class="code">#!/usr/bin/bash<br />
java Test<br />
exitval=$?<br />
echo <span style="color:#CC0000;">"exit val: ${exitval}"</span><br />
exit $exitval</div>
</div>
</div>
<p></p>
<p>Then in our shell script to run test.sh each time we'd do something like this.</p>
<div class="syntax_hilite">
<div id="code-7">
<div class="code">#!/usr/bin/bash</p>
<p>./test.<span style="">sh</span><br />
step1=$?</p>
<p>if <span style="color:#006600; font-weight:bold;">&#91;</span> $step1 -eq <span style="color:#CC0000;">"0"</span> <span style="color:#006600; font-weight:bold;">&#93;</span> ; then<br />
&nbsp; ./test.<span style="">sh</span><br />
&nbsp; step2=$?<br />
&nbsp; if <span style="color:#006600; font-weight:bold;">&#91;</span> $step2 -eq <span style="color:#CC0000;">"0"</span> <span style="color:#006600; font-weight:bold;">&#93;</span> ; then<br />
&nbsp; &nbsp; ./test.<span style="">sh</span><br />
&nbsp; &nbsp; step3=$?<br />
&nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#91;</span> $step3 -eq <span style="color:#CC0000;">"0"</span> <span style="color:#006600; font-weight:bold;">&#93;</span> ; then<br />
&nbsp; &nbsp; &nbsp; echo <span style="color:#CC0000;">"Finished successfully."</span><br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp;echo <span style="color:#CC0000;">"Step 3 failed."</span><br />
&nbsp; &nbsp; fi<br />
&nbsp; else<br />
&nbsp; &nbsp; echo <span style="color:#CC0000;">"Step 2 failed with ${step2}"</span><br />
&nbsp; fi<br />
else<br />
&nbsp; echo <span style="color:#CC0000;">"Step 1 Failed. with ${step1}"</span><br />
fi</div>
</div>
</div>
<p></p>
<p>To test my script I made a little java class that will error out half the time that looks like this:</p>
<div class="syntax_hilite">
<div id="java-8">
<div class="java"><span style="color: #a1a100;">import java.util.Random;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test<br />
<span style="color: #66cc66;">&#123;</span></p>
<p><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">static</span> <span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<a href="http://www.google.com/search?q=allinurl%3ARandom+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Random</span></a> gen = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ARandom+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Random</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>gen.<span style="color: #006600;">nextInt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>&gt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"I Win!"</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #b1b100;">else</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ARuntimeException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">RuntimeException</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"I Fail!"</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/&amp;title=Capturing+Uncaught+Java+Exceptions+in+a+Bash+Shell+Script" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Del.icio.us" alt="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/&amp;title=Capturing+Uncaught+Java+Exceptions+in+a+Bash+Shell+Script" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to digg" alt="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Capturing+Uncaught+Java+Exceptions+in+a+Bash+Shell+Script&amp;u=http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to FURL" alt="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/&amp;title=Capturing+Uncaught+Java+Exceptions+in+a+Bash+Shell+Script" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to reddit" alt="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Technorati" alt="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/&amp;title=Capturing+Uncaught+Java+Exceptions+in+a+Bash+Shell+Script" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Google Bookmarks" alt="Add 'Capturing Uncaught Java Exceptions in a Bash Shell Script' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2009/05/13/capturing-uncaught-java-exceptions-in-a-bash-shell-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mylyn + Trac + wsgi</title>
		<link>http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/</link>
		<comments>http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 13:16:22 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/</guid>
		<description><![CDATA[I am using mod_wsgi instead of mod_python for my trac .11 install. I'm also using the AccountManager plugin for authentication, and don't have anonymous access setup. Anyway, authentication wasn't working (through XML RPC) hence mylyn didn't have the perms to do anything, and was silently defaulting to anon mode. even though I had the XML [...]]]></description>
			<content:encoded><![CDATA[<p>I am using mod_wsgi instead of mod_python for my trac .11 install.</p>
<p>I'm also using the AccountManager plugin for authentication, and don't have anonymous access setup.</p>
<p>Anyway, authentication wasn't working (through XML RPC) hence mylyn didn't have the perms to do anything, and was silently defaulting to anon mode. even though I had the XML RPC plugin installed and permissions set up.</p>
<p>Here's the steps to get them all playing nice (this was harder than it looked to figure out):</p>
<ol>
<li>Install/Enable the <a href="http://trac-hacks.org/wiki/XmlRpcPlugin">XML RPC Plugin</a> for trac</li>
<li>Give your authenticated group the XML_RPC permission</li>
<li>Install/Enable the <a href="http://trac-hacks.org/wiki/HttpAuthPlugin">HttpAuth Plugin</a></li>
<li>Add this line to your apache config for your site: WSGIPassAuthorization On</li>
</ol>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/&amp;title=Mylyn+%2B+Trac+%2B+wsgi" title="Add 'Mylyn + Trac + wsgi' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Mylyn + Trac + wsgi' to Del.icio.us" alt="Add 'Mylyn + Trac + wsgi' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/&amp;title=Mylyn+%2B+Trac+%2B+wsgi" title="Add 'Mylyn + Trac + wsgi' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Mylyn + Trac + wsgi' to digg" alt="Add 'Mylyn + Trac + wsgi' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Mylyn+%2B+Trac+%2B+wsgi&amp;u=http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/" title="Add 'Mylyn + Trac + wsgi' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Mylyn + Trac + wsgi' to FURL" alt="Add 'Mylyn + Trac + wsgi' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/&amp;title=Mylyn+%2B+Trac+%2B+wsgi" title="Add 'Mylyn + Trac + wsgi' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Mylyn + Trac + wsgi' to reddit" alt="Add 'Mylyn + Trac + wsgi' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/" title="Add 'Mylyn + Trac + wsgi' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Mylyn + Trac + wsgi' to Technorati" alt="Add 'Mylyn + Trac + wsgi' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/&amp;title=Mylyn+%2B+Trac+%2B+wsgi" title="Add 'Mylyn + Trac + wsgi' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Mylyn + Trac + wsgi' to Google Bookmarks" alt="Add 'Mylyn + Trac + wsgi' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2009/02/19/mylyn-trac-wsgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily Creating Fixed Length Flat Files With Groovy</title>
		<link>http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/</link>
		<comments>http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 13:42:27 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[groovy]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/</guid>
		<description><![CDATA[Here's an (I think elegant) way to create flat files with Groovy. I want this script to be easy to read by future developers. So if someone wants to know what the format of the file is they can see it just by opening the script. Classes We'll Use Groovy: SQL: We'll use this library [...]]]></description>
			<content:encoded><![CDATA[<p>Here's an (I think elegant) way to create flat files with Groovy.</p>
<p>I want this script to be easy to read by future developers. So if someone wants to know what the format of the file is they can see it just by opening the script.</p>
<h2>Classes We'll Use</h2>
<p>Groovy:</p>
<ul>
<li><a href="http://docs.codehaus.org/display/GROOVY/Tutorial+6+-+Groovy+SQL">SQL</a>: We'll use this library to access the database, it has some nice closure methods like eachRow which make iterating over results easy.</li>
<li><a href="http://groovy.codehaus.org/groovy-jdk/java/lang/String.html">String</a>: Groovy includes a string class that has some nice methods like padRight and padLeft, handy for making fixed length files.</li>
</ul>
<p>Java:</p>
<ul>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileWriter.html">File Writer</a>: The easiest way to create files in java.</li>
</ul>
<h2>The Plan</h2>
<p>Define our file in a map at the top of the file, it will be SQL Alias Name : Length.</p>
<p>Execute our SQL, for each row iterate through our file definition map and pad each value by the appropriate length.</p>
<h2>The Code</h2>
<p>Pretty self explanatory -- a few neat groovy things we use in this script:</p>
<ul>
<li>Triple quotes for a multiline string (our sql)</li>
<li>The format method to easily format a date (bye bye simple date format) for the file name</li>
<li>The elvis operator <code>?:</code> makes the results null safe so we can call padRight.</li>
<li>The each method on Groovy's Map that accepts a closure, we use that to iterate through our file definition.</li>
</ul>
<div class="syntax_hilite">
<div id="java-10">
<div class="java"><span style="color: #a1a100;">import groovy.sql.Sql</span></p>
<p><span style="color: #a1a100;">import java.io.File;</span><br />
<span style="color: #a1a100;">import java.io.FileWriter;</span></p>
<p>&nbsp; &nbsp; def fileName = <span style="color: #ff0000;">"FLATFILE"</span> + <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a>.<span style="color: #006600;">format</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'%tY%&lt;tm%&lt;td'</span>,<span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ADate+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Date</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">".txt"</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; def sql = Sql.<span style="color: #006600;">newInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"jdbc:oracle:thin:@localhost:1521:midb01"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"xxx"</span>,<span style="color: #ff0000;">"xxx"</span>, <span style="color: #808080; font-style: italic;">//user,pass</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"oracle.jdbc.driver.OracleDriver"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">//jdbc driver</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AFileWriter+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">FileWriter</span></a> writer = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AFileWriter+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">FileWriter</span></a><span style="color: #66cc66;">&#40;</span>fileName<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//this map defines the field length based on alias id from the SQL</span><br />
&nbsp; &nbsp; def fileDef = <span style="color: #66cc66;">&#91;</span>COLUMN1:<span style="color: #cc66cc;">14</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN2:<span style="color: #cc66cc;">9</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN3:<span style="color: #cc66cc;">5</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN4:<span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; def qry = <span style="color: #ff0000;">""</span><span style="color: #ff0000;">"SELECT column1,column2,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; column3,column4 FROM OurTable"</span><span style="color: #ff0000;">""</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; def test = sql.<span style="color: #006600;">eachRow</span><span style="color: #66cc66;">&#40;</span>qry<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>row -&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; fileDef.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#123;</span> k,v-&gt; writer.<span style="color: #006600;">append</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>row<span style="color: #66cc66;">&#91;</span>k<span style="color: #66cc66;">&#93;</span> ?: <span style="color: #ff0000;">" "</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">padRight</span><span style="color: #66cc66;">&#40;</span>v<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; writer.<span style="color: #006600;">append</span> <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; writer.<span style="color: #006600;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</div>
</div>
<p></p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/&amp;title=Easily+Creating+Fixed+Length+Flat+Files+With+Groovy" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Del.icio.us" alt="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/&amp;title=Easily+Creating+Fixed+Length+Flat+Files+With+Groovy" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to digg" alt="Add 'Easily Creating Fixed Length Flat Files With Groovy' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Easily+Creating+Fixed+Length+Flat+Files+With+Groovy&amp;u=http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to FURL" alt="Add 'Easily Creating Fixed Length Flat Files With Groovy' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/&amp;title=Easily+Creating+Fixed+Length+Flat+Files+With+Groovy" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to reddit" alt="Add 'Easily Creating Fixed Length Flat Files With Groovy' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Technorati" alt="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/&amp;title=Easily+Creating+Fixed+Length+Flat+Files+With+Groovy" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Google Bookmarks" alt="Add 'Easily Creating Fixed Length Flat Files With Groovy' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2009/01/21/easily-creating-fixed-length-flat-files-with-groovy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Limiting log4j SMTPAppender</title>
		<link>http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/</link>
		<comments>http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 14:43:21 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/</guid>
		<description><![CDATA[I wanted to set a maximum amount of e-mails that SMTPAppender would send after filling up a mailbox with 30,000 damn e-mails. Turns out it was pretty damn easy, I set up my appender in a java class, and the SMTP appender has a method called setEvaluator that takes an instance of TriggeringEventEvaluator, so I [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to set a maximum amount of e-mails that SMTPAppender would send after filling up a mailbox with 30,000 damn e-mails.</p>
<p>Turns out it was pretty damn easy, I set up my appender in a java class, and the SMTP appender has a method called setEvaluator that takes an instance of TriggeringEventEvaluator, so I just created a quick inner class like so.</p>
<div class="syntax_hilite">
<div id="java-13">
<div class="java"><span style="color: #000000; font-weight: bold;">class</span> LimitingEvaluator <span style="color: #000000; font-weight: bold;">implements</span> TriggeringEventEvaluator<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">int</span> sentEvents = <span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">int</span> MAX_EVENTS = <span style="color: #cc66cc;">20</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> isTriggeringEvent<span style="color: #66cc66;">&#40;</span>LoggingEvent arg0<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sentEvents++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>sentEvents&gt;= MAX_EVENTS<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>and when i set up my appender I do this</p>
<div class="syntax_hilite">
<div id="java-14">
<div class="java">appender.<span style="color: #006600;">setEvaluator</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> LimitingEvaluator<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/&amp;title=Limiting+log4j+SMTPAppender" title="Add 'Limiting log4j SMTPAppender' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Limiting log4j SMTPAppender' to Del.icio.us" alt="Add 'Limiting log4j SMTPAppender' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/&amp;title=Limiting+log4j+SMTPAppender" title="Add 'Limiting log4j SMTPAppender' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Limiting log4j SMTPAppender' to digg" alt="Add 'Limiting log4j SMTPAppender' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Limiting+log4j+SMTPAppender&amp;u=http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/" title="Add 'Limiting log4j SMTPAppender' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Limiting log4j SMTPAppender' to FURL" alt="Add 'Limiting log4j SMTPAppender' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/&amp;title=Limiting+log4j+SMTPAppender" title="Add 'Limiting log4j SMTPAppender' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Limiting log4j SMTPAppender' to reddit" alt="Add 'Limiting log4j SMTPAppender' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/" title="Add 'Limiting log4j SMTPAppender' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Limiting log4j SMTPAppender' to Technorati" alt="Add 'Limiting log4j SMTPAppender' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/&amp;title=Limiting+log4j+SMTPAppender" title="Add 'Limiting log4j SMTPAppender' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Limiting log4j SMTPAppender' to Google Bookmarks" alt="Add 'Limiting log4j SMTPAppender' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2008/02/15/limiting-log4j-smtpappender/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Killing a process by name in ubuntu</title>
		<link>http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/</link>
		<comments>http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 20:52:23 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/</guid>
		<description><![CDATA[I have to kill mongrel alot because it's a flea-bitten mutt. My usual method was to do a ps -aux &#124; grep mongrel , find the pid and kill it! Annoying and stupid! Now I just use the nice pkill tool in ubuntu like so. pkill mongrel boom! All bad doggies killed! This probably works [...]]]></description>
			<content:encoded><![CDATA[<p>I have to kill <a href="http://mongrel.rubyforge.org/">mongrel</a> alot because it's a flea-bitten mutt.</p>
<p>My usual method was to do a <code>ps -aux | grep mongrel </code>, find the pid and kill it!</p>
<p>Annoying and stupid!</p>
<p>Now I just use the nice pkill tool in ubuntu like so.</p>
<p><code>pkill mongrel</code></p>
<p>boom! All bad doggies killed! This probably works on other *nix flavors, but who knows if your stupid admin installed it.</p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/&amp;title=Killing+a+process+by+name+in+ubuntu" title="Add 'Killing a process by name in ubuntu' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Killing a process by name in ubuntu' to Del.icio.us" alt="Add 'Killing a process by name in ubuntu' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/&amp;title=Killing+a+process+by+name+in+ubuntu" title="Add 'Killing a process by name in ubuntu' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Killing a process by name in ubuntu' to digg" alt="Add 'Killing a process by name in ubuntu' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Killing+a+process+by+name+in+ubuntu&amp;u=http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/" title="Add 'Killing a process by name in ubuntu' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Killing a process by name in ubuntu' to FURL" alt="Add 'Killing a process by name in ubuntu' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/&amp;title=Killing+a+process+by+name+in+ubuntu" title="Add 'Killing a process by name in ubuntu' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Killing a process by name in ubuntu' to reddit" alt="Add 'Killing a process by name in ubuntu' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/" title="Add 'Killing a process by name in ubuntu' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Killing a process by name in ubuntu' to Technorati" alt="Add 'Killing a process by name in ubuntu' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/&amp;title=Killing+a+process+by+name+in+ubuntu" title="Add 'Killing a process by name in ubuntu' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Killing a process by name in ubuntu' to Google Bookmarks" alt="Add 'Killing a process by name in ubuntu' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2007/09/17/killing-a-process-by-name-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Capturing STDERR with ruby backticks</title>
		<link>http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/</link>
		<comments>http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 14:13:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/</guid>
		<description><![CDATA[I was writing a ruby script today that ran a linux command for every line in a file. The problem was the backtick operator in ruby only captures stdout, here's a little trick to get stderr as well. (*nix only) out = `ourlinuxcmd 2&#62;&#38;1` the 2>&#038;1 bit tells the shell to redirect stderr to stdout [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing a ruby script today that ran a linux command for every line in a file. The problem was the backtick operator in ruby only captures stdout, here's a little trick to get <strong>stderr</strong> as well. (<em>*nix only</em>)</p>
<div class="syntax_hilite">
<div id="ruby-16">
<div class="ruby">out = <span style="color:#996600;">`ourlinuxcmd 2&gt;&amp;1`</span></div>
</div>
</div>
<p></p>
<p>the 2>&#038;1 bit tells the shell to redirect <strong>stderr</strong> to <strong>stdout</strong></p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/&amp;title=Capturing+STDERR+with+ruby+backticks" title="Add 'Capturing STDERR with ruby backticks' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Capturing STDERR with ruby backticks' to Del.icio.us" alt="Add 'Capturing STDERR with ruby backticks' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/&amp;title=Capturing+STDERR+with+ruby+backticks" title="Add 'Capturing STDERR with ruby backticks' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Capturing STDERR with ruby backticks' to digg" alt="Add 'Capturing STDERR with ruby backticks' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Capturing+STDERR+with+ruby+backticks&amp;u=http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/" title="Add 'Capturing STDERR with ruby backticks' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Capturing STDERR with ruby backticks' to FURL" alt="Add 'Capturing STDERR with ruby backticks' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/&amp;title=Capturing+STDERR+with+ruby+backticks" title="Add 'Capturing STDERR with ruby backticks' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Capturing STDERR with ruby backticks' to reddit" alt="Add 'Capturing STDERR with ruby backticks' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/" title="Add 'Capturing STDERR with ruby backticks' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Capturing STDERR with ruby backticks' to Technorati" alt="Add 'Capturing STDERR with ruby backticks' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/&amp;title=Capturing+STDERR+with+ruby+backticks" title="Add 'Capturing STDERR with ruby backticks' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Capturing STDERR with ruby backticks' to Google Bookmarks" alt="Add 'Capturing STDERR with ruby backticks' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2007/09/14/capturing-stderr-with-ruby-backticks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Running rails with mongrel for a specific sub directory</title>
		<link>http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/</link>
		<comments>http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 13:20:54 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/</guid>
		<description><![CDATA[I've started using mongrel for running rails apps with apache2 and mod_proxy , it works like a charm and allows you to run multiple rails apps and mongrel instances on one server. Your proxy setup looks like this in your httpd.conf or vhost.conf &#60;VirtualHost *:80&#62; &#160; &#160; ServerName myapp.com &#160; &#160; ServerAlias www.myapp.com &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I've started using <a href="http://mongrel.rubyforge.org/index.html">mongrel</a> for running rails apps with apache2 and mod_proxy , it works like a charm and allows you to run multiple rails apps and mongrel instances on one server.</p>
<p>Your proxy setup looks like this in your httpd.conf or vhost.conf</p>
<div class="syntax_hilite">
<div id="code-19">
<div class="code">&lt;VirtualHost *:<span style="color:#800000;">80</span>&gt;<br />
&nbsp; &nbsp; ServerName myapp.<span style="">com</span><br />
&nbsp; &nbsp; ServerAlias www.<span style="">myapp</span>.<span style="">com</span></p>
<p>&nbsp; &nbsp; ProxyPass /myapp http:<span style="color:#FF9933; font-style:italic;">//www.myapp.com:8000/</span><br />
&nbsp; &nbsp; ProxyPassReverse /myapp http:<span style="color:#FF9933; font-style:italic;">//www.myapp.com:8000</span><br />
&nbsp; &nbsp; ProxyPreserveHost on<br />
&nbsp; &lt;/VirtualHost&gt;</div>
</div>
</div>
<p></p>
<p>Then in your environment.rb add:</p>
<div class="syntax_hilite">
<div id="ruby-20">
<div class="ruby">ActionController::AbstractRequest.<span style="color:#9900CC;">relative_url_root</span> = '/myapp'</div>
</div>
</div>
<p></p>
<p>This will make ActionController rewrite the proper URL for your rails application.</p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/&amp;title=Running+rails+with+mongrel+for+a+specific+sub+directory" title="Add 'Running rails with mongrel for a specific sub directory' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add 'Running rails with mongrel for a specific sub directory' to Del.icio.us" alt="Add 'Running rails with mongrel for a specific sub directory' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/&amp;title=Running+rails+with+mongrel+for+a+specific+sub+directory" title="Add 'Running rails with mongrel for a specific sub directory' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add 'Running rails with mongrel for a specific sub directory' to digg" alt="Add 'Running rails with mongrel for a specific sub directory' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=Running+rails+with+mongrel+for+a+specific+sub+directory&amp;u=http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/" title="Add 'Running rails with mongrel for a specific sub directory' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add 'Running rails with mongrel for a specific sub directory' to FURL" alt="Add 'Running rails with mongrel for a specific sub directory' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/&amp;title=Running+rails+with+mongrel+for+a+specific+sub+directory" title="Add 'Running rails with mongrel for a specific sub directory' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add 'Running rails with mongrel for a specific sub directory' to reddit" alt="Add 'Running rails with mongrel for a specific sub directory' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/" title="Add 'Running rails with mongrel for a specific sub directory' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add 'Running rails with mongrel for a specific sub directory' to Technorati" alt="Add 'Running rails with mongrel for a specific sub directory' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/&amp;title=Running+rails+with+mongrel+for+a+specific+sub+directory" title="Add 'Running rails with mongrel for a specific sub directory' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add 'Running rails with mongrel for a specific sub directory' to Google Bookmarks" alt="Add 'Running rails with mongrel for a specific sub directory' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2007/09/10/running-rails-with-mongrel-for-a-specific-sub-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#9829; HTML Heart Code &#9829;</title>
		<link>http://www.weheartcode.com/2007/09/01/html-heart-code/</link>
		<comments>http://www.weheartcode.com/2007/09/01/html-heart-code/#comments</comments>
		<pubDate>Sat, 01 Sep 2007 21:21:16 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.weheartcode.com/2007/09/01/html-heart-code/</guid>
		<description><![CDATA[Here's how you make a heart in HTML, &#38;hearts; Now, stop coming here for that! I'm sick of seeing you in my referral logs! *Edit - Now i'm #1 in google for this unwillingly! Oh, well go ahead and try it out in the comments you weirdos. Bookmark to:]]></description>
			<content:encoded><![CDATA[<p>Here's how you make a heart in HTML,
<div class="syntax_hilite">
<div id="html-22">
<div class="html"><span style="color: #ddbb00;">&amp;hearts;</span></div>
</div>
</div>
<p> Now, stop coming here for that! I'm sick of seeing you in my referral logs!</p>
<p>*Edit - Now i'm #1 in google for this unwillingly! Oh, well go ahead and try it out in the comments you weirdos.</p>
<!-- Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.weheartcode.com/2007/09/01/html-heart-code/&amp;title=%26hearts%3B+HTML+Heart+Code+%26hearts%3B" title="Add '&hearts; HTML Heart Code &hearts;' to Del.icio.us"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/delicious.png" title="Add '&hearts; HTML Heart Code &hearts;' to Del.icio.us" alt="Add '&hearts; HTML Heart Code &hearts;' to Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.weheartcode.com/2007/09/01/html-heart-code/&amp;title=%26hearts%3B+HTML+Heart+Code+%26hearts%3B" title="Add '&hearts; HTML Heart Code &hearts;' to digg"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/digg.png" title="Add '&hearts; HTML Heart Code &hearts;' to digg" alt="Add '&hearts; HTML Heart Code &hearts;' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://furl.net/storeIt.jsp?t=%26hearts%3B+HTML+Heart+Code+%26hearts%3B&amp;u=http://www.weheartcode.com/2007/09/01/html-heart-code/" title="Add '&hearts; HTML Heart Code &hearts;' to FURL"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/furl.png" title="Add '&hearts; HTML Heart Code &hearts;' to FURL" alt="Add '&hearts; HTML Heart Code &hearts;' to FURL" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.weheartcode.com/2007/09/01/html-heart-code/&amp;title=%26hearts%3B+HTML+Heart+Code+%26hearts%3B" title="Add '&hearts; HTML Heart Code &hearts;' to reddit"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/reddit.png" title="Add '&hearts; HTML Heart Code &hearts;' to reddit" alt="Add '&hearts; HTML Heart Code &hearts;' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.weheartcode.com/2007/09/01/html-heart-code/" title="Add '&hearts; HTML Heart Code &hearts;' to Technorati"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/technorati.png" title="Add '&hearts; HTML Heart Code &hearts;' to Technorati" alt="Add '&hearts; HTML Heart Code &hearts;' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.weheartcode.com/2007/09/01/html-heart-code/&amp;title=%26hearts%3B+HTML+Heart+Code+%26hearts%3B" title="Add '&hearts; HTML Heart Code &hearts;' to Google Bookmarks"><img src="http://www.weheartcode.com/wp-content/plugins/social_bookmarks/google.png" title="Add '&hearts; HTML Heart Code &hearts;' to Google Bookmarks" alt="Add '&hearts; HTML Heart Code &hearts;' to Google Bookmarks" /></a></div>
<!-- Social Bookmarks END -->]]></content:encoded>
			<wfw:commentRss>http://www.weheartcode.com/2007/09/01/html-heart-code/feed/</wfw:commentRss>
		<slash:comments>260</slash:comments>
		</item>
	</channel>
</rss>

