<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2" -->
<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/"
	>

<channel>
	<title>samuelschroeder.com</title>
	<link>http://samuelschroeder.com</link>
	<description>Ruby in the front, Rails in the back.</description>
	<pubDate>Fri, 27 Jun 2008 15:50:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>
	<language>en</language>
			<item>
		<title>RESTful_Easy_Messages now on GitHub.</title>
		<link>http://samuelschroeder.com/2008/06/05/restful_easy_messages-now-on-github/</link>
		<comments>http://samuelschroeder.com/2008/06/05/restful_easy_messages-now-on-github/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 15:45:27 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2008/06/05/restful_easy_messages-now-on-github/</guid>
		<description><![CDATA[I just pushed the 0.7 svn tag of the RESTful_Easy_Messages plug-in to GitHub so I can play with the cool kids.  Go see it here => http://github.com/sschroed/restful_ezm. This will be the authoritative source from here on out.
It is in need of an update for Rails 2.1 so any help is appreciated.
]]></description>
			<content:encoded><![CDATA[<p>I just pushed the 0.7 svn tag of the <a href="http://samuelschroeder.com/2007/10/16/restful_easy_messages/">RESTful_Easy_Messages plug-in</a> to GitHub so I can play with the cool kids.  Go see it here => <a href="http://github.com/sschroed/restful_ezm">http://github.com/sschroed/restful_ezm</a>. This will be the authoritative source from here on out.</p>
<p>It is in need of an update for Rails 2.1 so any help is appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2008/06/05/restful_easy_messages-now-on-github/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RSpec and Rails Partials</title>
		<link>http://samuelschroeder.com/2008/05/13/rspec-and-rails-partials/</link>
		<comments>http://samuelschroeder.com/2008/05/13/rspec-and-rails-partials/#comments</comments>
		<pubDate>Tue, 13 May 2008 19:03:17 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[RSpec]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2008/05/13/rspec-and-rails-partials/</guid>
		<description><![CDATA[For some reason Test:Unit and I are not friends.  I&#8217;m not really sure why, but I always drop to voice mail when I call.  So, I moved and started working on project with Andy and Heather Tinkham (two local MPLS software testers) to learn RSpec.  More to come on that at a [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason Test:Unit and I are not friends.  I&#8217;m not really sure why, but I always drop to voice mail when I call.  So, I moved and started working on project with <a href="http://twitter.com/andytinkham">Andy</a> and <a href="http://www.linkedin.com/pub/0/4a8/7b0">Heather</a> Tinkham (two local MPLS software testers) to learn RSpec.  More to come on that at a later date.  Stealth mode now.  Move along, nothing to see&#8230;</p>
<p>It&#8217;s been fun and I&#8217;m enjoying BDD.  Once I get the basics down I&#8217;ll get into RSpec stories too. Anyway, back to the point.</p>
<p>On my current project we are working on a new version of the most important feature of the site.  Without it, everything else is crap.  It&#8217;s the main driver for adding content and it needs to be rock solid, no, <a href="http://van.physics.uiuc.edu/qa/listing.php?id=613">diamond solid</a>.  And being a newly minted RSpec user I wanted spec it all out, cover every angle, even add view specs.  Here is where my noobness shines.</p>
<p>The new feature is in it&#8217;s own partial which is nested in another partial nested within a page.  Pretty standard stuff.  With the process for writing Rails views and partials in mind I set about trying to write nested view specs.  That doesn&#8217;t work. AT ALL.  The RSpec <a href="http://rspec.rubyforge.org/documentation/rails/writing/views.html">view docs</a> talk about the expect_render and stub_render methods but I still couldn&#8217;t figure it out. </p>
<p>So I called google and still nothing really popped out until I saw an archived email chain where someone said just spec the partials.  WTF? OK?  So I added a new file to my specs:  spec/views/my_view_folder/partial_name.html.erb_spec.rb, added the following, and waited for autotest to run.  And you know what?  That bastard ran.  Maybe I&#8217;m just dense, or missed a paragraph somewhere, but an example of the right way to do partial specs would have been sweet.  I hope this helps other unsuspecting noob.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
require File.dirname(__FILE__) + '/../../spec_helper'

describe "/my_view_folder/_partial_name.html.erb" do

  include ControllerHelper

  before(:each) do
    # Stub
    @variable = mock_model(ModelName)
  end 
  
  it "should display the div" do
    render :partial => "/my_view_folder/partial", :locals => { :variable => @variable }
    response.should have_tag('div#div-id')
  end
end
</textarea>
<p><strong>Note:</strong> Just in case this genero code is confusing replace &#8220;my_view_folder&#8221; with the actual name of the view directory and &#8220;partial&#8221; with the actual partial name.  And change ControllerHelper to be the name of the actual helper.  You get that when you run the RSpec scaffold generator.  I did that because I&#8217;m lazy and didn&#8217;t want to make all the spec files by hand.</p>
<p><strong>UPDATE:</strong> I&#8217;ve updated the source to show how to do locals.</p>
<p><strong>Resources I found useful</strong></p>
<ul>
<li><a href="http://blog.davidchelimsky.net/articles/2006/11/06/view-spec-tutorial">http://blog.davidchelimsky.net/articles/2006/11/06/view-spec-tutorial</a></li>
<li><a href="http://rubypond.com/articles/2008/03/31/using-rspec-have_tag/">http://rubypond.com/articles/2008/03/31/using-rspec-have_tag/</a></li>
<li><a href="http://errtheblog.com/posts/66-view-testing-20">http://errtheblog.com/posts/66-view-testing-20</a></li>
<li><a href="http://rspec.rubyforge.org/documentation/rails/writing/views.html">http://rspec.rubyforge.org/documentation/rails/writing/views.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2008/05/13/rspec-and-rails-partials/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Live Blogging from the F1 Web Challenge</title>
		<link>http://samuelschroeder.com/2008/03/01/live-blogging-from-the-f1-web-challenge/</link>
		<comments>http://samuelschroeder.com/2008/03/01/live-blogging-from-the-f1-web-challenge/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 14:33:32 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2008/03/01/live-blogging-from-the-f1-web-challenge/</guid>
		<description><![CDATA[Well it&#8217;s 8:30 am and we are about to get started with 24 hours of hard core web development.  I&#8217;ll be updating our progress throughout the day.

8:55 am Opening comments
8:57 am Our non-profit is Little Brother: Friends of the Elderly
12:07 pm Lunch break with a Rock Band challenge
There are some hard core Rock Band [...]]]></description>
			<content:encoded><![CDATA[<p>Well it&#8217;s 8:30 am and we are about to get started with 24 hours of hard core web development.  I&#8217;ll be updating our progress throughout the day.</p>
<p><img src="http://farm3.static.flickr.com/2234/2301547981_b1e6ea2842.jpg" alt="Team Ruby.mn" /><img src="http://farm3.static.flickr.com/2164/2302343158_f339188b9e.jpg" alt="Team setup" /></p>
<p><strong>8:55 am</strong> Opening comments<br />
<strong>8:57 am</strong> Our non-profit is Little Brother: Friends of the Elderly<br />
<strong>12:07 pm</strong> Lunch break with a Rock Band challenge</p>
<p>There are some hard core Rock Band players here.  I hope our rookie team can do well, and by that I mean not place last.  I think we&#8217;ll do well.  Here&#8217;s the band&#8230;</p>
<p>Vocals: Robert Fischer<br />
Guitar: Nate Kadlac<br />
Drums: Andy Tinkhan<br />
Bass: Kathleen O&#8217;Brien, from Little brothers</p>
<p><img src="http://farm4.static.flickr.com/3024/2302086653_77b648dd56.jpg" alt="Drum Master Andy" /><img src="http://farm3.static.flickr.com/2268/2302083955_015b76c956.jpg" alt="Robert Rocks On" /><img src="http://farm3.static.flickr.com/2345/2302879202_2019eb4f49.jpg" alt="The Band" /></p>
<p>So far we&#8217;re in 2nd place&#8230;</p>
<p><strong>6:58 pm</strong> Dinner time.  Mmmm Chipotle.  </p>
<p>Here is the official flickr stream for the event >> <a href="http://flickr.com/groups/637807@N24/pool/">Photo me, baby!</a></p>
<p>Notice how Team Ruby.mn is properly featured?  </p>
<p>Alicia and Nate have created a sweet site design that just blows away Little Brother&#8217;s <a href="http://www.littlebrothersmn.org/">current site.</a>  Justin and I are hacking away at the CMS.  Lars is maxing out his credit cards with the online donations.  Andy has written a book of RSpec tests. And Coung and Robert are building the volunteer sign-up.  Everything is still parts is parts but everything is progressing nicely.</p>
<p><strong>8:17 pm</strong> Little Brothers brought in a surprise for us.  We got a clown. No one else got a clown. We rule.</p>
<p><img src="http://farm3.static.flickr.com/2172/2303671936_e67d9e1f8f.jpg" alt="Lars and Magic" /><img src="http://farm4.static.flickr.com/3134/2302872139_2539065dde.jpg" alt="Pink Bunny" /><img src="http://farm3.static.flickr.com/2273/2302868413_8160c80191.jpg" alt="Our Clown" /><img src="http://farm4.static.flickr.com/3186/2302869925_6ab647e7ed.jpg" alt="Monkey Coder" /></p>
<p><strong>12:02 am</strong> Half way there.  I&#8217;m tired.</p>
<p><strong>12:32 am</strong> Domino&#8217;s Pizza just delivered.  Why did I think it was a good idea?</p>
<p><strong>3:27 am</strong> Sierra Bravo just gave out some raffle prizes.  I won &#8220;The Ultimate MAtix Collection&#8221; in HD-DVD.  I don&#8217;t have an HD-DVD player yet and someone just told me Blue-Ray won the format war so I got that going for me.  Which is nice.</p>
<p><strong>5:12 am</strong> Can&#8217;t. Speak. In. Complete&#8230;  Sentences&#8230;</p>
<p><strong>7:05 am</strong> I just noticed the sun in coming up.  I&#8217;ve been awake for 25 hours now.  So tired&#8230;</p>
<p><strong>9:35 am</strong> The site looks sweet.  We&#8217;re just putting on the final touches and preparing for our demo.</p>
<p><strong>9:44 am</strong> Time for a photo check-in.<br />
<img src="http://farm4.static.flickr.com/3240/2304120741_0e2e26d8be.jpg" alt="Count Down" /></p>
<p>THIS IS NO PLACE FOR THE WEAK!</p>
<p><img src="http://farm3.static.flickr.com/2111/2304121471_5f95125e01.jpg" alt="Sleeping Dude." /></p>
<p>TEAM RUbY.mn hard at work.</p>
<p><img src="http://farm3.static.flickr.com/2390/2304919168_7b0a1a9692.jpg" alt="Team Ruby.mn" /></p>
<p><strong>10:51 am</strong> 1h 10 m left.  Subversion commits are flying all over the place.  <a href="http://enfranchisedmind.com/blog/2008/03/02/f1-closing-in-on-the-end/">Robert</a> is also live blogging the end.</p>
<p><strong>11:42 am</strong> Our final revision, number 161, was just checked in.  Here are the stats for our project&#8230;</p>
<p><font face="courier"></p>
<pre>
+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |   579 |   467 |      16 |      58 |   3 |     6 |
| Helpers              |    32 |    29 |       0 |       1 |   0 |    27 |
| Models               |   356 |   294 |      11 |      36 |   3 |     6 |
| Libraries            |   455 |   315 |       2 |      27 |  13 |     9 |
| Integration tests    |    46 |    40 |       1 |       2 |   2 |    18 |
| Functional tests     |   304 |   246 |      12 |      39 |   3 |     4 |
| Unit tests           |   242 |   201 |       7 |      31 |   4 |     4 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |  2014 |  1592 |      49 |     194 |   3 |     6 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 1105     Test LOC: 487     Code to Test Ratio: 1:0.4
</pre>
<p></font></p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2008/03/01/live-blogging-from-the-f1-web-challenge/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix: MySQL 5 on Mac OS X Leopard</title>
		<link>http://samuelschroeder.com/2008/02/05/fix-mysql-5-on-mac-os-x-leopard/</link>
		<comments>http://samuelschroeder.com/2008/02/05/fix-mysql-5-on-mac-os-x-leopard/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 19:37:54 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Mac]]></category>

		<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2008/02/05/fix-mysql-5-on-mac-os-x-leopard/</guid>
		<description><![CDATA[This past weekend I bought a new MacBook and, of course, it has Leopard for the OS.  As I was installing all of the development tools I need I kept having issues when trying to run MySQL 5.0.51.  I installed from the Mac OS X packages.
After consulting google I came across Ted Hogan&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>This past weekend I bought a new MacBook and, of course, it has Leopard for the OS.  As I was installing all of the development tools I need I kept having issues when trying to run MySQL 5.0.51.  I installed from the <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">Mac OS X packages</a>.</p>
<p>After consulting google I came across <a href="http://tedhogan.blogspot.com/2007/12/leopard-mysql-preference-pane-not.html">Ted Hogan&#8217;s site</a>.  He explained that is was a permissions issue between <strong>&#8220;/usr/local/mysql/data&#8221;</strong> and the current logged in user.  His fix is listed below.</p>
<blockquote><p>
You can get to this through the finder by using the &#8220;Go to Folder&#8221; dropdown item from the Finder&#8217;s &#8220;Go&#8221; menu. Just type in /usr/local and go from there. Also, you can modify the permissions by command-I (info dialog) at the bottom (Sharing &#038; Permissions.) Be sure to click the options button (gear box at bottom) and select &#8220;Apply to enclosed items&#8221; as well.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2008/02/05/fix-mysql-5-on-mac-os-x-leopard/feed/</wfw:commentRss>
		</item>
		<item>
		<title>F1 Overnight Website Challenge</title>
		<link>http://samuelschroeder.com/2008/01/22/f1-overnight-website-challenge/</link>
		<comments>http://samuelschroeder.com/2008/01/22/f1-overnight-website-challenge/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 22:52:48 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2008/01/22/f1-overnight-website-challenge/</guid>
		<description><![CDATA[Yesterday I found that my team was selected for the Sierra Bravo F1 Overnight Website Challenge.  I&#8217;m pretty excited about it. The teams get to stay up all night coding like fiends while powered by free Red Bull, Peace Coffee, Buffalo Wild Wings, and Chipotle with an occasional break for a Guitar Hero contest. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i143.photobucket.com/albums/r122/sschroed/samuelschroederdotcom/graphic_competitor.gif" alt="F1 Overnight Website Challenge" align="left" />Yesterday I found that my team was selected for the <a href="http://www.f1webchallenge.com/">Sierra Bravo F1 Overnight Website Challenge</a>.  I&#8217;m pretty excited about it. The teams get to stay up all night coding like fiends while powered by free Red Bull, Peace Coffee, Buffalo Wild Wings, and Chipotle with an occasional break for a Guitar Hero contest.  My team is one representing the <a href="http://ruby.mn/">Ruby Users of Minnesota (RUM)</a> and we have some top quality developers.  I hope I measure up.</p>
<blockquote><p>One part nerd Olympics, one part community service project and one part race-against-the-clock — Sierra Bravo’s F1 Overnight Website Challenge presented by VISI will partner deserving Minnesota non-profits with teams of talented web developers for 24 hours of fun collaboration culminating in a fully operational website for each participating non-profit. - Sierra Bravo website</p></blockquote>
<p>Here is the <a href="http://www.f1webchallenge.com/teams/11-Ruby-mn">link</a> to team Ruby.mn.  I&#8217;m the one with the party hat.</p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2008/01/22/f1-overnight-website-challenge/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RESTful_Easy_Messages</title>
		<link>http://samuelschroeder.com/2007/10/16/restful_easy_messages/</link>
		<comments>http://samuelschroeder.com/2007/10/16/restful_easy_messages/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 18:50:57 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2007/10/16/restful_easy_messages/</guid>
		<description><![CDATA[So three month ago I released my first Rails plug-in, Easy_Messages (EZM), and I was pleasantly surprised by the response, excited that people were actually using my code.  Then I became paranoid as people were actually using my code!  Since then I worked briefly on a project which was written with REST in [...]]]></description>
			<content:encoded><![CDATA[<p>So three month ago I released my first Rails plug-in, <a href="http://samuelschroeder.com/2007/07/18/easy_messages/">Easy_Messages</a> (EZM), and I was pleasantly surprised by the response, excited that people were actually using my code.  Then I became paranoid as <em>people were actually using my code!</em>  Since then I worked briefly on a project which was written with <a href="http://en.wikipedia.org/wiki/REST">REST</a> in mind and was forced to look into it.  Up to that point I had been doing my best to not meet REST in the hallway as I was a little scared by him.  I don&#8217;t know why?  After watching the <a href="http://peepcode.com/products/restful-rails">Peepcode screencast </a> by Geoffrey Grosenbach, everything clicked and I realized that I could make the code for EZM much better.  The end result is this plug-in.  I hope you find it useful.</p>
<p>The code is hosted at <a href="http://github.com/sschroed/restful_ezm">GitHub</a>.</p>
<p><strong>Here&#8217;s how to install the plug-in.</strong> (Rails 2.1 required for git plug-ins)</p>
<p><tt>./script/plugin install git://github.com/sschroed/restful_ezm.git</tt></p>
<p><strong>Here&#8217;s how to run the generator.</strong></p>
<p>For standard html views: <tt>./script/generate messages erb</tt><br />
For <a href="http://haml.hamptoncatlin.com/">haml</a>[1] views: <tt>./script/generate messages haml</tt></p>
<p>[1] You will need to install the haml plug-in for the views to render properly.</p>
<p>I&#8217;ve tried to decouple as much of the code as I could with this release.  If you used Easy_Messages you&#8217;ll remember most of the code was stuck in the plug-in directory.  With REZM the generator will put a controller, helper, model, tests, and a few other support files right into your project for easy access.  To see the entire list view the FILELIST in plugins/restful_easy_messages.  There is still a tiny bit of code in the plug-in though.</p>
<p>If you are using <a href="http://www.techno-weenie.net/">Rick Olson&#8217;s</a> <a href="http://svn.techno-weenie.net/projects/plugins/restful_authentication/">RESTful_Authentication</a> you can get REZM up and running with minimal setup as I pulled it from a project that uses it.</p>
<p>First, update the user model.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
class User &lt; ActiveRecord::Base
  restful_easy_messages
  # The rest of your class
  #
  #
end
</textarea>
<p>Then add the REZM routes.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
# Add these names routes to your project's config/routes.rb
map.resources :messages,
              :collection => {:destroy_selected => :post,
                              :inbox => :get,
                              :outbox => :get,
                              :trashbin => :get},
              :member => {:reply => :get}
</textarea>
<p><strong>NOTE:</strong> Routes have been changed in the lastest release on GitHub.  The User is no longer needed.  This break backwards compatibility, unfortunately.  Thanks to <a href="http://sivarg.blogspot.com/">Gravis</a> for the update. </p>
<p>Now run db:migrate and you should be good to go.  </p>
<p>But what if you didn&#8217;t use restful_authentication?  Having to use Acts_As_Authenticated for EZM was the biggest complaint that I heard so I made REZM with hooks for you to switch out R_A if you want.  Open lib\restful_easy_messages_controller_system.rb to do so.  Just replace the <tt>current_user</tt> and <tt>login_required</tt> methods with calls to similar ones in your application.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
module RestfulEasyMessagesControllerSystem
  protected
  
  # This method provides an abstraction layer to the REZM controller for the
  # "current", logged-in user in case you are not using Restful_Authentication.
  def rezm_user
    # Provide your version of current_user here if not using Restful_authentication
    current_user
  end
  
  # This method provides an abstraction layer to the REZM controller for 
  # requiring a user to be loggefd in if you are not using Restful_Authentication.
  def rezm_login_required
    # Provide your version of login_required here if not using Restful_authentication
    login_required
  end
  
  # Inclusion hook to make #rezm_user
  # available as ActionView helper methods.
  def self.included(base)
    base.send :helper_method, :rezm_user
  end
end
</textarea>
<p>I believe that is it.  Oh wait, there is also an Atom feed for the inbox!</p>
<p>If you wish to try out REZM I&#8217;ve set up a sample app.  You can message the user &#8220;sam&#8221; if you want to test writing a mesasge.</p>
<p>***** <a href="http://www.samuelschroeder.com/rezm/login">Click to play with the REZM Sample App.</a> *****</p>
<p><strong>Thanks to&#8230;</strong></p>
<p>**<a href="http://nubyonrails.com/">Geoffrey Grosenbach </a> for the REST PeepCode </p>
<p>**<a href="http://matt-beedle.com/">Matt Beedle</a> for writing and releasing <a href="http://matt-beedle.com/2007/06/05/acts_as_emailable/">Acts_As_Emailable</a> which was my starting point with Easy_Message and now RESTful_easy_messages.</p>
<p>**<a href="http://techno-weenie.net/"> Rick Olson</a> for writing and <em>releasing</em> all of his plug-ins.</p>
<p>** <a href="http://drnicwilliams.com/">Dr. Nic Williams</a> for his <a href="http://drnicwilliams.com/2007/07/26/sample-app-rails-multiple-openids-per-user/">multiple-openids-per-user-sample-app</a> which I used as a starting point for the REZM sample app which I&#8217;ll put up soon.</p>
<p>** <a href="http://www.bencurtis.com/">Ben Curtis</a> for his <a href="http://www.bencurtis.com/archives/2007/07/openid-sample-application-updated/">OpenID sample app</a> which Dr. Nic based his. </p>
<p>Lastly, please recommend me if you like RESTful_Easy_Messages.<br />
<a href="http://workingwithrails.com/recommendation/new/person/7897-sam-schroeder"><img src="http://workingwithrails.com/images/tools/compact-med.jpg" alt="Recommend Me" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2007/10/16/restful_easy_messages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple Syntax for XML node looping</title>
		<link>http://samuelschroeder.com/2007/09/12/simple-syntax-for-xml-node-looping/</link>
		<comments>http://samuelschroeder.com/2007/09/12/simple-syntax-for-xml-node-looping/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 21:55:42 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[.Net / C#]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2007/09/12/simple-syntax-for-xml-node-looping/</guid>
		<description><![CDATA[Sometimes I really hate .Net blogs and C# websites.
All I wanted was the syntax to loop through the nodes of an XML document.  You&#8217;d think that would be easy to find.
WRONG!
My search lead me to many long winded dissertations on to use XML for web services or someone&#8217;s home grown SAX implementation but no [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I really hate .Net blogs and C# websites.</p>
<p>All I wanted was the syntax to loop through the nodes of an XML document.  You&#8217;d think that would be easy to find.</p>
<p>WRONG!</p>
<p>My search lead me to many long winded dissertations on to use XML for web services or someone&#8217;s home grown SAX implementation but no simple syntax that wasn&#8217;t buried in 1000 lines of code.   Seriously, who is going to read 1000 lines of code in a blog post?</p>
<p>Anyway, I&#8217;ve distilled it below.  I know it&#8217;s simple.  But, I couldn&#8217;t find simple.  Maybe my google skillz are lacking.</p>
<p>This code assumes you have &#8220;customer&#8221; nodes within your XML document and each customer has an attribute called &#8220;name&#8221;.</p>
<textarea name="code" class="c#" cols="100" rows="10">
// Make sure you are using this
using System.Xml;

string nodeValue = string.Empty;

// Create a XmlDocument object
XmlDocument xd = new XmlDocument();

// Load XmlDocument from where ever
xd.Load([your_xml_doc_here])

XmlNodeList nodeList = xd.SelectNodes("//customer"); // Must use an XPath string

foreach (XmlNode node in nodeList)
{
ListItem appServerMethod = new ListItem();
nodeValue = node.Attributes["name"].Value;
}
</textarea>
<p>I realize the above code reassigns nodeValue each time through the loop, but I just wanted to show the syntax for retrieving an attribute value.</p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2007/09/12/simple-syntax-for-xml-node-looping/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing ImageMagick and MiniMagick on Windows</title>
		<link>http://samuelschroeder.com/2007/07/31/installing-imagemagick-and-minimagick-on-windows/</link>
		<comments>http://samuelschroeder.com/2007/07/31/installing-imagemagick-and-minimagick-on-windows/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 03:12:40 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[Miscellany]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2007/07/31/installing-imagemagick-and-minimagick-on-windows/</guid>
		<description><![CDATA[I know this has been documented in other places so this is mostly for my own sanity.   I want to use the attachment_fu plug-in by Rick Olson for my rails app to upload user avatars.  I also want to resize the images and create a series of smaller thumbnails for use throughout [...]]]></description>
			<content:encoded><![CDATA[<p>I know this has been documented in other places so this is mostly for my own sanity.   I want to use the <a href="http://svn.techno-weenie.net/projects/plugins/attachment_fu/" target="_blank">attachment_fu</a> plug-in by <a href="http://techno-weenie.net">Rick Olson</a> for my rails app to upload user avatars.  I also want to resize the images and create a series of smaller thumbnails for use throughout the site.</p>
<p><strong>Steps to install ImageMagick </strong></p>
<ol>
<li> Download the <a href="http://www.imagemagick.org/script/binary-releases.php#windows" target="_blank">Windows binary of ImageMagick</a>.  I used ImageMagick-6.3.5-4-Q16-windows-dll.exe</li>
<li>Run the ImageMagick installer (The file you just downloaded) and accept the defaults.</li>
<li>Open a command prompt to verify the install was successful</li>
<li> Type &gt;convert logo: logo.miff</li>
<li>Type &gt;imdisplay logo.miff</li>
<li>If all went well with the install a little picture of blue wizard should appear.</li>
</ol>
<p><strong>Steps to install MiniMagick</strong></p>
<ol>
<li>Install the gem from the command prompt with the command <tt>gem install mini_magick.</tt>  You may be asked to install a few required dependencies.  Say yes.</li>
<li>Wait for the download and install to complete.</li>
</ol>
<p>You should be good now to install attachment_fu, but that is beyond the scope of this article.  Use the links below for more information</p>
<p>References:</p>
<ul>
<li><a href="http://www.clarkware.com/cgi/blosxom/2007/02/24">Mike Clark&#8217;s Tutorial</a></li>
<li><a href="http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent">Khamsouk Souvanlasy&#8217;s Ajax and attachment_fu</a></li>
<li><a href="http://www.railsweenie.com/forums/3/topics/1257">Helpful hints with attachment_fu and Windows</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2007/07/31/installing-imagemagick-and-minimagick-on-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Easy_Messages</title>
		<link>http://samuelschroeder.com/2007/07/18/easy_messages/</link>
		<comments>http://samuelschroeder.com/2007/07/18/easy_messages/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 12:54:40 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2007/07/18/easy_messages/</guid>
		<description><![CDATA[ A few weeks ago I was looking for Rails plug-in to provide simple messaging between users on  a website.  I came across Acts_As_Emailable by Matt Beedle.  It was a good start but only gave me a model and some methods but I would still need to flesh out a controller and [...]]]></description>
			<content:encoded><![CDATA[<p> A few weeks ago I was looking for Rails plug-in to provide simple messaging between users on  a website.  I came across <a href="http://matt-beedle.com/2007/06/05/acts_as_emailable/">Acts_As_Emailable</a> by <a href="http://matt-beedle.com/">Matt Beedle</a>.  It was a good start but only gave me a model and some methods but I would still need to flesh out a controller and some views for my little private messaging project to be complete.  The result of that work is this plug-in, Easy_Messages.  I took Acts_As_Emailable as a starting point and added some controller methods, a few views, a helper, and some named routes.</p>
<p>Below are the installation instructions.  This is my first Rails plug-in so let me know if you find something to refactor.  I&#8217;m open to constructive criticism.</p>
<p>The code is hosted  at <a href="http://rubyforge.org">RubyForge</a>.</p>
<p style="font-weight: bold">UPDATE I: I have created a new branch for 0.51,  please use that one for the latest stable release</p>
<p style="font-weight: bold">UPDATE II: I have removed the docs from branch 0.51 and placed them online here: <a href="http://easymessages.samuelschroeder.com" title="Easy_Messages Documentation" target="_blank">http://easymessages.samuelschroeder.com</a>.   Now the generator should work like a charm</p>
<p><tt>svn://rubyforge.org/var/svn/easymessages/branches/RB-0.51</tt></p>
<p>The run the generator to create the model, migration, helper, and views.</p>
<p><tt>script/generate easy_messages message account</tt></p>
<p>Note: Easy_Messages assumes you have <a href="http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated">Acts_As_Authenticated</a> installed with the defaults of a model named <strong>User</strong> and a controller named <strong>Account</strong>.  And you must use the above line exactly.  I have grand aspirations of making the generator fully dynamic someday but for now you&#8217;ll have to deal.</p>
<p>The generator should produce this output.<br />
<tt><br />
exists  app/models/<br />
exists  app/helpers/<br />
exists  app/views/account<br />
create  app/models/message.rb<br />
create  app/helpers/easy_messages_helper.rb<br />
create  app/views/account/message_view.rhtml<br />
create  app/views/account/messages.rhtml<br />
create   app/views/account/send_message.rhtml<br />
exists  db/migrate<br />
create db/migrate/###_create_easy_messages_messages.rb<br />
</tt></p>
<p>Yes, I realize the redundant naming but once/if I get the dynamic generator going it would say ###_create_easy_messages_[MessageClassNames]s.</p>
<p>Now you have to do three manual changes to your code.  First, add &#8220;easy_messages&#8221; to apps/model/user.rb.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
class User &lt; ActiveRecord::Base
easy_messages
# The rest of your class
#
#
end
</textarea>
<p>Second, add &#8220;authenticated_commands&#8221; to apps/controllers/account_controller.rb.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
class AccountController &lt; ApplicationController
authenticated_commands
# The rest of your class
#
#
end
</textarea>
<p>Finally, you need to copy the named routes from vendor/plugins/easy_messages/config/easy_messages_named_routes.rb to config/routes.rb.</p>
<textarea name="code" class="ruby" cols="100" rows="10">
# Add these names routes to your project's config/routes.rb

map.with_options :controller =&gt; 'account' do |m|

m.compose '/account/message/send', :action =&gt; 'send_message'
m.delete 'account/message/delete/:id', :action =&gt; 'delete_message'
m.inbox '/account/inbox', :action =&gt; 'inbox'
m.outbox '/account/outbox', :action =&gt; 'outbox'
m.trashbin '/account/trashbin', :action =&gt; 'trash_bin'
m.reply '/account/message/reply/:id', :action =&gt; 'reply_to_message'
m.view '/account/message/view/:id', :action =&gt; 'view_message'

end
</textarea>
<p>That should be it for the setup.  So start your development server and point your brower to..</p>
<p><tt>http://localhost:3000/account/inbox</tt></p>
<p>There is also a complete RDoc listing in vendor/plugins/easy_messages/doc</p>
<p><em><strong>Thanks to&#8230;</strong></em></p>
<p>**<a href="http://matt-beedle.com/">Matt Beedle</a> for writing and releasing <a href="http://matt-beedle.com/2007/06/05/acts_as_emailable/">Acts_As_Emailable</a>.</p>
<p>**<a href="http://techno-weenie.net/"> Rick Olson</a> for writing and releasing the kick-ass <a href="http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated">Acts_As_Authenticated</a> plug-in.  It was been such a help when starting new projects.</p>
<p><a href="http://workingwithrails.com/recommendation/new/person/7897-sam-schroeder"><img src="http://workingwithrails.com/images/tools/compact-med.jpg" alt="Recommend Me" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2007/07/18/easy_messages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ASP.Net 2.0 and It&#8217;s Crazy Strict Install Order OR Be Careful When Installing Windows Components</title>
		<link>http://samuelschroeder.com/2007/07/09/aspnet-20-and-its-crazy-strict-install-order-or-be-careful-installing-windows-components/</link>
		<comments>http://samuelschroeder.com/2007/07/09/aspnet-20-and-its-crazy-strict-install-order-or-be-careful-installing-windows-components/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 19:24:53 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
		<category><![CDATA[.Net / C#]]></category>

		<guid isPermaLink="false">http://samuelschroeder.com/2007/07/09/aspnet-20-and-its-crazy-strict-install-order-or-be-careful-installing-windows-components/</guid>
		<description><![CDATA[Recently, I re-imaged my work machine and had to re-install all of my development tools.  See here for a list.  The one thing I did pay attention to was to make sure IIS was installed before Visual Studio and ASP.Net 2.0.  If you do it backward you&#8217;re in for a fun filled [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I re-imaged my work machine and had to re-install all of my development tools.  See <a href="http://samuelschroeder.com/2007/06/19/the-simple-development-life/">here</a> for a list.  The one thing I did pay attention to was to make sure IIS was installed before Visual Studio and ASP.Net 2.0.  If you do it backward you&#8217;re in for a fun filled day of error messages leading your nowhere.  But, I did it right so I didn&#8217;t have to worry.</p>
<p>Then this morning everything went to hell and the very descriptive errors appeared and I spent a few hours googling and trying  some of the Kbases at Microsoft.  Nothing worked until I tried <a href="http://support.microsoft.com/kb/555583/en-us">this</a> which states the cause as&#8230;</p>
<p><code>The most probable cause for this error is that you must have installed Internet Information Services (IIS) after the installation of Microsoft .NET Framework 2.0.</code></p>
<p>But remember I did do it in the right order.  Right?  To make a long boring story short I was messing around with adding and removing some Windows Components from the Add/Remove Programs wizard and sowhere along the line it must have reinstalled part of IIS.  Either that or the Network Gnomes are back.</p>
]]></content:encoded>
			<wfw:commentRss>http://samuelschroeder.com/2007/07/09/aspnet-20-and-its-crazy-strict-install-order-or-be-careful-installing-windows-components/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
