<?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>Buddy Lindsey &#187; Programming</title>
	<atom:link href="http://buddylindsey.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://buddylindsey.com</link>
	<description>Exploring and Teaching Emerging Web Technologies</description>
	<lastBuildDate>Mon, 26 Mar 2012 19:00:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>7 Databases in 7 Weeks &#8211; 8 Week Review and Experience</title>
		<link>http://buddylindsey.com/7-databases-in-7-weeks-8-week-review-and-experience/</link>
		<comments>http://buddylindsey.com/7-databases-in-7-weeks-8-week-review-and-experience/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 01:18:06 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[CouchDB]]></category>
		<category><![CDATA[HBase]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Neo4J]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[Riak]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=663</guid>
		<description><![CDATA[Databases are annoying and generally suck. Many us developers prefer to just do stuff with data and don&#8217;t like to deal with storing data beyond a nice pretty api. However, to be an effective software developer we also understand knowing about databases is a smart idea, doesn&#8217;t mean we have to like it. One of [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://pragprog.com/book/rwdata/seven-databases-in-seven-weeks"><img alt="7 Databases in 7 Weeks" src="http://imagery.pragprog.com/products/251/rwdata.jpg?" title="7 Databases in 7 Weeks" class="alignright" width="295" /></a></p>
<p>Databases are annoying and generally suck. Many us developers prefer to just do stuff with data and don&#8217;t like to deal with storing data beyond a nice pretty api. However, to be an effective software developer we also understand knowing about databases is a smart idea, doesn&#8217;t mean we have to like it.</p>
<p>One of the biggest problems for me is I don&#8217;t really know a lot about data stores outside of RDBMS&#8217;s. NoSQL data stores do not generally make a lot of sense to me, I know about them technically, but I haven&#8217;t found (m)any good overviews which help things click on proper ways to use them. It is my hope that reading <a href="http://pragprog.com/book/rwdata/seven-databases-in-seven-weeks">7 Databases in 7 Weeks</a> will be that final piece of knowledge which helps everything click into place.</p>
<h3>A Note</h3>
<p>I feel I should note before moving on this book is still in beta so things can, and will probably change. Most of the book covers different NoSQL databases so with my limited knowledge anything is better than nothing. I just wanted to be sure to point out as of now the book is in beta, but that doesn&#8217;t mean it is wrong or bad.</p>
<h2>What to Expect</h2>
<p>Over the course of the next 7 weeks I will take one database at a time and do all the exercises, to the best of my ability, and read the entire chapter. I will then describe what I have learned and what, if anything, really helped things click in my head. Finally, on week 8 I will do a wrap-up of everything I have read and my opinion of the book.</p>
<h2>What is In the Book</h2>
<p>Databases of course <img src='http://buddylindsey.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . The book is broken up into the following databases:</p>
<ol>
<li><a href="http://buddylindsey.com/postgresql-week-1-of-7-databases-in-7-weeks/">PostgreSQL</a></li>
<li><a href="http://buddylindsey.com/riak-week-2-of-7-databases-in-7-weeks/">Riak</a></li>
<li><a href="http://buddylindsey.com/hbase-week-3-of-7-databases-in-7-weeks/">HBase</a></li>
<li><a href="http://buddylindsey.com/mongodb-week-4-of-7-databases-in-7-weeks/">MongoDB</a></li>
<li><a href="http://buddylindsey.com/couchdb-week-5-of-7-databases-in-7-weeks/">CouchDB</a></li>
<li><a href="http://buddylindsey.com/neo4j-week-6-of-7-databases-in-7-weeks/">Neo4J</a></li>
<li><a href="http://buddylindsey.com/redis-week-7-of-7-databases-in-7-weeks/">Redis</a></li>
</ol>
<p>Each database will get its own post so I can do them justice. Especially since there are several different types of databases.</p>
<h2>What I Hope to Get Out of The Book</h2>
<p>I mostly use RDBMS&#8217;s, namely mysql, but I need to learn NoSQL, and want to learn PostgreSQL, if for nothing else to know when and where to use it. I don&#8217;t want to just use it because I can, but because I should. In the first chapter, which was an overview, this is what they promise and I think they will deliver. I don&#8217;t intend to be an expert in each database, but at least have a working knowledge of them to combat my database ignorance. </p>
<p>Please comeback next week for the first part on PostgreSQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/7-databases-in-7-weeks-8-week-review-and-experience/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Learn Python the Hard Way &#8211; Review</title>
		<link>http://buddylindsey.com/learn-python-the-hard-way-review/</link>
		<comments>http://buddylindsey.com/learn-python-the-hard-way-review/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 22:00:45 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[new-language]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=576</guid>
		<description><![CDATA[Life tends to push you in directions you don&#8217;t expect, and it has for me. Recently I have felt I am being pushed to learn python based on a various situations and conversations that have arrived. So, I decided to sit down and learn python, and let me tell you it has been a fun [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Life tends to push you in directions you don&#8217;t expect, and it has for me. Recently I have felt I am being pushed to learn python based on a various situations and conversations that have arrived. So, I decided to sit down and learn python, and let me tell you it has been a fun and interesting experience.</p>
<p>I think though a tiny bit of history should be involved first. About a year and half ago I decided to learn python because I wanted to create a few utilities for my netbook which was running Ubuntu. I struggled for a about a week and didn&#8217;t get anywhere at all. The language was so confusing and I couldn&#8217;t seem to find a resource succinct enough for me. Various things happened shortly after and I moved on never to touch python again, for a while at least.</p>
<p>Fast forward 6 months and I started getting heavily involved in learning Ruby and Ruby on Rails. Even made a few different applications, including <a href="http://sourcehold.com">Sourcehold</a>, also gave some presentations, and became very familiar with the Ruby programming language. My experience up to this point with dynamic languages involved php and my failed attempt at python.</p>
<p>Now lets jump to this last weekend. Based on my experiences over the last year and a half, coupled with a &#8220;have to learn&#8221; attitude I was able to do just that. I&#8217;ll be honest I am really liking python. I was unsure how I would take to the whitespace issue and the fact I had failed at learning it in the past, but things were not so bad this time because I found the best resource for me.</p>
<p><a href="http://learnpythonthehardway.org/">Learn Python the Hard Way</a></p>
<p>Generally accepting that a) learning programming can be hard and b) just because it says hard doesn&#8217;t mean it is. I jumped in feet first into this book online. I am a huge proponent of typing out all code and not copying and pasting. So was very happy to see it is exactly how this book was designed. Each chapter is short enough to get the point across and provides a solid piece of code to get you comfortable with what you are doing.</p>
<p>There is also some good explanations of what is going on, and the extra credit&#8217;s are really good at getting you to go a bit beyond what is on the page and think a bit more. If you already program there is a lot of mundane things listed, but I went ahead and read everything anyway hoping I could pickup something more. I do have to say doing so paid off because there are a lot of good nuggets of information in the writing.</p>
<p>I would honestly say if you want to learn python and have a solid previous experience programming you can get through this book in a day and start your next program the next day. I actually did just that. I started about noon on Saturday and off and on until the afternoon on Sunday I worked on going through the whole book. Then on Monday I started working on &#8220;<a href="http://sourcehold.com/buddylindsey/termnews">termnews</a>&#8221; which is a command line app I am writing, not done yet, to get the latest headlines from my rss feeds, basically I want the latest world news headlines quickly to see what is happening. So going from no python experience on Saturday morning to a working application Monday afternoon I think is pretty good, and goes to show how well the book works.</p>
<p>Overall I think <a href="http://learnpythonthehardway.org/">Learn Python the Hard Way</a> is the way to go if you want to pickup python. It can be gone through quickly and really gives you a good tour of the language to start using it right away. My next goal is to start working with Django and get familiar with that so I know what is going on in Django world as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/learn-python-the-hard-way-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>update_attributes Takes a Hash Not an Object</title>
		<link>http://buddylindsey.com/update_attributes-takes-a-hash-not-an-object/</link>
		<comments>http://buddylindsey.com/update_attributes-takes-a-hash-not-an-object/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 14:48:10 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=561</guid>
		<description><![CDATA[Sometimes you need to break rails convention to achieve specific goals. Unfortunately, this can lead to some not so pretty code which doesn&#8217;t allow you to use as many of the rails niceties that exist, if you do everything by default. One of the things that makes it tough at times to do rails development [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes you need to break rails convention to achieve specific goals. Unfortunately, this can lead to some not so pretty code which doesn&#8217;t allow you to use as many of the rails niceties that exist, if you do everything by default. One of the things that makes it tough at times to do rails development is so much is handled for you it is hard to be explicit about your intentions.</p>
<p>I had to create a very ugly form recently and on the back end I couldn&#8217;t do a simple <em>update_attributes(params[:object])</em> in my update controller method. So not really understanding how the method works and just assuming like everything else it works with objects I kept throwing objects at update_attributes to no avail. Even tried some crazy raw db calls as well, it wasn&#8217;t pretty.</p>
<p>Then I decided to get the bright idea and actually look at what update_attributes takes as a parameter. Well I didn&#8217;t actually look for it specifically at some point it jumped off the page and slapped me up side the head.</p>
<p>The thing of note is update_attributes takes a hash <strong>not</strong> an object. It doesn&#8217;t read the current state of the object you are running the method on, and check against the database and then do a save. Nope it plain and simple takes a hash. Lets take a look at some code.</p>
<p>Lets say you have a user model and it has a few attributes.</p>
<pre class="brush: ruby; title: ; notranslate">
name
state
phone
</pre>
<p>You also have your controller with an edit and update method.</p>
<pre class="brush: ruby; title: ; notranslate">
class UsersController &lt; ApplicationController
     def edit
          @user = User.find(1)
     end     

     def update
     end
end
</pre>
<p>Normally you would have a form and it would pass the &#8220;object&#8221; to the controller and you would do the following:</p>
<pre class="brush: ruby; title: ; notranslate">
class UsersController &lt; ApplicationController
     def edit
          @user = User.find(1)
     end  

     def update
          @user = User.find(params[:id])
          @user.update_attributes(params[:user])
     end
end
</pre>
<p>It is so much fun when that actually works. However, lets say you have to do something really, really funny after a user submits their data which requires you to modify the state and phone. To remedy some problems that might occur all you need to do is create a hash with the attribute name and the value then pass that to the update_attribute method. Like this:</p>
<pre class="brush: ruby; title: ; notranslate">
class UsersController &lt; ApplicationController
  def edit
    @user = User.find(1)
  end  

  def update
    @user = User.find(params[:id])

     submission_hash = {&quot;name&quot; =&gt; params[:name],
                       &quot;state&quot; =&gt; some_method1(params[:state]),
                       &quot;phone&quot; =&gt; some_method2(params[:phone])}

     @user.update_attributes(submission_hash)
  end
end
</pre>
<p>That should work for you. I actually like this solution in a couple of edge cases because it allows me to be explicit in what I am doing instead of relying on voodoo. Sometimes it is how explicit you have to be in ASP.NET MVC which is why I miss it. So next time you have a problem updating data remember you can pass a hash if you need to go down that road.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/update_attributes-takes-a-hash-not-an-object/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Getting RSpec to Work With New and Existing Rails Projects</title>
		<link>http://buddylindsey.com/getting-rspec-to-work-with-new-and-existing-rails-projects/</link>
		<comments>http://buddylindsey.com/getting-rspec-to-work-with-new-and-existing-rails-projects/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 22:37:07 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=554</guid>
		<description><![CDATA[Part 1: General Installation and Using with a new Rails Project We are going to install rspec for our testing framework and autotest is going to be the actual thing that runs all your tests. How, autotest works is it watches for when a file has been modified. If it sees that a file has [...]]]></description>
			<content:encoded><![CDATA[<p></p><h3>Part 1: General Installation and Using with a new Rails Project</h3>
<p>We are going to install rspec for our testing framework and autotest is going to be the actual thing that runs all your tests.</p>
<p>How, autotest works is it watches for when a file has been modified. If it sees that a file has had a modified date change it runs the tests automatically. Also rspec is what autotests runs when it detects a file change.</p>
<h4>Getting the Gems you Need</h4>
<p>To get started you need to add these lines to your Gemfile, and do a bundle install so you can install the appropriate gems. It is recommended to put them in the development and test group so that you only runs them while doing development since in production those gems are no longer needed.</p>
<blockquote><p>
group :development, :test do<br />
&nbsp; &nbsp; gem &#8220;rspec&#8221;<br />
&nbsp; &nbsp; gem &#8220;rspec-rails&#8221;<br />
&nbsp; &nbsp; gem &#8220;autotest&#8221;<br />
&nbsp; &nbsp; gem &#8220;autotest-standalone&#8221;<br />
end
</p></blockquote>
<p>Don&#8217;t forget to run &#8220;bundle install&#8221;</p>
<h4>Install Rspec in your Rails app</h4>
<p>Just run this in command line on your rails application</p>
<pre class="brush: plain; title: ; notranslate">
$ rails generate rspec:install
</pre>
<p>Now that you have your install done when you create a new controller it should generate all your rspec files for you, and you are ready to go with your new project. From here open up a fresh terminal window and run the command &#8216;autotest&#8217; and it will start running your tests.</p>
<p>If you are only using rspec for a new project you can skip to part 3, writing your first couple of tests, but I recommend you read the next part as well to get a better understanding of what is going on.</p>
<h3>Part 2: Adding Rspec to an Existing Project</h3>
<p>If you haven&#8217;t used TestUnit for writing tests then you can just delete the /test folder out of your project it really doesn&#8217;t need to be there at this point since all of our tests are going to be in the /spec folder.</p>
<p>This next part needs a bit more detail since you already have a project going and need to know how to insert rspec into it, and start using it. Specific things are needed in specific places, very similar to rails opinionation.</p>
<p>The specific files that are needed for a controller test are &#8220;spec/controllers/person_controller_spec.rb&#8221;, &#8220;app/helpers/person_helper.rb&#8221;.</p>
<p>These can really have any name to them. In general your test file will have the same name as your controller, or model, with _spec at the end of the name. Also for each controller you need to have the main helper file as well since rspec does try call it when running tests.</p>
<p>Here is some code from both so you can at least have a place holder, for now. We won&#8217;t be actually using the helper class in this, but, again, I am talking about it because you do need it. In general the helper is generated for you if you use the command line generation tool for controllers.</p>
<p><strong>users_helper.rb</strong></p>
<pre class="brush: ruby; title: ; notranslate">
module UsersHelper
end
</pre>
<p><strong>users_controller_spec.rb</strong></p>
<pre class="brush: ruby; title: ; notranslate">
require 'spec_helper'
</pre>
<p>Below is a general idea of the layout of what your spec/ folder should look like in your project. It helps keep it organized and looking good.</p>
<ul>
<li>spec/
<ul>
<li>helpers/</li>
<li>routes/</li>
<li>models/</li>
<li>controllers/</li>
<li>views/</li>
</ul>
</li>
</ul>
<p>You can probably guess what kind of tests go where. For naming the test files you take the name of the file you are wanting to test and just add _spec to it. So:</p>
<blockquote><p>persons_controller.rb =&gt; persons_controller_spec.rb<br />
users_controller.rb =&gt; users_controller_spec.rb</p></blockquote>
<p>Finally, if you are going to be running any of your tests and your application hits a database then you will need to make sure you have your migration files up-to-date and working. If you get any errors in your tests, only if you get them, where it cannot find a table and/or column name run the following command. It runs the migrations agains the test database to make sure the structure is there.</p>
<pre class="brush: plain; title: ; notranslate">
$ RAILS_ENV=&quot;test&quot; rake db:migrate
</pre>
<h3>Part 3: Writing your first few tests</h3>
<p>First, if autotest is not running go ahead and open up a command line window and run it.</p>
<pre class="brush: plain; title: ; notranslate">
$ autotest
</pre>
<p>Now you need actually write a couple of tests to make sure things are working. Here is some example test code we can use to test our users controller, a bit.</p>
<p>Add this to your users_controller_spec.rb file in the /spec/controllers/ folder.</p>
<pre class="brush: ruby; title: ; notranslate">
require 'spec_helper'

describe UsersController do
  describe &quot;GET Index&quot; do
    it &quot;gets the index view&quot; do
      get &quot;index&quot;
      response.status.should be 200
    end

    it &quot;gets the correct index view template&quot; do
      get &quot;index&quot;
      response.should render_template(&quot;users/index&quot;)
    end
  end
end
</pre>
<p>Those two tests should pass and you should get an output similar to:</p>
<blockquote><p>Finished in 0.08076 seconds<br />
2 examples, 0 failures</p></blockquote>
<p>That result assumes you aren&#8217;t doing anything fancy with your controllers.</p>
<p>A note about the example code, which I&#8217;ll explain more in some other post, the get call actually makes an http get and response is what is returned from that get, so you can test based on that.</p>
<h3>Conclusion</h3>
<p>Rspec was really scary until i could get it broken down to simplest terms as I have laid out in this post. This really is the simplest form you can get it into when starting to use rspec with your projects. Understanding how some of these basics work really will help when getting started, especially if you are adding rspec to an existing project. Hopefully this will help others as much as it has helped me.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/getting-rspec-to-work-with-new-and-existing-rails-projects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Get Started with NSSavePanel in MacRuby</title>
		<link>http://buddylindsey.com/get-started-with-nssavepanel-in-macruby/</link>
		<comments>http://buddylindsey.com/get-started-with-nssavepanel-in-macruby/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 19:00:35 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[MacRuby]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=540</guid>
		<description><![CDATA[Save file dialog boxes have always seemed magical to me because I have never done any client side applications. While working on a MacRuby client app I needed to save a file, obviously, and it was amazing how simple a save file dialog box really is. What Does NSSavePanel Do? This is very simple. It [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Save file dialog boxes have always seemed magical to me because I have never done any client side applications. While working on a MacRuby client app I needed to save a file, obviously, and it was amazing how simple a save file dialog box really is.</p>
<h2>What Does NSSavePanel Do?</h2>
<p>This is very simple. It returns a path to the file you want to save. From there you hand off that path to what ever you needed to save a file. This really makes it simple to save files. I was impressed with NSSavePanel for 2 reasons. One: It gave me a way to have users save files with a consistent look and feel. And two: Once you figure it out, its dead simple to use and understand.</p>
<h2>The Code</h2>
<p>You can configure the NSSavePanel a lot more than what I am showing here. I recommend you take a look at the <a href="http://developer.apple.com/library/mac/#documentation/cocoa/reference/ApplicationKit/Classes/NSSavePanel_Class/Reference/Reference.html">NSSavePanel Class Reference</a> to see what all you can do, then just play with it a bit.</p>
<pre class="brush: ruby; title: ; notranslate">
dialog = NSSavePanel.new

dialog.allowedFileTypes = [&quot;xyz&quot;]

if dialog.runModal == NSOKButton
     puts dialog.filename
end
</pre>
<p>Above is mostly the bare minimum. Lets look at what it does.</p>
<p>Line 1: creates a new instance of NSSavePanel so we can use it. NSSavePanel is a cocoa object that you are using.</p>
<p>Line 3: This sets the array allowedFileTypes 0 index to &#8220;xyz&#8221;. If you only have 1 file type in the array it defaults the path returned to have that file type. So you could set it to txt and the path returned would be /some/path/to/file.txt. </p>
<p>Line 5: This is the magic. The runModal method is what opens the NSSavePanel. Once you do your thing and hit the OK button it checks that you clicked the OK button and runs line 6.</p>
<p>Line 6: This outputs to console the filename of where and what you just wanted to save. This is where you would put your actual save file code using dialog.filename for the path to write to. You can use the ruby File object here.</p>
<h2>Conclusion</h2>
<p>Saving files is easy enough. Using the built in cocoa ability to save files makes life all that much easier. This is why I really like using MacRuby because it makes writing cocoa apps so much simpler. The code used in this example is the bare minimum of what you need, and will work in a lot of cases. Have fun with MacRuby.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/get-started-with-nssavepanel-in-macruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>is_admin Security SMF and WordPress error</title>
		<link>http://buddylindsey.com/is_admin-security-smf-and-wordpress-error/</link>
		<comments>http://buddylindsey.com/is_admin-security-smf-and-wordpress-error/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 16:43:00 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SMF]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=535</guid>
		<description><![CDATA[Integrating the SMF SSI.php file with wordpress tends to lead to a problem for some people, it was for me for a while. To get it to work takes 2 simple steps. 1) In your themes functions.php page add the following line: 2) Delete the is_admin() function at the bottom of the Sources/security.php file of [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Integrating the SMF SSI.php file with wordpress tends to lead to a problem for some people, it was for me for a while. To get it to work takes 2 simple steps.</p>
<p>1) In your themes functions.php page add the following line:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php include(&quot;/path/to/smf/SSI.php&quot;); ?&gt;
</pre>
<p>2) Delete the is_admin() function at the bottom of the Sources/security.php file of your SMF installation. It isn&#8217;t needed anymore just there for legacy support.</p>
<p>That is it. Now you should be able to use the SMF SSI.php functions in your app just fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/is_admin-security-smf-and-wordpress-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>no such file to load &#8212; zlib &#8211; Solution</title>
		<link>http://buddylindsey.com/no-such-file-to-load-zlib-solution/</link>
		<comments>http://buddylindsey.com/no-such-file-to-load-zlib-solution/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 23:15:32 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=532</guid>
		<description><![CDATA[Installing ruby with RVM on Ubuntu seems to be a tricky endeavor. While RVM was installing ruby 1.9.2 it ended with an error. The ruby install seemed to work fine, but I got the following line close to the end: Problem error: Error running &#8216;/home/buddy/.rvm/rubies/ruby-1.9.2-p0/bin/gem update &#8211;system So I tried to run the command myself: [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Installing ruby with <a href="http://rvm.beginrescueend.com/">RVM</a> on <a href="http://ubuntu.com">Ubuntu</a> seems to be a tricky endeavor. While RVM was installing ruby 1.9.2 it ended with an error. The ruby install seemed to work fine, but I got the following line close to the end:</p>
<h2>Problem</h2>
<blockquote><p>
error: Error running &#8216;/home/buddy/.rvm/rubies/ruby-1.9.2-p0/bin/gem update &#8211;system
</p></blockquote>
<p>So I tried to run the command myself:</p>
<pre class="brush: plain; title: ; notranslate">
gem update --system
</pre>
<p>I got the following full error:</p>
<h2>Exact Error</h2>
<blockquote><p>
buddy@ubuntu:~$ gem update &#8211;system<br />
ERROR:  Loading command: update (LoadError)<br />
    no such file to load &#8212; zlib<br />
ERROR:  While executing gem &#8230; (NameError)<br />
    uninitialized constant Gem::Commands::UpdateCommand
</p></blockquote>
<p>This error tends to leave one a little flustered since it is so ambiguous, yet exact. So I opened up synaptic and started installing zlib packages until one worked. I finally found the one &#8220;zlib1g-dev&#8221; so just do a simple command.</p>
<h2>Solution</h2>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install zlib1g-dev
</pre>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/no-such-file-to-load-zlib-solution/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails From ASP.NET Perspective</title>
		<link>http://buddylindsey.com/ruby-on-rails-from-asp-net-perspective/</link>
		<comments>http://buddylindsey.com/ruby-on-rails-from-asp-net-perspective/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 19:45:01 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=519</guid>
		<description><![CDATA[These are the slides and video from my presentation at Tulsa TechFest 2010. The talk is a walkthrough of Ruby on Rails. From install to working application. Please leave feedback on your thoughts. Slides Video Project Files Downloads Ruby On Rails Tulsa TechFest 2010 Presentation Code &#8211; Unedited or Added to]]></description>
			<content:encoded><![CDATA[<p></p><p>These are the slides and video from my presentation at Tulsa TechFest 2010. The talk is a walkthrough of Ruby on Rails. From install to working application. Please leave feedback on your thoughts.</p>
<h3>Slides</h3>
<object type='application/x-shockwave-flash' wmode='opaque' data='http://static.slideshare.net/swf/ssplayer2.swf?id=5758448&doc=ror-101112130917-phpapp02' width='425' height='348'><param name='movie' value='http://static.slideshare.net/swf/ssplayer2.swf?id=5758448&doc=ror-101112130917-phpapp02' /><param name='allowFullScreen' value='true' /></object>
<h3>Video</h3>
<p><iframe src="http://player.vimeo.com/video/16795841" width="600" height="338" frameborder="0"></iframe></p>
<h3>Project Files Downloads</h3>
<p><a href='http://buddylindsey.com/wp-content/uploads/2010/11/RubyOnRails_TulsaTechFest2010_Presentation_Code.zip'>Ruby On Rails Tulsa TechFest 2010 Presentation Code &#8211; Unedited or Added to</a></p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/ruby-on-rails-from-asp-net-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# vs Ruby: If…Then…Else</title>
		<link>http://buddylindsey.com/c-vs-ruby-if-then-else/</link>
		<comments>http://buddylindsey.com/c-vs-ruby-if-then-else/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 17:45:12 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=508</guid>
		<description><![CDATA[Everyone needs the powerful &#8220;if&#8230;then&#8230;else&#8221; when doing development. With ruby it is actually quite simple and close to C#, but you need to see it so you can understand the differences. Ruby has the traditional operators: &#8220;==&#8221;, &#8220;&#124;&#124;&#8221;, &#8220;&#038;&#038;&#8221;, &#8220;&#8221; etc. So you can still use those like normal. They also have some modifications of [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Everyone needs the powerful &#8220;if&#8230;then&#8230;else&#8221; when doing development. With ruby it is actually quite simple and close to C#, but you need to see it so you can understand the differences.</p>
<p>Ruby has the traditional operators: &#8220;==&#8221;, &#8220;||&#8221;, &#8220;&#038;&#038;&#8221;, &#8220;<", ">&#8221; etc. So you can still use those like normal. They also have some modifications of those which will explained in another post because of the nuances of them.</p>
<h2>Traditional If Statement</h2>
<p><strong>C#</strong></p>
<pre class="brush: csharp; title: ; notranslate">
if(i == 2)
{
	Console.WriteLine(i);
}
</pre>
<p><strong>Ruby</strong></p>
<pre class="brush: ruby; title: ; notranslate">
if i == 1
 	puts i
end
</pre>
<p>The ruby code above can works with parenthesis, but a lot of the code I see doesn&#8217;t use them. There is a whole discussion that can be had about when and where to use parenthesis which is for another time and date, just wanted you to be aware.</p>
<p>Here are a couple of other ways for your code to be formatted which can allow for better readability or just a quick way to throw an if in where needed.</p>
<pre class="brush: ruby; title: ; notranslate">
# short hand 1
puts i if i == 1

# short hand 2
if i == 1 then puts i end

#short hand 3
if i == 1 : puts i end
</pre>
<h2>If&#8230;Else</h2>
<p>For those times that the if doesn&#8217;t work and you need to output something else.<br />
<strong>C#</strong></p>
<pre class="brush: csharp; title: ; notranslate">
if(i == 2){
	Console.WriteLine(i);
}
else {
	Console.WriteLine(i);
}
</pre>
<p><strong>Ruby</strong></p>
<pre class="brush: ruby; title: ; notranslate">
if (i == 2)
	puts i
else
	puts i
end
</pre>
<h2>If&#8230;Else Shorthand</h2>
<p>This can be useful, but a bit of a pain to implement at times. I am curios how often others actually use these if then else shorthands?<br />
<strong>C#</strong></p>
<pre class="brush: csharp; title: ; notranslate">
Console.WriteLine(	i == 2 ? i++ : 3 );
</pre>
<p><strong>Ruby</strong></p>
<pre class="brush: ruby; title: ; notranslate">
i == 2 ? (puts i) : (puts 1)
</pre>
<h2>If&#8230;ElseIf&#8230;Else</h2>
<p>As you have probably notice a lot of this is fairly similar just note for the Ruby first of else if there is no e in the elseif. That is about the only difference.</p>
<p><strong>C#</strong></p>
<pre class="brush: csharp; title: ; notranslate">
if(i == 2){
	Console.WriteLine(i);
}
else if(i == 3){
	Console.WriteLine(i);
}
else{
	Console.WriteLine(i);
}
</pre>
<p><strong>Ruby</strong></p>
<pre class="brush: ruby; title: ; notranslate">
if i == 1
	puts i
elsif i == 2
	puts i
else
	puts i
end
</pre>
<h2>Conclusion</h2>
<p>If statements are easy to do and quite essential when programming. There are probably many more ways in both languages to do these. I just was showing a few. If you are aware of other ways please post them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/c-vs-ruby-if-then-else/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add jQuery to Ruby on Rails</title>
		<link>http://buddylindsey.com/add-jquery-to-ruby-on-rails/</link>
		<comments>http://buddylindsey.com/add-jquery-to-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 15:25:13 +0000</pubDate>
		<dc:creator>Buddy Lindsey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://buddylindsey.com/?p=473</guid>
		<description><![CDATA[In a previous post I talked about using jQuery and modifying the rails.js file to fit your needs doing deletion. Recently I figured out a much better way to do this. You can install a gem then run a rails generate command which will delete your current javascript files and replace them with the appropriate [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In a previous post I talked about using jQuery and modifying the rails.js file to fit your needs doing deletion. Recently I figured out a much better way to do this. You can install a gem then run a rails generate command which will delete your current javascript files and replace them with the appropriate jQuery files.</p>
<h2>Step 1: Install &#8220;jquery-rails&#8221; Gem</h2>
<p>In command line type:</p>
<blockquote><p>
gem install jquery-rails
</p></blockquote>
<p>Or Add the following line to your gemfile project and run the &#8220;bundle install&#8221; command</p>
<blockquote><p>
gem &#8216;jquery-rails&#8217;
</p></blockquote>
<h2>Step 2: Add jQuery to Project</h2>
<p>Open up your project in command line and type:</p>
<blockquote><p>
rails generate jquery:install
</p></blockquote>
<p>If you want to use jQuery UI add &#8211;ui</p>
<blockquote><p>
rails generate jquery:install &#8211;ui
</p></blockquote>
<p>That is it. Fairly simple to do for more information about this gem visit the githup repo for it. <a href="http://github.com/rails/jquery-ujs">jquery-ujs github repositor</a>. I recommend adding the line to your gem file for doing the install. However, if you want to add jquery manually visit the github page for manual installation instructions.</p>
]]></content:encoded>
			<wfw:commentRss>http://buddylindsey.com/add-jquery-to-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

