<?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"
	>

<channel>
	<title>Patrick Tulskie</title>
	<atom:link href="http://www.patricktulskie.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.patricktulskie.com</link>
	<description>The Best Blog Ever</description>
	<pubDate>Tue, 30 Dec 2008 19:10:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Ruby String#Nameize Revised</title>
		<link>http://www.patricktulskie.com/2008/12/ruby-string-nameize-revised/</link>
		<comments>http://www.patricktulskie.com/2008/12/ruby-string-nameize-revised/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 19:10:31 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Software Development]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=102</guid>
		<description><![CDATA[This morning, Kevin Glowacz (@kevinglowacz) replied to me a few times on Twitter about Ruby String#Nameize class extension I had posted a while back.  I had done some work to it after posting it here.  Kevin also asked me a few questions about oddities that were in it that have since been resolved.  So thanks [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, Kevin Glowacz (<a href="http://twitter.com/kevinglowacz">@kevinglowacz</a>) replied to me a few times on Twitter about Ruby String#Nameize class extension I had posted a while back.  I had done some work to it after posting it here.  Kevin also asked me a few questions about oddities that were in it that have since been resolved.  So thanks to his prodding, you get a slightly updated version&#8230;</p>
<p>The only real &#8220;feature&#8221; is that it will now handle full names just fine. Otherwise, the rest of the stuff was mostly performance related.  Here it is:</p>
<pre>class String
  # Extension of the string class to properly handle camel names
  def nameize
    if self.match(/ /)
      # If the name has a space in it, we gotta run the parts through the nameizer.
      name = self.split(' ').each { |part| part.nameize! }.join(' ')
      return name
    elsif self.match(/^[A-Z]/)
      # If they took the time to capitalize their name then let's just jump out.
      return self
    else
      # If there are no spaces and there is no prior capitalization then let's downcase the whole thing.
      name = self.downcase
    end
    # Let's now assume that they were lazy...
    return case
    when name.match(/^mac/)
      name.gsub(/^mac/, "").capitalize.insert(0, "Mac")
    when name.match(/^mc/)
      name.gsub(/^mc/, "").capitalize.insert(0, "Mc")
    when name.match(/^o\'/)
      name.split("'").each{ |piece| piece.capitalize! }.join("'")
    else
      name.capitalize # Basically if the name is a first name or it's not Irish then capitalize it.
    end
  end

  def nameize!
    replace nameize # BANG!
  end

end</pre>
<p>As always - question, comments, suggestions - shoot me an email, leave a comment, or hit me on Twitter (@PatrickTulskie).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/12/ruby-string-nameize-revised/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Ruby, Git, and Bonjour to Get Through Code Review</title>
		<link>http://www.patricktulskie.com/2008/12/using-ruby-git-and-bonjour-to-get-through-code-review/</link>
		<comments>http://www.patricktulskie.com/2008/12/using-ruby-git-and-bonjour-to-get-through-code-review/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 05:55:38 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Software Development]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=97</guid>
		<description><![CDATA[Every Friday we have our code reviews at BeenVerified and it is definitely a non-trivial event.  Our development team looks through the code all together and offers suggestions and ways to improve what the creator deems near-complete code.  Code reviews have become my favorite part of team based development because they offer me such a [...]]]></description>
			<content:encoded><![CDATA[<p>Every Friday we have our code reviews at BeenVerified and it is definitely a non-trivial event.  Our development team looks through the code all together and offers suggestions and ways to improve what the creator deems near-complete code.  Code reviews have become my favorite part of team based development because they offer me such a badass opportunity to learn more.  Everyone looks a problem differently and so getting insight from other people is huge because you might not consider all of your options when you&#8217;re knee deep in 1000 lines of ruby, CSS, and js all at once.</p>
<p>Yeah it&#8217;s great, except this Friday it didn&#8217;t happen.  Thanksgiving weekend happened instead so we pushed it to Monday.  Being the silly goose I am, I decided to get a new Macbook on Black Friday.  I restored my stuff from Time Machine, installed my Ruby Gems, and thought all was well.  Monday morning, my turn to present code came up and there was a problem with screen sharing.  Crap.  All of my code is in a git branch that is not pushed to a server yet and the time it would have taken to get to a state where we could present it from another machine would have been too much so we postponed my review until my screen sharing would work.  This was most displeasing to me.<span id="more-97"></span></p>
<p><strong>How To Handle It Next Time.</strong></p>
<p>As of late, there has been a lot of talk about bonjour in the ruby world.  There are a lot of really awesome applications that use the technology.  Take for example, gitjour.  It takes an existing git repository and makes it available to machines on the local network through bonjour.  All they would need is the gem and to type &#8220;gitjour list&#8221; in a terminal window to see what&#8217;s available.  That&#8217;s badass.</p>
<p>So if we had to rewind to Monday morning, what we should have done is take a functioning machine on the local network and had that person do a clone of my repository to a new working directory and then we could have screen shared that.  It would have taken a fraction of the time that it would have taken to push it to the server with my own local branch, tell someone to get a copy of my branch from the server and what branch to take.  Gitjour would have cut out all of the steps and it would have been quicker since it&#8217;s on the local network.</p>
<p>This thought alone makes me want to dive deeper into bonjour and figure out how to use it for various things.  If you have any good resources, post them in the comments or hit me up on Twitter. (http://twitter.com/patricktulskie)</p>
<p><strong>What Was The Screen Sharing Problem?</strong></p>
<p>Turns out iChat 4.0.5 doesn&#8217;t know how to view the screen of someone with iChat 4.0.6.  The new Macbook comes with 4.0.6 by default and there is no easy way to upgrade to it.  I downgraded to 4.0.2 from my Blackbook and now all is well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/12/using-ruby-git-and-bonjour-to-get-through-code-review/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Leopard and MySQL Gem</title>
		<link>http://www.patricktulskie.com/2008/11/leopard-and-mysql-gem/</link>
		<comments>http://www.patricktulskie.com/2008/11/leopard-and-mysql-gem/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 18:48:14 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Software Development]]></category>

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

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

		<category><![CDATA[ruby gem mysql rails]]></category>

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=88</guid>
		<description><![CDATA[Those of you doing rails development work on Leopard with MySQL have probably seen this error message when starting your app:
WARNING: You&#8217;re using the Ruby-based MySQL library that ships with Rails. This library is not suited for production. Please install the C-based MySQL library instead (gem install mysql).
Normally I don&#8217;t care, but I figured since [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you doing rails development work on Leopard with MySQL have probably seen this error message when starting your app:</p>
<blockquote><p>WARNING: You&#8217;re using the Ruby-based MySQL library that ships with Rails. This library is not suited for production. Please install the C-based MySQL library instead (gem install mysql).</p></blockquote>
<p>Normally I don&#8217;t care, but I figured since I was doing some cleanup today and getting things ready to move on to a longer term it might be good to have a properly working MySQL gem.  I like to run with a system that is close to what we run production.  The closer you get, the less surprises you have when you push it live.</p>
<p><span id="more-88"></span></p>
<p><strong>More Fixing.  Less Talking.</strong></p>
<p>Damn you&#8217;re so pushy sometimes.  Anyhow.  I did a sudo gem install mysql and got another damn error.</p>
<pre><code>Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
</code></pre>
<p>Oh good.  Another error.  Perfect.  I searched around the interwebs and someone suggested using &#8220;&#8211;with-mysql-lib=/usr/local/mysql/lib&#8221; in the options since that&#8217;s where the libraries are located.  It still barfed on me with that.</p>
<p><strong>A Solution Please.</strong></p>
<p>A few more minutes of hunting and pecking and I found the golden command:</p>
<pre><code>sudo gem install mysql -- --with-mysql-config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed</code></pre>
<p>Now I don&#8217;t have any errors when starting my rails applications that use MySQL and I&#8217;m closer to what I have in production.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/11/leopard-and-mysql-gem/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Tie Breaker [Updated]</title>
		<link>http://www.patricktulskie.com/2008/11/the-tie-breaker/</link>
		<comments>http://www.patricktulskie.com/2008/11/the-tie-breaker/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 21:23:29 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Opinion]]></category>

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

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

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=82</guid>
		<description><![CDATA[I have this disturbing lack of confidence in both presidential candidates.  I don&#8217;t really want either of them.  Today I was trying to decide who to vote for because, well, it is election day.  I was walking into the office from lunch when it dawned on me: the best way to pick a president is [...]]]></description>
			<content:encoded><![CDATA[<p>I have this disturbing lack of confidence in both presidential candidates.  I don&#8217;t really want either of them.  Today I was trying to decide who to vote for because, well, it is election day.  I was walking into the office from lunch when it dawned on me: the best way to pick a president is based on their website.</p>
<p><strong>Presidential Candidate Websites.</strong></p>
<p>Shock and horror came over me as I scanned their websites.  There was stuff all over the place, explosive gradients and backgrounds that simply don&#8217;t jive.  Youtube videos are injected in every nook and cranny.  Since both websites are full of crap I don&#8217;t fell like reading or watching, I thought that I&#8217;d go a step further and do a good ol&#8217; W3C Markup Validation on them.  The results were astounding to say the least.</p>
<p>John McCain: 171 Errors, 46 Warnings (217 <em>problems</em>)<br />
Source: <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.johnmccain.com&amp;charset=(detect+automatically)&amp;doctype=Inline&amp;group=0">W3C</a></p>
<p>Barack Obama: 220 Errors, 37 Warnings (257 <em>problems</em>)<br />
Source: <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.barackobama.com%2Findex.php&amp;charset=(detect+automatically)&amp;doctype=Inline&amp;group=0&amp;user-agent=W3C_Validator%2F1.591">W3C</a></p>
<p>You would think that with the Democratic party doing anything and everything to get Barack all over the media, news, magazines, to the point where I check under my bed at night to make sure he&#8217;s not there, they would have made sure his website was W3C compliant.  If he wins, what does that say about their concern for web standards.  It makes his &#8220;net neutrality&#8221; talks sound like complete crap.  McCain&#8217;s site is not <em>much</em> better than Obama&#8217;s but the fact is that McCain&#8217;s site <strong>is</strong> better.  Winning is winning.</p>
<p>You&#8217;d think that my selection process would be over, but you would be wrong.</p>
<p><strong>VP Candidates.</strong></p>
<p>I went to JoeBiden.com and SarahPalin.com and both were serious let downs.  Biden freeloads off of Obama&#8217;s website.  Palin&#8217;s website says &#8220;This space intentionally left blank.&#8221;  Serious disappointment.  Not even a picture of Palin for me to hang up on the wall of my gun locker.  Biden too&#8230; dude what&#8217;s up with that?  You gotta have Obama carry you through the whole damn election?  Complete rubbish from both the elephant and the ass.</p>
<p>For giggles, I ran &#8216;em through anyway&#8230;</p>
<p>Sarah Palin: 5 Errors, 0 Warnings</p>
<p>Joe Biden: 72 Errors, 29 Warnings</p>
<p>&#8230;and let me tell you, I did giggle quite a bit.</p>
<p>Because of how atrocious both VP candidates&#8217; sites are, I won&#8217;t be including them in my decision.  Their awfulness cancels each other out.  If you wanted to play a numbers game though, Biden&#8217;s piggybacking on Obama&#8217;s site does more hurt than good.</p>
<p><strong>The Tie Breaker.</strong></p>
<p>Don&#8217;t listen to my drivel.  This blog post is balderdash.  You shouldn&#8217;t judge your presidential candidate based on how compliant their website is with W3C standards, even if I am.  When you don&#8217;t like either candidate, you need to pick one small issue that you can judge the candidates on go from there.  That&#8217;s the tie breaker.  Could be something as lofty as religious beliefs or something as trivial as who has a better choice of neck ties.</p>
<p>Fact of the matter is, you need to go out and vote, no matter how irrational and illogical your selection process might be.</p>
<p><strong>Update</strong></p>
<p>Just tested Change.gov and I&#8217;m slightly more impressed.  Seems like since Obama is now president-elect he is able to rocket past anything McCain could ever compose with a WYSIWYG with a cup of coffee.  He has created quite a website that is pretty damn compliant.</p>
<p>Change.gov:                  20 Errors, 3 Warning</p>
<p>This makes me feel much better, because the one thing that keeps me up at night is web standards.  Seems like we&#8217;re getting much closer to changing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/11/the-tie-breaker/feed/</wfw:commentRss>
		</item>
		<item>
		<title>String#Nameize</title>
		<link>http://www.patricktulskie.com/2008/10/stringnameize/</link>
		<comments>http://www.patricktulskie.com/2008/10/stringnameize/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 15:50:03 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Software Development]]></category>

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

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

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

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=79</guid>
		<description><![CDATA[This morning we had an email from someone who wanted us to capitalize their name because they had not done it at signup.  That&#8217;s fine and all, but this is one of those things we&#8217;re going to see again.  Normally you&#8217;d just slap a .capitalize on the string and call it a day.  Unfortunately with [...]]]></description>
			<content:encoded><![CDATA[<p>This morning we had an email from someone who wanted us to capitalize their name because they had not done it at signup.  That&#8217;s fine and all, but this is one of those things we&#8217;re going to see again.  Normally you&#8217;d just slap a .capitalize on the string and call it a day.  Unfortunately with Irish names, you run into a problem because capitalize doesn&#8217;t capitalize those types of names properly.  I wrote a quick function to extend the String class in Ruby that will help get around this problem.</p>
<pre>class String
  # Extension of the string class to properly handle camel names
  # Should be used on pieces of names, not full names.
  def nameize
    # If they took the time to capitalize their name then let's just jump out
    if self.match(/\A[A-Z]/)
      return self
    else
      name = self.downcase
    end
    # Let's now assume that they were lazy...
    return case
    when name.match(/^mac/)
      name.capitalize.gsub(/Mac/, "").capitalize.insert(0, "Mac")
    when name.match(/^mc/)
      name.capitalize.gsub(/Mc/, "").capitalize.insert(0, "Mc")
    when name.match(/^o\'/)
      name.split("'").each{ |piece| piece.capitalize! }.join("'")
    else
      name.capitalize
    end
  end
end</pre>
<p>I know it&#8217;s not perfect, but it should handle most oddly capitalized names.  Let me know what you think in the comments or on Twitter or whatever and definitely give me any changes you think should be in there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/10/stringnameize/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Identity Landscape</title>
		<link>http://www.patricktulskie.com/2008/09/the-identity-landscape/</link>
		<comments>http://www.patricktulskie.com/2008/09/the-identity-landscape/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 19:42:03 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Opinion]]></category>

		<category><![CDATA[Social Media]]></category>

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

		<category><![CDATA[social networking]]></category>

		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=61</guid>
		<description><![CDATA[The other day, I noticed something that sort of pertained to what I wrote a few months ago about killing off JiveMasterT.  I see a lot of people doing this, albeit, subconsciously.  I&#8217;m not sure when this change in mentality began and I believe I was actually late to the party.  What follows here is [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I noticed something that sort of pertained to what I wrote a few months ago about killing off JiveMasterT.  I see a lot of people doing this, albeit, subconsciously.  I&#8217;m not sure when this change in mentality began and I believe I was actually late to the party.  What follows here is what I think happened.</p>
<p>Over the past ten years, the way that people identify themselves on the internet has changed drastically.  It&#8217;s not quite obvious because the change was very gradual and it has not totally affected every area of the internet.  Despite this, it definitely happened.  It&#8217;s almost like when your girlfriend asks you if you think she&#8217;s lost weight.  It happened so gradually you didn&#8217;t notice but when asked - you notice.  There was a time when someone could jump onto IRC and chat with their friends using a username that had varying value.  The username could be thrown away if its reputation faltered and it could be retained if it had meaning and significance to those that interacted with it.</p>
<p><span id="more-61"></span></p>
<p><strong>And Then It Happened.</strong></p>
<p>Social networks erupted onto the internet with a force more powerful than any of the trends we&#8217;ve seen in the past, on and off the internet.  MySpace.  Facebook.  LinkedIn.  Some forum and IRC elitests refuted the fact that these sites for people by people were extremely valuable and a great way to associate an online identity with yourself.  They claimed that these networks were for teenagers and emo kids.  They made fun of the pictures that people posted all the while, clinging onto their text based chat and personal blogs linked to a screen name.  In the end, the naysayers were defeated and social networks have become a very real force on the internet.  Now, a lot of those that were once against social networks probably have an account or two of their own.</p>
<p><strong>Why Did It Happen?</strong></p>
<p>It&#8217;s hard to pinpoint the cause, but one thing is for sure - people by nature are social.  A place to go and share you lives with your friends is immensely attractive to everyone, even if they deny it.  What&#8217;s more is, anyone could signup to a social network and begin building their online identity to mirror that of their real world identity.  The need to know HTML and have a geocities or angelfire account became nullified.  Some people still retained their text based identities on IRC channels and forums, but many people (especially those of the internet brats) had decided to get their own account on a social network.</p>
<p><strong>There Was An Incentive Though, Right?</strong></p>
<p>Absolutely.  The problem with screen names and text based communication is that it is nearly impossible to take credit for what has been accomplished.  With the widespread adoption of social networks came the opportunity to take advantage of your reputation to gain love, money, bragging rights, and just generally enhance your social circles.  Those who understand the concepts of branding themselves have been able to utilize social networks for gains across the board.</p>
<p><strong>Hey But Like Anything, There Is A Risk.<br />
</strong></p>
<p>This is true of social networking in a big way.  If one is not careful with what it is they associate themselves with on social networks, they can tarnish their reputation at &#8220;internet speed.&#8221;  A high ranking person in a Fortune 500 company who posts pictures of their half naked and drunk self will surely have repercussions in the work place.  Aside from maintaining some restraint in the content you post, it is also important to keep on top of where your identity is being used and insure that you are in control of it.  It is a real risk that someone might sign up on a social network as you in order to do and say things that ruin your brand or even exploit others using your good name.</p>
<p><strong>Sort Of Like Social Network Identity Theft.</strong></p>
<p>True but it is much easier to do and get away with.  One thing anyone should do, if you value their online reputation, is to run some searches for your name and make sure no one is using it badly.  You should also consider signing up on social networks that you think you might have an interest in at a later date to prevent someone from beating you to it and stealing your name.  These sorts of things don&#8217;t happen that frequently but they can happen and might also be a huge hassal to fix.  Your credit record is a bunch of numbers but your reputation is a complex web of people and stories.  Someone introducing poison to that web can be very difficult to repair.</p>
<p>The identity landscape is changing and we&#8217;re all participating in its evolution.  Gone are the days of your disposable screen names - now our online identities can be more valuable (and more difficult to repair) than our credit records.  Our next generation of hiring managers are going to be former internet brats and you can be certain that they will weigh your online reputation heavily when you&#8217;re looking for a job.  Protecting and enhancing that reputation should be much higher on everyone&#8217;s priority list than ever before.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/09/the-identity-landscape/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Rails Saved Me Last Week</title>
		<link>http://www.patricktulskie.com/2008/08/how-rails-saved-me-last-week/</link>
		<comments>http://www.patricktulskie.com/2008/08/how-rails-saved-me-last-week/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 05:00:39 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=50</guid>
		<description><![CDATA[The night time, it was great.  Air was cool, had just gone on a nice jog with my girlfriend, and I was quite content with everything.  Being that my girlfriend has my health in my best interest, she decided to give me some cereal to take home with me.  I walk out to my car [...]]]></description>
			<content:encoded><![CDATA[<p>The night time, it was great.  Air was cool, had just gone on a nice jog with my girlfriend, and I was quite content with everything.  Being that my girlfriend has my health in my best interest, she decided to give me some cereal to take home with me.  I walk out to my car in my <strong>running shorts</strong> that have no pockets and I&#8217;m half juggling my clothes, laptop case, shoes, cereal, and&#8230; my <strong>Blackberry</strong>.</p>
<p><code><br />
def for_the_record<br />
running_shorts != skin_tight<br />
end<br />
</code></p>
<p>I do what I can, placing my blackberry on the roof of my car, get everything inside the car and start driving home.  I get about half way there and&#8230;</p>
<p><span id="more-50"></span></p>
<p><strong>Oh Crap.</strong></p>
<p>I hear a horrible banging noise from the rear of my car.  I look in the rear view mirror to see my Blackberry exploding in the air from its impact with the trunk of my car followed by an additional round of roughness from the black top.  I spent the next little while collecting pieces from the pavement but I could not find enough to get a working device again.  Despite this, what I could find on the dark road was in surprisingly good shape for the 40mph violence that had just occurred.  Before I go too far off course, let me just say that the long story short is: I had insurance on the phone and I&#8217;d have a new one in a day.</p>
<p><strong>That&#8217;s Not So Bad Patrick.  What&#8217;s The Big Deal?</strong></p>
<p>Well, for some reason, people like to call me with opportunities.  These opportunities are pretty important for me to keep track of and my Blackberry was my #1 way of doing just that.  That&#8217;s when I turned to rails&#8230; ah yes.</p>
<p><strong>Ruby on Rails?</strong></p>
<p>No.  Grahm Crackers on Rails.  What the heck do you think I&#8217;m talking about?  You know if you&#8217;re going to act like that I&#8217;m going to just stop writing.  Ok?  Good.  Now that we have that out of the way.</p>
<p>I wrote zero code to do this.  That&#8217;s right.  None!  I used my Heroku account to create a new application.  I then used their generate tool with the following command:</p>
<p><code>scaffold opportunity name:string number:string notes:text</code></p>
<p>After that I ran a rake db:migrate and it was done.  Rails went, created my opportunities table, added the columns, and even made me some nice pages for me.  I then went to the page and began adding stuff as I listened to voicemails.  If I needed it to disappear all I had to do was close my browser window and no one was the wiser.</p>
<p><strong>So You Just Made a Rails App With Two Command Line Entries?</strong></p>
<p>Yes.  That&#8217;s what I did.  The scaffold is obviously meant to be a building block to get a project started, but the ability to generate all of this stuff absolutely blows people&#8217;s minds sometimes.  It does show you though - anyone can write something in this frame work in no time.  I did - with zero code.  It feels almost like cheating doesn&#8217;t it?  Something like that would take a bunch of code in PHP or Perl and that&#8217;s not even talking about the SQL that one would also need to do.</p>
<p>So that&#8217;s my answer to those of you ask me &#8220;Why do I want to learn Ruby/Rails?&#8221;  I&#8217;ve now explained it in the open on the internet so hopefully I <em>don&#8217;t have the repeat myself</em>.  Afterall, if I did, that would be violating one of the principals of the framework.</p>
<p>If you&#8217;ve never done anything with Rails then consider this your &#8220;Hello World!&#8221; and then go look at the files that were generated.  You currently have a lot of basic stuff sitting in front of you that you can learn from.  Play with it, break it, make it better, take it apart, put it back together.  Worst comes to worst, you destroy your project and start over.  It only took 2 command line entries to get it going.</p>
<p><strong>Hey! I Want a Heroku Invite!</strong></p>
<p>Well, shoot me an email, tweet, linkedin message, etc and let me know!  I can definitely get you one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/08/how-rails-saved-me-last-week/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PatrickTulskie - Now More Mobile!</title>
		<link>http://www.patricktulskie.com/2008/08/patricktulskie-now-more-mobile/</link>
		<comments>http://www.patricktulskie.com/2008/08/patricktulskie-now-more-mobile/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 17:11:11 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Blog News]]></category>

		<category><![CDATA[New Stuff]]></category>

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=48</guid>
		<description><![CDATA[If you read my site from your Blackberry or iPhone then try pointing your browser at http://m.patricktulskie.com
This is powered by Mobi which basically takes the RSS feed from my site and parses it into a normally readable page.  This works pretty good on iPhones and Blackberries but I would imagine that it will be just [...]]]></description>
			<content:encoded><![CDATA[<p>If you read my site from your Blackberry or iPhone then try pointing your browser at <a title="http://m.patricktulskie.com" href="http://m.patricktulskie.com">http://m.patricktulskie.com</a></p>
<p>This is powered by Mobi which basically takes the RSS feed from my site and parses it into a normally readable page.  This works pretty good on iPhones and Blackberries but I would imagine that it will be just fine on even your normal cellphone.  It took me like 1 minute to setup my site so if you&#8217;ve always wanted the m.yourdomain.com then here is an easy way for you to do it.</p>
<p>I think I might need to write some logic in the back end to redirect viewers to the mobile site if I detect they are browsing from a mobile browser.  Hmm.  That&#8217;s a post for another time I suppose.</p>
<p><em>Please note: I am not affiliated with this service at all.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/08/patricktulskie-now-more-mobile/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What the heck is REST?</title>
		<link>http://www.patricktulskie.com/2008/08/what-the-heck-is-rest/</link>
		<comments>http://www.patricktulskie.com/2008/08/what-the-heck-is-rest/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 14:39:57 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Software Development]]></category>

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

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

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

		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=40</guid>
		<description><![CDATA[Quite frankly, I&#8217;m tired of about hearing about REST.
&#8230;
So what if I started off my post with a pun?  Look you&#8217;re just going to have to deal with it.  Let&#8217;s move on.  No stop it with the face, it&#8217;s my blog and I can do what I want.
Anyhow - REST is one of those things [...]]]></description>
			<content:encoded><![CDATA[<p>Quite frankly, I&#8217;m <em>tired</em> of about hearing about REST.</p>
<p>&#8230;</p>
<p>So what if I started off my post with a pun?  Look you&#8217;re just going to have to deal with it.  Let&#8217;s move on.  No stop it with the face, it&#8217;s my blog and I can do what I want.</p>
<p>Anyhow - REST is one of those things I hear a lot of people talk about as if it is this big mystery.  Then, when you finally find someone to explain it, it turns out they have never actually used it and only understand the theory.  It&#8217;s so frustrating to the beginning Ruby on Rails developer because not everyone has a mini David Hansson in their pocket and it really is one of those things you need to see to understand.</p>
<p><span id="more-40"></span></p>
<p><strong>Ok Patrick.  I&#8217;ll bite.  Let&#8217;s hear more about this.</strong></p>
<p>It&#8217;s a really simple concept that I will explain abstractly at first and then I want you to forget what I said until I compare it to what you&#8217;ve probably already seen.  REST stands for Representational State Transfer.  Technically speaking, REST should be RST but since Roy Fielding coined the term in the year 2000 and he&#8217;s kind of a big deal, people tend to stick with his acronym.</p>
<p>The theory behind it is that your destination |object| is nothing more than a representation of that object at the time you are viewing it.  This plays extremely well into a MVC framework like Ruby on Rails since your controllers and models handle the object and the view is just how you see the object at a given point in time.  Then in the URL, you would just be using nouns to describe what you&#8217;re getting.  Sorta like this:</p>
<p>http://yourdomain.com/noun1/&#8230;/your_object_name</p>
<p><strong>That makes no sense.</strong></p>
<p>I know.  Look, it&#8217;s actually really simple.</p>
<p>Ok so say I have a web application that you would like to pull data from in order to handle however you&#8217;d like with a separate application you are creating.  An example might be a news site - they provide for you an RSS feed that.  The data is all the same server side but how your web browser sees it is different from how your RSS feed reader sees it so the object (the data) needs to change its form to be readable to the current application.  With me so far?</p>
<p>If I wrote my web application to be RESTful then your application could request the data in RSS or XML or whatever form you prefer to parse, all while maintaining a normal user&#8217;s view in their web browser.  Ah ha!  So we&#8217;re no longer web page builders - we&#8217;re data providers.  You&#8217;re now actually building page templates and writing more code to handle your data.</p>
<p><strong>I&#8217;m still a little unsure about this Patrick.</strong></p>
<p>I was too, so I sat down and tried it.</p>
<p>On my side project - www.Twexaminer.com - I made sure that my controller was pulling data from twitter and storing it into objects instead of just &#8220;building a page.&#8221;  From there I created 2 views.  One is the default HTML view that you see when you view the page from a web browser and the other is a special .xml request that gives you the output of all of the data that the application has collected.</p>
<p>Ex:<br />
http://www.twexaminer.com/examiner/result/patricktulskie<br />
-vs-<br />
http://www.twexaminer.com/examiner/result/patricktulskie.xml</p>
<p>Basically I&#8217;m going to my examiner and saying &#8220;hey, give me a result&#8221; and then clarifying that it should be PatrickTulskie.  In the second example there I tell the examiner to give me the result of PatrickTulskie in XML format.</p>
<p>I could further expand this to make more views or representations for the same data, but for the time being I just have the 2.  In this way, I am now passing on the content using standard looking URLs that a common person can understand.  In addition, if you want to parse the data easily, there is a very intuitive way to get the data without the formatting fluff.  I am effectively passing data to your app, without the use of SOAP or any special hacks, in a format it understands just with a simple GET.  Ah ha!  Simple!</p>
<p>Ok now if I wanted to get fancier then I could add something to my examiner controller to handle updating of a cached result so it would look something like this&#8230; in pseudo code&#8230;</p>
<p>pt_object = new RestResource(http://www.twexaminer.com/examiner/result/patricktulskie)<br />
pt_object.update</p>
<p>&#8230;and then pull off data from that.  This would all be handled through HTTP requests though without needing any additional layers to handle transferring XML to and from client and server.  RestResource is a hypothetical object that one could create that has a simple XML parser to make an easy to use hash out of the data.  XML parsing and generation is easy in Ruby so this just makes sense.</p>
<p><strong>Ah so this is pretty sweet.</strong></p>
<p>Yeah. I know.  It makes things much simpler when you&#8217;re creating something that uses my data now doesn&#8217;t it?  Go, play with it in your project and let me know what you think in the comments or on Twitter, or through email, or through facebook&#8230; or whatever.  Just make sure I get the &#8220;comment&#8221; you&#8217;re trying to convey through some medium.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/08/what-the-heck-is-rest/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tales of a Developer: I Code in my Sleep</title>
		<link>http://www.patricktulskie.com/2008/08/tales-of-a-developer-i-code-in-my-sleep/</link>
		<comments>http://www.patricktulskie.com/2008/08/tales-of-a-developer-i-code-in-my-sleep/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 19:51:02 +0000</pubDate>
		<dc:creator>Patrick Tulskie</dc:creator>
		
		<category><![CDATA[Opinion]]></category>

		<category><![CDATA[Tales of a Developer]]></category>

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

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

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

		<category><![CDATA[self-improvement]]></category>

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

		<guid isPermaLink="false">http://www.patricktulskie.com/?p=36</guid>
		<description><![CDATA[Patrick talks about coding in your sleep and why this is terrible to your personal health, productivity, and overall quality of life.]]></description>
			<content:encoded><![CDATA[<p>You know what I am talking about.  It happens to us all at some point.</p>
<p><em>Oh no it doesn&#8217;t, you&#8217;re just being silly/bragging/etc.</em></p>
<p>No.  It will happen if it hasn&#8217;t already so just shut up and listen.</p>
<p><strong>The Night Before</strong></p>
<p>You&#8217;re working on a project, it&#8217;s late at night, you can barely function, so you close the lid on your Macbook and go to sleep.  A meer fifteen minutes later and you&#8217;re coding again.  How is this possible?  You&#8217;re not at your computer anymore.  You&#8217;re off in la la land and yet the project you&#8217;re working on continues to consume your subconscious.</p>
<p>Suddenly, at 3am, you spring out of bed, open up Textmate, and write in some code, relaunch your application and sometimes it works perfectly, other times the foos and bars don&#8217;t line up properly so you start trying to fix it.  Next thing you know it&#8217;s 5am and you need to wake up for work in an hour.  Then you get back into bed, angry at yourself for ruining your sleep, and get out of bed an hour later, shower, head into work a complete zombie.</p>
<p><span id="more-36"></span></p>
<p><strong>Back in the Office</strong></p>
<p><em>Good night last night Patrick?  You look like you got trashed last night.  No hair gel?  Wearing your glasses? </em></p>
<p>Yeah no I was just working on a problem.  Didn&#8217;t get much sleep.</p>
<p><em>Yeah ok buddy.  Catch you later.</em></p>
<p>And then you space out at your desk like Peter Gibbons and nothing actually gets done until you&#8217;ve  had 5-6 cups of coffee and it&#8217;s the afternoon already.  Chances are your accomplishments the night before are thrust into the shadows by the total lack of productivity when you&#8217;re back in the office the next day.</p>
<p><strong>After the 5:00 Whistle</strong></p>
<p>You arrive home, take a nap, wake up, have dinner, and sit down and start coding.  Vicious cycle isn&#8217;t it?  Pretty soon you just become completely consumed in what you&#8217;re doing and it ruins you.  You become a mad scientist, only, you&#8217;re mad at yourself and you&#8217;re spinning your wheels going no where.  Time to take a step back and look at the bigger picture.  What the hell are you doing to yourself Patrick?  You begin to think an addiction to blow would be healthier than this.</p>
<p><strong>The Big Picture</strong></p>
<p>I don&#8217;t claim to know everything, but I do claim to know what happens to me.  I can do this because I&#8217;m an expert in most things pertaining to myself.  I&#8217;m still quite sure that the things that happen to me also happen to others.  What I&#8217;m getting at is a lot of people work their brain trying to figure things out and get work done, effectively exercising their brain.  When they try to go to sleep their brain is just chugging away while the rest of your body sits there completely suspended.  Even if you aren&#8217;t coding in your sleep, or solving problems that you were thinking about the entire time you were awake, you are still not resting completely.  Between <a title="China trying to steal your name" href="http://www.patricktulskie.com/2008/07/the-chinese-government-is-stealing-my-birth-name-part-i/">China trying to steal your name</a>, the projects you have at work and in your personal life, getting more followers on twitter, and maintaining all of your real world relationships, it&#8217;s a wonder your brain can relax and let you sleep.  If you think about it (not too hard), you quickly realize that sleep starts before you get into your bed.</p>
<p><strong>Sleeping before Sleep</strong></p>
<p>And I&#8217;m not talking about napping.  I&#8217;m talking about getting your mind off of the thing that&#8217;s consuming you.  Perhaps it&#8217;s time for a new hobby.  Have too many hobbies?  Maybe you should exercise.  The wonderful thing about exercising is that it helps you feel better mentally and physically.  I started running again and I&#8217;m following the Couch to 5k using <a title="Robert Ullrey's Podcasts" href="http://www.ullreys.com/robert/Podcasts/">Robert Ullrey&#8217;s Podcasts</a>.  In addition to that, I do my best to make sure that the thing I do before going to bed is not the same thing I&#8217;ve been doing all day.  I&#8217;ll read the news, some blogs, and maybe go through some email.  Nothing that gives me brain strain.  We sit inside all day under flourescent lights, working on computers.  Doing something the complete opposite on the geek scale rounds you out, makes sure you&#8217;re completely tired, and helps you to get a good night&#8217;s rest.  This in turn makes you more productive the following day.</p>
<p>It&#8217;s not about the hours you spend working on a project, it&#8217;s about whether or not you make progress on the project.  When you step up your game, change things up, and round yourself out you can find that you get more work done in much less time.  This in turn allows you to improve your overall quality of life and do other things that you normally would not have time to do.</p>
<p><em>But Patrick, I have such great breakthroughs in my sleep sometimes.</em></p>
<p>That&#8217;s great.  I have several break throughs in a given day and I don&#8217;t look like a party animal alcoholic the next day in the office.  I used to think that having my subconscious do work for my in my sleep was something to brag about, but it&#8217;s not.  If you stop it from happening in a positive way then you to will find you&#8217;ve just upgraded your life.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patricktulskie.com/2008/08/tales-of-a-developer-i-code-in-my-sleep/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
