<?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>serene_fu</title>
	<atom:link href="http://blog.asereneworld.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.asereneworld.com</link>
	<description>rails, java, and xp...</description>
	<lastBuildDate>Wed, 30 Sep 2009 16:40:55 +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>Refactoring tools&#8230;</title>
		<link>http://blog.asereneworld.com/?p=143</link>
		<comments>http://blog.asereneworld.com/?p=143#comments</comments>
		<pubDate>Wed, 30 Sep 2009 16:40:55 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=143</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Learning how to use the extract method command doesn&#8217;t make you an OO designer. In fact, extracting a huge massive long method into a bunch of smaller methods, especially ones that take in a shitload of parameters, does not make the code much better! It most definitely does not mean that it&#8217;s all of a sudden a better design.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=143</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Deceiving Personality of Test Coverage</title>
		<link>http://blog.asereneworld.com/?p=135</link>
		<comments>http://blog.asereneworld.com/?p=135#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:56:20 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[deveopment]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[test driven]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=135</guid>
		<description><![CDATA[Running Ncover, or Emma, or things like that give you some idea of what your code coverage is like, but what does it all really mean?
We should always keep in mind that such ideas of &#8220;coverage&#8221; really only indicate what lines in our code has been touched by our tests, and really doesn&#8217;t tell us [...]]]></description>
			<content:encoded><![CDATA[<p>Running Ncover, or Emma, or things like that give you some idea of what your code coverage is like, but what does it all really mean?</p>
<p>We should always keep in mind that such ideas of &#8220;coverage&#8221; really only indicate what lines in our code has been touched by our tests, and really doesn&#8217;t tell us anything about what functionality we&#8217;re testing.</p>
<p>Not that there are any arrogant programmers in this world, but if there were, a test coverage percentage of 84% might lead one to believe that their heads are bigger than they really are. This does not mean that your system is inpenetrable by any means.</p>
<p>Hey look, we&#8217;re back to the benefits of test driven development&#8230;</p>
<p>Test driven development, when done correctly, assures you that you have a test for every piece of functionality you add into a system. It also helps you focus on one thing at a time.</p>
<p>Check out this test:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">public void testIsValidWhenDogIsBrown() {
// setup
Dog dog = new Dog();
dog.color = &quot;Brown&quot;;
&nbsp;
// execute
bool isValid = dog.isValid();
&nbsp;
// verify
assertTrue(isValid);
}</pre></div></div>

<p>Minimal effort to make the test pass:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">public class Dog {
bool isValid() {
return true;
}
}</pre></div></div>

<p>This forces you to have a negative test.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">public void testIsNotValidWhenDogIsBrown() {
// setup
Dog dog = new Dog();
dog.color = &quot;Red&quot;;
&nbsp;
// execute
bool isValid = dog.isValid();
&nbsp;
// verify
assertTrue(isValid);
}</pre></div></div>

<p>The natural thing to do would just be to write the first test, and miss the second.</p>
<p>Yay test driven development&#8230; I&#8217;m not going to reinvent the wheel, or try to convince anyone that it&#8217;s the right way to go, but I am not comfortable coding without having a test first, not only for a refactoring safety net, but also to ensure that I am implementing everything I need, and only everything I need.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=135</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FutureRuby &#8211; July 9-12, 2009</title>
		<link>http://blog.asereneworld.com/?p=131</link>
		<comments>http://blog.asereneworld.com/?p=131#comments</comments>
		<pubDate>Mon, 25 May 2009 18:16:14 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[conference]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[futureruby]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=131</guid>
		<description><![CDATA[The only conference I&#8217;ve ever been to has been the NFJS ones in Calgary, which is totally uncool compared to the FutureRuby one ThoughtWorks is sending me to this July.
I&#8217;m not sure where my exitement stems from. Maybe just that it&#8217;s my first out-of-town conference, my first Ruby conference, or my first conference where I [...]]]></description>
			<content:encoded><![CDATA[<p>The only conference I&#8217;ve ever been to has been the <a href="http://www.nofluffjuststuff.com/home.jsp">NFJS </a>ones in Calgary, which is totally uncool compared to the FutureRuby one ThoughtWorks is sending me to this July.</p>
<p>I&#8217;m not sure where my exitement stems from. Maybe just that it&#8217;s my first out-of-town conference, my first Ruby conference, or my first conference where I know more about the parties than the speakers.</p>
<p>It all starts on Thursdy, July 9th at the <a href="http://qcyc.ca/">Queen City Yacht Club</a>, with <a href="http://failcampto.eventbrite.com/">FAILCamp</a>. I don&#8217;t really know what it is, but it sounds like a boatload of fun, and a very touristy thing for us to do. This starter event offers food, a cash bar, and some nice scenery.</p>
<p>Friday night is the commencement party at the <a href="http://www.unspace.ca/">Unspace HQ</a>. I think we&#8217;re supposed to mingle (do rubyists mingle?), eat, drink (at the open bar!), and listen (dance?) to a live DJ. I don&#8217;t think</p>
<p>Saturday night is the Pravda Gala at the <a href="http://pravdavodkabar.com/">Pravda Vodka Bar</a>. lol. I never expected to go to a Ruby party at a Vodka bar. This is a formal event, fully catered, with an open bar and vodka tasting. Apparently there will also be some surprise performances.</p>
<p><a href="http://www.unspace.ca/">Unspace </a>has also organized a &#8220;<a href="http://futureruby.com/comrade-program/">Companion Path</a>&#8221; for those bringing spouses (me).  For $125, it gets your partner into all the dinner events, breakfasts, a Toronto Transit Pass, and a swag bag. There is also a group that will be traveling Toronto during the days that I&#8217;m in a conference, that will be visiting tourist hot spots. The companion ticket will give your partner free and discounted tickets to various locations, and some free lunches. It makes me wish I were the non-nerdy half. But anyways, it&#8217;s brilliant. I was worried that he would be bored and lost.</p>
<p>Don&#8217;t ask me whose speaking, or about what. I have no idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=131</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ruby, Women, and Porn</title>
		<link>http://blog.asereneworld.com/?p=125</link>
		<comments>http://blog.asereneworld.com/?p=125#comments</comments>
		<pubDate>Wed, 29 Apr 2009 03:05:12 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubyconf]]></category>
		<category><![CDATA[women]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=125</guid>
		<description><![CDATA[How often can you write about porn on a dev blog?
Along with the rest of the Ruby community, my attention was brought to the silly CouchDB slideshow that Matt Aimonetti presented at the Golden Gate Ruby Conference. I wouldn&#8217;t say I&#8217;m offended by the images, or the concept in general, but I do think that [...]]]></description>
			<content:encoded><![CDATA[<p>How often can you write about porn on a dev blog?</p>
<p>Along with the rest of the Ruby community, my attention was brought to the silly <a href="http://www.slideshare.net/mattetti/couchdb-perform-like-a-pr0n-star">CouchDB slideshow</a> that <a href="http://merbist.com/">Matt Aimonetti</a> presented at the Golden Gate Ruby Conference. I wouldn&#8217;t say I&#8217;m offended by the images, or the concept in general, but I do think that it&#8217;s funny that someone would do that at a conference. I think it&#8217;s even funnier that his wife/business partner approved of it! I wonder how the conversation went. &#8220;Honey, check out the cool slideshow I made for the conference! It has scantily clad women. I think it&#8217;ll really capture the audience&#8217;s attention.&#8221; I would hope that my spouse and/or business partner(s) would at the very least question how the audience might receive it. I know that my husband fell over laughing when I told him about it. You couldn&#8217;t make this stuff up any better.</p>
<p>Anyways, being a woman Rubyist, I do feel that I have a difficult time in the software development world. I have to earn my wings everywhere I go, re-climb the ladder, and reestablish a rapport. Rapport that many other males get for free! However, I don&#8217;t think that this guy&#8217;s presentation really made it worse.</p>
<p>On a side note, I tried to join <a href="http://www.devchix.com/">DevChix</a> a few months, but didn&#8217;t get a reply. I wonder what you have to do to qualify.</p>
<p>Do I think that his actions accurately portray the community&#8217;s attitudes? Well, I think that&#8217;s kind of a broad judgement to make. He made a mistake, and he&#8217;s getting the full wrath of the internet. It&#8217;s not going to change anyone&#8217;s attitudes towards women in Computer Science.</p>
<p>After looking through the slideshow, I still have no idea what CouchDB is, but it now feels dirty.</p>
<p>Something good did come from this though. I&#8217;d never heard of this guy before he put half naked chicks in front of a room full of programmers. He is an active member of the Rails &amp; Merb communities. He is a participant in the merging of Rails and Merb into Rails 3.0. I&#8217;m sure that his talk at RailsConf2009 is going to be packed! It&#8217;s too bad that I won&#8217;t be there to see it <img src='http://blog.asereneworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Is Aimonetti saying that EngineYard is like the John Holmes of Ruby?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=125</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why Would a .NET Programmer Learn Ruby on Rails</title>
		<link>http://blog.asereneworld.com/?p=119</link>
		<comments>http://blog.asereneworld.com/?p=119#comments</comments>
		<pubDate>Fri, 24 Apr 2009 18:56:04 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[musings]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=119</guid>
		<description><![CDATA[Googling around for some Rails issues the other day, I stumbled upon this interesting article:
http://www.infoq.com/articles/Netter-on-Rails
I find it interesting, mostly because I went from a Rails project to a .NET project with absolutely no .NET experience. The result is frustrating! Stephen Chu (the author of the article, who happens to be a fellow ThoughtWorker) talks about [...]]]></description>
			<content:encoded><![CDATA[<p>Googling around for some Rails issues the other day, I stumbled upon this interesting article:</p>
<p><a href="http://www.infoq.com/articles/Netter-on-Rails">http://www.infoq.com/articles/Netter-on-Rails</a></p>
<p>I find it interesting, mostly because I went from a Rails project to a .NET project with absolutely no .NET experience. The result is frustrating! Stephen Chu (the author of the article, who happens to be a fellow ThoughtWorker) talks about how Rails lets you get to the meat and potatoes of the software, instead of having to fuss around with trivial things, like O/R Mapping, AJAX, DB Migrations, deployment. These things come standard with Ruby on Rails, but do not come cheap with .NET. Now, I shouldn&#8217;t single out .NET, because you have the same issues with Java. I&#8217;m merely using it as an example.</p>
<p>I&#8217;m not a huge fan of programming fan wars. There was an interesting comment on that article that said</p>
<blockquote><p><span id="quote_2273"> I think many developers actually believe the drill is more important than the hole that it creates.</span></p></blockquote>
<p>Isn&#8217;t that so true! We silly nerdy, geeky, techies get so caught up in the technology we&#8217;re using , that we forget about the problem that we&#8217;re trying to solve! As far as programmers go, I think we absolutely SHOULD try new languages, new frameworks, new platforms. Not necessarily because they may be &#8220;better&#8221;, but because it may be a better way of solving the current problem you have.</p>
<p>P.S. I keep hearing that RoR is great, but not for an enterprise app. I don&#8217;t know if I believe that yet. I have to do more research.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=119</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transitioning from Ruby on Rails to ASP.NET and C#</title>
		<link>http://blog.asereneworld.com/?p=117</link>
		<comments>http://blog.asereneworld.com/?p=117#comments</comments>
		<pubDate>Mon, 20 Apr 2009 18:39:04 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=117</guid>
		<description><![CDATA[Having immediately moved from an RoR project to a webapp in C#, I&#8217;m having some trouble coping with the amount of code you have to write and number of files you have to create to do the simplest things.
For example, if you want a date selector in Rails, you can do something simple like

&#60;% form_for [...]]]></description>
			<content:encoded><![CDATA[<p>Having immediately moved from an RoR project to a webapp in C#, I&#8217;m having some trouble coping with the amount of code you have to write and number of files you have to create to do the simplest things.</p>
<p>For example, if you want a date selector in Rails, you can do something simple like</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> form_for <span style="color:#0066ff; font-weight:bold;">@my_item</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
...
<span style="color:#006600; font-weight:bold;">&lt;%</span>= calendar_date_select <span style="color:#ff3333; font-weight:bold;">:date</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
...
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>This gives you a pretty little date selector and automagically looks at the date attribute on @my_item. Now, I don&#8217;t know .NET very well, so I cannot really give sample code for it, but basically, it&#8217;s a disaster. There are providers, and the code behind them, there are controls, and the code behind them&#8230;.AAAHHHHH.</p>
<p>And then there&#8217;s the issue of deciphering between creating a new object and editing an existing one. Of coures, in Rails, the <em>form_for @my_item</em> decides for you. No such crazy black magic in .NET&#8230;or Java for that matter.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=117</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gems, paths, dependencies, and everything that makes kittens cry</title>
		<link>http://blog.asereneworld.com/?p=113</link>
		<comments>http://blog.asereneworld.com/?p=113#comments</comments>
		<pubDate>Wed, 08 Apr 2009 17:34:21 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[gems]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[hostingrails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[slicehost]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=113</guid>
		<description><![CDATA[Today, I spent the majority of the morning getting the Feedzirra gem to work on the production server. It&#8217;s a great gem, and I got it working no problem locally (Mac OS X). It requires libcurl, libxml, libxslt&#8230;which is all already installed on my Mac, but apparently not on my slicehost slice. After downloading it [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I spent the majority of the morning getting the <a href="http://github.com/pauldix/feedzirra/tree/master">Feedzirra</a> gem to work on the production server. It&#8217;s a great gem, and I got it working no problem locally (Mac OS X). It requires libcurl, libxml, libxslt&#8230;which is all already installed on my Mac, but apparently not on my slicehost slice. After downloading it all, uploading it to the server, and compiling it, I realized that I hadn&#8217;t installed <a href="http://github.com/taf2/curb/tree/master">taf2-curl</a> yet. Ok, installed that, installed feedzirra&#8230;.</p>
<p>Anyway, long story short, after many different instances of &#8220;no such file to load&#8221;s, I don&#8217;t know what I did, but at some point, something clicked, and it worked.</p>
<p>Did you know that you can install gems to a whole shitload of different paths? Goody. It just makes life so much more fun. It confuses Rails cause it doesn&#8217;t know where to look, not to mention how much it confused me.</p>
<p>Life used to make sense.</p>
<p>Moral of the story: Just use a server that already has everything installed (like hostingrails) because it&#8217;s such a pain in the ass, and waste of time to get standard things installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using rake to run a legacy database migration</title>
		<link>http://blog.asereneworld.com/?p=103</link>
		<comments>http://blog.asereneworld.com/?p=103#comments</comments>
		<pubDate>Tue, 07 Apr 2009 14:34:32 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[migration]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=103</guid>
		<description><![CDATA[Most legacy migrations are run with a SQL script. Originally, this is where I started, but then I realized that I was not taking advantage of my model validations and domain methods.
Here&#8217;s kinda what I did:
lib/tasks/migrate_legacy.rake

namespace :migrate_legacy do
 LEGACY_CONNECTION = &#123;
          :adapter  =&#62; &#34;mysql&#34;,
  [...]]]></description>
			<content:encoded><![CDATA[<p>Most legacy migrations are run with a SQL script. Originally, this is where I started, but then I realized that I was not taking advantage of my model validations and domain methods.</p>
<p>Here&#8217;s kinda what I did:</p>
<p>lib/tasks/migrate_legacy.rake</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">namespace <span style="color:#ff3333; font-weight:bold;">:migrate_legacy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
 LEGACY_CONNECTION = <span style="color:#006600; font-weight:bold;">&#123;</span>
          <span style="color:#ff3333; font-weight:bold;">:adapter</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;mysql&quot;</span>,
          <span style="color:#ff3333; font-weight:bold;">:host</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;hostname.com&quot;</span>,
          <span style="color:#ff3333; font-weight:bold;">:port</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">3306</span>,
          <span style="color:#ff3333; font-weight:bold;">:username</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;dbuser&quot;</span>,
          <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;dbpass&quot;</span>,
          <span style="color:#ff3333; font-weight:bold;">:database</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;legacy_db&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">class</span> LegacyBase <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
    establish_connection LEGACY_CONNECTION
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
 <span style="color:#9966CC; font-weight:bold;">class</span> LegacyUsers <span style="color:#006600; font-weight:bold;">&lt;</span> LegacyBase
    set_table_name <span style="color:#996600;">&quot;REGUSER&quot;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">get_role_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>role<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">case</span> role
      <span style="color:#9966CC; font-weight:bold;">when</span> 0
        <span style="color:#006666;">3</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#006666;">1</span>
        <span style="color:#006666;">2</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#006666;">2</span>
        <span style="color:#006666;">1</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#996600;">&quot;Migrate users from legacy database&quot;</span>
  task <span style="color:#ff3333; font-weight:bold;">:users</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:environment</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Migrating legacy users&quot;</span>
    <span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span>.<span style="color:#9900CC;">perform_deliveries</span> = <span style="color:#0000FF; font-weight:bold;">false</span>
    <span style="color:#0066ff; font-weight:bold;">@users</span> = LegacyUsers.<span style="color:#9900CC;">find_by_sql</span> <span style="color:#996600;">&quot;SELECT * FROM USERS&quot;</span>
&nbsp;
    new_user = User.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>
         <span style="color:#ff3333; font-weight:bold;">:first_name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> user.<span style="color:#9900CC;">FIRST_NAME</span>,
        <span style="color:#ff3333; font-weight:bold;">:last_name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> user.<span style="color:#9900CC;">LAST_NAME</span>,
        <span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> user.<span style="color:#9900CC;">EMAIL</span>,
        <span style="color:#ff3333; font-weight:bold;">:created_at</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>,
        <span style="color:#ff3333; font-weight:bold;">:activated_at</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>,
        <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> user.<span style="color:#9900CC;">PWD</span>,
        <span style="color:#ff3333; font-weight:bold;">:password_confirmation</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> user.<span style="color:#9900CC;">PWD</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      new_user.<span style="color:#9900CC;">id</span> = user.<span style="color:#9900CC;">ID</span>
&nbsp;
      new_user.<span style="color:#9900CC;">country</span> = Country.<span style="color:#9900CC;">find_by_name</span><span style="color:#006600; font-weight:bold;">&#40;</span>user.<span style="color:#9900CC;">COUNTRY</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      new_user.<span style="color:#9900CC;">state</span> = State.<span style="color:#9900CC;">find_by_name</span><span style="color:#006600; font-weight:bold;">&#40;</span>user.<span style="color:#9900CC;">STATE</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      new_user.<span style="color:#9900CC;">metro_area</span> = MetroArea.<span style="color:#9900CC;">find_by_name_and_state_id</span><span style="color:#006600; font-weight:bold;">&#40;</span>user.<span style="color:#9900CC;">CITY</span>, new_user.<span style="color:#9900CC;">state_id</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      new_user.<span style="color:#9900CC;">role</span> = LegacyUsers.<span style="color:#9900CC;">get_role_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>user.<span style="color:#9900CC;">ROLE</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
      new_user.<span style="color:#9900CC;">set_display_name</span>
      new_user.<span style="color:#9900CC;">generate_login_slug</span>
&nbsp;
      new_user.<span style="color:#9900CC;">save</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This way, I take advantage of all the validations and the before_saves, before_creates, etc. Also, I have access to Ruby/Rails code functions of just SQL functions.</p>
<p>And of course, my basic rake knowledge came from <a href="http://railscasts.com/episodes/66-custom-rake-tasks">Railscasts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=103</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding to the gem install mysql frenzy</title>
		<link>http://blog.asereneworld.com/?p=100</link>
		<comments>http://blog.asereneworld.com/?p=100#comments</comments>
		<pubDate>Mon, 06 Apr 2009 20:48:33 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=100</guid>
		<description><![CDATA[It appears that I wasn&#8217;t the only person who had issues with gem install mysql.
On Mac OS X, the solution I&#8217;ve found that worked:
http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard
Basically, you have to install MySql for Mac OS X. Originally, I tried install MySql5 through MacPorts, which didn&#8217;t help. I also tried install rb-mysql, which also was completely useless.
So this is [...]]]></description>
			<content:encoded><![CDATA[<p>It appears that I wasn&#8217;t the only person who had issues with gem install mysql.</p>
<p>On Mac OS X, the solution I&#8217;ve found that worked:<br />
<a href="http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard">http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard</a></p>
<p>Basically, you have to install <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">MySql for Mac OS X</a>. Originally, I tried install MySql5 through MacPorts, which didn&#8217;t help. I also tried install rb-mysql, which also was completely useless.</p>
<p>So this is my contribution to the</p>
<p>ERROR: Failed to build gem native extension.</p>
<p>funness.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hpricot</title>
		<link>http://blog.asereneworld.com/?p=98</link>
		<comments>http://blog.asereneworld.com/?p=98#comments</comments>
		<pubDate>Mon, 06 Apr 2009 17:34:29 +0000</pubDate>
		<dc:creator>serene</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[hpricot]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[parser]]></category>

		<guid isPermaLink="false">http://blog.asereneworld.com/?p=98</guid>
		<description><![CDATA[Hpricot is way too cool.
Here&#8217;s what I did today.
I needed to parse a string in the format &#60;a href=&#8221;some_link.html&#8221;&#62;link stuff&#60;/a&#62; into its seperate parts &#8211; link text and link url.
Let&#8217;s say:

  string = &#34;&#60;a href=&#34;some_link.html&#34;&#62;link stuff&#60;/a&#62;&#34;
  hpricot_element = Hpricot.parse&#40;post.title&#41;.search&#40;&#34;a&#34;&#41;
  link_text = hpricot_element.inner_text
  link_url = hpricot_element.attributes&#91;'href'&#93;

=> link_text = &#8220;link_stuff&#8221;
=> link_url = &#8220;some_link.html&#8221;
Voila!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://wiki.github.com/why/hpricot">Hpricot</a> is way too cool.</p>
<p>Here&#8217;s what I did today.<br />
I needed to parse a string in the format &lt;a href=&#8221;some_link.html&#8221;&gt;link stuff&lt;/a&gt; into its seperate parts &#8211; link text and link url.</p>
<p>Let&#8217;s say:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#CC0066; font-weight:bold;">string</span> = <span style="color:#996600;">&quot;&lt;a href=&quot;</span>some_link.<span style="color:#9900CC;">html</span><span style="color:#996600;">&quot;&gt;link stuff&lt;/a&gt;&quot;</span>
  hpricot_element = Hpricot.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span>post.<span style="color:#9900CC;">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">search</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  link_text = hpricot_element.<span style="color:#9900CC;">inner_text</span>
  link_url = hpricot_element.<span style="color:#9900CC;">attributes</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'href'</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>=> link_text = &#8220;link_stuff&#8221;<br />
=> link_url = &#8220;some_link.html&#8221;</p>
<p>Voila!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asereneworld.com/?feed=rss2&amp;p=98</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
