<?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>international geographic</title>
	<atom:link href="http://www.chetanislazy.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chetanislazy.com/blog</link>
	<description>ooh, shiny!</description>
	<lastBuildDate>Wed, 24 Feb 2010 01:35:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using MySQL with JRuby</title>
		<link>http://www.chetanislazy.com/blog/2010/02/23/using-mysql-with-jruby/</link>
		<comments>http://www.chetanislazy.com/blog/2010/02/23/using-mysql-with-jruby/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 01:35:02 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=139</guid>
		<description><![CDATA[For some reason, I had a relatively hard time finding this info all in one spot, so here it is:
Using MySQL with JRuby is actually pretty easy (and no annoying arch issues on OS X! :-)
Install GEMs (DBI, JDBC driver, DBI adapter):

$ jgem install dbi jdbc-mysql dbd-jdbc

Then use it!

require 'dbi'
require 'jdbc/mysql'
dbh = DBI.connect&#40;'dbi:jdbc:mysql://localhost:3306/test', 'root', '', [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, I had a relatively hard time finding this info all in one spot, so here it is:</p>
<p>Using MySQL with JRuby is actually pretty easy (and no annoying arch issues on OS X! :-)</p>
<p>Install GEMs (DBI, JDBC driver, DBI adapter):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ jgem install dbi jdbc-mysql dbd-jdbc</pre></div></div>

<p>Then use it!</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'dbi'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'jdbc/mysql'</span>
dbh = DBI.<span style="color:#9900CC;">connect</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'dbi:jdbc:mysql://localhost:3306/test'</span>, <span style="color:#996600;">'root'</span>, <span style="color:#996600;">''</span>, 
                  <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">&quot;driver&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;com.mysql.jdbc.Driver&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2010/02/23/using-mysql-with-jruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hooking app exit in Firefox extensions</title>
		<link>http://www.chetanislazy.com/blog/2010/02/10/hooking-app-exit-in-firefox-extensions/</link>
		<comments>http://www.chetanislazy.com/blog/2010/02/10/hooking-app-exit-in-firefox-extensions/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 23:44:16 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=126</guid>
		<description><![CDATA[I&#8217;ve spent the last few days since joining Better Advertising working on a new feature for a Firefox extension called Ghostery. We&#8217;ll be announcing the new feature soon, but until then I thought I&#8217;d share some of what I&#8217;ve learned so far. 
I&#8217;ve never worked on an extension before but as it turns out, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent the last few days since joining <a href="http://www.betteradvertising.com/">Better Advertising</a> working on a new feature for a Firefox extension called <a href="http://www.ghostery.com/">Ghostery</a>. We&#8217;ll be announcing the new feature soon, but until then I thought I&#8217;d share some of what I&#8217;ve learned so far. </p>
<p>I&#8217;ve never worked on an extension before but as it turns out, it&#8217;s really quite easy to pick up; some fairly simple XML (aka XUL) for composing the UI and JavaScript for the rest. One of the trickier bits has to do with scope. After doing some testing I figured out that the entry point into an extension is via the browser window; that is, your extension code will be executed each time you open a new window and that means that all your code is basically scoped to a single window. </p>
<p>In developing the new Ghostery feature I needed a way to run some code when the user quits Firefox. Luckily, the extension architecture is extremely flexible (if poorly documented at times) and I didn&#8217;t have to jump through any hoops to do it. Almost anything, it seems can be either chained or hooked in some way. In this case, the <a href="https://developer.mozilla.org/en/NsIObserverService">nsIObserverService</a> gives us access to the necessary <a href="https://developer.mozilla.org/en/Observer_Notifications">shutdown</a> event to which we can attach an observer using a simple interface. </p>
<p>The problem, then, was that since our code is run every time a new window is created, I needed a way to register the hook only once to avoid firing multiple times on exit. My first thought was to try to register the hook outside of the window scope (e.g. using a different chrome overlay) but that appeared to be a dead end. Using a globally scoped variable as a lock was also a dead end. In the end I settled on something I already knew how to use: preferences. Essentially, I created a simple lock around a preference variable which, while I don&#8217;t need to store it between sessions, is in fact a global storage area that can be accessed from different windows. </p>
<p>Check out the code below for an example implementation. I left out the actual <a href="https://developer.mozilla.org/en/Code_snippets/Preferences">preferences</a> code since it&#8217;s not crucial to understanding the solution.</p>
<p><script src="http://gist.github.com/300959.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2010/02/10/hooking-app-exit-in-firefox-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best concerts of 2009</title>
		<link>http://www.chetanislazy.com/blog/2009/12/31/best-concerts-of-2009/</link>
		<comments>http://www.chetanislazy.com/blog/2009/12/31/best-concerts-of-2009/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 05:02:09 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[best of]]></category>
		<category><![CDATA[lollapalooza]]></category>
		<category><![CDATA[newport]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=113</guid>
		<description><![CDATA[
This year was something of an anomaly for me: I only went to five shows. Two of those shows, however, were music festivals and easily made up for the otherwise quiet concert calendar &#8212; Lollapalooza with a staggering 35 shows in three days and the Newport Folk Festival with another 6.
I also went to 3 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://chetanislazy.com/images/blog/mattkim.jpg" /></p>
<p>This year was something of an anomaly for me: I only went to <strong>five</strong> shows. Two of those shows, however, were music festivals and easily made up for the otherwise quiet concert calendar &#8212; Lollapalooza with a staggering <strong>35 shows</strong> in <em>three</em> days and the Newport Folk Festival with another 6.</p>
<p>I also went to 3 free shows at Madison Square Park: Jonatha Brooke, Raul Malo, and the John Scofield Trio. I&#8217;m a huge fan of Raul Malo and the Mavericks so we ended up braving some of the worst rain of the summer to see him. It rained through most of his shortened set, but it was still worth it.<br />
<span id="more-113"></span><br />
With so few real shows this year they all made the list, but here they are in order:</p>
<ol>
<li>Matt &#038; Kim &#8211; at the Music Hall of Williamsburg</li>
<li>The Thermals &#8211; at Bowery Ballroom (my favorite venue)</li>
<li>Warren G &#8211; at the Music Hall of Williamsburg</li>
<li>Raul Malo &#8211; in the rain at MadSqPark</li>
<li>Jonatha Brooke &#8211; at MadSqPark</li>
<li>The John Scofield Trio &#8211; at MadSqPark</li>
</ol>
<h3>Lollapalooza</h3>
<p>The name of the game at lolla was coverage: we tried to see as many shows as humanly possible with the size of the venue, the crowds and the weather (from soaking rain to blazing heat) all working against us. Some shows we stopped at were simply on the way to a must-see show, while others we went to because they were starting on a nearby stage. All in all, we saw a ton of great shows, but these were the best:</p>
<ol>
<li>Dan Deacon &#8211; I&#8217;m actually not a very big fan of his [albums], but his live set was just amazing</li>
<li>Passion Pit</li>
<li>Depeche Mode</li>
<li>Lykke Li &#8211; another surprisingly great set</li>
</ol>
<p>Full list of shows:</p>
<h3>Lollapalooza</h3>
<h4>DAY 1:</h4>
<p>Heartless Bastards<br />
Thievery Corporation<br />
Peter Bjorn &#038; John<br />
Depeche Mode</p>
<h4>DAY 2:</h4>
<p>Miike Snow<br />
Ida Maria<br />
Los Campesinos!<br />
Joe Pug<br />
Carebears on Fire<br />
Gomez<br />
Coheed and Cambria<br />
No Age<br />
Glasvegas<br />
Lykke Li<br />
Animal Collective<br />
Tool<br />
Yeah Yeah Yeahs</p>
<h4>DAY 3:</h4>
<p>Friendly Fires<br />
Portugal. The Man<br />
Car Stereo Wars<br />
The Greencards<br />
The Kaiser Chiefs<br />
He Say, She Say<br />
Neon Hitch<br />
Gang Gang Dance<br />
Dan Deacon<br />
Vampire Weekend<br />
Passion Pit<br />
Cold War Kids<br />
Deerhunter<br />
MSTRKRFT<br />
Band of Horses<br />
Jane&#8217;s Addiction<br />
Deadmau5<br />
The Killers</p>
<h3>Newport Folk Festival</h3>
<p>Ramblin&#8217; Jack Elliot<br />
Ben Kweller<br />
The Avett Brothers<br />
Gillian Welch<br />
Fleet Foxes<br />
The Decemberists</p>
<p>They were all great shows at Newport, but the main stage was just too crowded by the time we arrived and the sound was sorely lacking at the further reaches of the field. We ended up sitting on the grass at just about the furthest possible point from the stage, save for the boats just off shore, on the only patch of grass that was not yet covered by blankets.  </p>
<p>We had a terrific time, but the shows we caught on the smaller tented stages were far better, so I have to give the best in show prize here to Ben Kweller, whom I&#8217;m a big fan of. We also caught the last couple songs of Ramblin&#8217; Jack&#8217;s set, which was just amazing. We even got to sing him happy birthday as he was celebrating his 78th birthday at the festival. </p>
<p>The weather was beautiful and it turned out to be a perfect day for outdoor music. What the shows lacked, the weather and the scenery more than made up for. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/12/31/best-concerts-of-2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Best music of 2009</title>
		<link>http://www.chetanislazy.com/blog/2009/12/31/best-music-of-2009/</link>
		<comments>http://www.chetanislazy.com/blog/2009/12/31/best-music-of-2009/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 05:01:26 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[best of]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=96</guid>
		<description><![CDATA[I&#8217;ve been procrastinating publishing this latest post for several weeks now. I&#8217;ve had ample time to write it; that&#8217;s not the problem at all. No, I simply find it painfully, frustratingly difficult to narrow my collection down to only a handful of records, especially in a year with so many fantastic releases to choose from.

I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been procrastinating publishing this latest post for several weeks now. I&#8217;ve had ample time to write it; that&#8217;s not the problem at all. No, I simply find it painfully, frustratingly difficult to narrow my collection down to only a handful of records, especially in a year with so many fantastic releases to choose from.<br />
<span id="more-96"></span><br />
I began making a mental draft a couple of weeks ago and sketched out my initial list a week later. Since then I&#8217;ve revised it six or seven times (and grew the list from five spots to ten in the process), but I think I&#8217;ve finally locked it down. Here, then, are my picks for the 10 best albums of 2009 (sorted alphabetically):</p>
<ol>
<li>The Avett Brothers &#8211; I and Love and You</li>
<li>Black Joe Lewis &#038; The Honeybears &#8211; Tell &#8216;Em What Your Name Is!</li>
<li>Discovery &#8211; LP</li>
<li>Girls &#8211; Album</li>
<li>Monsters of Folk &#8211; Monsters of Folk</li>
<li>Passion Pit &#8211; Manners</li>
<li>Phoenix &#8211; Wolfgang Amadeus Phoenix</li>
<li>The Thermals &#8211; Now We Can See</li>
<li>Wilco &#8211; Wilco (the album)</li>
<li>The xx &#8211; xx</li>
</ol>
<p>A lot of the folk/rock influence comes from listening to NYC&#8217;s best music radio station, <a href="http://www.wfuv.org/">WFUV</a>, and indeed, four of my top 10 albums are also on the <a href="http://www.wfuv.org/music/best/bestof09.html">listener&#8217;s best of 2009 poll</a>. I&#8217;m actually a little surprised that Black Joe Lewis didn&#8217;t make it into their top 50, given how much they played it over the summer, but there&#8217;s still lots more great music on there. </p>
<p>Here&#8217;s some more of mine that didn&#8217;t make it the top 10 but were also in heavy rotation this year: </p>
<ul>
<li>Andrew Bird &#8211; Noble Beast</li>
<li>Bell X1 &#8211; Blue Lights on the Runway</li>
<li>Ben Kweller &#8211; Changing Horses</li>
<li>The BPA &#8211; I Think We&#8217;re Gonna Need a Bigger Boat</li>
<li>Camera Obscura &#8211; My Maudlin Career</li>
<li>The Decemberists &#8211; The Hazards of Love</li>
<li>Fanfarlo &#8211; Reservoir</li>
<li>Felice Brothers &#8211; Yonder is the Clock</li>
<li>Gomez &#8211; A New Tide</li>
<li>Grizzly Bear &#8211; Veckatimest</li>
<li>Heartless Bastards &#8211; the Mountain</li>
<li>The Low Anthem &#8211; Oh My God, Charlie Darwin</li>
<li>Miike Snow &#8211; Miike Snow</li>
<li>Mos Def &#8211; The Ecstatic</li>
<li>Röyksopp &#8211; Junior</li>
<li>Them Crooked Vultures &#8211; Them Crooked Vultures</li>
<li>Yeah Yeah Yeahs &#8211; It&#8217;s Blitz!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/12/31/best-music-of-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading the Mac Pro: Adding a 2nd GPU</title>
		<link>http://www.chetanislazy.com/blog/2009/12/16/upgrading-the-mac-pro-adding-a-2nd-gpu/</link>
		<comments>http://www.chetanislazy.com/blog/2009/12/16/upgrading-the-mac-pro-adding-a-2nd-gpu/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 04:42:17 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[computers suck]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[mac pro]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=95</guid>
		<description><![CDATA[tl;dr- Yes, you can add a 2nd GPU; OS X will ignore it; Windows will use it. Make sure to disable the card in the 1st slot to use it for gaming.
Apple makes great hardware, there&#8217;s no doubt about it. However, occasionally they make decisions that not only boggle the mind but are completely infuriating. [...]]]></description>
			<content:encoded><![CDATA[<p><em>tl;dr- Yes, you <strong>can</strong> add a 2nd GPU; OS X will ignore it; Windows will use it. Make sure to disable the card in the 1st slot to use it for gaming.</em></p>
<p>Apple makes great hardware, there&#8217;s no doubt about it. However, occasionally they make decisions that not only boggle the mind but are completely infuriating. Like putting <a href="http://en.wikipedia.org/wiki/Mini-DVI">non-standard ports</a> on a laptop and charging twenty bucks for the proper adapter cable! </p>
<p>A similar problem I ran into recently is the issue of the graphics card in the Mac Pro: only specially branded &#8220;Mac-compatible&#8221; GPUs will work in OS X. What&#8217;s the problem with that you ask? Availability and pricing. </p>
<p><span id="more-95"></span></p>
<h3>Availability</h3>
<p>The current generation Mac Pro as of this writing offers a whopping <strong>two</strong> GPU options at the Apple store: the NVIDIA GeForce GT 120 512mb or the ATI Radeon HD 4870 512MB. I also managed to find and EVGA GeForce GTX 285 PCIe 1GB at a third-party retailer, bringing our total to three. Compare that with a whopping 380 PCIe x16 cards available right now on <a href="http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&#038;N=40000048%201069633099&#038;name=PCI%20Express%202.0%20x16&#038;ActiveSearchResult=True">Newegg</a>.</p>
<h3>Pricing</h3>
<p>This one should be pretty obvious if you&#8217;ve ever bought an Apple computer product: there is a steep markup on these specially branded cards. Where the Radeon HD 4870 costs about <a href="http://www.smalldog.com/product/73308">$349</a> a similar PC card costs about $150 and you get 1GB of memory to boot!</p>
<h3>Who cares?</h3>
<p>Ok, so upgrading the GPU is looking like it&#8217;s going to cost an arm and a leg for an OS X compatible part. Is it worth it? Truth is, it&#8217;s not. Gaming on the Mac is in a sad state of affairs with a severe shortage of available titles and when they <strong>do</strong> appear, it&#8217;s often long, long after the PC version (e.g., <a href="http://en.wikipedia.org/wiki/Call_of_Duty_4:_Modern_Warfare">CoD4: Modern Warfare</a> which suffered a delay of nearly 11 months). </p>
<p>So why all the fuss, then? Well, if you&#8217;re a Mac gamer, then you&#8217;re running Windows via Bootcamp to get your fix, like I am. </p>
<h3>Solution</h3>
<p>After much research, and some helpful replies to queries posted on the Apple community boards, I finally found my answer. A second &#8220;PC&#8221; GPU added to the Mac Pro will be safely ignored by OS X and properly recognized by Windows (see screenshots below). Just be sure to disable the original GPU in Windows once you&#8217;ve got the second card all setup or else you won&#8217;t be able to use it for gaming. </p>
<p>I still ran into one minor issue: the Mac Pro has a unique PCIe x16 power connector requiring, you guessed it, a special <a href="http://chetanislazy.com/images/blog/PCIe_cable.jpg" rel="lightbox[95]">Mac-only power cable</a>! Fortunately there are plenty of them <a href="http://shop.ebay.com/i.html?_nkw=pcie+power+cable+mac+pro">available on eBay</a> for under 20 bucks so you should still be able to pull off a rather &#8220;cheap&#8221; upgrade. </p>
<p><a href="http://chetanislazy.com/images/blog/MacOSX_2nd_GPU.png" rel="lightbox[95]"><img src="http://chetanislazy.com/images/blog/MacOSX_2nd_GPU.png" alt="Mac OS X with 2nd GPU" width="248" /></a> <a href="http://chetanislazy.com/images/blog/WinXP_2nd_GPU.png" rel="lightbox[95]"><img src="http://chetanislazy.com/images/blog/WinXP_2nd_GPU.png" alt="Windows XP with 2nd GPU" width="248" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/12/16/upgrading-the-mac-pro-adding-a-2nd-gpu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classmates.com just earned a spot on my blacklist</title>
		<link>http://www.chetanislazy.com/blog/2009/07/23/classmates-blacklisted/</link>
		<comments>http://www.chetanislazy.com/blog/2009/07/23/classmates-blacklisted/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:02:14 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=93</guid>
		<description><![CDATA[Just fixed another longstanding pet peeve of mine: I finally added classmates.com and cmates.com to my email server&#8217;s blacklist. How these guys have managed to stay in business for so long is beyond. They don&#8217;t even try to hide the fact that they&#8217;re spammers. They even sign all their messages with a valid domain keys [...]]]></description>
			<content:encoded><![CDATA[<p>Just fixed another longstanding pet peeve of mine: I finally added classmates.com and cmates.com to my email server&#8217;s blacklist. How these guys have managed to stay in business for so long is beyond. They don&#8217;t even <em>try</em> to hide the fact that they&#8217;re spammers. They even sign all their messages with a valid domain keys signature!</p>
<pre>
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d=classmates.com;
     s=prod20081009.key.pem; t=1248374724; bh=PH2W8/WWF0Eq5UeHS7xrebJL9l
     g=; h=Date:from:to:Subject:Mime-Version:Content-Type:Message-Id;
     b=IMICZJvpMfW9pEWFSGX9gnScTOsQb0sI3edRgw7jHekqAK8OuJoFkmGBYcLC8IhpD
     mnoepYufrgbzzCEUWiYwpqCNSJ7PkqiyDs5n9upo4qtyEa29vgv6rXb39vQ+FjymKV+
     E39Tuzsm2MuXTTO+e0C7LlOozzqnSfh30yovIOI=
</pre>
<p>Gotta love the sheer audacity of it.. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/07/23/classmates-blacklisted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing SquirrelMail&#8217;s weird reply behavior</title>
		<link>http://www.chetanislazy.com/blog/2009/07/23/fixing-squirrelmail-replies/</link>
		<comments>http://www.chetanislazy.com/blog/2009/07/23/fixing-squirrelmail-replies/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 18:00:44 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=92</guid>
		<description><![CDATA[After years of being annoyed by the fact that SquirrelMail, an otherwise fine product, doesn&#8217;t include the date and name of the sender when replying to emails like just about every other email client on the planet, I finally broke down and fixed it. Below is the simple 1 line patch against SquirrelMail 1.4.19. It [...]]]></description>
			<content:encoded><![CDATA[<p>After years of being annoyed by the fact that <a href="http://squirrelmail.org/">SquirrelMail</a>, an otherwise fine product, doesn&#8217;t include the date and name of the sender when replying to emails like just about every other email client on the planet, I finally broke down and fixed it. Below is the simple 1 line patch against SquirrelMail 1.4.19. It will most likely work on older 1.4.x versions  as well. </p>
<p><a href="http://www.pixelcop.org/~chetan/files/squirrelmail-1.4.19-reply_body.patch">Download patch</a> (squirrelmail-1.4.19-reply_body.patch)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">---</span> squirrelmail<span style="color: #339933;">-</span>1<span style="color: #339933;">.</span>4<span style="color: #339933;">.</span>19<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>compose<span style="color: #339933;">.</span>php	<span style="color: #cc66cc;">2009</span><span style="color: #339933;">-</span><span style="color: #208080;">05</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">14</span> <span style="color: #208080;">06</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">26</span><span style="color: #339933;">:</span><span style="color:#800080;">29.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0000</span>
<span style="color: #339933;">+++</span> squirrelmail<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>compose<span style="color: #339933;">.</span>php	<span style="color: #cc66cc;">2009</span><span style="color: #339933;">-</span><span style="color: #208080;">07</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">23</span> <span style="color: #cc66cc;">16</span><span style="color: #339933;">:</span><span style="color:#800080;">09</span><span style="color: #339933;">:</span><span style="color:#800080;">59.000000000</span> <span style="color: #339933;">+</span><span style="color: #208080;">0000</span>
<span style="color: #339933;">@@</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">856</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span> <span style="color: #339933;">+</span><span style="color: #cc66cc;">856</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span> <span style="color: #339933;">@@</span>
                 <span style="color: #000088;">$rewrap_body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$orig_header</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$orig_header</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$orig_header</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$orig_header</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #339933;">;</span>
                 sqUnWordWrap<span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">-</span>                <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #339933;">+</span>                <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>On &quot;</span> <span style="color: #339933;">.</span> getLongDateString<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$orig_header</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">date</span><span style="color: #339933;">,</span> <span style="color: #000088;">$orig_header</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">date_unparsed</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; <span style="color: #006699; font-weight: bold;">{$send_to}</span> wrote:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// MOD BY chetan</span>
                 <span style="color: #000088;">$cnt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rewrap_body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$cnt</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                     sqWordWrap<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rewrap_body</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$editor_size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$default_charset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/07/23/fixing-squirrelmail-replies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Google Gears on Mac OS X</title>
		<link>http://www.chetanislazy.com/blog/2009/07/14/installing-google-gears-on-mac-os-x/</link>
		<comments>http://www.chetanislazy.com/blog/2009/07/14/installing-google-gears-on-mac-os-x/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 04:09:55 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=90</guid>
		<description><![CDATA[If you&#8217;re looking to install Google Gears on OS X, installation order can be somewhat important. The Safari version installs as a standard OS X browser plugin and will be picked up by all the browsers on your system. Sounds good, except that the Firefox version is actually a standard Firefox XPI extension and the [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking to install <a href="http://gears.google.com/">Google Gears</a> on OS X, installation order can be somewhat important. The Safari version installs as a standard OS X browser plugin and will be picked up by all the browsers on your system. Sounds good, except that the Firefox version is actually a standard Firefox XPI extension and the two will conflict &#8212; you actually won&#8217;t be able to install the XPI unless you first disable the plugin via the Tools > Add-ons > Plugins menu option. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/07/14/installing-google-gears-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing command line interfaces for Spring apps</title>
		<link>http://www.chetanislazy.com/blog/2009/06/29/writing-command-line-interfaces-for-spring-apps/</link>
		<comments>http://www.chetanislazy.com/blog/2009/06/29/writing-command-line-interfaces-for-spring-apps/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 03:58:30 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=81</guid>
		<description><![CDATA[I recently needed to script some tasks for a Spring-based app at work so we could shove it into a crontab. It proved to be much easier than I thought. 
You can use your spring.xml config file for wiring up your beans as usual, but rather than deal with various property files you can easily [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to script some tasks for a Spring-based app at work so we could shove it into a crontab. It proved to be much easier than I thought. </p>
<p>You can use your spring.xml config file for wiring up your beans as usual, but rather than deal with various property files you can easily override properties on the fly using system properties. See the following example:</p>
<p>In your spring.xml make sure you have this line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;propertyConfigurer&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- Allow properties to be overriden via </span>
<span style="color: #808080; font-style: italic;">         system properties --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;systemPropertiesMode&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;locations&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> [...snip...] <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Then you can override your aliases either using standard java properties (-Djdbc.url=&#8221;mysql://&#8230;&#8221;) or via your program&#8217;s own command line arguments, which is the route I ended up going.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">CommandLineParser parser <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GnuParser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Options options <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Options<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Option</span> brokerOption <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Option</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;b&quot;</span>, <span style="color: #0000ff;">&quot;broker&quot;</span>, <span style="color: #000066; font-weight: bold;">true</span>, <span style="color: #0000ff;">&quot;broker uri&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
brokerOption.<span style="color: #006633;">setRequired</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
options.<span style="color: #006633;">addOption</span><span style="color: #009900;">&#40;</span>brokerOption<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
CommandLine line <span style="color: #339933;">=</span> parser.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span>options, args<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">setProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jms.broker.url&quot;</span>, line.<span style="color: #006633;">getOptionValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;b&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/06/29/writing-command-line-interfaces-for-spring-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installshield sucks</title>
		<link>http://www.chetanislazy.com/blog/2009/05/31/installshield-sucks/</link>
		<comments>http://www.chetanislazy.com/blog/2009/05/31/installshield-sucks/#comments</comments>
		<pubDate>Sun, 31 May 2009 21:02:24 +0000</pubDate>
		<dc:creator>chetan</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.chetanislazy.com/blog/?p=77</guid>
		<description><![CDATA[And furthermore, Peachtree sucks. Last weekend I battled this error thrown by the Peachtree 2008 installer and this weekend I had the great pleasure of upgrading to Peachtree 2010 and being greeted by the very same error. 
The fix in both cases? Simply copy the contents of the CD to the local harddisk (a network [...]]]></description>
			<content:encoded><![CDATA[<p>And furthermore, Peachtree sucks. Last weekend I battled <a href="http://support.microsoft.com/kb/888019">this</a> <a href="http://consumerdocs.installshield.com/selfservice/viewContent.do?externalId=Q108340&#038;sliceId=1">error</a> thrown by the Peachtree 2008 installer and this weekend I had the great pleasure of upgrading to Peachtree 2010 and being greeted by the very same error. </p>
<p>The fix in both cases? Simply copy the contents of the CD to the local harddisk (a network share works just as well) and then run setup.exe from there. Don&#8217;t be fooled by the suggested &#8220;solutions&#8221; from Microsoft or Installshield like I was. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chetanislazy.com/blog/2009/05/31/installshield-sucks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
