<?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>Corgibytes, LLC</title>
	<atom:link href="http://www.corgibytes.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.corgibytes.com</link>
	<description>ruby developers. web writers. code mechanics.</description>
	<lastBuildDate>Mon, 22 Aug 2011 18:26:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Workaround: Mac OS X terminal fonts start showing up bold</title>
		<link>http://www.corgibytes.com/2011/08/09/workaround-mac-os-x-terminal-fonts-start-showing-up-bold/</link>
		<comments>http://www.corgibytes.com/2011/08/09/workaround-mac-os-x-terminal-fonts-start-showing-up-bold/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 18:52:51 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.corgibytes.com/?p=729</guid>
		<description><![CDATA[Evidently, years of living with a typography geek have made my eyes a little sensitive. When I opened the Mac OS X Lion Terminal app today, which I use all the time, I noticed that the fonts were bold. It may sound silly, but it was actually starting to hurt my eyes to look at [...]]]></description>
			<content:encoded><![CDATA[<p>Evidently, years of living with a <a href="http://www.chambers-design.com">typography geek</a> have made my eyes a little sensitive. When I opened the Mac OS X Lion Terminal app today, which I use all the time, I noticed that the fonts were bold. It may sound silly, but it was actually starting to hurt my eyes to look at all of the terminal windows that I had open. It took quite a bit of sleuthing, but I managed to find a workaround.</p>
<p>In hopes that it gives someone else&#8217;s eyes a rest, here&#8217;s the fix.</p>
<ol>
<li>
Run the following commands in a terminal window:</p>
<pre><code>atsutil databases -removeUser
atsutil server -shutdown
atsutil server -ping
</code></pre>
</li>
<li>
Then restart terminal, and your eyes should thank you.
</li>
</ol>
<p>Source: <a href="http://support.mozilla.com/en-US/kb/Some%20text%20shows%20up%20bold%20after%20upgrade/discuss/5">Restarting you Font Server in OSX</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2011/08/09/workaround-mac-os-x-terminal-fonts-start-showing-up-bold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recipe: How to make your ruby version and gemset more visible when using rvm</title>
		<link>http://www.corgibytes.com/2011/01/28/recipe-how-to-make-your-ruby-version-and-gemset-more-visible-when-using-rvm/</link>
		<comments>http://www.corgibytes.com/2011/01/28/recipe-how-to-make-your-ruby-version-and-gemset-more-visible-when-using-rvm/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 07:08:28 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=673</guid>
		<description><![CDATA[I recently started using rvm for all of my projects. rvm is designed to help ruby developers work with multiple versions of ruby on their system. I recently came up with a great way always knowing with version of ruby is in use by rvm. But before I go into that, let&#8217;s talk about some [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started using <code>rvm</code> for all of my projects. <code>rvm</code> is designed to help ruby developers work with multiple versions of ruby on their system. I recently came up with a great way always knowing with version of ruby is in use by <code>rvm</code>. But before I go into that, let&#8217;s talk about some details about <code>rvm</code>.</p>
<h3>Installing a few rubys</h3>
<p>Once you get <code>rvm</code> installed, you only need to run <code>rvm install 1.9.2</code>. That command will download and build the latest version of ruby 1.9.2 from source. If you also work with Phusion&#8217;s ruby enterprise edition, you can install it from source by running <code>rvm install ree</code>.</p>
<p>After running those two commands, you will have three versions of ruby installed on your computer, the system version, ruby 1.9.2 and ruby enterprise edition. However, if you run <code>ruby --version</code> you&#8217;ll notice that the system version is the one that is getting executed. Here&#8217;s what doing so looks like on my Mac running Mac OS X version 10.6.6.</p>
<pre><code>
cloudraker:~ mscottford$ ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
</code></pre>
<p>However, if you first run <code>rvm use 1.9.2</code>, the running <code>ruby --version</code> should give you exactly what you expect. Try switching to ruby enterprise edition with <code>rvm use ree</code>. Again, running <code>ruby --version</code> should confirm that the switch took place correctly. Should you want to return to using your system&#8217;s version of ruby, just execute <code>rvm use system</code>.</p>
<p>If you ever need to check which version of <code>rvm</code> is active, you can run <code>rvm current</code>. This will output the name of the ruby that <code>rvm</code> has setup. We&#8217;ll discuss a better way to determine which ruby is active a little later. But first, let&#8217;s talk about how <code>rvm</code> helps us manage gems for each project.</p>
<h3>Working with gemsets</h3>
<p>Since just having different versions of ruby is not enough, <code>rvm</code> also gives us the ability to create different sets of gems that are completely isolated from each other. By default each version of ruby that we install gets its own gemset. We also have the ability to create named gemsets.</p>
<p>We create gemsets with the command <code>rvm gemset create gemset_name</code>. This will create a gemset for the currently selected version of ruby. One thing to keep in mind is that creating a gemset does not automatically switch you to that gemset. To do that you&#8217;ll need to use the <code>rvm use</code> command, for example <code>rvm use 1.9.2@gemset_name</code>. If you need to figure out which gemset is active, you can run the <code>rvm currrent</code> command. Once again, a better way to keep track of this is on it&#8217;s way.</p>
<p>Here&#8217;s a longer example that shows how to create and work with gemsets.</p>
<pre><code>
$ rvm use 1.8.6
$ rvm gemset create funkyness
'funkyness' gemset created (/Users/mscottford/.rvm/gems/ruby-1.8.6-p399@funkyness).
$ rvm current
ruby-1.8.6-p399
$ rvm use 1.8.6@funkyness
Using /Users/mscottford/.rvm/gems/ruby-1.8.6-p399 with gemset funkyness
$ rvm current
ruby-1.8.6-p399@funkyness
$ rvm use 1.8.6
Using /Users/mscottford/.rvm/gems/ruby-1.8.6-p399
$ rvm current
ruby-1.8.6-p399
</code></pre>
<h3>Start using <code>.rvmrc</code>, and stop thinking</h3>
<p>To make it impossible to forget which of your projects are using which versions of ruby and even then which gemsets, <code>rvm</code> will look for a <code>.rvmrc</code> in each directory that you switch into with the <code>cd</code> command. </p>
<p>Here&#8217;s an example.</p>
<pre><code>
$ rvm current
system
$ cd funkyness
$ rvm current
ruby-1.8.6-p399@funkyness
</code></pre>
<p>Okay. That looks like magic. What&#8217;s going on?</p>
<p>To answer that question, let&#8217;s take a peek inside of ~/funkyness/.rvmrc.</p>
<pre><code>
rvm 1.8.6@funkyness --create
</code></pre>
<p>With that one line, <code>rvm</code> will switch to ruby version 1.8.6 and gemset funkyness. It will even create it for you if it does not exist. </p>
<p>Since this feature could potentially be used to trick you into running malicious code on your system, <code>rvm</code> asks you to trust a <code>.rvmrc</code> file the first time that it reads it. You only have to do this once however.</p>
<h3>What&#8217;s this post about again?</h3>
<p>Now that I&#8217;ve explained the finer points about using <code>rvm</code>, I can finally start to vent a little.</p>
<p>I have several ruby projects that I&#8217;m working on at the moment. Some are for fun, but most are for my paying clients. I only recently started using <code>.rvmrc</code> files, and I&#8217;ve yet to create them for all of my projects. This means that for some projects, I don&#8217;t really need to think about which version of ruby is getting run, because it is the version that I&#8217;ve specified in the <code>.rvmrc</code> file. For other projects, however, I need to remember to run <code>rvm use</code> with the correct version of ruby for that project. </p>
<p>But I&#8217;d hate to run <code>rvm use</code> if I don&#8217;t need to. And running <code>rvm current</code> all them time seems a little silly. The solution that I&#8217;ve come up with is to alter the bash prompt to always let me know the current version of ruby that is in use by rvm. </p>
<p>To get started I used my favorite search engine to see if someone had already tackled this problem. I found one <a href="http://www.lostechies.com/blogs/derickbailey/archive/2010/11/24/my-osx-terminal-prompt-reposted-from-tumblr.aspx">really good example</a> that even introduced some color, however it was also using some <code>git</code> magic to include the current branch on the prompt. A few modifications later, I came up with <a href="https://gist.github.com/799933">my own version</a> that just displays the ruby that is in use by <code>rvm</code>, and it does so while looking like it was copied and pasted out of Textmate.</p>
<p>Here&#8217;s what it looks like.</p>
<pre><code>
<span style='color: #cb3621'>:rvm</span> =&gt; <span style='color: #25bc24'>'system'</span>
~ $ cd funkyness

<span style='color: #cb3621'>:rvm</span> =&gt; <span style='color: #25bc24'>'ruby-1.8.6@funkyness'</span>
funkyness $ cd ..

<span style='color: #cb3621'>:rvm</span> =&gt; <span style='color: #25bc24'>'system'</span>
~ $
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2011/01/28/recipe-how-to-make-your-ruby-version-and-gemset-more-visible-when-using-rvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Unit Testing</title>
		<link>http://www.corgibytes.com/2010/10/19/css-unit-testing/</link>
		<comments>http://www.corgibytes.com/2010/10/19/css-unit-testing/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 01:58:44 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=669</guid>
		<description><![CDATA[CSS is often not treated as code, but I&#8217;d like to make the argument that it should be treated as code. For instance, it needs to be easier to refactor CSS documents, and it needs to be possible to detect when there are CSS rules that are no longer needed. I&#8217;ve read some recent discussions [...]]]></description>
			<content:encoded><![CDATA[<p>CSS is often not treated as code, but I&#8217;d like to make the argument that it should be treated as code. For instance, it needs to be easier to refactor CSS documents, and it needs to be possible to detect when there are CSS rules that are no longer needed. </p>
<p>I&#8217;ve read some recent discussions where the question of CSS unit testing has been raised. Many of these discussions devolved into a debate about whether or not CSS was &#8220;code&#8221;. A lot of these commentators complained about CSS not being a Turing complete language. I&#8217;d like to claim that this debate, with respect to unit testing, is a giant waste of time. Whether or not CSS is Turing complete has nothing to do with the reasons why one would like to write tests against CSS. </p>
<p>But to avoid that debate, I&#8217;ll avoid describing CSS as code. Instead I&#8217;d to propose that CSS is actually a domain specific language that is used to control the the way a browser works. For simplicity, let&#8217;s think of CSS as a configuration syntax. </p>
<p>CSS is a language that affects the way that HTML documents are displayed by web browsers. As the use of CSS has increased as the primary method for altering the way information is displayed, HTML documents have become more and more semantic. The additional tags that have been added to HTML 5 have made the documents even more semantic. </p>
<p>This means that HTML is basically just data that is displayed by a web browser. Web browsers have a default way of presenting this information. CSS is used to alter this default presentation, which means that CSS is simply a method for configuring the workings of a browser. Since CSS has an effect on the execution of a program, the web browser in this case, that is used for displaying information, it is important to ensure that the configuration is accurate for the task at hand. </p>
<p>This is where testing comes in. Testing should be employed any time that we want to ensure the correct operation of an application. </p>
<p>So can we stop the bitching and get started on a decent method for testing CSS already? I&#8217;ve got some ideas, but I&#8217;ll have to write about them later, once I&#8217;ve had a chance to work up some experiments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2010/10/19/css-unit-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>7 Tips to Instantly Give Your Content Personality</title>
		<link>http://www.corgibytes.com/2010/05/26/7-tips-to-instantly-give-your-content-personality/</link>
		<comments>http://www.corgibytes.com/2010/05/26/7-tips-to-instantly-give-your-content-personality/#comments</comments>
		<pubDate>Wed, 26 May 2010 13:40:09 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[ad copy]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[branding]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[conversation]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[copywriting]]></category>
		<category><![CDATA[corgibytes]]></category>
		<category><![CDATA[creativity]]></category>
		<category><![CDATA[customer service]]></category>
		<category><![CDATA[marketing basics]]></category>
		<category><![CDATA[small business]]></category>
		<category><![CDATA[web copy]]></category>
		<category><![CDATA[websites]]></category>
		<category><![CDATA[word of mouth]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://writeideasmarketing.wordpress.com/?p=361</guid>
		<description><![CDATA[Content with personality sells. Brands spend big bucks developing a distinct voice that makes them stand out. Conversational words engage your prospects instead of putting them to sleep, or worse, buying from someone else. This idea of copy that is personable and professional at the same time is what I built my career on. And here [...]]]></description>
			<content:encoded><![CDATA[<p>Content with personality sells. Brands spend big bucks developing a distinct voice that makes them stand out. Conversational words engage your prospects instead of putting them to sleep, or worse, buying from someone else. This idea of copy that is personable and professional at the same time is what I built my career on. And here are some tips I&#8217;ve learned along the way to help your brand stand out from the pack.</p>
<p><strong>1. Keep words and sentences short.<br />
</strong>Big words do not make you sound smart. (I actually had to re-write that sentence. Originally it said, &#8220;Big words make you sound pretentious.&#8221; I have to keep even myself in check.) Long sentences make you seem boring. Readers, especially savvy web-oriented ones, don&#8217;t actually read — they scan. Short sentences keep these scanners more engaged, which leads to more sales. I try to keep most of my sentences to one thought, or clause. Sometimes two. More that that, and I try to break it up into separate sentences. Another way to put this idea is, &#8220;write like you talk.&#8221;</p>
<p><strong>2. Use contractions.<br />
</strong>When we&#8217;re talking casually, we use contractions — those &#8220;shortcut&#8221; words like can&#8217;t, won&#8217;t, shouldn&#8217;t, etc. We say &#8211; &#8220;I&#8217;d love to join you, but I can&#8217;t. Maybe next time, when I don&#8217;t have a conflict.&#8221;  In conversation, we&#8217;ll use the non-contracted form when we need to clarify or make a point. For example, &#8220;Joe, for the last time, I will not go on a date with you. Please, do not ask me again.&#8221; Using contractions instantly lightens the tone of your communications, and (you guessed it) makes your readers feel more engaged with your content.</p>
<p><strong>3. Choose the &#8220;sparkle&#8221; word.<br />
</strong>Which has more personality? &#8220;We&#8217;re happy to announce&#8230;&#8221; or &#8220;We&#8217;re thrilled to announce&#8230;&#8221; They essentially mean the same thing, but &#8220;thrilled&#8221; jumps out just a little more because it&#8217;s more exact. Happy is generic. It&#8217;s probably the first word you&#8217;ll reach for. Stretching just a little bit for that vibrant word can make your copy sing.</p>
<p><strong>4. Write in the present tense, active voice, second person.<br />
</strong>In non-academic terms, this means &#8211; avoid the words &#8220;have&#8221; or &#8220;been&#8221; and use the word &#8220;you&#8221;. Writing in this style is one of the most powerful ways to connect with your reader. It puts them in the here and now. It makes it feel like you&#8217;re having a conversation with them through the screen. Compare, for example, these two sentences: &#8220;We have enjoyed working with wonderful clients like you.&#8221; Versus, &#8220;You are a wonderful client. Thank you for your business. It makes ours more fun.&#8221; See the difference?</p>
<p><strong>5. Know which (few) grammar rules you can break.<br />
</strong>On occasion, I&#8217;ll start a sentence with &#8220;and&#8221;. I sometimes end with a preposition, too. That&#8217;s because these grammar rules help facilitate the conversational style. But there are some rules that when broken, make you look silly, or stupid, or ignorant. Here&#8217;s just a small sampling.</p>
<ul>
<li>Your (you own it) vs. You&#8217;re (you are)</li>
<li>There (not here) vs. Their (it belongs to them) vs. They&#8217;re (they are)</li>
<li>Assure (give support) vs. Insure (to buy or sell insurance)</li>
<li>Affect (verb) vs. Effect (noun &#8211; can you put &#8220;the&#8221; in front of it?)</li>
<li>&#8220;A lot&#8221; is two words.</li>
</ul>
<p>There are plenty more, and feel free to vent in the comments below. To keep your writing neat and tidy, try typing your opposing words in a search engine with &#8220;vs&#8221; between them. You can also check out <a href="http://grammar.quickanddirtytips.com/" target="_blank">The Grammar Girl</a>.</p>
<p><strong>6. Accessorize with styles.<br />
</strong>Not to sound like your high-school English teacher, but rhetorical styles such as <a href="http://en.wikipedia.org/wiki/Alliteration" target="_blank">alliteration</a>, <a href="http://en.wikipedia.org/wiki/Metaphor" target="_blank">metaphor</a>, <a href="http://en.wikipedia.org/wiki/Simile">similes</a>, <a href="http://en.wikipedia.org/wiki/Rhyme">rhyme</a>, and <a href="http://en.wikipedia.org/wiki/Repetition_(rhetorical)">repetition</a> are marks of great writing. So use them. A word of caution though; too much of any of these styles, and you can easily swing to the other side of the personality pendulum (the one where you sound like an amateur and we don&#8217;t want that). It&#8217;s best to think of these styles like an accessory — add enough to accentuate your content, but not too much where you overwhelm the message.</p>
<p><strong>7. Read out loud before you publish.<br />
</strong>And by &#8220;out loud&#8221;, I don&#8217;t mean &#8220;really loud and slow but still in my head&#8221;. It means with your voice, at a natural volume. In addition to catching typos, this form of editing is perfect for making sure your content is conversational. Does it sound natural? If there&#8217;s a sentence that just doesn&#8217;t flow, work with it until it sounds right. Then, give your content to someone who hasn&#8217;t read it yet. Ask them to read it out loud. Then, massage any phrases that tripped them up.</p>
<p>With these simple tweaks, you can transform writing that&#8217;s bland and impersonal, into content that brings your readers closer to your brand. These are great tips for all sorts of business communications in both print and web. Have a question about how to implement these styles? Have a story about how you turned your copy around? Want to vent about your grammar pet peeves? Put it in the comment below.</p>
<p>Thanks, and happy writing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2010/05/26/7-tips-to-instantly-give-your-content-personality/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dynamic DNS with Rackspace Apps Control Panel</title>
		<link>http://www.corgibytes.com/2010/05/24/dynamic-dns-with-rackspace-apps-control-panel/</link>
		<comments>http://www.corgibytes.com/2010/05/24/dynamic-dns-with-rackspace-apps-control-panel/#comments</comments>
		<pubDate>Mon, 24 May 2010 19:04:34 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=666</guid>
		<description><![CDATA[I use Rackspace Apps for email across all of my domains, and I am using them as a domain registrar, too. A few days ago, I wanted to create a subdomain, like example.vaderpi.com, that pointed to my computer at home. I didn&#8217;t want to use one of the free dynamic dns services, and I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://www.rackspace.com/apps">Rackspace Apps</a> for email across all of my domains, and I am using them as a domain registrar, too. A few days ago, I wanted to create a subdomain, like example.vaderpi.com, that pointed to my computer at home. I didn&#8217;t want to use one of the free dynamic dns services, and I wanted to be able to create the subdomain for a domain that I already own.</p>
<p>Through the Rackspace Apps <a href="http://cp.rackspace.com">control panel</a>, I can change all of the DNS entries for any of the domains that they are hosting. To create a subdomain, all I have to do is create an A record entry for &#8220;example&#8221; that points to my home ip address. I used <a href="http://whatismyip.org">whatismyip.org</a> to look that up. Clicked &#8220;save&#8221;, and then the address started resolving right away. Perfect. Well, at least until my ISP hands out a different ip address. </p>
<p>What I needed was a programmatic way to detect that my ip address has changed and then update the A record entry for example.vaderpi.com with the new ip address.</p>
<p>I dug through the Rackspace Apps <a href="http://api-wiki.apps.rackspace.com/api-wiki/index.php/Main_Page">API documentation</a> looking for a published way to do this, but I was unable to find one. Then I realized that I could just treat the control panel website as an API by driving it with a headless browser, like HtmlUnit.</p>
<p>There are several ruby gems that provide the ability to drive headless browsers. I took a quick look at <a href="http://celerity.rubyforge.org/">celerity</a>, <a href="http://mechanize.rubyforge.org/mechanize/">mechanize</a>, <a href="http://github.com/svenfuchs/steam">steam</a>, and <a href="http://code.google.com/p/selenium/wiki/GettingStarted">webdriver</a>. I settled in on using steam, because it seemed like it had the fewest number of layers between it and the headless browser. I had also never used it before, and wanted to get a feel for how well it worked.</p>
<p>I have posted the <a href="http://gist.github.com/412271">resulting script</a> as a github gist. Take a peek. Comments and forks are welcome. Note that all domain names, user names, and passwords have been replaced with made up examples.</p>
<p>As for running the script, I set up an @hourly entry in cron. The script only contacts the Rackspace Apps control panel if it detects an ip address change, so the risk of accidentally hammering their web server with this, should be low. (I point that out in case any of my old coworkers stumbles across this. <img src='http://www.corgibytes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>The current implementation can only update an existing DNS entry, but it should not be too hard to extend it to support creating additional DNS entries. Anyone that goes to implement this should make sure to correctly handle clicking the add link if there are not any empty rows in the entry table.</p>
<p>In addition to supporting creating new entries, there are a few improvements that I would like to make to this script. (1) I&#8217;d like to have an external service resolve the domain. This is going to become critical, because I want my the domain to resolve to the private ip address for devices that are on the private network. (2) I&#8217;d like to not rely on whatismyip.org. </p>
<p>I&#8217;m thinking of writing a small web service that I can install on my server that will address both of these. The service will be able to do DNS resolution, and it will be able to detect the public ip address of the caller.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2010/05/24/dynamic-dns-with-rackspace-apps-control-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rake recipes for working with Visual Studio projects</title>
		<link>http://www.corgibytes.com/2010/02/03/rake-recipes-for-working-with-visual-studio-projects/</link>
		<comments>http://www.corgibytes.com/2010/02/03/rake-recipes-for-working-with-visual-studio-projects/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:09:26 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=633</guid>
		<description><![CDATA[Despite spending my day job coding in Microsoft-land, I find myself using ruby tools more and more during my daily development. I recently wrote some rake tasks that I think are worth sharing and explaining. Specifically, I wrote a tasks to control building with msbuild (seems redundant, I know) and some tasks for starting and [...]]]></description>
			<content:encoded><![CDATA[<p>Despite spending my day job coding in Microsoft-land, I find myself using ruby tools more and more during my daily development. I recently wrote some rake tasks that I think are worth sharing and explaining. Specifically, I wrote a tasks to control building with msbuild (seems redundant, I know) and some tasks for starting and stopping Cassini (or webdev.webserver as it is now named). </p>
<p><b>Monkey patch <code>Pathname</code> for Windows paths</b></p>
<p>Since I am using the <code>Pathname</code> class to build paths in my examples, I need to give you the monkey patch that I use to make <code>Pathname</code> correctly display win32 paths.</p>
<pre><code>
require 'pathname'
class Pathname
  alias_method <img src='http://www.corgibytes.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> riginal_to_s, :to_s
  def to_s
    original_to_s.gsub('/', '\')
  end
end
</code></pre>
<p><b>Visual Studio command line environment</b></p>
<p>Running command line Visual Studio tools requires having certain environment variables loaded. This can be done by running <code>vsvars32.bat</code> directly or by launching a Visual Studio command prompt from the start menu. This is something that I always forget to do; my terminal windows spring into life by typing <code>cmd</code> in the run box. So, I wanted to write a task to ensure that the environment was properly set up.</p>
<p>I am working with Visual Studio 2005. If you want to use the Visual Studio 2008 tools then you will need to adjust the <code>vsvars32_bat</code> variable accordingly.</p>
<pre><code>
vsvars32_bat = Pathname.new(
  "c:\program files\") +
  "microsoft visual studio 8" +
  "common7\tools\vsvars32.bat"
task :vsvars do
  if ENV["VSINSTALLDIR"].nil?
    `"#{vsvars32_bat}" &#038;&#038; set`.each do |line|
      if line =~ /(w+)=(.+)/
        ENV[$1] = $2
      end
    end
  end
  raise "Eek!" if ENV["VSINSTALLDIR"].nil?
end
</code></pre>
<p>This code is the product of about 30 minutes of googling. I eventually found this trick in the <a href="http://github.com/whymirror/shoes/blob/master/Rakefile">shoes rakefile</a>[<a href="#footnote-1">1</a>].</p>
<p>Now any task that needs to call a Visual Studio command line tool just needs to declare <code>vsvars</code> as a prerequisite, like so.</p>
<pre><code>
task :csc => [:vsvars] do
  sh "csc test.cs"
end
</code></pre>
<p><b>Building with msbuild</b></p>
<p>This is actually pretty easy once we have the environment set up correctly. Just create a task that calls msbuild from a <code>sh</code> call.</p>
<pre><code>
namespace :build do
  desc "Build the core project"
  task :core => [:vsvars] do
    sh "msbuild #{core_solution_path}"
  end
end
</code></pre>
<p><b>Controlling Cassini (or webdev.webserver)</b></p>
<p>There is a lot going on here, so let me first overwhelm you with the code, and then explain what it is doing.</p>
<pre><code>
def wait_until_site_loaded
  puts "Please be patient. Waiting for site to respond...."
  site_loaded = false
  until site_loaded
    site_loaded = system
      "curl -L -I -f http://localhost:2088/Default.aspx > NUL 2>&#038;1"
  end
  puts "done."
end

namespace :web do
  desc "Start the local web server"
  task :start => [:vsvars] do
    Thread.new do
      sh "webdev.webserver /path:#{web_root_path} /port:2088 /vpath:/"
    end    

    wait_until_site_loaded
  end

  desc "Stop the local web server"
  task :stop => [:vsvars] do
    `taskkill /im webdev.webserver.exe > NUL 2>&#038;1`
  end

  desc "Restart the local web server"
  task :restart => [:vsvars, :stop, :start]
end
</code></pre>
<p>Before the code block above will work, you will need to create a <code>web_root_path</code> variable that points to the <i>absolute path</i> of your website. Relative paths will not work.</p>
<p>The <code>web:start</code> task will start the web server. If an instance is already running at the specified port, then you will get an error message in the form of a dialog box. I wish I knew how to make it fail silently. (I also wish I knew how to prevent it from displaying an annoying balloon notification.)</p>
<p>After starting the web server, the <code>web:start</code> calls out to <code>curl</code> to make sure that the site is responding to get requests. I have <code>curl</code> installed as a result of installing <a href="http://www.cygwin.com/">cygwin</a>. There are <a href="http://curl.haxx.se/latest.cgi?curl=win32-nossl">other ways</a> to get <code>curl</code>, but you will need to make sure your path points at it&#8217;s location to use the code above without modifications. <code>curl</code> is pretty chatty, so I have silenced it by routing its standard out and standard error streams to <code>NUL</code>.</p>
<p>The <code>web:stop</code> task will kill all instances of Cassini. This might be annoying if you have more than one instance running. If that is the case, then you will need to write in some form of accounting for the process id of the web server process, or develop a way to figure out which process id owns the port you want. Once you know the specific pid, you can call <code>taskkill /pid</code> and pass it the pid of the process you want to kill.</p>
<p>The <code>web:restart</code> task will call <code>web:stop</code> task followed by <code>web:start</code> task.</p>
<p><b>One more thing: display available tasks from default task</b></p>
<p>Note: This recipe does not apply to just Windows development. It will work on any platform.</p>
<p>You can get a list of documented tasks by calling <code>rake -T</code>, but I always forget to do that. I usually just call <code>rake</code> when I want to know what it does. So I created a <code>:default</code> task that displays the same task list that you get when you call <code>rake -T</code>.</p>
<pre><code>
task :default do |task|
  puts "You must specifiy a task. Available tasks are listed below:"
  task.application.options.show_task_pattern = /.*/
  task.application.display_tasks_and_comments
end
</code></pre>
<p>That&#8217;s it. I hope you found these recipes helpful. Happy coding!</p>
<p>[<a name="footnote-1">1</a>]: This is way off topic, so I stuck it in a footnote. I know it&#8217;s old news, but the way _why, the creator of shoes, <a href="http://www.rubyinside.com/why-the-lucky-stiff-is-missing-2278.html">committed Internet suicide</a> really irritates me. There were a lot of people benefiting from his contributions to the ruby world, and then one day he just decides to take his toys and go home. He could have bowed out graciously, explaining that he had moved on, but he instead chose identity death. His works remain in <a href="http://viewsourcecode.org/why/">archived form</a>, but I am not sure if there is still any energy behind them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2010/02/03/rake-recipes-for-working-with-visual-studio-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Tips for a Kickass Wanted Ad</title>
		<link>http://www.corgibytes.com/2010/01/15/10-tips-for-a-kickass-wanted-ad/</link>
		<comments>http://www.corgibytes.com/2010/01/15/10-tips-for-a-kickass-wanted-ad/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:47:31 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[corgibytes]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://writeideasmarketing.wordpress.com/?p=332</guid>
		<description><![CDATA[Here&#8217;s a great example of how to write a job description that works. I found this on Andy Sernovitz&#8217;s blog (a must have on your RSS feed if you ask me.) 10 Reasons why it works: The first word. You. Not me, I, we or any other form of the first person. You. It grabs [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a great example of how to write a job description that works. I found this on <a href="http://www.damniwish.com/2010/01/we-need-interns-you-can-be-a-blogging-social-media-word-of-mouth-supergenius-everyone-will-want-to-hire-you.html" target="_blank">Andy Sernovitz&#8217;s blog</a> (a must have on your RSS feed if you ask me.)</p>
<div id="attachment_333" class="wp-caption alignleft" style="width: 490px"><a href="http://writeideasmarketing.files.wordpress.com/2010/01/supergenius.jpg"><img class="size-full wp-image-333" title="supergenius" src="http://writeideasmarketing.files.wordpress.com/2010/01/supergenius.jpg" alt="" width="480" height="349" /></a><p class="wp-caption-text">Benifit-driven conversational copy gets you noticed.</p></div>
<p><strong>10 Reasons why it works:</strong></p>
<ol>
<li><strong>The first word</strong>. You. Not me, I, we or any other form of the first person. You. It grabs the reader&#8217;s attention and makes your message relevant.</li>
<li><strong>Conversational tone.</strong> &#8220;Here&#8217;s the deal&#8221; is a great opening line. It closes the gap between the writer and reader. It makes your reader feel like they&#8217;re face-to-face, and opens an emotional bond. And in advertising, that&#8217;s a powerful thing.</li>
<li><strong>Clear benefits.</strong> Your reader wants to know, &#8220;What&#8217;s in it for me&#8221;. Give them clear and meaningful examples. Andy does a great job here with, &#8220;You will become a rock star with badass contacts. We will find you a job when you graduate.&#8221;</li>
<li><strong>Name dropping. </strong>Works every time. If you have the clout and the contacts, make it known.</li>
<li><strong>Edgy</strong>. Yes, this ad uses words like &#8220;shitwork&#8221; and &#8220;badass&#8221;. But it works here because of the audience. It makes your ad stand out amid a sea of corporate babble. Just make sure that you have the corporate culture to pull it off.</li>
<li><strong>Authentic. </strong>There&#8217;s no guessing that this job will require a lot of effort and work. In fact, they come out and say &#8220;You will be exhausted.&#8221; But transparency and honesty about the job (especially early in the process) just make you more credible.</li>
<li><strong>Keywords instead of tasks.</strong> &#8220;Blogging, Youtube, Social Media, Viral, Word of Mouth&#8230;&#8221; describe what the job is about without saying what the employee will be doing on a day-to-day basis. This helps ensure that qualified candidates won&#8217;t self-select out because they perceive they&#8217;re under qualified.</li>
<li><strong>Short &amp; Simple.</strong> At just over 100 words, this ad packs punch. In just a glance and a quick scan, you clearly understand what Andy&#8217;s looking for and whether or not it&#8217;s a good fit for you. No need to drone on and on. We&#8217;re all too busy to read useless information.</li>
<li><strong>Written for the audience.</strong> This ad might not be the best fit if you were trying to find a more senior position, but for an intern, the edgy and conversational tone is perfect. This is how 19 year olds speak. Write how you (and your audience) speak.</li>
<li><strong>Clear call to action.</strong> &#8220;How to apply: blow my mind&#8221; (love this!) followed by three websites where you can learn more. Clear next steps are critical for increased response.</li>
</ol>
<p>What are your thoughts? Is this an effective Wanted Ad? Or did it cross the line? Would you apply? Would you pass it on?</p>
<p>To your success,</p>
<p>Andrea <img src='http://www.corgibytes.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2010/01/15/10-tips-for-a-kickass-wanted-ad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watir Wait</title>
		<link>http://www.corgibytes.com/2010/01/07/watir-wait/</link>
		<comments>http://www.corgibytes.com/2010/01/07/watir-wait/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 14:09:27 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=630</guid>
		<description><![CDATA[I have been working with watir over the last couple of days. I quickly became frustrated with numerous errors claiming that the element I wanted to perform an operation on did not exist. I found the Watir::Waiter class and started using it extensively. So extensively, that I decided to write a little monkey patch to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with <a href="http://watir.com/">watir</a> over the last couple of days. I quickly became frustrated with numerous errors claiming that the element I wanted to perform an operation on did not exist. I found the Watir::Waiter class and started using it extensively. So extensively, that I decided to write a little monkey patch to make my life easier.</p>
<p>The application that I am working with performs a lot of client-side DOM manipulation. This can create instances where my script was asking Watir to perform operations on DOM objects that didn&#8217;t exist. To defend against that, every time that I called click or set or select on various DOM objects, I wrote two additional statements. One to make sure the browser had finished whatever it was working on, and one to make sure that the element I was about to interact with actually existed. </p>
<p>The code looked something like this.</p>
<pre><code>
  @browser = Watir::Browser.new
  @browser.goto("http://localhost")

  @browser.wait
  Watir::Waiter.wait_until { @browser.text_field(:name, /UserName/).exists? }
  @browser.text_field(:name, /UserName/).set("Admin")

  @browser.wait
  Watir::Waiter.wait_until { @browser.text_field(:name, /Password/).exists? }
  @browser.text_field(:name, /Password/).set("Password")

  @browser.wait
  Watir::Waiter.wait_until { @browser.button(:name, /Submit/).exists? }
  @browser.button(:name, /Submit/).click
</code></pre>
<p>While that works, I got really sick of having to re-type the selector for the DOM element that I wanted to muck with. What I wanted to do was write code that looked something like this.</p>
<pre><code>
  @browser = Watir::Browser.new
  @browser.goto("http://localhost")

  @browser.text_field(:name, /UserName/).wait_to_set("Admin")
  @browser.text_field(:name, /Password/).wait_to_set("Password")
  @browser.button(:name, /Submit/).wait_to_click
</code></pre>
<p>Wow. That is much more concise and easier to understand. Even a non-programmer can understand what is happening now.</p>
<p>To make this code actually work, I decided to write a quick monkey patch that adds a &#8220;wait_to_&#8221; alternative for every method that can be called on input elements and links. These methods call <code>@browser.wait</code>, ask <code>Watir::Waiter</code> to wait for the element to exist, and then call the requested method. </p>
<p>I called my monkey patch <a href="http://gist.github.com/271231">Watir Wait</a>. (Get it? I crack myself up! <img src='http://www.corgibytes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) Take a peek and let me know what you think. If I get enough positive feedback, I&#8217;ll rework this into a proper patch and submit it to the Watir team for inclusion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2010/01/07/watir-wait/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Dump: export the contents of your Oracle database</title>
		<link>http://www.corgibytes.com/2009/12/18/database-dump-export-the-contents-of-your-oracle-database/</link>
		<comments>http://www.corgibytes.com/2009/12/18/database-dump-export-the-contents-of-your-oracle-database/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 18:25:31 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=619</guid>
		<description><![CDATA[I created another small utility written in ruby. This one dumps the entire contents of a database to a text file. Contents are spewed to standard out, so you will have to pipe the output to a file if you want to do anything useful with it later. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>I created another <a href="http://gist.github.com/259661">small utility</a> written in ruby. This one dumps the entire contents of a database to a text file. Contents are spewed to standard out, so you will have to pipe the output to a file if you want to do anything useful with it later.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2009/12/18/database-dump-export-the-contents-of-your-oracle-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ever wanted a database equivalent to grep?</title>
		<link>http://www.corgibytes.com/2009/12/17/ever-wanted-a-database-equivalent-to-grep/</link>
		<comments>http://www.corgibytes.com/2009/12/17/ever-wanted-a-database-equivalent-to-grep/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 20:08:49 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corgibytes]]></category>

		<guid isPermaLink="false">http://vaderpi.com/blog/?p=617</guid>
		<description><![CDATA[I am always banging my head against the wall when working with legacy databases, because it is difficult tell where information is stored. Reading through the entire application code base to find the location of a string on the user interface is a very frustrating task. It would be much faster if I could just [...]]]></description>
			<content:encoded><![CDATA[<p>I am always banging my head against the wall when working with legacy databases, because it is difficult tell where information is stored. Reading through the entire application code base to find the location of a string on the user interface is a very frustrating task. It would be much faster if I could just run <code>grep '.*message.*'</code>. I have been wishing that such a thing existed for quite a while, but I was unable to find one that did what I wanted. Start with a dash of ruby, add an hour of my time, throw in some tinkering, and bang. <a href="http://gist.github.com/258993">It&#8217;s done</a>. </p>
<p>This version only works with Oracle databases, but it should not be too difficult to rework this to talk to database management system that you are mucking with.</p>
<p>Requirements: ruby 1.8.7 or later, ruby-oci8 version 2.0 (if on Windows, make sure you download the binary gem from rubyforge instead of trying to do <code>gem install ruby-oci8</code>)</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.corgibytes.com/2009/12/17/ever-wanted-a-database-equivalent-to-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

