<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Yet Another Programming Blog</title>
	
	<link>http://blog.yetisoftware.com</link>
	<description>But this is the only one *I* author, so it's got to be good!</description>
	<lastBuildDate>Sat, 18 Apr 2009 17:39:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/YetAnotherProgrammingBlog" /><feedburner:info uri="yetanotherprogrammingblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Android, NetBeans, and the Assets directory</title>
		<link>http://feedproxy.google.com/~r/YetAnotherProgrammingBlog/~3/MutO_kivm0A/</link>
		<comments>http://blog.yetisoftware.com/2009/04/02/android-netbeans-and-the-assets-directory/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 23:23:04 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://blog.yetisoftware.com/?p=169</guid>
		<description><![CDATA[Working on an Android app this week, I wanted to add some resources in the assets directory for use in a WebView as described in the SDK docs.  I loaded up my project in NetBeans with the cool nbandroid NetBeans plugin for Android development.  I built the application, loaded it up in the [...]]]></description>
			<content:encoded><![CDATA[<p>Working on an Android app this week, I wanted to add some resources in the assets directory for use in a WebView as described in the <a href="http://developer.android.com/reference/android/webkit/WebView.html">SDK docs</a>.  I loaded up my project in NetBeans with the cool <a href="http://kenai.com/projects/nbandroid">nbandroid</a> NetBeans plugin for Android development.  I built the application, loaded it up in the WebView, and&#8230;  File not found?</p>
<p>I found <a href="http://www.mail-archive.com/android-developers@googlegroups.com/msg11450.html">a</a> <a href="http://markmail.org/message/mnsauipeziu4bxbe#query:+page:1+mid:3abqt2ygl3xjmjy3+state:results">few</a> <a href="http://www.techjini.com/blog/2009/01/10/android-tip-1-contentprovider-accessing-local-file-system-from-webview-showing-image-in-webview-using-content/">posts</a> about WebView being unable to open local files, and the need to use a ContentProvider to get around the limitation.  Tried that, no luck.  So, I eventually expanded the .apk and&#8230;  No assets?</p>
<p><span id="more-169"></span></p>
<p>I found <a href="http://kenai.com/projects/nbandroid/forums/forum/topics/560-using-assets-with-nbandroid">this post</a> to the nbandroid forum from someone seeing the same issue, and tracked down the problem from there.  It turned out to be an issue in the build script generated by nbandroid, and the fix is quite simple.</p>
<p>To fix:</p>
<ol>
<li>Create a directory called &#8216;assets&#8217; at your project root (same dir that AndroidManifest.xml lives)</li>
<li>In <strong>/nbproject/project.properties</strong>, change
<pre style="padding-left: 30px;"><strong>assets.dir=</strong></pre>
<p>to</p>
<pre style="padding-left: 30px;"><strong>assets.dir=<span style="color: #ff6600;">assets</span></strong>
<strong>assets.available=<span style="color: #ff6600;">true</span></strong><strong></strong></pre>
</li>
<li>In <strong>/nbproject/build-impl.xml</strong>, there is line in the &#8220;if=assets.available&#8221; target that reads
<pre style="padding-left: 30px;"><span style="color: #0000ff;">&lt;arg <span style="color: #008000;">value<span style="color: #000000;">=</span></span><span style="color: #ff6600;">"${asset.dir}"</span>/&gt;
</span></pre>
<p>that needs to be changed to</p>
<pre style="padding-left: 30px;"><span style="color: #0000ff;">&lt;arg <span style="color: #008000;">value<span style="color: #000000;">=</span></span><span style="color: #ff6600;">"${assets.dir}"</span>/&gt;</span></pre>
</li>
</ol>
<p>That&#8217;s it &#8211; you should be all set and &#8220;file:///android_asset/&#8221; should be accessible to your application and contain the contents of your project&#8217;s assets directory.</p>
<img src="http://feeds.feedburner.com/~r/YetAnotherProgrammingBlog/~4/MutO_kivm0A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.yetisoftware.com/2009/04/02/android-netbeans-and-the-assets-directory/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.yetisoftware.com/2009/04/02/android-netbeans-and-the-assets-directory/</feedburner:origLink></item>
		<item>
		<title>Introducing YetiUp!</title>
		<link>http://feedproxy.google.com/~r/YetAnotherProgrammingBlog/~3/i3u1Z1QDGk0/</link>
		<comments>http://blog.yetisoftware.com/2009/03/20/introducing-yetiup/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 05:34:04 +0000</pubDate>
		<dc:creator>Deepak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[mms]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.yetisoftware.com/?p=161</guid>
		<description><![CDATA[Ever since I signed up for Facebook a few months ago I&#8217;ve been bummed that their &#8216;Mobile&#8217; application doesn&#8217;t support my carrier (T-Mobile). Since I&#8217;ve got a pretty basic phone (Nokia 6133), I couldn&#8217;t install a Facebook application on the device either. (For those not familiar with it, their Mobile app allows you to upload [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I signed up for Facebook a few months ago I&#8217;ve been bummed that their &#8216;Mobile&#8217; application doesn&#8217;t support my carrier (T-Mobile). Since I&#8217;ve got a pretty basic phone (Nokia 6133), I couldn&#8217;t install a Facebook application on the device either. (For those not familiar with it, their Mobile app allows you to upload photos, update your status and more from your phone)</p>
<p>Since I&#8217;d been meaning to experiment with the Facebook APIs anyway, I built an application that lets me do the basics from my phone. This is something that can be used by anyone with a camera phone, on pretty much any carrier (worldwide!).</p>
<p>Presenting <a href="http://www.facebook.com/apps/application.php?id=59253238538">YetiUp!</a> a simple application that lets you easily upload your camera phone pictures to a photo album on Facebook.</p>
<p>It is built using the excellent (though lacking in documentation) <a href="http://facebooker.rubyforge.org/">Facebooker rails plugin</a>, deployed to Dreamhost.</p>
<p>My wife &amp; I have already uploaded several photos that were previously just confined to our phones.</p>
<p>If you end up using the application, I&#8217;d love to hear your feedback!</p>
<img src="http://feeds.feedburner.com/~r/YetAnotherProgrammingBlog/~4/i3u1Z1QDGk0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.yetisoftware.com/2009/03/20/introducing-yetiup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.yetisoftware.com/2009/03/20/introducing-yetiup/</feedburner:origLink></item>
		<item>
		<title>Sinatra on Dreamhost</title>
		<link>http://feedproxy.google.com/~r/YetAnotherProgrammingBlog/~3/pbzaMf_xkpo/</link>
		<comments>http://blog.yetisoftware.com/2009/03/07/sinatra-on-dreamhost/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 06:02:40 +0000</pubDate>
		<dc:creator>Deepak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://blog.yetisoftware.com/?p=146</guid>
		<description><![CDATA[EDIT 2: My patch to the Sinatra Book has been accepted. The instructions below can now be found in the book itself.
EDIT : I&#8217;ve created a page on the dreamhost wiki that includes this information.
There is a lot of good information on how to run Sinatra on Dreamhost, but after following all the excellent advice, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>EDIT 2: <a href="http://github.com/sinatra/sinatra-book/commit/5dde570b5a3d441a7626304496931efaa1455808">My patch to the Sinatra Book</a> has been accepted. The instructions below can now be found in <a href="http://www.sinatrarb.com/book.html#deployment_passenger">the book itself</a>.</strong></p>
<p>EDIT : I&#8217;ve created a <a href="http://wiki.dreamhost.com/Sinatra">page on the dreamhost wiki </a>that includes this information.</p>
<p>There is a <a href="http://www.sinatrarb.com/book.html#deployment_passenger">lot</a> of <a href="http://www.gittr.com/index.php/archive/deploying-rack-apps-on-dreamhost-via-passenger-including-sinatra/">good</a> <a href="http://railstips.org/2008/12/15/deploying-sinatra-on-dreamhost-with-passenger">information</a> on how to run Sinatra on Dreamhost, but after following all the excellent advice, I still ended up with Passenger failing to start with the following error :</p>
<pre>can’t activate rack (&gt;= 0.9.1, &lt; 1.0, runtime), already activated rack-0.4.0</pre>
<p>Luckily, the solution was pretty easy.</p>
<p><span id="more-146"></span>After following the <a href="http://www.sinatrarb.com/book.html#installation">instructions</a> in the <a href="http://www.sinatrarb.com/book.html#deployment_passenger">Sinatra</a> book, all you need to do is configure where the Rack &amp; Sinatra gems are loaded from. I chose to load them directly from my local gem repository, as this eliminates an additional step of unpacking the gem.</p>
<p>Here is what my config.ru looks like.</p>
<pre style="padding-left: 30px;">require '/home/USERNAME/.gem/ruby/1.8/gems/rack-0.9.1/lib/rack.rb'
require '/home/USERNAME/.gem/ruby/1.8/gems/sinatra-0.9.1/lib/sinatra.rb'
require 'YOUR-APPLICATION'
log = File.new("log/sinatra.log", "w")
STDOUT.reopen(log)
STDERR.reopen(log)
run Sinatra::Application</pre>
<p>A quick touch tmp/restart.txt to restart Passenger, and there you have it! Sinatra and Dreamhost sitting in a tree..</p>
<p style="padding-left: 30px;">
<img src="http://feeds.feedburner.com/~r/YetAnotherProgrammingBlog/~4/pbzaMf_xkpo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.yetisoftware.com/2009/03/07/sinatra-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.yetisoftware.com/2009/03/07/sinatra-on-dreamhost/</feedburner:origLink></item>
		<item>
		<title>Running IE on your Mac in VirtualBox (for free!) revisited</title>
		<link>http://feedproxy.google.com/~r/YetAnotherProgrammingBlog/~3/y_x01IpOQjI/</link>
		<comments>http://blog.yetisoftware.com/2009/03/07/running-ie-on-your-mac-in-virtualbox/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 17:32:57 +0000</pubDate>
		<dc:creator>Deepak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://blog.yetisoftware.com/?p=78</guid>
		<description><![CDATA[I&#8217;ve been developing a few rails applications recently and wanted to test them in IE. A quick google search turned up this excellent article. While that writeup (and its comments) has some excellent content, it is a little dated. Thanks to advances in VirtualBox, I was also able to reduce the number of steps required.
This [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been developing a few rails applications recently and wanted to test them in IE. A quick google search turned <a href="http://blog.mozmonkey.com/2008/vpc-ie6-ie7-ie8-on-mac-os-x/">up this excellent article</a>. While that writeup (and its comments) has some excellent content, it is a little dated. Thanks to advances in VirtualBox, I was also able to reduce the number of steps required.</p>
<p>This procedure still isn&#8217;t for the tech savvy. You will encounter a Windows blue screen of death for example, and have to use the command prompt, but hopefully it&#8217;ll be worth it in the end.</p>
<p>What I wanted to achieve is the ability to test my site using licensed versions of IE6, IE7 &amp; IE8, on my Mac, <strong>for free</strong>.  As it turns out, Microsoft supplies free VirtualPC images &#8220;for testing websites with different IE versions on Windows XP SP2, Windows XP SP3 and Windows Vista&#8221;. Sweet!.  <span id="more-78"></span></p>
<h2><strong>Downloads</strong></h2>
<p>You&#8217;ll need to download a few things :</p>
<ul>
<li><a href="http://www.virtualbox.org/wiki/Downloads">VirtualBox</a>, an excellent free desktop virtualization solution from Sun. Follow the installation instructions.</li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;displaylang=en#filelist">A VPC image</a>. Don&#8217;t let the fact that the download is an exe deter you.</li>
<li><a href="http://www.zipeg.com/">Zipeg</a> to extract the image(s) you download.</li>
</ul>
<h2><strong>Steps</strong></h2>
<h3><strong>Extract the VHD file<br />
</strong></h3>
<ul>
<li>Rename the .exe image you downloaded to .zip</li>
<li>Open Zipeg and extract the zip file. Of the contents of the zip, the only file you need is the .VHD file. I&#8217;m extracting it to a VirtualBox specific location, but this could be any folder on your system. This takes a few minutes on my MacBook.</li>
</ul>
<div id="attachment_92" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/zipeg-extract.png"><img class="size-medium wp-image-92" title="zipeg-extract" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/zipeg-extract-300x139.png" alt="Extract the image" width="300" height="139" /></a><p class="wp-caption-text">Extract the image</p></div>
<h3>Setup VirtualBox</h3>
<ul>
<li>Start VirtualBox and create a new virtual machine</li>
</ul>
<div id="attachment_94" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-1.png"><img class="size-medium wp-image-94" title="new-vm-1" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-1-300x265.png" alt="Getting started" width="300" height="265" /></a><p class="wp-caption-text">Getting started</p></div>
<div id="attachment_95" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-2.png"><img class="size-medium wp-image-95" title="new-vm-2" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-2-300x265.png" alt="Naming VM" width="300" height="265" /></a><p class="wp-caption-text">Give the VM a name</p></div>
<div id="attachment_96" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-3.png"><img class="size-medium wp-image-96" title="new-vm-3" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-3-300x265.png" alt="Configure RAM" width="300" height="265" /></a><p class="wp-caption-text">Give the VM some RAM</p></div>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-4.png"><img class="size-medium wp-image-97" title="new-vm-4" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-4-300x265.png" alt="Configure the hard disk, choose &quot;Existing&quot; here" width="300" height="265" /></a><p class="wp-caption-text">Configure the hard disk, choose &quot;Existing&quot; here</p></div>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-5.png"><img class="size-medium wp-image-98" title="new-vm-5" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-5-300x267.png" alt="Select the VHD you extracted in the first step" width="300" height="267" /></a><p class="wp-caption-text">Select &quot;Add&quot; and then choose the VHD you extracted in the first step</p></div>
<div id="attachment_100" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-7.png"><img class="size-medium wp-image-100" title="new-vm-7" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/new-vm-7-300x265.png" alt="You are done! Click Finish, and then Start the newly created VM" width="300" height="265" /></a><p class="wp-caption-text">You are done! Click Finish, and then Start the newly created VM</p></div>
<h3>Get past the Windows Blue Screen of Death (BSOD)</h3>
<ul>
<li>At first boot, you&#8217;ll likely encounter the infamous BSOD. Here is how you get around it. As soon as you start the VM, press <strong>fn + F8.</strong> That&#8217;ll bring up this options menu<span style="text-decoration: underline;"><strong><br />
</strong></span></li>
</ul>
<div id="attachment_113" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/picture-1.png"><img class="size-medium wp-image-113" title="safe-mode" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/picture-1-300x196.png" alt="Select Safe mode with Command Prompt" width="300" height="196" /></a><p class="wp-caption-text">Select Safe mode with Command Prompt</p></div>
<ul>
<li>You get around the BSOD by renaming the file that is causing the error, in this case processor.sys. (You&#8217;ll likely encounter a number of &#8220;Files needed&#8221; and &#8220;Found new hardware wizard&#8221; dialog boxes, I just kept pressing cancel until I go to the command prompt)</li>
</ul>
<div id="attachment_91" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/02/start-vm-5.png"><img class="size-medium wp-image-91" title="start-vm-5" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/start-vm-5-300x252.png" alt="Rename processor.sys" width="300" height="252" /></a><p class="wp-caption-text">Rename processor.sys and then restart the machine.</p></div>
<ul>
<li>After a restart, you&#8217;ll finally be rewarded with a Windows desktop, and presented with the EULA. You&#8217;ll also still run into a number of &#8220;Files needed&#8221; and &#8220;Found new hardware wizard&#8221; dialog boxes. Keep canceling them.</li>
</ul>
<h3>Install VirtualBox Guest Additions</h3>
<ul>
<li>With your VM running, select <strong>Devices &gt; Install Guest Additions</strong>, and follow the wizard. Select <strong>Continue Anyway</strong> when prompted. Finish the install, and select the option to reboot later.</li>
</ul>
<h3>Configure Networking</h3>
<ul>
<li>Finally, we need to get networking working. While VirtualBox used to ship with Windows XP drivers for their network interface, they don&#8217;t seem to be included in the guest additions any more (As of 2.1.4?)</li>
<li>On your Mac, type the following commands into the terminal to download the drivers from AMD</li>
</ul>
<pre>      $ mkdir VirtualBoxShares
      $ cd VirtualBoxShares
      $ wget http://www.amd.com/us-en/assets/content_type/utilities/V4.51.zip
      $ unzip V4.51.zip -d driver</pre>
<ul>
<li>Configure sharing so that you can access the afore extracted drivers from the windows VM.</li>
</ul>
<div id="attachment_117" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/configure-share-1.png"><img class="size-medium wp-image-117" title="configure-share-1" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/configure-share-1-300x227.png" alt="With the VM running, select &quot;Devices &gt; Shared Folders&quot; to bring up this dialog" width="300" height="227" /></a><p class="wp-caption-text">With the VM running, select &quot;Devices &gt; Shared Folders&quot; to bring up this dialog</p></div>
<div id="attachment_118" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/configure-share-2.png"><img class="size-medium wp-image-118" title="configure-share-2" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/configure-share-2-300x207.png" alt="Point this at the VirtualBoxShares directory you made earlier" width="300" height="207" /></a><p class="wp-caption-text">Point this at the VirtualBoxShares directory you made earlier</p></div>
<div id="attachment_119" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/configure-share-3.png"><img class="size-medium wp-image-119" title="configure-share-3" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/configure-share-3-300x227.png" alt="Press OK to complete the sharing" width="300" height="227" /></a><p class="wp-caption-text">Press OK to complete the sharing</p></div>
<ul>
<li>In the Windows VM, Click <strong>Start</strong>, click <strong>Control Panel</strong>, click <strong>Performance and Maintenance</strong>, and then click <strong>System</strong>.</li>
<li>On the <strong>Hardware</strong> tab, click <strong>Device Manager</strong>.</li>
</ul>
<div id="attachment_120" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-1.png"><img class="size-medium wp-image-120" title="networking-1" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-1-300x247.png" alt="Device Manager. " width="300" height="247" /></a><p class="wp-caption-text">Device Manager. </p></div>
<div id="attachment_121" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-2.png"><img class="size-medium wp-image-121" title="networking-2" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-2-300x247.png" alt="networking-2" width="300" height="247" /></a><p class="wp-caption-text">Right-click on the Ethernet Controller and select Update Driver...</p></div>
<div id="attachment_122" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-3.png"><img class="size-medium wp-image-122" title="networking-3" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-3-300x247.png" alt="Don't connect to windows update (since we don't have a network yet!)" width="300" height="247" /></a><p class="wp-caption-text">Don&#39;t connect to windows update (since we don&#39;t have a network yet!)</p></div>
<div id="attachment_123" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-4.png"><img class="size-medium wp-image-123" title="networking-4" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-4-300x247.png" alt="We'll tell it where to find the AMD drivers" width="300" height="247" /></a><p class="wp-caption-text">We&#39;ll tell it where to find the AMD drivers</p></div>
<div id="attachment_124" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-5.png"><img class="size-medium wp-image-124" title="networking-5" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-5-300x247.png" alt="Select &quot;Include this location in the search&quot; and then &quot;Browse&quot;" width="300" height="247" /></a><p class="wp-caption-text">Select &quot;Include this location in the search&quot; and then &quot;Browse&quot;</p></div>
<div id="attachment_125" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-6.png"><img class="size-medium wp-image-125" title="networking-6" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-6-300x247.png" alt="Browse to the location of the shared folder. " width="300" height="247" /></a><p class="wp-caption-text">Browse to the location of the shared folder. </p></div>
<div id="attachment_126" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-7.png"><img class="size-medium wp-image-126" title="networking-7" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-7-300x247.png" alt="Getting closer!" width="300" height="247" /></a><p class="wp-caption-text">Getting closer!</p></div>
<div id="attachment_128" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-9.png"><img class="size-medium wp-image-128" title="networking-9" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/networking-9-300x247.png" alt="Networking is configured!" width="300" height="247" /></a><p class="wp-caption-text">Networking is configured!</p></div>
<ul>
<li>Finally, launch IE, and ensure you&#8217;ve got connectivity.</li>
</ul>
<div id="attachment_129" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.yetisoftware.com/wp-content/uploads/2009/03/wohoo.png"><img class="size-medium wp-image-129" title="wohoo" src="http://blog.yetisoftware.com/wp-content/uploads/2009/03/wohoo-300x247.png" alt="Sweet success!" width="300" height="247" /></a><p class="wp-caption-text">Sweet Success!</p></div>
<h2>Summary</h2>
<p>An hour or two of tedium is rewarded with a functional Windows VM, one on which you can browser test to your hearts content. Hopefully  my outlining of the steps will allow you to get through it quickly and with minimum frustration!</p>
<p>I should note I haven&#8217;t tried this process with the Vista VPC images yet, so would love to hear your feedback if you have.</p>
<img src="http://feeds.feedburner.com/~r/YetAnotherProgrammingBlog/~4/y_x01IpOQjI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.yetisoftware.com/2009/03/07/running-ie-on-your-mac-in-virtualbox/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		<feedburner:origLink>http://blog.yetisoftware.com/2009/03/07/running-ie-on-your-mac-in-virtualbox/</feedburner:origLink></item>
		<item>
		<title>Receiving emails in Rails using Gmail &amp; IMAP, while staying efficient and RESTful.</title>
		<link>http://feedproxy.google.com/~r/YetAnotherProgrammingBlog/~3/OiAbw1IqVos/</link>
		<comments>http://blog.yetisoftware.com/2009/02/07/receiving-emails-in-rails-using-gmail-imap-rest/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 21:35:27 +0000</pubDate>
		<dc:creator>Deepak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionmailer]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tmail]]></category>

		<guid isPermaLink="false">http://blog.yetisoftware.com/?p=17</guid>
		<description><![CDATA[For a recent project I had a need to receive emails (actually MMSs, but that&#8217;ll be the subject of a future post) in a Rails application. My requirements for the solution were:

Shouldn&#8217;t require root access: I&#8217;m deploying this app to a shared hosting service on which I don&#8217;t have root.
Shouldn&#8217;t require firing up the Rails [...]]]></description>
			<content:encoded><![CDATA[<p>For a recent project I had a need to receive emails (actually MMSs, but that&#8217;ll be the subject of a future post) in a Rails application. My requirements for the solution were:</p>
<ol>
<li><em>Shouldn&#8217;t require root access</em>: I&#8217;m deploying this app to a shared hosting service on which I don&#8217;t have root.</li>
<li><em>Shouldn&#8217;t require firing up the Rails stack for every incoming email</em>: A number of the solutions I came across use this method. Seems awfully inefficient, especially if you expect to receive lots of messages. Since I&#8217;ve already got a running rails application, why not just create a new service/controller in it?</li>
<li><em>Can be scheduled to run automatically</em>: Pretty obvious. I want to be able to retrieve messages periodically.</li>
</ol>
<p>There is already a lot of information out there on how to achieve parts of these requirements, including <a href="http://wiki.rubyonrails.org/rails/pages/HowToReceiveEmailsWithActionMailer">the Rails wiki</a>, <a href="http://railstips.org/2008/10/27/using-gmail-with-imap-to-receive-email-in-rails">Rails Tips</a> and <a href="http://blog.craigambrose.com/past/2008/2/9/respond_toemail_or_how_to_handle">Craig&#8217;s writeup</a>. My solution is really just piecing together bits of each.  Here&#8217;s a high level overview of the components in my solution :</p>
<div id="attachment_60" class="wp-caption aligncenter" style="width: 509px"><img class="size-full wp-image-60" title="Components" src="http://blog.yetisoftware.com/wp-content/uploads/2009/02/components1.png" alt="High level overview of components and desired interaction" width="499" height="245" /><p class="wp-caption-text">High level overview of components and desired interaction</p></div>
<p><span id="more-17"></span></p>
<p><strong>Mail Poller</strong>:</p>
<p>This is the component responsible for :</p>
<ul>
<li>Connecting to the email provider (Gmail)</li>
<li>Downloading new emails</li>
<li>Posting contents of new emails to the Rails app.</li>
</ul>
<p>I started by creating a new ruby script in <code>RAILS_ROOT/script/</code> called <code>mail_poller</code>. This is based heavily on the <a href="http://railstips.org/2008/10/27/using-gmail-with-imap-to-receive-email-in-rails">script by John at RailsTips</a></p>
<pre>#!/usr/bin/env ruby
require 'net/imap'
require 'net/http'
require 'rubygems'
require 'logger'

config = YAML.load(File.read(File.join(File.dirname(__FILE__), '..', 'config', 'mail.yml')))
log = Logger.new(STDOUT)

begin
  imap = Net::IMAP.new(config['host'], config['port'], true)
  imap.login(config['username'], config['password'])

  # select inbox as our mailbox to process
  imap.select('Inbox')
  # get all emails that are in inbox that have not been deleted
  imap.uid_search(["NOT", "DELETED"]).each do |uid|
    # fetches the straight up source of the email
    source   = imap.uid_fetch(uid, 'RFC822').first.attr['RFC822']
    # Post the email to the Rails app's restful service
    res = Net::HTTP.post_form(URI.parse(config['service_url']), {'email'=&gt; source})
    case res
      when Net::HTTPSuccess, Net::HTTPRedirection
        # OK
      else
        res.error!
    end
    # Delete the email
    imap.uid_store(uid, "+FLAGS", [:Deleted])
  end

  # expunge removes the deleted emails
  imap.expunge
  imap.logout

  # NoResponseError and ByResponseError happen often when imap'ing
  rescue Net::IMAP::NoResponseError =&gt; e
    # Log if you'd like
  rescue Net::IMAP::ByeResponseError =&gt; e
    # Log if you'd like
  rescue =&gt; e
    log.warn e
end</pre>
<p>This script relies on a <code>RAILS_ROOT/config/mail.yml</code> script for configuration of mail server, username, password etc. Here&#8217;s a sample of that config file. It is pretty ugly, and needs to be refactored to be environment aware. Perhaps I&#8217;ll update this post once I&#8217;ve refactored it. The username &amp; password in the service_url are explained in the &#8220;Mail Controller&#8221; section below.</p>
<pre>host: 'imap.gmail.com'
port: '993'
username: 'your.address@gmail.com'
password: 'your password'
service_url: 'http://admin:pass@localhost/admin/incoming'</pre>
<p>I like this solution over a postfix/sendmail/qmail/et all solution because it keeps the logic of fetching mail &#8216;close&#8217; to my application. What does that mean? If I needed to deploy my application to a new host, I wouldn&#8217;t have to reconfigure an MTA on that host. It also has the added benefit of not requiring sudo/root privs.</p>
<p><strong>Mail Poller Scheduler:</strong></p>
<p>Since this is running on *nix systems, cron is a well vetted, ubiquitous solution. Creating a cron job to run our mail poller every minute is easy. Add the following to your crontab entry (crontab -e). Replace the full path to ruby with what is correct for your system (a &#8216;which ruby&#8217; command should give you the  path you need). Replace RAILS_ROOT with the full path to your rails application.</p>
<pre>* * * * * /opt/local/bin/ruby RAILS_ROOT/script/mail_poller &gt;&gt; RAILS_ROOT/log/mail_poller.log</pre>
<p>This will ask cron to invoke the mail_poller script every minute, and redirect STDOUT to the &#8216;mail_poller.log&#8217; log file.</p>
<p><strong>Mail Controller:</strong></p>
<p>This is the last piece in the puzzle. It is invoked via a POST when the poller retrieves a new email. In my case, the controller is namespaced to an /admin/ area which is password protected, thus the need for the username &amp; password in the service_url above.</p>
<p>Lets start of with my <code>routes.rb</code></p>
<pre>  ...
  map.namespace :admin do |admin|
    admin.resource :incoming,  <img src='http://blog.yetisoftware.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly =&gt; [:create]
  end
  ...</pre>
<p>This creates the folowing route :</p>
<pre>admin_incoming POST   /admin/incoming                  {:controller=&gt;"admin/incomings", :action=&gt;"create"}</pre>
<p>My controller looks like this :</p>
<pre>class Admin::IncomingsController &lt; ApplicationController
  before_filter :admin_required
  skip_before_filter :verify_authenticity_token  

  # Being invoked as a POST from the mail_poller
  def create
    mail = TMail::Mail.parse(params[:email])
    # Do stuff with the mail object
    ...
  end
end</pre>
<p>I&#8217;m using TMail to parse the email (which is also used by ActionMailer&#8217;s receive method). Once you&#8217;ve got the mail object parsed, you can process away at will. There are plenty of examples out there on how to walk through the email looking for what you want.</p>
<p><strong>Acknowledgments</strong>:</p>
<p>As mentioned above, this solution is heavily based on the following resources. Many thanks to the folks behind that information</p>
<ul>
<li><a href="http://wiki.rubyonrails.org/rails/pages/HowToReceiveEmailsWithActionMailer">Rails wiki</a></li>
<li><a href="http://railstips.org/2008/10/27/using-gmail-with-imap-to-receive-email-in-rails">Rails Tips</a></li>
<li><a href="http://blog.craigambrose.com/past/2008/2/9/respond_toemail_or_how_to_handle">Craig&#8217;s writeup</a></li>
</ul>
<p><strong>Summary:</strong></p>
<p>I really like the simplicity &amp; separation of concerns this solution provides. The poller is pretty &#8216;dumb&#8217;, i.e. it doesn&#8217;t have any application logic (does nothing with the contents of the email), and it doesn&#8217;t have any timer/sleep logic. The application logic is relegated to the <em>already running</em> rails application. The timer logic is relegated to the old stalwart, cron.</p>
<p>I&#8217;d love to hear your thoughts on this approach. Post a comment below and let me know what you think.</p>
<img src="http://feeds.feedburner.com/~r/YetAnotherProgrammingBlog/~4/OiAbw1IqVos" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.yetisoftware.com/2009/02/07/receiving-emails-in-rails-using-gmail-imap-rest/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://blog.yetisoftware.com/2009/02/07/receiving-emails-in-rails-using-gmail-imap-rest/</feedburner:origLink></item>
		<item>
		<title>Does the iPhone support…?</title>
		<link>http://feedproxy.google.com/~r/YetAnotherProgrammingBlog/~3/vNydX96Vy3I/</link>
		<comments>http://blog.yetisoftware.com/2009/01/28/does-the-iphone-support/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 05:47:29 +0000</pubDate>
		<dc:creator>Deepak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[waste of time]]></category>

		<guid isPermaLink="false">http://blog.yetisoftware.com/?p=5</guid>
		<description><![CDATA[I recently got stuck in really bad traffic on 520 on my way to work. Bored, and moving at exactly 0 MPH, I sent my boss a picture message of the parking lot the bridge had become as a way of telling him I&#8217;d be late. When I got to work, I discovered that his [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got stuck in <em><strong>really</strong></em> bad traffic on 520 on my way to work. Bored, and moving at exactly 0 MPH, I sent my boss a picture message of the parking lot the bridge had become as a way of telling him I&#8217;d be late. When I got to work, I discovered that his phone didn&#8217;t actually receive the picture! He did get a message from me, but absent the photo. What&#8217;s this you say? A phone that is incapable of receiving an MMS? It is 2009 after all! What kind of back assward phone does he have? Wait for it.. wait for it..  an iPhone of course!</p>
<p>Did you know the iPhone doesn&#8217;t support MMS? I didn&#8217;t until this incident. It doesn&#8217;t support copy &#038; paste either! I love me some apple action (all 3 computers in this house are Macs), but come on Apple! Pretty basic features don&#8217;t ya think?</p>
<p>Short story long, that is what inspired me to create :</p>
<p>Does the iPhone support MMS?  : <a href="http://doestheiphonesupportmmsyet.com/" target="_self">http://doestheiphonesupportmmsyet.com/</a></p>
<p>Does the iPhone support copy &#038; paste? : <a href="http://doestheiphonesupportcopyandpasteyet.com/" target="_self">http://doestheiphonesupportcopyandpasteyet.com/</a></p>
<p>Enjoy!</p>
<img src="http://feeds.feedburner.com/~r/YetAnotherProgrammingBlog/~4/vNydX96Vy3I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.yetisoftware.com/2009/01/28/does-the-iphone-support/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.yetisoftware.com/2009/01/28/does-the-iphone-support/</feedburner:origLink></item>
	</channel>
</rss>
