<?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>Inside Coder</title>
	<atom:link href="http://blog.insidecoder.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.insidecoder.com</link>
	<description>Coding on company time</description>
	<lastBuildDate>Mon, 06 May 2013 11:14:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Differences I&#8217;ve seen between Rails and ASP.NET MVC</title>
		<link>http://blog.insidecoder.com/differences-ive-seen-between-rails-and-asp-net-mvc/</link>
		<comments>http://blog.insidecoder.com/differences-ive-seen-between-rails-and-asp-net-mvc/#comments</comments>
		<pubDate>Mon, 06 May 2013 11:14:39 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.insidecoder.com/?p=106</guid>
		<description><![CDATA[I&#8217;ve spent a long time with both Rails and ASP.NET MVC and thought I&#8217;d document some of the differences I saw for future reference. Both frameworks can produce nearly identical solutions so as far as the end product of either &#8230; <a href="http://blog.insidecoder.com/differences-ive-seen-between-rails-and-asp-net-mvc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve spent a long time with both Rails and ASP.NET MVC and thought I&#8217;d document some of the differences I saw for future reference.  Both frameworks can produce nearly identical solutions so as far as the end product of either there&#8217;s not much to talk about.  There are some subtle differences in how you get to that point.</p>
<p>Rails has a rapid release cycle<br />
ASP.NET MVC releases slower and maintains compatibility</p>
<p>Rails is a full stack framework<br />
ASP.NET MVC requires you to make your own choices</p>
<p>Rails tooling is mostly free<br />
ASP.NET MVC has many great tools locked behind a purchase price</p>
<p>Rails works the same with most databases<br />
ASP.NET MVC has a discrepancy in tooling and favors SQL Server</p>
<p>Rails is powered by Ruby which is a dynamic language<br />
ASP.NET MVC is powered by C# which is a static language</p>
<p>Rails works great in Mac OS or Linux<br />
ASP.NET MVC is meant for Windows</p>
<p>I&#8217;m sure there are a lot more but those are the ones that stood out for me.  Neither one has reasons not to use them.  Each one has ways to get around any perceived deficiencies.  Both frameworks are being actively developed and continue to grow and get better.  In my mind you can&#8217;t go wrong with either one but one might be more suited to a particular project.  The best way to figure that out is to use them both and see which fits your current needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/differences-ive-seen-between-rails-and-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NHibernate Listeners for Rails style audit fields</title>
		<link>http://blog.insidecoder.com/using-nhibernate-listeners-for-rails-style-audit-fields/</link>
		<comments>http://blog.insidecoder.com/using-nhibernate-listeners-for-rails-style-audit-fields/#comments</comments>
		<pubDate>Sat, 04 May 2013 17:33:04 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[entity framework]]></category>
		<category><![CDATA[event listeners]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.insidecoder.com/?p=94</guid>
		<description><![CDATA[One of the great advantages I&#8217;ve found of NHibernate over Entity Framework is the ability to create event listeners.  These allow you to fire off pieces of code at specific times in the ORM cycle such as before creating or &#8230; <a href="http://blog.insidecoder.com/using-nhibernate-listeners-for-rails-style-audit-fields/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>One of the great advantages I&#8217;ve found of <a href="http://nhforge.org" target="_blank">NHibernate</a> over <a href="http://entityframework.codeplex.com/" target="_blank">Entity Framework</a> is the ability to create event listeners.  These allow you to fire off pieces of code at specific times in the ORM cycle such as before creating or updating a record.  We can use that functionality to provide audit properties in much the same way as ActiveRecord does in Rails 3.</p>
<p>These properties are the created_at and updated_at fields on a table in a Rails application database.  To duplicate this we&#8217;ll need to add two properties to our entity classes through an interface.</p>
<pre class="brush: csharp; title: ; notranslate">
public interface IAuditProperties
{
    DateTime CreatedAt { get; set; }
    DateTime? UpdatedAt { get; set; }
}
</pre>
<p>Next create a class called AuditEventListener and have it implement the NHibernate IPreUpdateEventListener and IPreInsertEventListener interfaces.</p>
<pre class="brush: csharp; title: ; notranslate">
public class AuditEventListener : IPreUpdateEventListener, IPreInsertEventListener
{
    public bool OnPreUpdate(PreUpdateEvent @event)
    {
        var audit = @event.Entity as IAuditProperties;
        if (audit == null)
        {
            return false;
        }

        var time = DateTime.Now;

        SetState(@event.Persister, @event.State, &quot;UpdatedAt&quot;, time);
        audit.UpdatedAt = time;

        return false;
    }

    public bool OnPreInsert(PreInsertEvent @event)
    {           
        var audit = @event.Entity as IAuditProperties;

        if (audit == null)
        {
            return false;
        }

        var time = DateTime.Now;

        SetState(@event.Persister, @event.State, &quot;CreatedAt&quot;, time);
        audit.CreatedAt = time;

        return false;
    }

    private void SetState(IEntityPersister persister, object[] state, string propertyName, object value)
    {
        var index = Array.IndexOf(persister.PropertyNames, propertyName);
        if (index == -1)
            return;
        state[index] = value;
    }   
}
</pre>
<p>Now we need to hook these listeners into our configuration. I use <a href="http://www.fluentnhibernate.org/" target="_blank">Fluent NHibernate</a> to configure NHibernate so we&#8217;ll add the following to our session factory.</p>
<pre class="brush: csharp; title: ; notranslate">
return Fluently.Configure()
               .Database(config)                
               .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;UserMap&gt;())
               .ExposeConfiguration(SetListeners)
               .BuildSessionFactory();
</pre>
<p>SetListeners is a method that takes the configuration and adds the listeners to it.  I have it defined like so:</p>
<pre class="brush: csharp; title: ; notranslate">
private static void SetListeners(NHibernate.Cfg.Configuration config)
{
    config.AppendListeners(NHibernate.Event.ListenerType.PreInsert, new[] { new AuditEventListener() });
    config.AppendListeners(NHibernate.Event.ListenerType.PreUpdate, new[] { new AuditEventListener() });
}
</pre>
<p>This will append our listener to the configuration for each event we want to respond to from NHibernate.</p>
<p>Once all of this is in place, any time you save a new entity and NHibernate is about to insert that data into the database it will call our listener and set the audit property CreatedAt.  The same for update but this time it only updates the UpdatedAt property.</p>
<p>This will give you the same audit properties that Rails has to tell you when a specific record was created and last updated.  This can be helpful to track down when a record was created, whether or not a record has been updated and the last time it was.</p>
<p>Event Listeners are a great way to gain control over your ORM and a excellent way to keep your code DRY.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/using-nhibernate-listeners-for-rails-style-audit-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Open Source Advantage</title>
		<link>http://blog.insidecoder.com/the-open-source-advantage/</link>
		<comments>http://blog.insidecoder.com/the-open-source-advantage/#comments</comments>
		<pubDate>Fri, 03 May 2013 16:18:01 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.insidecoder.com/?p=66</guid>
		<description><![CDATA[I was recently developing an application using NHibernate as the ORM and wanted to implement an event listener to update a timestamp field on records before they were saved to the database.  Having looked up information about NHibernate listeners I &#8230; <a href="http://blog.insidecoder.com/the-open-source-advantage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I was recently developing an application using NHibernate as the ORM and wanted to implement an event listener to update a timestamp field on records before they were saved to the database.  Having looked up information about NHibernate listeners I found an example of using OnPreInsert and OnPreUpdate that I could hook into and get what I wanted.</p>
<p>The problem came when I didn&#8217;t pay attention to the return value of these listeners.  I saw that it was supposed to return a bool value and in my haste I simply had it return true after updating the entity properties.</p>
<p>This began my fun journey of running around trying to figure out why my tests where now all failing.  I pinpointed my listener routine as the problem but every time I looked at it I felt confident that return true is what it should do.  I figured that it wanted to know whether it was successful at making the change, so I told it to return true.</p>
<p>Finally out of frustration I changed it to return false.  Suddenly all of my tests passed.  I was happy that I found the solution to my problem but I hated not knowing why it worked.  Luckily NHibernate is an open source project and the source code is freely available on <a href="https://github.com/nhibernate/nhibernate-core" target="_blank">GitHub</a>.  I fired up my browser and started looking through the code.  I found where <a href="https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Event/IPreInsertEventListener.cs" target="_blank">OnPreInsertEventListener</a> was implemented and saw a single line comment that told me exactly what I wanted to know.  You return true in your listener if you want it to be vetoed.</p>
<p>Basically I was telling NHibernate to do the opposite of what I wanted based on my own preconceived notion of what the return bool meant.  That was quickly cleared up and my understanding of this functionality was increased simply by being able to see what it was doing.</p>
<p>The power that comes from being able to look at the source code of a library you&#8217;re working with and see exactly how it functions is immensely useful.  It has allowed me to overcome obstacles, given me choices in my solutions to problems and even allows me to learn from those who are much better than myself.  And that is the open source advantage to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/the-open-source-advantage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails versus ASP.NET MVC 4 Business Performance</title>
		<link>http://blog.insidecoder.com/rails-versus-asp-net-mvc-4-business-performance/</link>
		<comments>http://blog.insidecoder.com/rails-versus-asp-net-mvc-4-business-performance/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 15:39:03 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.insidecoder.com/?p=72</guid>
		<description><![CDATA[ASP.NET MVC is based loosely off of the ideas found in Ruby on Rails. After using ASP.NET MVC 2 for many projects I decided to learn Rails 3 to get a deeper understanding of what Microsoft was basing its ideas &#8230; <a href="http://blog.insidecoder.com/rails-versus-asp-net-mvc-4-business-performance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>ASP.NET MVC is based loosely off of the ideas found in Ruby on Rails. After using ASP.NET MVC 2 for many projects I decided to learn Rails 3 to get a deeper understanding of what Microsoft was basing its ideas upon. I spent a couple years working with Rails exclusively for web development. The last large project I produced was a student time tracking application. The application allows a student to sign into and out of the academic labs and tracks their total time spent over the course of a semester.</p>
<p>The application worked without problems for a single semester. The next semester saw a dramatic increase in the amount of students passing through the system. This increase caused some hardships and the weaknesses in my application were starting to show.</p>
<p>I spent several months researching solutions, digging through my code and solving problems I found. There was an N+1 problem in the reporting module that was solved using includes in ActiveRecord. That gave a major increase in performance and it seemed that the problems were solved. Then I started to receive gateway timeouts as the database grew each day. That&#8217;s when I decided to look at ASP.NET MVC and nHibernate to test its ability to process the data as an alternative to moving all processing to the background.</p>
<p>Initial testing was done on a final semester data set that included all student sessions for that semester. The code generates a detailed report that displays the total time spent by each student for each of their courses. The time required to run this report on both frameworks is below.</p>
<p>Rails 3.2 : 45.3 seconds<br />
ASP.NET MVC 4 : 15.1 seconds</p>
<p>Based on these numbers I decided to completely rewrite the application using ASP.NET MVC 4. I spent several months of nonstop development to rewrite the project. Upon completion I was able to realize an increase of five times the performance of Rails for CPU intensive operations.</p>
<p>Both of these application servers run within the corporate VMware server using the same configurations. RHEL 6.3 was used for Rails while Windows 2008 R2 was used for ASP.NET MVC 4. I am comfortable in both environments and have successful applications running on both platforms. I embrace the Open Source movement even within ASP.NET MVC. For these tests I have tried to remain as unbiased as possible.</p>
<p>After spending considerable time with both frameworks I feel confident that either can provide the same solutions. The only difference comes when you run up against underlying problems with the technology. In this case MRI Ruby is known as being slower at CPU processing than C#. For web applications this is not the normal bottleneck but for business applications it can be depending on the amount of data that needs to be processed in a given unit of time.</p>
<p>Being a developer means knowing which tool to use for the problems you face. Neither of these frameworks have features to completely give up the other for. It is mostly a matter of choosing the right tool for the job. Having spent time writing the same application in both I have seen the good and bad qualities of each of them. I would recommend getting to know both and making your own decision as to which you like. For the work environment ASP.NET MVC 4 seems to be a better fit for me while in my off hours I still enjoy the simplicity of Rails.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/rails-versus-asp-net-mvc-4-business-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY git remote repository</title>
		<link>http://blog.insidecoder.com/diy-git-remote-repository/</link>
		<comments>http://blog.insidecoder.com/diy-git-remote-repository/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 11:37:39 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[remote repository]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://insidecoder.com/?p=42</guid>
		<description><![CDATA[I have a secret to tell you.  There was a long period of time where I didn&#8217;t use a source revision control system.  *GASP*  Honestly, I mostly work alone so it never seemed like the effort was worth the payout. &#8230; <a href="http://blog.insidecoder.com/diy-git-remote-repository/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have a secret to tell you.  There was a long period of time where I didn&#8217;t use a source revision control system.  *GASP*  Honestly, I mostly work alone so it never seemed like the effort was worth the payout.  I made copies of my code before I did major changes and always had backups.  I did have a brief run-in with SVN and while the idea of having your files watched and backed up as needed was nice, it turned into a hassle when I would move between machines or work offline.</p>
<p>Then I started rails development and <a href="http://git-scm.com/">git </a>was thrown at me as a defacto standard.  At first I thought of looking for a GUI like I had with SVN but since I move between operating systems pretty regularly depending on where I am, I wanted something I could count on being where I was no matter what.  The command line utility was my choice.  It&#8217;s really not too difficult once you get used to it and even now I really don&#8217;t use it to it&#8217;s full potential as it&#8217;s mostly just myself.  But if I want to add a developer or a whole team to a project I can and we can all work seamlessly.</p>
<p>Once you decide to use git you need to have a place to upload your source.  A lot of people will use <a href="https://github.com/">github</a> and if you have an open source project that&#8217;s a great idea because it&#8217;s free.  For me, I already had a VPS and wanted to utilize that instead of paying another monthly fee.  Here&#8217;s how I got it working on my server.</p>
<p>Just a quick note about the server, my VPS is a Linux server.  I cannot say if this would work on a Windows server but as long as you can get a SSH server and git working there should be no reason it wouldn&#8217;t.  I suggest using Linux.</p>
<p>First you create a git user.  Doesn&#8217;t matter what you call it, but this will be the user you will use to log in to your server.  I suggest creating a separate user so you can store all your repositories in a fresh home directory.  Then log in to that user and do the following:</p>
<p>To create a new project repository on the server:</p>
<p>First create a directory to contain the code</p>
<blockquote><p><code>mkdir myrepo.git</code></p></blockquote>
<p>Then change into that directory and create a bare git repository</p>
<blockquote><p><code>git --bare init</code></p></blockquote>
<p>That&#8217;s it!  Now on your development machine we will setup git to push to this server.</p>
<p>I suggest setting up your name and email in git if you haven&#8217;t already done so.  You can do that using the following commands:</p>
<blockquote><p><code>git config --global user.name "Your full name"</p>
<p>git config --global user.email "your@email.com"</code></p></blockquote>
<p>In your project directory do the following:</p>
<p>Initialize the repository</p>
<blockquote><p><code>git init</code></p></blockquote>
<p>Add all the files to the repository</p>
<blockquote><p><code>git add .</code></p></blockquote>
<p>Commit the files to the repository</p>
<blockquote><p><code>git commit -m "Initial commit"</code></p></blockquote>
<p>Now setup the remote repository</p>
<blockquote><p><code>git remote add origin gituser@yourserver.com:myrepo.git</code></p></blockquote>
<p>[ Replace gituser with your user, yourserver.com with your domain and myrepo.git with your repository directory you create on your server ]</p>
<p>Now push the code to the server</p>
<blockquote><p><code>git push origin master</code></p></blockquote>
<p>It should ask you for the password for the user you used.  Once you enter it your code will be pushed into the repository.  If everything was setup correctly you should now be able to utilize your own server for housing your source code.</p>
<p>To pull down your code from your server you do the following in your projects folder:</p>
<p>Clone the repository</p>
<blockquote><p><code>git clone gituser@yourserver.com:myrepo.git</code></p></blockquote>
<p>This will prompt you for your password and then once entered will create the project directory and pull your code down from the server.  This is a new repository ready to go and you can push and pull on it as you need.</p>
<p>There are ways to get SSH to store your password on your development machine so you don&#8217;t have to keep typing in your password but I don&#8217;t use that mechanism.  For me, I just wanted to use my server to store my files between sites.  I&#8217;m sure there are better ways to do it, but this has worked for me for a while and I wanted to document it in case it was helpful to anyone else just looking for a quick and dirty DIY git repository server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/diy-git-remote-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RSpec Scaffolding View Spec Errors in Rails 3.1</title>
		<link>http://blog.insidecoder.com/rspec-scaffolding-view-spec-errors-in-rails-3-1/</link>
		<comments>http://blog.insidecoder.com/rspec-scaffolding-view-spec-errors-in-rails-3-1/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 19:00:05 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[rails 3.1]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[scaffold]]></category>

		<guid isPermaLink="false">http://insidecoder.com/?p=34</guid>
		<description><![CDATA[Rails 3.1 was released yesterday and I decided to update a large project I was working on to it.  I have that kind of leisurely time table to be able to do that.  I&#8217;m kidding, I&#8217;m already getting asked when &#8230; <a href="http://blog.insidecoder.com/rspec-scaffolding-view-spec-errors-in-rails-3-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Rails 3.1 was released yesterday and I decided to update a large project I was working on to it.  I have that kind of leisurely time table to be able to do that.  I&#8217;m kidding, I&#8217;m already getting asked when it&#8217;ll be done but since 3.1 came out I wanted to take a day and see what I was up against for future projects.</p>
<p>I&#8217;ve really taken to the whole testing idea.  I love rspec and have been using it on my projects.  I don&#8217;t normally use scaffolding in my apps but I thought since it was a new version of rails that I&#8217;d check out what was generated with the scaffold to see if I needed to update my standard way of doing things.  I&#8217;m still fairly new to rails so it&#8217;s nice to see an &#8220;official&#8221; way of doing things.</p>
<p>After running four or five scaffold generations I decided to fire up rspec and see what happened.  That&#8217;s when I got this ugly failure popping up:</p>
<blockquote><p><code>Failure/Error: assert_select "tr&gt;td", :text =&gt; 1.to_s, :count =&gt; 2<br />
MiniTest::Assertion:<br />
Expected exactly 2 elements matching "tr &gt; td", found 8.</code></p></blockquote>
<p>This was in my index.html.erb file and was odd.  Digging into the spec file I noticed that I have four integer fields.  It&#8217;s trying to test these four integer fields by using 1.to_s and complaining because it&#8217;s seeing 8 instead of 2.  Well, it&#8217;s going to see 8 because it stubs two records both containing 4 integer fields all with the same integer.</p>
<p>So my solution to the problem was to edit the spec file and change the integer fields from 1 to sequential numbers.  So 1,2,3 and 4 in my case.  I did this both in the stub_model sections and below in the &#8220;renders a list of &lt;model&gt;&#8221; block.  Once those were updated the tests all pass and I can move on knowing it&#8217;s actually working.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/rspec-scaffolding-view-spec-errors-in-rails-3-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-Platform Rails Editor</title>
		<link>http://blog.insidecoder.com/cross-platform-rails-editor/</link>
		<comments>http://blog.insidecoder.com/cross-platform-rails-editor/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 15:17:55 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[sublime text]]></category>
		<category><![CDATA[sublime text 2]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://insidecoder.com/?p=19</guid>
		<description><![CDATA[I do own a Macbook, I&#8217;ll get that out up front.  I understand that the standard image of a rails developer is a person sitting behind a Macbook using Textmate as their editor.  I really wanted to be that person, &#8230; <a href="http://blog.insidecoder.com/cross-platform-rails-editor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I do own a Macbook, I&#8217;ll get that out up front.  I understand that the standard image of a rails developer is a person sitting behind a Macbook using Textmate as their editor.  I really wanted to be that person, I tried really hard to do that.  The biggest stumbling block I have is that my job allows me a nearly unlimited amount of PC hardware to play with and very little to no Apple hardware.</p>
<p>I have nothing against Apple or Macs in general.  I&#8217;ve owned several Macs through the years and while they&#8217;re nice and look great, there&#8217;s always some little thing that frustrates me and I walk away.  The last was trying to keep the Macbook running with the lid down.  Apple says that when you close the lid, you&#8217;re done.  That&#8217;s great but what if I&#8217;m not?</p>
<p>I am clearly not the target audience for the Mac and while it does just work, it also does so with a price.  You can&#8217;t do things your way.  Like I said, this is great for some people and I&#8217;m not knocking that at all.  To some, the price you pay to just be able to use a computer and have it handle everything for you is totally worth it.  For me, I&#8217;m a tweaking, gear turning, tech that likes to bend technology to my will.  So while I did find a nice utility to keep the Macbook running when you close the lid, it was just the straw that broke the camel&#8217;s back.</p>
<p>So with two PC laptops and various Dells at my disposal I set out to build an environment that I could use to develop in rails 3.  My previous post talked about setting up that environment but once it&#8217;s setup you will need an editor to do your work in.  That editor, after much looking, is <a href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a>.</p>
<p>Sublime Text 2 is cross-platform and will run on Mac OS X, Linux and Windows.  On top of this the editor is very customizable.  You can tweak it to be the editor you need.  This is great because at first I didn&#8217;t think it would work for me as it didn&#8217;t auto-pair rails tags in my views.  It&#8217;s such a simple thing but I really like that when I type &lt;% I get the ending tag and I want my cursor to be placed next to the open tag.</p>
<p>After much digging and trial and error I was able to put together a fairly simple keymap for myself that might help others in their pursuit of the perfectly tweaked editor.  This is my user keymap:</p>
<p>[<br />
{ "keys": ["alt+/"], &#8220;command&#8221;: &#8220;move_to&#8221;, &#8220;args&#8221;: {&#8220;to&#8221;: &#8220;eol&#8221;, &#8220;extend&#8221;: false} },<br />
{ &#8220;keys&#8221;: ["alt+,"], &#8220;command&#8221;: &#8220;move&#8221;, &#8220;args&#8221;: {&#8220;by&#8221;: &#8220;characters&#8221;, &#8220;forward&#8221;: true} },<br />
{ &#8220;keys&#8221;: ["alt+."], &#8220;command&#8221;: &#8220;move&#8221;, &#8220;args&#8221;: {&#8220;by&#8221;: &#8220;wordends&#8221;, &#8220;forward&#8221;: true} },<br />
// Auto-pair Rails erb tags<br />
{ &#8220;keys&#8221;: ["&lt;", "%"], &#8220;command&#8221;: &#8220;insert_snippet&#8221;, &#8220;args&#8221;: { &#8220;contents&#8221;: &#8220;&lt;%$0 %&gt;&#8221; } }<br />
]</p>
<p><em>Note: For Mac OS X use </em>super<em> instead of </em>alt<em>.</em></p>
<p>It&#8217;s simple and the auto-pairing is done for me, not as nicely as brackets or quotes but it works for me.  The alt key commands are what I came up with to allow me to easily move around my code without the need to remove my hands from the keyboard.  The one I use most is ALT+. as it allows me to just quickly move to the ends of words when typing commands such as link_to.</p>
<p>It&#8217;s a great editor and actually supports textmate snippets and has so much power under the hood that I&#8217;ve barely even touched.  It&#8217;s priced the same as Textmate and it&#8217;s definitely worth it.  You get cross-platform use, textmate snippets, the power to tweak the editor to your liking and so much more.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/cross-platform-rails-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Rails 3 on Ubuntu</title>
		<link>http://blog.insidecoder.com/install-rails-3-on-ubuntu/</link>
		<comments>http://blog.insidecoder.com/install-rails-3-on-ubuntu/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 13:14:32 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[xubuntu]]></category>

		<guid isPermaLink="false">http://insidecoder.com/?p=13</guid>
		<description><![CDATA[So the first thing you need when you decide to start rails development is a development environment.  I personally own a Macbook and while there seems to be this notion that rails developers all use Macs I still haven&#8217;t found &#8230; <a href="http://blog.insidecoder.com/install-rails-3-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>So the first thing you need when you decide to start rails development is a development environment.  I personally own a Macbook and while there seems to be this notion that rails developers all use Macs I still haven&#8217;t found a tactful way to run a purchase requisition through for one at work.  So being stuck with PC hardware the choice was Windows or Linux.</p>
<p>Windows actually can be used to develop rails applications and I did that for a week or two until I got the itch to put Linux to use.  Que about a week of lost productivity as I ran through all the distros looking for something I could use daily at work.  Surprisingly I was unable to find anything to replace Outlook and since it has become common for people to email me change requests or project ideas I really need a stable communication line with the Exchange server.  Yes, I could use the web client but when you&#8217;ve used Outlook for years you get used to being notified of new mail and having offline abilities available.</p>
<p>So without a replacement for Outlook easily available, I decided on the next best thing:  virtualization.  I have a license for VMware Workstation and it does have nice features like dual monitor support but all I need is a quick, light environment to work with.  Enter <a title="Virtualbox" href="http://www.virtualbox.org/" target="_blank">VirtualBox</a>.  It&#8217;s open source and free to use so I can load it up on my computers at home or at work.  I picked XUbuntu for the distribution as it was light on resource usage and still has everything I need to feel at home.</p>
<p>With XUbuntu running on a fresh install the following steps will get you a rails development environment up and running in no time.  Since I compile ruby from source I need to install the development libraries and dependencies needed to do that.  The following is all one command:</p>
<blockquote><p><code>apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libpq-dev</code></p></blockquote>
<p>Once apt is done installing you can download the ruby source at <a title="http://www.ruby-lang.org/en/downloads/" href="http://www.ruby-lang.org/en/downloads/" target="_blank">http://www.ruby-lang.org/en/downloads/</a>  You&#8217;ll want the latest 1.9 source which at this time is 1.9.2 p290.</p>
<p>Extract this to a folder and run the following command:</p>
<blockquote><p><code>./configure &amp;&amp; make &amp;&amp; make install</code></p></blockquote>
<p>Once ruby is installed you can check by running:</p>
<blockquote><p><code>ruby -v</code></p></blockquote>
<p>and it should display the version you downloaded.  Now we need to update the rubygems.</p>
<blockquote><p><code>gem update --system</code></p></blockquote>
<p>This will install the latest version of rubygems on the system.  Now we can begin to install the rails environment.  Run the following commands:</p>
<blockquote><p><code>gem install rake</p>
<p>gem install rails</p>
<p>gem install pg</code></p></blockquote>
<p>The last one will install the PostgreSQL library which is what I use, you can change it to whatever database you use.</p>
<p>After this I like to do a full update of all the gems.</p>
<blockquote><p><code>gem update</code></p></blockquote>
<p>This will update all the gems on the system but be aware that this WILL install new versions of rails or any other gems you have loaded if you run this command later.</p>
<p>You should now have a running rails environment ready for you to play with.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insidecoder.com/install-rails-3-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.insidecoder.com/feed/ ) in 0.22294 seconds, on May 21st, 2013 at 9:14 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 21st, 2013 at 10:14 am UTC -->