<?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>riney.blog v2 &#187; riney</title>
	<atom:link href="http://rineysoft.com/blog/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://rineysoft.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 29 Dec 2011 23:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>worklog 12/28</title>
		<link>http://rineysoft.com/blog/2011/12/worklog-1228/</link>
		<comments>http://rineysoft.com/blog/2011/12/worklog-1228/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 01:22:29 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[worklog]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1461</guid>
		<description><![CDATA[Inaugural work in the new garage workshop! Nothing major, just drilled the jackplate for the marquee, and installed the power connector. I also put another coat of poly on the frame. Looks shiny! On the 3D printer front, I got &#8230; <a href="http://rineysoft.com/blog/2011/12/worklog-1228/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Inaugural work in the new garage workshop! Nothing major, just drilled the jackplate for the marquee, and installed the power connector. I also put another coat of poly on the frame. Looks shiny!</p>
<div id="attachment_1462" class="wp-caption alignnone" style="width: 594px"><a href="http://rineysoft.com/blog/2011/12/worklog-1228/img_20111228_193655/" rel="attachment wp-att-1462"><img src="http://rineysoft.com/blog/wp-content/uploads/2011/12/IMG_20111228_193655-1024x768.jpg" alt="" title="IMG_20111228_193655" width="584" height="438" class="size-large wp-image-1462" /></a><p class="wp-caption-text">jackplate and power connector</p></div>
<p>On the 3D printer front, I got the heated bed PCB soldered and installed the endstop switches. Soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2011/12/worklog-1228/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tickertweet</title>
		<link>http://rineysoft.com/blog/2011/09/tickertweet/</link>
		<comments>http://rineysoft.com/blog/2011/09/tickertweet/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 00:49:00 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1445</guid>
		<description><![CDATA[When the east coast earthquake hit a little while ago, I found out about it first from a tweet, followed up by an IM from a friend in Brooklyn, followed up 10 minutes or so later by Google News. I &#8230; <a href="http://rineysoft.com/blog/2011/09/tickertweet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When the east coast earthquake hit a little while ago, I found out about it first from a tweet, followed up by an IM from a friend in Brooklyn, followed up 10 minutes or so later by Google News. I thought it would be neat to have a way to call attention to important events. Inspired by old-fashioned ticker tapes, I put together some code to print specified Twitter updates in near-real-time to a thermal printer. More details in the video:</p>
<p><iframe width="560"  height="315" src="http://www.youtube.com/embed/RQrhODI4PVM" frameborder="0" allowfullscreen></iframe></p>
<p><a href="http://www.flickr.com/photos/riney/6198402705/in/photostream"><img src="http://farm7.static.flickr.com/6161/6198402705_eda7e906e0.jpg" alt="sample of the tweet output" /></a></p>
<p>The tweets are fetched using the <a href="http://twitter.rubyforge.org/">twitter Ruby gem</a>, rendered into a PBM image with <a href="http://rmagick.rubyforge.org/">rmagick</a>, and printed via the <a href="http://freelabs.com/~whitis/software/pbm2lwxl/">pbm2lwxl</a> library. I&#8217;ll put the code up on github after a little cleanup. As an upgrade, I&#8217;m setting up the software to run on a NSLU2 single-board computer, so the printer doesn&#8217;t have to be tethered to my desktop. More on that in a bit!</p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2011/09/tickertweet/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>kick off your shoes</title>
		<link>http://rineysoft.com/blog/2011/01/kick-off-your-shoes/</link>
		<comments>http://rineysoft.com/blog/2011/01/kick-off-your-shoes/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 23:40:56 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1443</guid>
		<description><![CDATA[Video showing the results of the little Christmas-vacation hackathon Beeland and I did: Code posted here: https://github.com/riney/g35_arduino_marquee Hackaday blog coverage (w00t!) here: http://hackaday.com/2011/01/11/scrolling-marquee-made-from-ge-christmas-lights/]]></description>
			<content:encoded><![CDATA[<p>Video showing the results of the little Christmas-vacation hackathon Beeland and I did:</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/WbtTBSTp0hk?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WbtTBSTp0hk?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p>Code posted here:<br />
<a href="https://github.com/riney/g35_arduino_marquee">https://github.com/riney/g35_arduino_marquee</a></p>
<p>Hackaday blog coverage (w00t!) here:<br />
<a href="http://hackaday.com/2011/01/11/scrolling-marquee-made-from-ge-christmas-lights/">http://hackaday.com/2011/01/11/scrolling-marquee-made-from-ge-christmas-lights/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2011/01/kick-off-your-shoes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>i spell &#8220;w3rd&#8221; with a three</title>
		<link>http://rineysoft.com/blog/2010/10/i-spell-w3rd-with-a-three/</link>
		<comments>http://rineysoft.com/blog/2010/10/i-spell-w3rd-with-a-three/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 06:15:35 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[guns]]></category>
		<category><![CDATA[halloween]]></category>
		<category><![CDATA[liquor]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1437</guid>
		<description><![CDATA[Saying &#8220;hello, abandoned blog&#8221; seems kind of stupid when my post ratio is approximately one post every year and a half, so let&#8217;s just skip past that. Some notes: I went to Bass Pro Shops today, looking for a suitable &#8230; <a href="http://rineysoft.com/blog/2010/10/i-spell-w3rd-with-a-three/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Saying &#8220;hello, abandoned blog&#8221; seems kind of stupid when my post ratio is approximately one post every year and a half, so let&#8217;s just skip past that. Some notes:</p>
<ul>
<li>I went to Bass Pro  Shops today, looking for a suitable holster for my <a href="http://realdealbrazil.com/zombieland-tallahassee-costume.asp">Halloween costume</a>. That store might just be the best reason I&#8217;ve found so far for Texas to exist at all. They are <em>incredibly</em> enthusiastic to throw a gun in your hand. No exaggeration; upon approaching the handgun counter, the gentleman behind it said &#8220;Well, howdy, tall feller! What can I put in your hand?&#8221;
<p>This is a line that is only appropriate at either gun shops or gay bathhouses.</p>
<p>I&#8217;m actually a pretty big gun fan. I find them technically interesting &#8211; you get to hold, in a convenient, handheld package, the cumulative result of several thousand years of applied technological development. Plus, shooting is fun &#8211; you have to relax, concentrate, and zone out a bit to shoot well, which is oddly similar to coding&#8230;</p>
<p>Anyway, I looked at a few <a href="http://en.wikipedia.org/wiki/M1911_pistol">M1911 pistols</a>. There was a Taurus, which was <a href="http://www.taurususa.com/product-details.cfm?id=608&#038;category=Pistol&#038;toggle=&#038;breadcrumbseries=19">attractive but cheaply made</a>, and a Sig Sauer, which was <a href="http://www.sigsauer.com/Products/ShowCatalogProductDetails.aspx?categoryid=25&#038;productid=99">far, far nicer</a>. I was hoping to get a look at a <a href="http://www.springfield-armory.com/armory.php?model=7">Springfield Armory Mil-Spec</a> and <a href="http://www.smith-wesson.com/webapp/wcs/stores/servlet/Product4_750001_750051_764907_-1_757754_757752_757751_ProductDisplayErrorView_Y">Smith and Wesson&#8217;s version</a>, but no luck. Both of those are far closer to the original GI version, which strikes me as a good thing &#8211; why add rails and gizmos to a fantastic design that has survived since WWI&#8230;</li>
<li>What&#8217;s also fun? Booze. Know where I&#8217;m never going to get any again? <a href="http://maps.google.com/maps/place?um=1&#038;ie=UTF-8&#038;q=dallas+liquor+store&#038;fb=1&#038;gl=us&#038;hq=liquor+store&#038;hnear=Dallas,+TX&#038;cid=44692828281361112">Dallas Liquor Store</a>, located at 2121 Main St # 102, just past the new Main Street Garden park. When I went in, there were two homeless people sitting on crates INSIDE THE SHOP harassing customers (i.e. me). And the guy working there didn&#8217;t seem particularly bothered by this. FAIL.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2010/10/i-spell-w3rd-with-a-three/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>why i hate apartment living</title>
		<link>http://rineysoft.com/blog/2010/08/why-i-hate-apartment-living/</link>
		<comments>http://rineysoft.com/blog/2010/08/why-i-hate-apartment-living/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 05:23:55 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apartment]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1433</guid>
		<description><![CDATA[It&#8217;s 12:15 AM. I&#8217;m hungry. I&#8217;m hungry because I&#8217;ve been working on DragonCon stuff for hours, and I&#8217;ve forgotten to eat. So I go to toss together some basic subsistence food (pasta, canned sauce, mystery meat from the freezer, and &#8230; <a href="http://rineysoft.com/blog/2010/08/why-i-hate-apartment-living/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s 12:15 AM. I&#8217;m hungry. I&#8217;m hungry because I&#8217;ve been working on DragonCon stuff for hours, and I&#8217;ve forgotten to eat. So I go to toss together some basic subsistence food (pasta, canned sauce, mystery meat from the freezer, and frozen vegetables). Fine. Here&#8217;s the problem, though. Last time I cooked, I used some oil. If you cook with oil, some of the oil gets on stuff, like your other stove burners. Normally you don&#8217;t give a damn. You can try to clean it off, but no amount of scrubbing will keep the burners from smoking, at least a little bit, when you turn them on. Normally, again, you don&#8217;t give a damn. But the smoke detectors in my apartment are so hyper-sensitive that making toast is enough to set them off.</p>
<p>Not burning toast. Making toast. And my toaster&#8217;s clean, don&#8217;t ask.</p>
<p>So now what I&#8217;m doing is, with all the windows open, and with every fan I can find blowing toward them, gently throttling each burner, one at a time, for brief intervals, and hoping that the slight tendrils of smoke generated aren&#8217;t enough to start the screeching wail of the alarms. We&#8217;re not talking a kitchen full of smoke, here. We&#8217;re talking wisps. WISPS! I know it&#8217;s an old building and all, but jeez. If the alarms don&#8217;t clear in a minute or so, the whole BUILDING&#8217;S alarm goes off, the fire department comes out, everybody evacuates. It&#8217;s happened five or six times since I&#8217;ve been here. Not caused by me, thank goodness.</p>
<p>So I wait, daring the alarms to go off.</p>
<p>And I&#8217;m really really hungry, dammit!</p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2010/08/why-i-hate-apartment-living/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>never as complicated as I wanted to be</title>
		<link>http://rineysoft.com/blog/2010/06/never-as-complicated-as-i-wanted-to-be/</link>
		<comments>http://rineysoft.com/blog/2010/06/never-as-complicated-as-i-wanted-to-be/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 02:56:38 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dragoncon]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[nintendo]]></category>
		<category><![CDATA[vlog]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1425</guid>
		<description><![CDATA[Dear abandoned blog, here are some videos: This is the video I made at DragonCon last year. I never posted it here. It might give you an idea what a big science fiction convention is about. Or it might give &#8230; <a href="http://rineysoft.com/blog/2010/06/never-as-complicated-as-i-wanted-to-be/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Dear abandoned blog, here are some videos:</p>
<p>This is the video I made at DragonCon last year. I never posted it here. It might give you an idea what a big science fiction convention is about. Or it might give you an idea how weird my friends and I are. Or it might give you some other ideas altogether! Best of luck with that. It&#8217;s probably what you&#8217;d call &#8220;not safe for work&#8221;, mostly due to cussin&#8217;.<br />
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/9t1ZqiqRex8&#038;hl=en_US&#038;fs=1&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9t1ZqiqRex8&#038;hl=en_US&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>Second, here&#8217;s a neat video wherein I play with thermal conduction. It&#8217;s just *slightly* more interesting than it sounds.</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/F8Cgkdm9tZk&#038;hl=en_US&#038;fs=1&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/F8Cgkdm9tZk&#038;hl=en_US&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>From E3 today, a teaser trailer from Portal 2:<br />
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Y-AeHxUbDn0&#038;hl=en_US&#038;fs=1&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Y-AeHxUbDn0&#038;hl=en_US&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>Something that always blows my mind about Valve games is the excruciating emphasis on storytelling. The *first line* of this trailer tells you a number of things about the game &#8211;  &#8220;It&#8217;s been a long time.&#8221; GLaDOS, as we all know, is <a href="http://www.youtube.com/watch?v=-8JatlRwd0s">Still Alive</a> &#8211; and she sounds dark. Angry. Serious. This is gonna be a helluva game.</p>
<p>Other E3 goodness &#8211; a new <a href="http://kotaku.com/5564377/kid-icarus-3ds-screenshots/gallery/">Kid Icarus</a>! A new <a href="http://kotaku.com/5564422/star-fox-returns-on-the-3ds/gallery/">StarFox</a>! A new <a href="http://kotaku.com/5564546/pilotwings-returns-on-the-3ds">PilotWings</a> for crap&#8217;s sake! By any definition, Nintendo killed it in their announcements today. Epic Mickey, alone, might sell me a Wii.</p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2010/06/never-as-complicated-as-i-wanted-to-be/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>snowpocalypse: dallas</title>
		<link>http://rineysoft.com/blog/2010/02/snowpocalypse-dallas/</link>
		<comments>http://rineysoft.com/blog/2010/02/snowpocalypse-dallas/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:55:56 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[snow dallas vlog]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/2010/02/snowpocalypse-dallas/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/grp81sISSW0&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/grp81sISSW0&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2010/02/snowpocalypse-dallas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>no-one flies around the sun</title>
		<link>http://rineysoft.com/blog/2010/01/no-one-flies-around-the-sun/</link>
		<comments>http://rineysoft.com/blog/2010/01/no-one-flies-around-the-sun/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 06:58:21 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apartment]]></category>
		<category><![CDATA[dallas]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1416</guid>
		<description><![CDATA[Almost, almost there. Posted some pics of the ongoing apartment organizational project. It&#8217;s made easier by the fact that it&#8217;s not, for example, raining in my bedroom (many sympathies to @DarthRachel). But it still has far, far to go.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/riney/sets/72157623286118440/"><img src="http://farm5.static.flickr.com/4003/4305187347_17ef55e3d0.jpg" alt="IMG_0643" width="500" height="375" border="0" /><br />
</a><br />
Almost, almost there. Posted some pics of the ongoing apartment organizational project. It&#8217;s made easier by the fact that it&#8217;s not, for example, raining in my bedroom (many sympathies to @DarthRachel). But it still has far, far to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2010/01/no-one-flies-around-the-sun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>untrustworthy hashes in ruby</title>
		<link>http://rineysoft.com/blog/2010/01/untrustworthy-hashes-in-ruby/</link>
		<comments>http://rineysoft.com/blog/2010/01/untrustworthy-hashes-in-ruby/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 23:02:50 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1394</guid>
		<description><![CDATA[I ran into one of those annoying bugs where a couple different things conspired to have an annoying result. We use GMail at the moment as our SMTP server, and we put all sorts of automated notifications through it. GMail &#8230; <a href="http://rineysoft.com/blog/2010/01/untrustworthy-hashes-in-ruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I ran into one of those annoying bugs where a couple different things conspired to have an annoying result. We use GMail at the moment as our SMTP server, and we put all sorts of automated notifications through it. GMail has a well-documented <a href="http://www.labnol.org/internet/email/gmail-daily-limit-sending-bulk-email/2191/">500 message limit</a> &#8211; that&#8217;s per-account, per-day. Upgrading to Premier bumps that to 2000, but we really don&#8217;t need to upgrade everybody on the domain just to get the extended limits for a system account. Ordinarily, we don&#8217;t send anywhere near that much email, but a bug that got our asynchronous mail-sending queue a little clogged up led to a glut of mails that needed to go out. Which put us over the limit. Bleh.</p>
<p>We&#8217;ll be switching to a sturdier mail provider soon enough, but for the time being, I decided to rig ActionMailer to load-balance between four accounts. So there&#8217;s a few different ways you could pull this off.</p>
<ul>
<li>Monkeypatch ActionMailer. I try to avoid patches like this if at all possible.</li>
<li>Randomize ActionMailer&#8217;s user_name setting before each use. Well, AM&#8217;s settings hash is a class global. Changing it every time, especially when others might be poking at it, seems in poor taste.</li>
<li>Something else.</li>
</ul>
<p>&#8220;Something else&#8221; turned out to be hacking the settings hash itself. Ordinarily, when you set it up, it looks like this:</p>
<pre>
ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
   :address => "smtp.gmail.com",
   :port => 587,
   :domain => "mydomain.com",
   :authentication => :plain,
   :user_name => "somebody@mydomain.com"
   :password => "mypassword"
}
</pre>
<p>Instead, I did:</p>
<pre>
ActionMailer::Base.delivery_method = :smtp

smtp_settings = {
   :address => "smtp.gmail.com",
   :port => 587,
   :domain => "mydomain.com",
   :authentication => :plain,
   :password => "mypassword"
}

SYSTEM_ACCOUNTS = %w[system@mydomain.com system2@mydomain.com system3@mydomain.com system4@mydomain.com]
ActionMailer::Base.smtp_settings = Hash.new { |h, k| SYSTEM_ACCOUNTS[rand SYSTEM_ACCOUNTS.size] if k == :user_name }.merge!(smtp_settings)
</pre>
<p>The useful part is the employment of the version of Hash.new that takes a block. If a key lookup fails, the block is invoked, and is passed the hash and the requested key. It&#8217;s basically &#8220;method_missing&#8221; for hashes. So, when ActionMailer looks for :user_name, the block picks a random entry out of the SYSTEM_ACCOUNTS array. For lack of a better name, I called this approach an &#8220;untrustworthy&#8221; hash &#8211; as one generally expects to get the same key-value mapping from a hash every time.</p>
<p>This wouldn&#8217;t work in all cases &#8211; for example, has_key?(:user_name) would fail. I&#8217;ve got a more generic solution in mind, that being an add-on for Hash that lets you insert key/proc pairs as well as key/value pairs. More on that soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2010/01/untrustworthy-hashes-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>take only what you need from it</title>
		<link>http://rineysoft.com/blog/2009/09/take-only-what-you-need-from-it/</link>
		<comments>http://rineysoft.com/blog/2009/09/take-only-what-you-need-from-it/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 02:26:07 +0000</pubDate>
		<dc:creator>riney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[vlog studio]]></category>

		<guid isPermaLink="false">http://rineysoft.com/blog/?p=1391</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/_cNvIUmZeUI&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_cNvIUmZeUI&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rineysoft.com/blog/2009/09/take-only-what-you-need-from-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

