<?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>Gabe Sumner</title>
	<atom:link href="http://gabesumner.com/feed" rel="self" type="application/rss+xml" />
	<link>http://gabesumner.com</link>
	<description></description>
	<lastBuildDate>Fri, 30 Mar 2012 15:09:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to create short links using C# and database ID&#8217;s</title>
		<link>http://gabesumner.com/how-to-create-short-links-using-c-and-database-ids</link>
		<comments>http://gabesumner.com/how-to-create-short-links-using-c-and-database-ids#comments</comments>
		<pubDate>Fri, 30 Mar 2012 14:33:19 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=849</guid>
		<description><![CDATA[I recently had a project where I wanted my web site content to utilize short URLs.  These short URL&#8217;s would be easier to utilize on Twitter where the message is limited to 140 characters.  At this stage link shortening is &#8230; <a href="http://gabesumner.com/how-to-create-short-links-using-c-and-database-ids">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had a project where I wanted my web site content to utilize short URLs.  These short URL&#8217;s would be easier to utilize on Twitter where the message is limited to 140 characters.  At this stage link shortening is old news and I could use one of the many available link shortening services (Bit.ly, Goo.gl) to generate these links.  However, I dislike the idea of encouraging visitors to tweet a Bit.ly link, as opposed to my own links.</p>
<h2>Using database ID&#8217;s to create short links</h2>
<p>To address this my original idea was to simply rely on the auto-incremented row ID&#8217;s for each item in the database.  For the database table, this looks something like this:</p>
<p><span id="more-849"></span></p>
<table>
<tbody>
<tr>
<td><strong>ID</strong></td>
<td><strong>Title</strong></td>
</tr>
<tr>
<td>1</td>
<td>Budgeting for your CMS or Web Project</td>
</tr>
<tr>
<td>2</td>
<td>How many web browsers support responsive design?</td>
</tr>
<tr>
<td>&#8230;</td>
<td>&#8230;</td>
</tr>
<tr>
<td>95131</td>
<td>Wanted: Video-conferencing solution for mid-sized teams</td>
</tr>
</tbody>
</table>
<p>Which means it would be easy to utilize shortened URL&#8217;s that look like this:</p>
<ul>
<li>http://mywebsite.com/1</li>
<li>http://mywebsite.com/2</li>
<li>http://mywebsite.com/95131</li>
</ul>
<p>However, these URL&#8217;s aren&#8217;t as short as they could be.  By only utilizing numbers (0-9) we&#8217;re not utilizing other valid characters (A-Z, a-z, -, _) that could potentially be used to create shorter URL&#8217;s.</p>
<h2>Using Base 64 to create shorter URL&#8217;s</h2>
<p>The numbers I&#8217;m utilizing for my database ID&#8217;s are using numbers based on 10.  Using this type of number I&#8217;m only utilizing the 0-9 characters  However, numbers that are based on 64 utilize other characters to represent numbers for which we do not have a character.</p>
<p><a href="http://convertxy.com/index.php/numberbases/" target="_blank"><img class="size-full wp-image-851 alignnone" title="Base 10 (Decimal) to Base 64" src="http://gabesumner.com/wp-content/uploads/2012/03/3-21-2012-3-16-53-PM.png" alt="" width="476" height="154" /></a></p>
<p>The way base 64 numbers are represented matches nicely with the characters that can be used in a URL.  Therefore, by converting my base 10 database id&#8217;s into base 64 I&#8217;ll get a shorter URL.  At the same time, I can be assured that the shortened URL&#8217;s aren&#8217;t duplicated since they are based on a unique database ID.</p>
<h2>C# code for converting a Base-10 Integer to a Base-64 String</h2>
<p>Ultimately, I wanted a solution that would work like this:</p>
<ul>
<li>ShortUrl.Shrink(95131) =&gt; Returns &#8220;XOb&#8221;</li>
<li>ShortUrl.Expand(&#8220;XOb&#8221;) =&gt; Returns 95131</li>
</ul>
<p>Here is the code I came up with.</p>
<div id="gist-2148657" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">using</span> <span class="nn">System</span><span class="p">;</span></div><div class='line' id='LC2'><span class="k">using</span> <span class="nn">System.Linq</span><span class="p">;</span></div><div class='line' id='LC3'><span class="k">using</span> <span class="nn">System.Text.RegularExpressions</span><span class="p">;</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'><span class="k">namespace</span> <span class="nn">MvcApplication.Helpers</span></div><div class='line' id='LC6'><span class="p">{</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="k">static</span> <span class="k">class</span> <span class="nc">ShortUrl</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// &lt;summary&gt;</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// Converts a Base-10 Integer to Base-64.  This will effectively shorten the number of characters used to represent a number &gt; 10.  </span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// &lt;/summary&gt;</span></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="k">static</span> <span class="kt">string</span> <span class="nf">Shrink</span><span class="p">(</span><span class="kt">int</span> <span class="n">Number</span><span class="p">)</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nf">ConvertDecToBase</span><span class="p">(</span><span class="n">Number</span><span class="p">,</span> <span class="m">64</span><span class="p">);</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// &lt;summary&gt;</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// Converts a Base-64 Number (represented as a string) into a Base-10 Integer.  This will effectively expand the numbers of characters needed to represent the number.</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// &lt;/summary&gt;</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// &lt;param name=&quot;NumberString&quot;&gt;&lt;/param&gt;</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">/// &lt;returns&gt;&lt;/returns&gt;</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="k">static</span> <span class="kt">int</span> <span class="nf">Expand</span><span class="p">(</span><span class="kt">string</span> <span class="n">NumberString</span><span class="p">)</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nf">ConvertBaseToDec</span><span class="p">(</span><span class="n">NumberString</span><span class="p">,</span> <span class="m">64</span><span class="p">);</span></div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">private</span> <span class="k">static</span> <span class="kt">string</span> <span class="n">DefaultChars</span> <span class="p">=</span> <span class="s">&quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;</span><span class="p">;</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">private</span> <span class="k">static</span> <span class="kt">string</span> <span class="n">Base64Chars</span> <span class="p">=</span>  <span class="s">&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_&quot;</span><span class="p">;</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">private</span> <span class="k">static</span> <span class="kt">int</span> <span class="nf">ConvertBaseToDec</span><span class="p">(</span><span class="kt">string</span> <span class="n">NumberString</span><span class="p">,</span> <span class="kt">int</span> <span class="n">Base</span><span class="p">)</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">string</span> <span class="n">Chars</span><span class="p">;</span></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">Base</span> <span class="p">==</span> <span class="m">64</span><span class="p">)</span></div><div class='line' id='LC34'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC35'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">NumberString</span> <span class="p">=</span> <span class="n">Regex</span><span class="p">.</span><span class="n">Replace</span><span class="p">(</span><span class="n">NumberString</span><span class="p">,</span> <span class="s">&quot;^A+&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">);</span></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Chars</span> <span class="p">=</span> <span class="n">Base64Chars</span><span class="p">;</span></div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC39'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">NumberString</span> <span class="p">=</span> <span class="n">Regex</span><span class="p">.</span><span class="n">Replace</span><span class="p">(</span><span class="n">NumberString</span><span class="p">,</span> <span class="s">&quot;^0+&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">);</span></div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Chars</span> <span class="p">=</span> <span class="n">DefaultChars</span><span class="p">;</span></div><div class='line' id='LC42'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC43'><br/></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">int</span> <span class="n">Dec</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span> <span class="n">i</span> <span class="p">&lt;=</span> <span class="n">NumberString</span><span class="p">.</span><span class="n">Length</span> <span class="p">-</span> <span class="m">1</span><span class="p">;</span> <span class="n">i</span><span class="p">++)</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC47'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">int</span> <span class="n">CharNum</span> <span class="p">=</span> <span class="n">Chars</span><span class="p">.</span><span class="n">IndexOf</span><span class="p">(</span><span class="n">NumberString</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span></div><div class='line' id='LC48'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">int</span> <span class="n">Conversion</span> <span class="p">=</span> <span class="n">CharNum</span> <span class="p">*</span> <span class="n">IntPow</span><span class="p">(</span><span class="n">Base</span><span class="p">,</span> <span class="p">(</span><span class="n">NumberString</span><span class="p">.</span><span class="n">Length</span> <span class="p">-</span> <span class="p">(</span><span class="n">i</span> <span class="p">+</span> <span class="m">1</span><span class="p">)));</span></div><div class='line' id='LC49'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Dec</span> <span class="p">=</span> <span class="n">Dec</span> <span class="p">+</span> <span class="n">Conversion</span><span class="p">;</span></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC51'><br/></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">Dec</span><span class="p">;</span></div><div class='line' id='LC53'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC54'><br/></div><div class='line' id='LC55'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">private</span> <span class="k">static</span> <span class="kt">string</span> <span class="nf">ConvertDecToBase</span><span class="p">(</span><span class="kt">int</span> <span class="n">OriginalNumber</span><span class="p">,</span> <span class="kt">int</span> <span class="n">Base</span><span class="p">)</span></div><div class='line' id='LC56'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC57'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">char</span><span class="p">[]</span> <span class="n">Chars</span><span class="p">;</span></div><div class='line' id='LC58'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">Base</span> <span class="p">==</span> <span class="m">64</span><span class="p">)</span></div><div class='line' id='LC59'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC60'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Chars</span> <span class="p">=</span> <span class="n">Base64Chars</span><span class="p">.</span><span class="n">ToCharArray</span><span class="p">();</span></div><div class='line' id='LC61'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC62'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC63'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC64'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Chars</span> <span class="p">=</span> <span class="n">DefaultChars</span><span class="p">.</span><span class="n">ToCharArray</span><span class="p">();</span></div><div class='line' id='LC65'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC66'><br/></div><div class='line' id='LC67'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">string</span> <span class="n">encoded</span> <span class="p">=</span> <span class="s">&quot;&quot;</span><span class="p">;</span></div><div class='line' id='LC68'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">encoded</span> <span class="p">=</span> <span class="n">ConvertDecToBase</span><span class="p">(</span><span class="n">OriginalNumber</span><span class="p">,</span> <span class="n">Base</span><span class="p">,</span> <span class="n">encoded</span><span class="p">,</span> <span class="n">Chars</span><span class="p">);</span></div><div class='line' id='LC69'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">encoded</span><span class="p">;</span></div><div class='line' id='LC70'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC71'><br/></div><div class='line' id='LC72'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">private</span> <span class="k">static</span> <span class="kt">string</span> <span class="nf">ConvertDecToBase</span><span class="p">(</span><span class="kt">int</span> <span class="n">Number</span><span class="p">,</span> <span class="kt">int</span> <span class="n">Base</span><span class="p">,</span> <span class="kt">string</span> <span class="n">EncodedString</span><span class="p">,</span> <span class="kt">char</span><span class="p">[]</span> <span class="n">Chars</span><span class="p">)</span></div><div class='line' id='LC73'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC74'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">Number</span> <span class="p">&lt;</span> <span class="n">Base</span><span class="p">)</span></div><div class='line' id='LC75'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC76'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">EncodedString</span> <span class="p">=</span> <span class="n">EncodedString</span> <span class="p">+</span> <span class="n">Chars</span><span class="p">[</span><span class="n">Number</span><span class="p">];</span></div><div class='line' id='LC77'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC78'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC79'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC80'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">int</span> <span class="n">NewNumber</span> <span class="p">=</span> <span class="n">Number</span> <span class="p">/</span> <span class="n">Base</span><span class="p">;</span></div><div class='line' id='LC81'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">EncodedString</span> <span class="p">=</span> <span class="n">ConvertDecToBase</span><span class="p">(</span><span class="n">NewNumber</span><span class="p">,</span> <span class="n">Base</span><span class="p">,</span> <span class="n">EncodedString</span><span class="p">,</span> <span class="n">Chars</span><span class="p">);</span></div><div class='line' id='LC82'><br/></div><div class='line' id='LC83'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Number</span> <span class="p">=</span> <span class="n">Number</span> <span class="p">-</span> <span class="p">(</span><span class="n">NewNumber</span> <span class="p">*</span> <span class="n">Base</span><span class="p">);</span></div><div class='line' id='LC84'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">Number</span> <span class="p">&lt;</span> <span class="n">Base</span><span class="p">)</span></div><div class='line' id='LC85'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC86'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">EncodedString</span> <span class="p">=</span> <span class="n">EncodedString</span> <span class="p">+</span> <span class="n">Chars</span><span class="p">[</span><span class="n">Number</span><span class="p">];</span></div><div class='line' id='LC87'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC88'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC89'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">EncodedString</span><span class="p">;</span></div><div class='line' id='LC90'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC91'><br/></div><div class='line' id='LC92'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">private</span> <span class="k">static</span> <span class="kt">int</span> <span class="nf">IntPow</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">pow</span><span class="p">)</span></div><div class='line' id='LC93'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC94'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">int</span> <span class="n">ret</span> <span class="p">=</span> <span class="m">1</span><span class="p">;</span></div><div class='line' id='LC95'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">while</span> <span class="p">(</span><span class="n">pow</span> <span class="p">!=</span> <span class="m">0</span><span class="p">)</span></div><div class='line' id='LC96'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC97'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">((</span><span class="n">pow</span> <span class="p">&amp;</span> <span class="m">1</span><span class="p">)</span> <span class="p">==</span> <span class="m">1</span><span class="p">)</span></div><div class='line' id='LC98'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ret</span> <span class="p">*=</span> <span class="n">x</span><span class="p">;</span></div><div class='line' id='LC99'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">x</span> <span class="p">*=</span> <span class="n">x</span><span class="p">;</span></div><div class='line' id='LC100'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">pow</span> <span class="p">&gt;&gt;=</span> <span class="m">1</span><span class="p">;</span></div><div class='line' id='LC101'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC102'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">ret</span><span class="p">;</span></div><div class='line' id='LC103'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC104'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC105'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2148657/c686d796e6d926ed56f60ab72d9bfbdaf0f5585f/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2148657#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2148657">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<h2>Some notes</h2>
<ul>
<li>The reason I didn&#8217;t use C#&#8217;s built-in <a href="http://msdn.microsoft.com/en-us/library/dhx0d524.aspx">Base-64 encoding</a> is because it adds padding to the string.  As a result, the Base-64 string often becomes longer than the original decimal number.  (Making it useless for link shortening)</li>
<li>There are decimal numbers that, when converted to Base-64, will turn into offensive words.  I haven&#8217;t dealt with this yet.</li>
<li><a href="http://www.codeproject.com/Articles/27493/Convert-an-integer-to-a-base-64-string-and-back-ag">Someone else</a> created a Base-10 to Base-64 converter with C#.  It looks like this code uses bit-shifting.  This is probably faster (and more clever), but I had trouble understanding the code.</li>
<li>There is a <a href="http://convertxy.com/index.php/numberbases/">nice website</a> that you can use to test these conversions.</li>
<li>That website is based on some PHP-code that can be <a href="http://www.pgregg.com/projects/php/base_conversion/base_conversion.php">found here</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/how-to-create-short-links-using-c-and-database-ids/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How many web browsers support responsive design?</title>
		<link>http://gabesumner.com/how-many-web-browsers-support-responsive-design</link>
		<comments>http://gabesumner.com/how-many-web-browsers-support-responsive-design#comments</comments>
		<pubDate>Mon, 27 Feb 2012 14:47:17 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[graceful degradation]]></category>
		<category><![CDATA[progressive enhancement]]></category>
		<category><![CDATA[responsive design]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=766</guid>
		<description><![CDATA[For anyone investigating Responsive Design it&#8217;s natural to ask what percentage of web browsers support this design technique.  However, the real question you&#8217;re asking is &#8220;what percentage of web browsers support CSS3 media queries?&#8221;.  CSS3 media queries are the primary &#8230; <a href="http://gabesumner.com/how-many-web-browsers-support-responsive-design">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-718 alignright" title="Responsive design" src="http://gabesumner.com/wp-content/uploads/2012/02/2-16-2012-12-33-44-PM-e1330275692929.png" alt="Responsive design" width="200" height="178" />For anyone investigating <a title="Responsive Design" href="http://gabesumner.com/cms-definitions/responsive-design">Responsive Design</a> it&#8217;s natural to ask what percentage of web browsers support this design technique.  However, the real question you&#8217;re asking is &#8220;what percentage of web browsers support CSS3 media queries?&#8221;.  CSS3 media queries are the primary technology involved in responsive design.  If you&#8217;re simply looking for a quick answer, here it is:</p>
<p><strong>Responsive design is supported by 70-80% of today&#8217;s web devices</strong></p>
<p><strong></strong>However, the complete answer is a lot more nuanced than this.  The number above examines all web-related traffic.  However, responsive design is often used to target mobile devices.  Those statistics look a lot different.  Furthermore, there are techniques for addressing browsers &amp; devices that do not support responsive design.</p>
<p><span id="more-766"></span></p>
<p>This post will examine the details missing from the generic statistic above.</p>
<h2>What web browsers support CSS3 media queries?</h2>
<p>CSS3 media queries are the primary technology powering responsive design.  These queries enable web designers to customize the website&#8217;s style for different form factors (desktop, smartphone, tablet, print, etc.). Consequently, quantifying web browser support of responsive design requires an examination of CSS3 media query support:</p>
<p><a href="http://caniuse.com/css-mediaqueries" target="_blank"><img class="alignnone size-medium wp-image-770" title="CSS3 Media Query support in modern web browsers" src="http://gabesumner.com/wp-content/uploads/2012/02/media-query-support-e1330206020851.png" alt="CSS3 Media Query support in modern web browsers" width="600" height="221" /></a> <a href="http://caniuse.com/css-mediaqueries" target="_blank">[Image courtesy of caniuse.com]</a></p>
<p>The biggest red flag is Internet Explorer, which only recently began supporting CSS3 media queries with IE9.  IE9 is the current version of IE and previous versions still have significant marketshare.  In fact, as of this writing IE 8 maintains the largest marketshare (22.3%) for a single version of a web browser.</p>
<p><a style="color: #ff4b33; line-height: 24px;" href="http://gs.statcounter.com/#browser_version-ww-monthly-201111-201201-bar" target="_blank"><img class="alignnone size-medium wp-image-772" title="Marketshare for single versions of web browsers" src="http://gabesumner.com/wp-content/uploads/2012/02/single-browser-version-marketshare-600x375.png" alt="Marketshare for single versions of web browsers" width="600" height="375" /></a><a href="http://gs.statcounter.com/#browser_version-ww-monthly-201111-201201-bar" target="_blank">[Image courtesy of statcounter.com] </a></p>
<p>If we add IE8 (22.3%), IE7 (3.96%) and IE6 (1.85%) then we quickly begin to climb towards the 20-30 non-supported percentage stated at the beginning of this post.  However, it&#8217;s worth noting that browser statistics vary per website.  For example, <a href="http://www.w3schools.com/browsers/browsers_explorer.asp" target="_blank">W3schools.com</a> puts IE8 usage at 10.5%.  You&#8217;ll want to compare these general statistics with the statistics for your website.</p>
<h2>How many mobile browsers support CSS3 media queries?</h2>
<p>Many websites are using responsive design to target mobile devices (smartphones &amp; tablets).  As shown above, IE8 is a cause for concern on desktop computers; however, IE usage on mobile devices is relatively insignificant:</p>
<p><a href="http://marketshare.hitslink.com/browser-market-share.aspx?qprid=0&amp;qpcustomd=1&amp;qptimeframe=M&amp;qpsp=155&amp;qpnp=1"><img class="alignnone size-full wp-image-784" title="Mobile browser marketshare" src="http://gabesumner.com/wp-content/uploads/2012/02/mobile-marketshare.png" alt="Mobile browser marketshare" width="395" height="139" /></a></p>
<p><a href="http://marketshare.hitslink.com/browser-market-share.aspx?qprid=0&amp;qpcustomd=1&amp;qptimeframe=M&amp;qpsp=155&amp;qpnp=1">[Image courtesy of hitslink.com]</a></p>
<p>These mobile statistics vary strongly based on region.  For example, Opera is the most popular mobile browser for large parts of Africa &amp; Asia:</p>
<p><a href="http://www.browserrank.com/2012/02/most-popular-mobile-browser-by-country.html" target="_blank"><img class="alignnone size-large wp-image-786" title="Global web browser marketshare per country" src="http://gabesumner.com/wp-content/uploads/2012/02/mobilebrowser-600x306.png" alt="Global web browser marketshare per country" width="600" height="306" /></a><a href="http://www.browserrank.com/2012/02/most-popular-mobile-browser-by-country.html" target="_blank">[Image courtesy of browserrank.com]</a></p>
<p>The good news is that CSS3 media queries are supported in all dominant mobile browsers (Android, iPhone, <a href="http://dev.opera.com/articles/view/opera-mini-5-developers/" target="_blank">Opera</a>, <a href="http://docs.blackberry.com/en/developers/deliverables/11844/BB_Browser_content_support_by_version_438586_11.jsp" target="_blank">Blackberry</a>, etc).</p>
<p><a href="http://www.quirksmode.org/mobile/tableViewport.html" target="_blank"><img class="alignnone size-large wp-image-788" title="Chart of CSS3 Media Query support in Mobile Web Browsers" src="http://gabesumner.com/wp-content/uploads/2012/02/mobile-media-query-support-600x95.png" alt="Chart of CSS3 Media Query support in Mobile Web Browsers" width="600" height="95" /></a><a href="http://www.quirksmode.org/mobile/tableViewport.html" target="_blank">[Image courtesy of quicksmode.org]</a></p>
<p>As a result, if you&#8217;re primarily using responsive design to &#8220;gracefully degrade&#8221; your default website design for tablets and smartphones then CSS3 media queries are widely supported (90%+ support).  However, as with desktop traffic you&#8217;ll want to compare these statistics with your own website.</p>
<h2>Does it really matter if Responsive Design isn&#8217;t supported?</h2>
<p><img class="alignright size-thumbnail wp-image-779" title="The stone age called and it wants its browser back" src="http://gabesumner.com/wp-content/uploads/2012/02/modernbrowser-e1330226025950.jpg" alt="The stone age called and it wants its browser back" width="200" height="159" /></p>
<p>Web browsers simply ignore anything they do not understand.  This behavior creates the basis for backwards compatibility on the web.  In fact, it&#8217;s possible for a modern HTML5 web page to be usable with a <a href="http://lynx.browser.org/">text-only browser</a>.</p>
<p>Consequently, your website can utilize CSS3 media queries to create a responsive design while still addressing browsers and devices that do not yet support this technique.  Doing this requires you to define a set of base layouts, styles &amp; functionality that would be appropriate for older browsers &amp; devices.  CSS3 media queries would then be layered on.  Older browsers would ignore these unrecognized attributes and newer browsers would become enhanced by them.  In both cases the web page remains usable.</p>
<p>This design philosophy is known as <em><strong>progressive enhancement </strong></em>and it&#8217;s <a href="https://www.google.com/search?aq=f&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=progressive+enhancement" target="_blank">worth studying</a>. These techniques can be supported at different levels, but at their core they enable you to utilize responsive design while still addressing older clients.</p>
<h2>Conclusion &#8211; go ahead and give it a try</h2>
<p><span style="color: #000000;">R</span>esponsive design is already supported by the majority of web traffic  (70-80%).  For mobile devices, that support is even higher (90%+).  Furthermore, CSS3 media queries are simply ignored if they aren&#8217;t supported.  Consequently, it&#8217;s possible to create a web design that is enhanced when possible but degrades when necessary.  As a result, there is no reason not to start experimenting with responsive design techniques on your own website.</p>
<p><strong>Update from Reddit:</strong>  There is a clever Javascript library called <a href="https://github.com/scottjehl/Respond" target="_blank">respond.js</a> that can be used to emulate CSS3 media query support in IE6, IE7 and IE8.</p>
<p><a title="Responsive Design" href="http://gabesumner.com/cms-definitions/responsive-design"><strong>More information about responsive design</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/how-many-web-browsers-support-responsive-design/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Budgeting for your CMS or Web Project</title>
		<link>http://gabesumner.com/budgeting-for-your-cms-or-web-project</link>
		<comments>http://gabesumner.com/budgeting-for-your-cms-or-web-project#comments</comments>
		<pubDate>Thu, 23 Feb 2012 21:28:00 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[cms selection]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=743</guid>
		<description><![CDATA[I don&#8217;t think I&#8217;ll get too many arguments if I make this statement: Content Management Systems (CMS) are a vital tool for creating and maintaining a modern web site. However, CMS&#8217;s vary in price from free to $100k+ and there &#8230; <a href="http://gabesumner.com/budgeting-for-your-cms-or-web-project">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t think I&#8217;ll get too many arguments if I make this statement:</p>
<blockquote><p>Content Management Systems (CMS) are a vital tool for creating and maintaining a modern web site.</p></blockquote>
<p>However, CMS&#8217;s vary in price from free to $100k+ and there are widely differing opinions about what a CMS should cost.  I&#8217;m probably not going to change any minds on this and I&#8217;m not terribly interested in trying.  However, I would like to better frame this conversation.</p>
<p><span id="more-743"></span></p>
<h2>Why is your CMS so expensive?</h2>
<p><img class="alignright size-full wp-image-749" title="Well, at least he is honest" src="http://gabesumner.com/wp-content/uploads/2012/02/liar_liar_1997_500x308_187736-e1330031991153.jpg" alt="Well, at least he is honest" width="200" height="123" />I work for Telerik and we have a CMS called <a href="http://www.sitefinity.com/" target="_blank">Sitefinity</a>.  This is a proprietary CMS that ranges in price from $499 &#8211; $7,999+.  Keep reading though.  I&#8217;m not here to sell you anything and if you think open-source is the way to go, have at it.  In the past I&#8217;ve been on both sides of the open-source debate; today I&#8217;m simply busy and only want to get work done faster (best tool for the job).</p>
<p>Nevertheless, I&#8217;ve had the &#8220;<em>your software is too expensive</em>&#8221; conversation more times than I would like.  I&#8217;ve also needed to answer people who ask &#8220;<em>Why on earth would anyone buy a CMS?</em>&#8220;.  Here is my best attempt at an answer&#8230;</p>
<h2>Should a plow horse expect to be fed?</h2>
<p><img class="alignright size-full wp-image-747" title="Open Source Plow Horse" src="http://gabesumner.com/wp-content/uploads/2012/02/Cropped-1936-Horse-drawn-plow-e1330029190414.jpg" alt="Open Source Plow Horse" width="200" height="129" />I know, I know&#8230;we&#8217;re a few generations removed from people with direct experience working with plow horses.  A plow horse is a beast of burden that helped farmers (prior to machines) till soil and generally be more productive.  In return, the farmer invested a <strong>small portion</strong> of their return back into the plow horse (via food).</p>
<p>Consider that the CMS is our modern day plow horse; it&#8217;s a tool that (hopefully) helps us produce more value from our websites.  How much value?  To answer that question you need to determine how much revenue you derive from your website.  Do you sell products?  Do you generate business leads?  Do you take donations?  Do you offer support?  All of these activities have a measurable business value that can be associated with the website.  For a given year, what is that value?</p>
<p>Let&#8217;s assume that number is as little as $100K.  It doesn&#8217;t seem unreasonable to imagine many organizations could associate $100K+ of annual value with their websites.  It&#8217;s also reasonable to expect that some percentage of that revenue should be re-invested to evolve and maintain the website.  In other words, take a small fraction of your return and feed your plow horse.</p>
<p>If an organization realizes $100K of annual revenue from their website and re-invests only 6% back into their website, that becomes $6K.    Does that feel unreasonable?  We&#8217;re talking about a single-digit percentage investment to maintain a tool that  helps us be more productive.</p>
<h2>Penny-wise &amp; pound-foolish</h2>
<p><img class="alignright size-full wp-image-752" title="Penny wise, Pound foolish" src="http://gabesumner.com/wp-content/uploads/2012/02/6a00d83452989a69e200e5503ceac18833-800wi-e1330032402935.jpg" alt="Penny wise, Pound foolish" width="199" height="124" />If you can accept the premise I&#8217;ve outlined above, then it simply becomes a process of discovering where you can get the most bang from your buck.  <span style="line-height: 24px;">The cost of a CMS becomes negligible (even unimportant) </span><strong style="line-height: 24px;">IF</strong><span> it empowers you to be more productive.  By contrast, pinching pennies during CMS selection could leave you perpetually handicapped;  ultimately causing you to sacrifice lots of revenue due to missed opportunities.</span></p>
<p>Against this backdrop, I could make a case for <a href="http://www.sitefinity.com/" target="_blank">our own CMS</a>.  Hell, I might even be right if the use-cases we target align with your own needs.  It&#8217;s also possible that an open-source solution might be a better fit.  Either way, the price isn&#8217;t what&#8217;s important.  What&#8217;s important is choosing a CMS that helps you be productive.  In summary, choose wisely, and the CMS will pay for itself.</p>
<p><strong>Update:</strong>  After writing this I realized I failed to mention the full ecosystem of implementors and analysts that exist around CMS deployments.  Everything I&#8217;ve written is equally applicable to them.  These people, through their expertise, can provide equal amounts of value for organizations wishing to maximize the returns from their website.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/budgeting-for-your-cms-or-web-project/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wanted: Video-conferencing solution for mid-sized teams</title>
		<link>http://gabesumner.com/wanted-video-conferencing-solutions-for-mid-sized-teams</link>
		<comments>http://gabesumner.com/wanted-video-conferencing-solutions-for-mid-sized-teams#comments</comments>
		<pubDate>Tue, 14 Feb 2012 22:32:20 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google hangouts]]></category>
		<category><![CDATA[lync]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[video conferencing]]></category>
		<category><![CDATA[webex]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=674</guid>
		<description><![CDATA[The Telerik Evangelism team has recently been experimenting with new techniques for staying connected and in-sync.  One of these techniques was to utilize video-conferencing for our bi-weekly meetings.  Sadly, I&#8217;ve not discovered any video-conferencing solutions that accommodates a team of our &#8230; <a href="http://gabesumner.com/wanted-video-conferencing-solutions-for-mid-sized-teams">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright  wp-image-682" title="Early attempts at video conferencing" src="http://gabesumner.com/wp-content/uploads/2012/02/images.jpg" alt="Early attempts at video conferencing" width="203" height="163" />The Telerik Evangelism team has recently been experimenting with new techniques for staying connected and in-sync.  One of these techniques was to utilize video-conferencing for our bi-weekly meetings.  Sadly, I&#8217;ve not discovered any video-conferencing solutions that accommodates a team of our size (15 people).  Below I&#8217;ve summarized my experiences thus far:</p>
<p><span id="more-674"></span></p>
<h2>Video-conferencing solutions at a glance</h2>
<p>All video-conferencing solutions limit how many attendees can participate with their webcams.  Once this limit is exceeded, the behavior varies from service to service.  However, most services will support several more audio-only participants.  Below I&#8217;ve summarized the video and total limits for each service.</p>
<table>
<tbody>
<tr>
<td><strong>Service</strong></td>
<td><strong>Video Limit</strong></td>
<td><strong>Total Limit</strong></td>
</tr>
<tr>
<td><a href="http://www.gotomeeting.com/fec/online_meeting">GotoMeeting</a></td>
<td>6</td>
<td>15</td>
</tr>
<tr>
<td><a href="http://www.webex.com/">Webex</a></td>
<td>7</td>
<td>25</td>
</tr>
<tr>
<td><a href="http://www.skype.com/">Skype </a></td>
<td>10</td>
<td>20</td>
</tr>
<tr>
<td><a href="http://www.google.com/+/learnmore/">Google Hangouts</a></td>
<td>10</td>
<td>10</td>
</tr>
<tr>
<td><a href="http://www.oovoo.com/">Oovoo</a></td>
<td>12</td>
<td>12</td>
</tr>
<tr>
<td><a href="http://vidtel.com/">Vidtel</a></td>
<td>12</td>
<td>12</td>
</tr>
<tr>
<td><a href="http://bluejeans.com/">Blue Jeans Network</a></td>
<td>25</td>
<td>25</td>
</tr>
<tr>
<td><a href="http://lync.microsoft.com/en-us/Pages/unified-communications.aspx">Microsoft Lync</a></td>
<td>250</td>
<td>250</td>
</tr>
</tbody>
</table>
<h2> What happens when the video limit is exceeded?</h2>
<p><strong>Gotomeeting</strong> -Video in Gotomeeting is first come, first serve.  Each participant must manually enable their webcam.  However, once the 6 video-user limit is reached the option is disabled for other attendees.  These other attendees will be audio-only, able to see the 6 video users, but not utilize their own webcam.</p>
<p><strong>Webex</strong> &#8211; When more than 7 participants join the meeting the meeting moderator can  select who can share video.  Up to 25 total participants can join the call but only 7 will have video sharing options available.</p>
<p><strong>Skype</strong> &#8211; When more than 10 participants join, video conferencing and screensharing get disabled for everyone.  After this, the call continues and up to 25 participants can join for audio-only conferencing.</p>
<p><strong>Google Hangouts</strong> &#8211; There is a hard cap of 10 participants.  Anyone else who joins the conference will be put into spectator mode.  They can hear the conference, but not participate.  I&#8217;m intrigued by Google Hangouts, but the 10 person limit is a deal-breaker.</p>
<p><strong>Microsoft Lync</strong> &#8211; Using Lync all participants can utilize their webcam, but only the speaker gets focus (no Hollywood Squares style display).  Furthermore, I&#8217;m seldom able to get Lync to perform reasonably with 2 participants, let alone 250.  This problem becomes even worse for our telecommuters who are forced to VPN into the network to utilize Lync.  On a LAN this might be a great solution; however, for our distributed team Lync does not produce great results.</p>
<p><strong>Oovoo</strong> &#8211; I have no direct experience with Oovoo yet.  If you do, feel free to comment below.</p>
<p><strong>Blue Jeans Network</strong> &#8211; I have no direct experience with Blue Jeans Network yet.  I&#8217;m intrigued by its ability to bridge multiple solutions (WebEx, Skype, etc.) though.  I would love to see feedback from others who have direct experiences with this service.</p>
<h2>Our current solution</h2>
<p>For the time being we&#8217;re using Skype for voice-only communication.  It&#8217;s ubiquitous, which is nice; it also has integrated chat which the evangelism team seems to enjoy using during the meetings.  For screen-sharing, we&#8217;ll probably just fire-up a Gotomeeting session as needed.  We&#8217;ll only use it for screen-sharing and disable the audio.</p>
<p>In a nutshell, we&#8217;re abandoning video-conferencing entirely.  I&#8217;m not happy about this, but I haven&#8217;t been happy with any of the other options either.  I&#8217;ll update this post if I locate a better solution or more information.</p>
<p><a href="https://twitter.com/ryanlowdermilk">Special thanks to @ryanlowdermilk for helping with this post.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/wanted-video-conferencing-solutions-for-mid-sized-teams/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to Export Blog Comments from Sitefinity 3 to Disqus</title>
		<link>http://gabesumner.com/how-to-export-blog-comments-from-sitefinity-3-to-disqus</link>
		<comments>http://gabesumner.com/how-to-export-blog-comments-from-sitefinity-3-to-disqus#comments</comments>
		<pubDate>Mon, 13 Feb 2012 02:04:22 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[disqus]]></category>
		<category><![CDATA[sitefinity]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=581</guid>
		<description><![CDATA[Over this past weekend I decided to retire my old goondocks.com blog.  This domain name is a reference to The Goonies which is a movie I remember fondly from the 80&#8242;s.  I picked up this domain many years ago and &#8230; <a href="http://gabesumner.com/how-to-export-blog-comments-from-sitefinity-3-to-disqus">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over this past weekend I decided to retire my old <strong>goondocks.com</strong> blog.  This domain name is a reference to The Goonies which is a movie I remember fondly from the 80&#8242;s.  I picked up this domain many years ago and held on to it.  When I discovered Sitefinity 3.0 I used it to experiment and share my lessons &amp; experiences.</p>
<p>After joining Telerik,  I launched <strong>sitefinitywatch.com</strong> and never again touched <strong>goondocks.com</strong>.  Consequently, this blog has stagnated and become a dumping ground for spammers.  There are now thousands of blog comments that contain nothing but spam:</p>
<p><a href="http://gabesumner.com/wp-content/uploads/2012/02/2012-02-12_1715.png" rel="lightbox[581]"><img class="alignnone size-full wp-image-584" title="Obscene amount of comments" src="http://gabesumner.com/wp-content/uploads/2012/02/2012-02-12_1715-e1329097604485.png" alt="Obscene amount of comments" width="600" height="261" /></a></p>
<p>I wanted to import my old blog posts and legitimate comments to this blog.  If you scroll down below you&#8217;ll see I&#8217;m using Disqus to manage my comments on this blog.  Consequently, I needed to find a way to filter the SPAM from these comments, export the comments from Sitefinity 3.x and then import these comments into Disqus.</p>
<p><span id="more-581"></span></p>
<h1>How to import comments into Disqus</h1>
<ol>
<li>Creating a Test Forum on Disqus</li>
<ol>
<li><em>Seriously, you&#8217;re going to make mistakes</em></li>
</ol>
<li>Read the following resources:</li>
<ol>
<li><a href="http://docs.disqus.com/developers/export/import_format/">Custom XML Import Format</a></li>
<li><a href="http://chrisrisner.com/Importing-Comments-into-Disqus">Importing-Comments-into-Disqus</a></li>
<li><a href="http://sumedh.info/articles/importing-comments-disqus-xml-database.php">How to import your existing database comments into Disqus using generic WXR XML format</a></li>
</ol>
<li>Create your Sitefinity Comments Export</li>
<ol>
<li>Add the code below to your Sitefinity 3 project</li>
<li>Access the page and paste the resulting XML into Notepad</li>
</ol>
<li>Upload the XML file to Disqus</li>
<li><em>Wait&#8230;.</em></li>
</ol>
<h2> Exporting Sitefinity 3 Comments using the API</h2>
<div id="gist-1811490" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nt">&lt;%@</span> <span class="n">Page</span> <span class="n">Language</span><span class="o">=</span><span class="s">&quot;C#&quot;</span> <span class="n">AutoEventWireup</span><span class="o">=</span><span class="s">&quot;true&quot;</span> <span class="n">CodeFile</span><span class="o">=</span><span class="s">&quot;test.aspx.cs&quot;</span> <span class="k">Inherits</span><span class="o">=</span><span class="s">&quot;test&quot;</span> <span class="nt">%&gt;</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="cp">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'><span class="nt">&lt;html</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/1999/xhtml&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC6'><span class="nt">&lt;head</span> <span class="na">id=</span><span class="s">&quot;Head1&quot;</span> <span class="na">runat=</span><span class="s">&quot;server&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;title&gt;</span>Use Ctrl + A to select All, then Paste into Notepad.  This is your XML export file.<span class="nt">&lt;/title&gt;</span></div><div class='line' id='LC8'><span class="nt">&lt;/head&gt;</span></div><div class='line' id='LC9'><span class="nt">&lt;body&gt;</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;form</span> <span class="na">id=</span><span class="s">&quot;form1&quot;</span> <span class="na">runat=</span><span class="s">&quot;server&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;div&gt;</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;asp:Repeater</span> <span class="na">ID=</span><span class="s">&quot;xmlRepeater&quot;</span> <span class="na">runat=</span><span class="s">&quot;server&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;HeaderTemplate&gt;</span></div><div class='line' id='LC15'><span class="nt">&lt;pre&gt;</span></div><div class='line' id='LC16'><span class="ni">&amp;lt;</span>?xml version=<span class="ni">&amp;quot;</span>1.0<span class="ni">&amp;quot;</span> encoding=<span class="ni">&amp;quot;</span>UTF-8<span class="ni">&amp;quot;</span>?<span class="ni">&amp;gt;</span></div><div class='line' id='LC17'><span class="ni">&amp;lt;</span>rss version=<span class="ni">&amp;quot;</span>2.0<span class="ni">&amp;quot;</span></div><div class='line' id='LC18'>&nbsp;&nbsp;xmlns:content=<span class="ni">&amp;quot;</span>http://purl.org/rss/1.0/modules/content/<span class="ni">&amp;quot;</span></div><div class='line' id='LC19'>&nbsp;&nbsp;xmlns:dsq=<span class="ni">&amp;quot;</span>http://www.disqus.com/<span class="ni">&amp;quot;</span></div><div class='line' id='LC20'>&nbsp;&nbsp;xmlns:dc=<span class="ni">&amp;quot;</span>http://purl.org/dc/elements/1.1/<span class="ni">&amp;quot;</span></div><div class='line' id='LC21'>&nbsp;&nbsp;xmlns:wp=<span class="ni">&amp;quot;</span>http://wordpress.org/export/1.0/<span class="ni">&amp;quot;</span></div><div class='line' id='LC22'><span class="ni">&amp;gt;</span></div><div class='line' id='LC23'>&nbsp;&nbsp;<span class="ni">&amp;lt;</span>channel<span class="ni">&amp;gt;</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/HeaderTemplate&gt;</span></div><div class='line' id='LC25'><br/></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;ItemTemplate&gt;</span></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>item<span class="ni">&amp;gt;</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>title<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Title]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/title<span class="ni">&amp;gt;</span></div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>link<span class="ni">&amp;gt;</span>http://www.goondocks.com/blog<span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Url]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span>.aspx<span class="ni">&amp;lt;</span>/link<span class="ni">&amp;gt;</span></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>dsq:thread_identifier<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[ID]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/dsq:thread_identifier<span class="ni">&amp;gt;</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:post_date_gmt<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[DatePosted]&quot;</span><span class="p">)</span><span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/wp:post_date_gmt<span class="ni">&amp;gt;</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_status<span class="ni">&amp;gt;</span>open<span class="ni">&amp;lt;</span>/wp:comment_status<span class="ni">&amp;gt;</span></div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;asp:Repeater</span> <span class="na">DataSource=</span><span class="s">&#39;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Comments]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span>&#39; runat=&quot;server&quot;&gt;</div><div class='line' id='LC35'><br/></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;ItemTemplate&gt;</span></div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment<span class="ni">&amp;gt;</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_id<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[ID]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/wp:comment_id<span class="ni">&amp;gt;</span></div><div class='line' id='LC39'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_author<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Author]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/wp:comment_author<span class="ni">&amp;gt;</span></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_author_email<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Email]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/wp:comment_author_email<span class="ni">&amp;gt;</span></div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_author_url<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Website]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span>/<span class="ni">&amp;lt;</span>/wp:comment_author_url<span class="ni">&amp;gt;</span></div><div class='line' id='LC42'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_author_IP<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[IpAddress]&quot;</span><span class="p">)</span> <span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/wp:comment_author_IP<span class="ni">&amp;gt;</span></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_date_gmt<span class="ni">&amp;gt;</span><span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[DatePosted]&quot;</span><span class="p">)</span><span class="nt">%&gt;</span><span class="ni">&amp;lt;</span>/wp:comment_date_gmt<span class="ni">&amp;gt;</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_content<span class="ni">&amp;gt;&amp;lt;</span>![CDATA[<span class="nt">&lt;%#</span> <span class="n">Eval</span><span class="p">(</span><span class="s">&quot;[Text]&quot;</span><span class="p">)</span><span class="nt">%&gt;</span>]]<span class="ni">&amp;gt;&amp;lt;</span>/wp:comment_content<span class="ni">&amp;gt;</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_approved<span class="ni">&amp;gt;</span>1<span class="ni">&amp;lt;</span>/wp:comment_approved<span class="ni">&amp;gt;</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>wp:comment_parent<span class="ni">&amp;gt;</span>0<span class="ni">&amp;lt;</span>/wp:comment_parent<span class="ni">&amp;gt;</span></div><div class='line' id='LC47'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>/wp:comment<span class="ni">&amp;gt;</span></div><div class='line' id='LC48'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/ItemTemplate&gt;</span></div><div class='line' id='LC49'><br/></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/asp:Repeater&gt;</span></div><div class='line' id='LC51'><br/></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="ni">&amp;lt;</span>/item<span class="ni">&amp;gt;</span></div><div class='line' id='LC53'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/ItemTemplate&gt;</span></div><div class='line' id='LC54'><br/></div><div class='line' id='LC55'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;FooterTemplate&gt;</span></div><div class='line' id='LC56'>&nbsp;&nbsp;<span class="ni">&amp;lt;</span>/channel<span class="ni">&amp;gt;</span></div><div class='line' id='LC57'><span class="ni">&amp;lt;</span>/rss<span class="ni">&amp;gt;</span>    </div><div class='line' id='LC58'><span class="nt">&lt;/pre&gt;</span></div><div class='line' id='LC59'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/FooterTemplate&gt;</span></div><div class='line' id='LC60'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/asp:Repeater&gt;</span></div><div class='line' id='LC61'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC62'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/div&gt;</span></div><div class='line' id='LC63'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/form&gt;</span></div><div class='line' id='LC64'><span class="nt">&lt;/body&gt;</span></div><div class='line' id='LC65'><span class="nt">&lt;/html&gt;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1811490/7787b8e5b3a0def241760d1fdde6e8d612008bf3/DisqusExport.aspx" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1811490#file_disqus_export.aspx" style="float:right;margin-right:10px;color:#666">DisqusExport.aspx</a>
            <a href="https://gist.github.com/1811490">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">using</span> <span class="nn">System</span><span class="p">;</span></div><div class='line' id='LC2'><span class="k">using</span> <span class="nn">System.Collections</span><span class="p">;</span></div><div class='line' id='LC3'><span class="k">using</span> <span class="nn">System.Web</span><span class="p">;</span></div><div class='line' id='LC4'><span class="k">using</span> <span class="nn">Telerik.Cms.Engine</span><span class="p">;</span></div><div class='line' id='LC5'><span class="k">using</span> <span class="nn">System.Text.RegularExpressions</span><span class="p">;</span></div><div class='line' id='LC6'><br/></div><div class='line' id='LC7'><span class="k">public</span> <span class="k">partial</span> <span class="k">class</span> <span class="nc">test</span> <span class="p">:</span> <span class="n">System</span><span class="p">.</span><span class="n">Web</span><span class="p">.</span><span class="n">UI</span><span class="p">.</span><span class="n">Page</span></div><div class='line' id='LC8'><span class="p">{</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">protected</span> <span class="k">void</span> <span class="nf">Page_Load</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">EventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Telerik</span><span class="p">.</span><span class="n">Cms</span><span class="p">.</span><span class="n">Engine</span><span class="p">.</span><span class="n">ContentManager</span> <span class="n">contentManager</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Telerik</span><span class="p">.</span><span class="n">Cms</span><span class="p">.</span><span class="n">Engine</span><span class="p">.</span><span class="n">ContentManager</span><span class="p">(</span><span class="s">&quot;Blogs&quot;</span><span class="p">);</span></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IList</span> <span class="n">posts</span> <span class="p">=</span> <span class="n">contentManager</span><span class="p">.</span><span class="n">GetContent</span><span class="p">();</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ArrayList</span> <span class="n">Posts</span> <span class="p">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="p">();</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">int</span> <span class="n">Count</span> <span class="p">=</span> <span class="m">0</span><span class="p">;</span></div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Loop through all blog posts</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">foreach</span> <span class="p">(</span><span class="n">IContent</span> <span class="n">post</span> <span class="k">in</span> <span class="n">posts</span><span class="p">)</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Yes, I know ArrayLists and Hashtables are lame.  However, Sitefinity 3 was built with .NET 2.0 </span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// which doesn&#39;t support generics and I didn&#39;t want to take the time to fully implement IList.</span></div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Hashtable</span> <span class="n">Post</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Hashtable</span><span class="p">();</span></div><div class='line' id='LC23'><br/></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Post</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;ID&quot;</span><span class="p">,</span> <span class="n">post</span><span class="p">.</span><span class="n">ID</span><span class="p">);</span></div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Post</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Title&quot;</span><span class="p">,</span> <span class="n">post</span><span class="p">.</span><span class="n">GetMetaData</span><span class="p">(</span><span class="s">&quot;Title&quot;</span><span class="p">));</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Post</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Url&quot;</span><span class="p">,</span> <span class="n">post</span><span class="p">.</span><span class="n">Url</span><span class="p">);</span></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// That &quot;GeteCreationDate()&quot; only exists in later version of Sitefinity 3.x.</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Post</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;DatePosted&quot;</span><span class="p">,</span> <span class="n">post</span><span class="p">.</span><span class="n">DateModified</span><span class="p">.</span><span class="n">ToUniversalTime</span><span class="p">().</span><span class="n">ToString</span><span class="p">(</span><span class="s">&quot;yyyy-MM-dd HH:mm:ss&quot;</span><span class="p">));</span></div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Post</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Comments&quot;</span><span class="p">,</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="p">());</span></div><div class='line' id='LC30'><br/></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">foreach</span> <span class="p">(</span><span class="n">IComment</span> <span class="n">comment</span> <span class="k">in</span> <span class="n">post</span><span class="p">.</span><span class="n">Comments</span><span class="p">)</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ArrayList</span> <span class="n">Comments</span> <span class="p">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="p">();</span></div><div class='line' id='LC34'><br/></div><div class='line' id='LC35'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// I had a TON of spam in my blog (thousands of comments), this is used to filter this SPAM.</span></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Sorry for the offensive language, you can thank spammers for this.</span></div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">comment</span><span class="p">.</span><span class="n">Visible</span> <span class="p">==</span> <span class="k">true</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC39'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">comment</span><span class="p">.</span><span class="n">IsReadByUser</span><span class="p">(</span><span class="s">&quot;admin&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">true</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">comment</span><span class="p">.</span><span class="n">Text</span><span class="p">.</span><span class="n">Length</span> <span class="p">&gt;</span> <span class="m">100</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">comment</span><span class="p">.</span><span class="n">GetCreationDate</span><span class="p">()</span> <span class="p">&lt;</span> <span class="k">new</span> <span class="n">DateTime</span><span class="p">(</span><span class="m">2011</span><span class="p">,</span> <span class="m">1</span><span class="p">,</span> <span class="m">1</span><span class="p">)</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC42'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Regex</span><span class="p">.</span><span class="n">IsMatch</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Email</span><span class="p">,</span> <span class="s">@&quot;aol\.com&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Regex</span><span class="p">.</span><span class="n">IsMatch</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Author</span><span class="p">,</span> <span class="s">@&quot;\@&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">String</span><span class="p">.</span><span class="n">IsNullOrEmpty</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Author</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Regex</span><span class="p">.</span><span class="n">IsMatch</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Text</span><span class="p">.</span><span class="n">ToString</span><span class="p">(),</span> <span class="s">@&quot;penis&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Regex</span><span class="p">.</span><span class="n">IsMatch</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Text</span><span class="p">.</span><span class="n">ToString</span><span class="p">(),</span> <span class="s">@&quot;sex&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC47'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Regex</span><span class="p">.</span><span class="n">IsMatch</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Text</span><span class="p">.</span><span class="n">ToString</span><span class="p">(),</span> <span class="s">@&quot;herbal&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span> <span class="p">&amp;&amp;</span></div><div class='line' id='LC48'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Regex</span><span class="p">.</span><span class="n">IsMatch</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">IpAddress</span><span class="p">.</span><span class="n">ToString</span><span class="p">(),</span> <span class="s">@&quot;121\.204&quot;</span><span class="p">)</span> <span class="p">==</span> <span class="k">false</span></div><div class='line' id='LC49'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">)</span></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC51'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Count</span><span class="p">++;</span></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Hashtable</span> <span class="n">Comment</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Hashtable</span><span class="p">();</span></div><div class='line' id='LC53'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;ID&quot;</span><span class="p">,</span> <span class="n">comment</span><span class="p">.</span><span class="n">ID</span><span class="p">);</span></div><div class='line' id='LC54'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Author&quot;</span><span class="p">,</span> <span class="n">comment</span><span class="p">.</span><span class="n">Author</span><span class="p">);</span></div><div class='line' id='LC55'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Email&quot;</span><span class="p">,</span> <span class="n">comment</span><span class="p">.</span><span class="n">Email</span><span class="p">);</span></div><div class='line' id='LC56'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Website&quot;</span><span class="p">,</span> <span class="n">comment</span><span class="p">.</span><span class="n">WebSite</span><span class="p">);</span></div><div class='line' id='LC57'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Text&quot;</span><span class="p">,</span> <span class="n">HttpUtility</span><span class="p">.</span><span class="n">HtmlEncode</span><span class="p">(</span><span class="n">comment</span><span class="p">.</span><span class="n">Text</span><span class="p">));</span></div><div class='line' id='LC58'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;IpAddress&quot;</span><span class="p">,</span> <span class="n">comment</span><span class="p">.</span><span class="n">IpAddress</span><span class="p">);</span></div><div class='line' id='LC59'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// That &quot;GeteCreationDate()&quot; only exists in later version of Sitefinity 3.x.</span></div><div class='line' id='LC60'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Comment</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;DatePosted&quot;</span><span class="p">,</span> <span class="n">comment</span><span class="p">.</span><span class="n">GetCreationDate</span><span class="p">().</span><span class="n">ToUniversalTime</span><span class="p">().</span><span class="n">ToString</span><span class="p">(</span><span class="s">&quot;yyyy-MM-dd HH:mm:ss&quot;</span><span class="p">));</span></div><div class='line' id='LC61'><br/></div><div class='line' id='LC62'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">((</span><span class="n">ArrayList</span><span class="p">)</span><span class="n">Post</span><span class="p">[</span><span class="s">&quot;Comments&quot;</span><span class="p">]).</span><span class="n">Add</span><span class="p">(</span><span class="n">Comment</span><span class="p">);</span></div><div class='line' id='LC63'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC64'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC65'><br/></div><div class='line' id='LC66'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(((</span><span class="n">ArrayList</span><span class="p">)</span><span class="n">Post</span><span class="p">[</span><span class="s">&quot;Comments&quot;</span><span class="p">]).</span><span class="n">Count</span> <span class="p">&gt;</span> <span class="m">0</span><span class="p">)</span></div><div class='line' id='LC67'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC68'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Posts</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="n">Post</span><span class="p">);</span></div><div class='line' id='LC69'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC70'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC71'><br/></div><div class='line' id='LC72'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">xmlRepeater</span><span class="p">.</span><span class="n">DataSource</span> <span class="p">=</span> <span class="n">Posts</span><span class="p">;</span></div><div class='line' id='LC73'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">xmlRepeater</span><span class="p">.</span><span class="n">DataBind</span><span class="p">();</span></div><div class='line' id='LC74'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC75'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1811490/8fb944c9ef6fb4eeafc570994f84152332cb79b2/DisqusExport.aspx.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1811490#file_disqus_export.aspx.cs" style="float:right;margin-right:10px;color:#666">DisqusExport.aspx.cs</a>
            <a href="https://gist.github.com/1811490">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/how-to-export-blog-comments-from-sitefinity-3-to-disqus/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2011 reflections on Telerik’s Sitefinity CMS</title>
		<link>http://gabesumner.com/2011-reflections-on-teleriks-sitefinity-cms</link>
		<comments>http://gabesumner.com/2011-reflections-on-teleriks-sitefinity-cms#comments</comments>
		<pubDate>Mon, 19 Dec 2011 15:36:07 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sitefinity]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=387</guid>
		<description><![CDATA[The Holidays are upon us and 2011 is nearly gone.  This past year has been extremely busy and significant for Sitefinity.  Before we move into 2012 I want to reflect on 2011.  This post is strictly my personal opinion and, &#8230; <a href="http://gabesumner.com/2011-reflections-on-teleriks-sitefinity-cms">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p><img class="alignright size-full wp-image-391" title="Sitefinity - Work in progress" src="http://gabesumner.com/wp-content/uploads/2011/12/sfServicePack.png" alt="Sitefinity - Work in progress" width="200" height="182" />The Holidays are upon us and 2011 is nearly gone.  This past year has been extremely busy and significant for Sitefinity.  Before we move into 2012 I want to reflect on 2011.  This post is strictly my personal opinion and, consequently, is being published to my personal blog.</p>
</div>
<p>I’m publishing this for Sitefinity customers who might be interested in a Telerik insiders’ perspective on this past year.  Hopefully this provides some context and a glimpse into what’s coming in 2012.</p>
<p><span id="more-387"></span></p>
<h2>Rewind, back to January 2011</h2>
<p>I can’t address the significance of 2011 without talking about the release of Sitefinity 4.0.</p>
<p>Sitefinity 4.0 was a huge milestone for us and its release marked a transition to a new chapter in Sitefinity’s evolution.  Sitefinity 4.0 changed everything.  This isn’t marketing babble, this is truth.  Not one line of Sitefinity 3 code was used in Sitefinity 4.  Furthermore, in addition to rebuilding the product, we also introduced a new licensing and pricing model.</p>
<p>If you’re thinking “<em>that looks like a lot of change to navigate</em>”, then you’d be right.  Saying Sitefinity 4.0 was “disruptive” would be an understatement.  We were prepared for some measure of this, but it took a lot more time than expected to fully assimilate these changes.</p>
<h2>Why was all this change needed?</h2>
<p>For those who don’t know, I was a Sitefinity customer before I was an employee.  When I discovered Sitefinity (back in 2007) this was the tag-line:</p>
<p><a href="http://gabesumner.com/wp-content/uploads/2011/12/built-for-developers.png" rel="lightbox[387]"><img class="alignnone size-full wp-image-388" title="Inspired by End-users, Built for Developers - Sitefinity" src="http://gabesumner.com/wp-content/uploads/2011/12/built-for-developers.png" alt="Inspired by End-users, Built for Developers - Sitefinity" width="630" height="248" /></a></p>
<p>At the time, this tagline matched my mental model.  I was a “developer” and I needed to deliver a website that could be managed by “end-users”.  Sitefinity spoke to me with this message and the product walked the talk.  I loved it!</p>
<p>However, this message now looks simplistic to me.  “End-user” is just a generic bucket where we dump everyone who isn’t us.  If you talk to those “end-users” you quickly discover real people with rich skillsets and objectives.  The CMS belongs as much to them, as it does developers.  Managing a modern website requires collaboration between multiple audiences and a good CMS enables this collaboration while simultaneously empowering diverse audiences throughout the organization.</p>
<p>This trend is a natural by-product of the web’s popularity.  An organization’s website is no longer a piece of technology, but instead a vital communication conduit.  As a result, the website impacts the entire organization and CMS stakeholders are diversifying.  Consequently, Sitefinity needed to engage beyond developers to address complex organizational challenges (governance, communication, collaboration, syndication, etc.).</p>
<p>Historically Sitefinity was an $899 product marketed and sold to developers.  If we wanted to move beyond this model, then substantial changes were required to the product and our organization.</p>
<h2>Getting from here to there</h2>
<p>I understand there could be debate about whether the premise outlined above is correct.  Some organizations still view the website as a “technology resource”.  As a result, CMS selection continues to be driven exclusively by the IT department and “users” simply inherit their decision.  For those scenarios, an $899 developer-focused product continues to be very attractive.</p>
<p>However, these scenarios are diminishing.  Internally, we became convinced Sitefinity needed to evolve beyond its historic market positioning to remain relevant.</p>
<p>This led to 3 conclusions:</p>
<ol>
<li>We needed to rebuild Sitefinity from the ground-up.</li>
<li>We needed to double+ the size of the Sitefinity team.</li>
<li>We needed to change Sitefinity’s licensing.</li>
</ol>
<p>I could write very long posts exploring each of these 3 decisions; instead I’ll try to quickly summarize:</p>
<ul>
<li><strong>Rebuilding Sitefinity</strong> – When Sitefinity 3 was conceived, .NET 2.0 was the predominant framework.  A lot has happened since then and it was becoming difficult (hacky) to evolve the platform.  Rebuilding on .NET 4 enabled us to utilize a lot of newer technologies (WWF 4.0, web services, LINQ, etc.).  In addition, Sitefinity 3 was built on Nolics and Nolics is dead.</li>
<li><strong>Doubling the team</strong> – Rebuilding and then extending the product takes a lot of manpower.  In addition, selling a CMS to non-developers takes a very different sales organization.  Not to mention support, partner managers, etc…</li>
<li><strong>Changing the licensing</strong> – I could simply refer to #2, but it goes beyond that.  A flat $899 price would not fuel product development at our current pace, nor support the large customer projects that we were engaging with.  The new tiered pricing was implemented to provide a more sustainable &amp; accessible licensing framework.</li>
</ul>
<p>We knew these decisions would cause discomfort for existing customers and none of us felt happy about this.  However, we viewed this as a necessary transition needed to evolve Sitefinity.</p>
<h2>Weathering the storm</h2>
<p>We underestimated what it would take to assimilate all of this change.  It’s like dropping a boulder into a pond while you’re sitting in a boat.  You expect some waves and brace for them, but in this case the waves continued for months.</p>
<p>A big part of 2011 was devoted to stabilizing Sitefinity (the product, the organization, the community) after this change.  This included a stream of product releases, license extensions, extensive support, etc. It’s been an exhausting year.</p>
<p>However, under difficult circumstances the team has pulled together to deliver the best possible results.  We’ve made massive headway in 2011.  Today, Sitefinity is seeing strong adoption and customers are now delivering a stream of results on Sitefinity 4.</p>
<p>With our recent <a href="http://www.sitefinity.com/upgrade">upgrade initiative</a>, we’re largely closing the book on this difficult transition.  Of course it’ll never fully be done, but we feel good about where we’re starting in 2012.</p>
<h2>A quick word for the developer audience</h2>
<p>I already expressed our desire to engage beyond developers with Sitefinity 4.  In practical terms, this meant a heavy emphasis on usability.  It also meant a lot of features like scheduling, layouts, workflows, granular permissions, a form builder, rich classifications, etc., etc.  These features are designed to empower people throughout the organization.</p>
<p>However, in the midst of empowering non-developers we complicated things that .NET developers loved about Sitefinity 3; this primarily being the accessibility of Sitefinity’s extensibility.  My phrasing is very precise here.  Sitefinity 4 has obscene amounts of extensibility, but to a developer with a tight deadline (most of us) this extensibility isn’t easily grasped or utilized.</p>
<p>We’ve addressed this through “teaching resources” (Sitefinity SDK, extensive documentation, webinars, videos, blogs), but it still takes too much time to absorb.  Our goal in Q1 2012 is to create an extensibility framework that is naturally intuitive to .NET developers.  We’ll do this primarily through the Module Builder and with Sitefinity Thunder (<a href="http://www.sitefinity.com/web-content-management/roadmap.aspx">roadmap</a>).</p>
<p>Expect to hear more about this in January and February.  We’ll iterate on these tools rapidly until extensibility is widely accessible &amp; utilized.  After all, developer productivity is what Telerik is widely recognized for.  It’s time for us to reclaim this benefit.</p>
<h2>Wrapping up…</h2>
<p>As many of you know Telerik is based in Sofia, Bulgaria and most of the Sitefinity team resides at this office.  I personally work from our Houston office and I visit Telerik HQ each year in October.  I chat with my co-workers constantly, but I only get to see them (in person) once a year.  This provides me a chance to view a time-elapsed perspective of this team and their growth.</p>
<p>Here is the team in October of 2010:</p>
<p><a href="http://gabesumner.com/wp-content/uploads/2011/12/team-2010.jpg" rel="lightbox[387]"><img class="alignnone size-full wp-image-390" title="Sitefinity Team - October 2010" src="http://gabesumner.com/wp-content/uploads/2011/12/team-2010.jpg" alt="Sitefinity Team - October 2010" width="620" height="358" /></a></p>
<p>Here is the team in October of 2011:</p>
<p><img class="alignnone size-full wp-image-389" title="Sitefinity Team - October 2011" src="http://gabesumner.com/wp-content/uploads/2011/12/team-2011.jpg" alt="Sitefinity Team - October 2011" width="620" height="298" /></p>
<p>This past October I left very optimistic.  My optimism didn’t stem from any grandiose idea that I saw prototypes for.  Instead, my optimism stemmed from the maturity and discipline I saw in action.  It was great to listen to their scrum meetings, their testing conversations, their planning meetings, etc.  The difficulties of this past year have made this team stronger and wiser.</p>
<p>Of course, we still have a lot of work ahead of us.  But we’re closing the book on 2011 and with it the high-volume of change that we needed to assimilate.  In 2012 we will finally get to explore the capabilities of this new team and product we’ve created.  As an evangelist, that makes me excited.  As a customer, hopefully it makes you excited too.</p>
<p><strong>Happy Holidays and we’ll chat next year!  :)</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/2011-reflections-on-teleriks-sitefinity-cms/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Amazon&#8217;s Silk Browser breaks Web Personalization</title>
		<link>http://gabesumner.com/amazons-silk-browser-breaks-web-personalization</link>
		<comments>http://gabesumner.com/amazons-silk-browser-breaks-web-personalization#comments</comments>
		<pubDate>Thu, 29 Sep 2011 20:29:58 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=461</guid>
		<description><![CDATA[Yesterday Amazon&#8217;s Jeff Bezos announced their new Kindle Fire tablet.  This tablet is a full color, touch-enabled device that is capable of apps, games, books, movies or web browsing.  To put it bluntly, it&#8217;s like an iPad&#8230;except it&#8217;s $199. However, it&#8217;s the &#8230; <a href="http://gabesumner.com/amazons-silk-browser-breaks-web-personalization">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday Amazon&#8217;s Jeff Bezos <a href="http://thisismynext.com/2011/09/28/amazon-kindle-tablet-pictures-videohands-on/">announced</a> their new Kindle Fire tablet.  This tablet is a full color, touch-enabled device that is capable of apps, games, books, movies or web browsing.  To put it bluntly, it&#8217;s like an iPad&#8230;except it&#8217;s $199.</p>
<p><img class="alignnone size-full wp-image-462" title="Kindle Fire" src="http://gabesumner.com/wp-content/uploads/2012/02/kindle-fire.png" alt="Kindle Fire" width="471" height="299" /></p>
<p>However, it&#8217;s the web browser component of this device that caught my attention.</p>
<p><span id="more-461"></span></p>
<h2>Introducing Amazon&#8217;s Silk Web Browser</h2>
<p>Amazon is calling the Kindle Fire&#8217;s browser &#8220;Amazon Silk&#8221;.  This browser is based on WebKit, but utilizes Amazon&#8217;s Elastic Computing to optimize the delivery of web content. [<a href="http://www.extremetech.com/mobile/97587-amazon-silk-bridging-the-gap-between-desktop-and-tablet-web-browsers">More details</a>]</p>
<p>This video gives a nice overview of how this works.</p>
<p><a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=_u7F_56WhHk">http://www.youtube.com/watch?feature=player_embedded&amp;v=_u7F_56WhHk</a></p>
<p>The <strong>key point to understand</strong> is that the web request will be coming from Amazon&#8217;s Elastic Computing infrastructure, not the visitor&#8217;s Kindle Fire device.  For web sites that are doing personalization, content targeting or analytics, this presents a challenge.</p>
<h2>It&#8217;s all about the experience</h2>
<p><a href="http://www.aiim.org/infonomics/web-experience-management.aspx">Web Experience Management</a> is the latest hot trend in CMS.  WEM enables marketers to slice &amp; dice their visiting audience into segments (based on behavior patterns, geolocation and profiles) and personalize content accordingly.</p>
<p>The ultimate goal is increased engagement (<em>we want to cultivate a more engaged audience</em>).  In practical terms though, this translates into more buying, sharing, subscribing, clicking, etc.</p>
<p>However, these personalization and targeting tools are often initially based on the IP address of your anonymous visitor.  Using their IP address the CMS can approximate which region of the world they are in and subsequent page requests bring their profile into clearer focus.</p>
<p>But what happens to this personalization when all the web requests are coming from Amazon&#8217;s Elastic Computing infrastructure?</p>
<h2>Opera did it &#8211; and it broke personalization</h2>
<p>Although not entirely the same, Opera already implemented a similar feature known as <a href="http://www.opera.com/browser/turbo/">Turbo</a> into their browser.  Opera, like Amazon Silk, is acting as a proxy and pre-fetching content on behalf of slower browsers.</p>
<p>As a little test, I fired up Opera Turbo and pointed it at <a href="http://whatismyipaddress.com/">WhatIsMyIPAddress.com</a>.</p>
<p><img class="alignnone size-full wp-image-463" title="Where am I? Based on my IP Address" src="http://gabesumner.com/wp-content/uploads/2012/02/whereami.png" alt="Where am I? Based on my IP Address" width="676" height="323" /></p>
<p>For the record, I&#8217;m not off the cost of Africa and my ISP isn&#8217;t Opera Software.  Here is another test searching for &#8220;restaurants&#8221; with Google:</p>
<p><img class="alignnone size-full wp-image-464" title="Restaurant results based on IP address" src="http://gabesumner.com/wp-content/uploads/2012/02/google-for-restaurants.png" alt="Restaurant results based on IP address" width="664" height="327" /></p>
<p>Google is very good at approximating your location (<a href="http://www.google.com/search?gcx=w&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=restaurants">try it</a>) and presenting restaurant results for your area.  However, with Opera Turbo it completely fails and they are forced to ask for my zip code.</p>
<h2>There is still hope</h2>
<p>Amazon Silk was only announced yesterday so details are still emerging.   It&#8217;s possible that Amazon has a solution to these challenges.  However, as demonstrated, these pre-fetching techniques can present sizable challenges for organizations that are employing personlization or content targeting on their web sites.  It will be interesting to see how Amazon addresses these challenges and how the CMS industry is impacted (if at all).</p>
<p>Long-term, I can&#8217;t imagine these pre-fetching technique will become widespread.  Mobile devices are getting increasingly more powerful and wireless broadband is becoming ubiquitous.  It will only be a matter of time before page load times are a non-issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/amazons-silk-browser-breaks-web-personalization/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WYSIWYG Rich Text Editors: Your CMS&#8217;s Achilles&#8217; heel</title>
		<link>http://gabesumner.com/wysiwyg-rich-text-editors-your-cmss-achilles-heel</link>
		<comments>http://gabesumner.com/wysiwyg-rich-text-editors-your-cmss-achilles-heel#comments</comments>
		<pubDate>Sun, 08 May 2011 15:13:22 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wysiwyg]]></category>

		<guid isPermaLink="false">http://gabesumner.com/?p=371</guid>
		<description><![CDATA[Most of what you read online flows through web-based (browser-based) WYSIWYG Rich Text editors.  These tools are central to every CMS and enable content authors, who might know little about HTML, to create HTML. However, content authors are often baffled by &#8230; <a href="http://gabesumner.com/wysiwyg-rich-text-editors-your-cmss-achilles-heel">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Most of what you read online flows through web-based (browser-based) WYSIWYG Rich Text editors.  These tools are central to every CMS and enable content authors, who might know little about HTML, to create HTML.</p>
<p>However, content authors are often baffled by the behavior of these tools.  In fact, many characterize their Rich Text editor as the <em><strong>most fragile part of their CMS</strong></em>.  This blog post is inspired by my research into this challenge.</p>
<p><span id="more-371"></span></p>
<h2>Why is web-based Rich Text editing so challenging?</h2>
<ul>
<li>Web “browsers” were never designed to be MS Word.</li>
<li>Lack of standards around browser-based WYSIWYG editing</li>
<li>Each browser has a unique implementation of this functionality</li>
<li>Rich Text editors require many layers of ‘hacks’ to create WYSIWYG editing</li>
</ul>
<p><em>** Standards are </em><a href="http://blog.whatwg.org/the-road-to-html-5-contenteditable"><em>beginning to emerge</em></a><em> through HTML5</em></p>
<h2>How can Rich Text editors be improved?</h2>
<ol>
<li><a href="http://gabesumner.com/unclutter-your-rich-text-editors-toolbar-essential-vs-useless-features">Get control of the toolbar</a></li>
<li><a href="http://gabesumner.com/copy-from-ms-word-paste-into-a-rich-text-wysiwyg-editor">Automatically clean pasted content</a></li>
<li><a href="http://gabesumner.com/do-not-use-font-styling-in-your-rich-text-wysiwyg-editor">Eliminate ad-hoc usage of fonts, font sizes &amp; colors</a></li>
<li>Eliminate tables</li>
<li><a href="http://gabesumner.com/create-a-rich-text-editing-experience-that-authors-wont-avoid">Use good typography</a></li>
<li><a href="http://gabesumner.com/create-a-rich-text-editing-experience-that-authors-wont-avoid">Go &#8216;full screen’</a></li>
<li><a href="http://gabesumner.com/create-a-rich-text-editing-experience-that-authors-wont-avoid">Use TAB for indent</a></li>
<li>Apply custom styles to the editor to create WYSIWYG</li>
<li>Auto-save content</li>
</ol>
<h2>Enough talk, where is a demo?</h2>
<p>I created a demo that implements many of these recommendations:</p>
<p><strong><a href="http://gabesumner.com/samples/wysiwyg.html">Rich Text WYSIWYG Demo</a></strong></p>
<p><em>** This demo is a work in progress.  Please report any issues you discover.  Some of the scripting needs refactored.  I also haven’t done extensive testing for browser compatibility.  Consider this demo a proof-of-concept, at this stage.</em></p>
<h2>See it in action</h2>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/7taQjWHRlc4?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/wysiwyg-rich-text-editors-your-cmss-achilles-heel/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DO NOT use font styling in your Rich Text WYSIWYG editor</title>
		<link>http://gabesumner.com/do-not-use-font-styling-in-your-rich-text-wysiwyg-editor</link>
		<comments>http://gabesumner.com/do-not-use-font-styling-in-your-rich-text-wysiwyg-editor#comments</comments>
		<pubDate>Wed, 04 May 2011 17:13:28 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wysiwyg]]></category>

		<guid isPermaLink="false">http://gabesumner.com/do-not-use-font-styling-in-your-rich-text-wysiwyg-editor</guid>
		<description><![CDATA[This web page looks the way it does because of a combination of HTML and CSS.  These 2 technologies are the primary languages of the web.  However, very few people who publish web content know HTML &#38; CSS.  This is &#8230; <a href="http://gabesumner.com/do-not-use-font-styling-in-your-rich-text-wysiwyg-editor">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This web page looks the way it does because of a combination of HTML and CSS.  These 2 technologies are the primary languages of the web.  However, very few people who publish web content know HTML &amp; CSS.  <em>This is okay though; very few people who drive cars can build a car.</em></p>
<p><em><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Using font types, sizes, colors and background colors in a WYSIWYG editor is WRONG" src="http://gabesumner.com/wp-content/uploads/2011/05/image3.png" border="0" alt="Using font types, sizes, colors and background colors in a WYSIWYG editor is WRONG" width="604" height="110" /></em></p>
<p>Rich Text (WYSIWYG) editors enable content authors, who know nothing about HTML, to create HTML.  However, there are good &amp; bad practices with regard to HTML &amp; CSS.  When Rich Text editors are poorly configured these tools make it easy for unsuspecting authors to accidently ruin their web site.</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/7taQjWHRlc4?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7taQjWHRlc4?version=3" type="application/x-shockwave-flash" width="640" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span id="more-359"></span></p>
<h2>Using font types, sizes, colors &amp; background colors in a Rich Text editor will eventually ruin your web site</h2>
<p>Most Rich Text editors (and CMS’s) enable authors to arbitrarily select new fonts, font sizes, font colors and background colors.  However, these tools should not be used!  In fact, these tools should be entirely <a href="http://gabesumner.com/unclutter-your-rich-text-editors-toolbar-essential-vs-useless-features">removed from the toolbar</a>.</p>
<p>Understanding why these features are destructive requires some basic HTML &amp; CSS knowledge.  Here is a simple example:</p>
<p>&lt;a href=”http://gabesumner.com”&gt;This is an important link.&lt;/a&gt;</p>
<p>The HTML shown above defines a web link (<a href="#">like this</a>).  These links are easy to create using a Rich Text editor.  However, this is an important link and the font should be bigger and red.  This is also easily accomplished using the font size and color features…</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Creating an important link using in-line styling in a WYSIWYG editor" src="http://gabesumner.com/wp-content/uploads/2011/05/image6.png" border="0" alt="Creating an important link using in-line styling in a WYSIWYG editor" width="604" height="102" /></p>
<p>However, this is what these features do to the HTML:</p>
<p>&lt;a href=&#8221;http://gabesumner.com&#8221;&gt;&lt;span style=&#8221;font-family: verdana; font-size: 24px; color: #c00000;&#8221;&gt;This is an important link.&lt;/span&gt;&lt;/a&gt;</p>
<p>The Rich Text editor injects in-line styling directly into the HTML.  This <em>looks</em> fine and it’s easy to understand why many authors are entirely happy with these results.   Eventually, however, this in-line styling will create insidious challenges for the web site.</p>
<h2>What will in-line (or ad-hoc) styling do to your web site?</h2>
<p>Occasional use of in-line styling won’t create many problems for the web site.  However, as the web site grows and in-line styling multiplies it creates visual inconsistencies between pages.  Each time authors compose content they are arbitrarily deciding what, for example, an important link looks like.</p>
<p>This lack of consistency creates usability issues for web visitors.  Each page in the web site is redefining the visual interface.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Using arbitrary in-line styling in a WYSWIYG editor makes each page feel like it's a new web site" src="http://gabesumner.com/wp-content/uploads/2011/05/image4.png" border="0" alt="Using arbitrary in-line styling in a WYSWIYG editor makes each page feel like it's a new web site" width="604" height="294" /></p>
<p>The other challenge arises when the visual style of the web site needs modified.  This might be due to a simple redesign, or it might be needed to adapt the web site to a new form factor (phones, tablets, etc.).  When styling is injected directly into the content it becomes extremely difficult to modify.</p>
<h2>Using pre-defined styles will make authors more productive and produce better results</h2>
<p>Instead of arbitrarily sprinkling ad-hoc styling through the web site, authors can work with web developers &amp; designers to establish a menu of pre-defined styles.  Once established, these styles can be used by authors to style content:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Use pre-defined styles in a WYSWIYG Rich Text editor" src="http://gabesumner.com/wp-content/uploads/2011/05/image5.png" border="0" alt="Use pre-defined styles in a WYSWIYG Rich Text editor" width="604" height="414" /></p>
<p>Behind the scenes, the Rich Text editor is applying pre-defined class styles to the content.</p>
<p>&lt;a href=&#8221;http://gabesumner.com&#8221; class=”ImportantLink”&gt;This is an important link.&lt;/a&gt;</p>
<p>In this example, the “ImportantLink” class was pre-defined.  The styling associated with this class (font size, color, type, weight, etc.) is defined outside the web content.  This class could be used thousands of times and, if it needed restyled, modified in a single place.</p>
<h2>The pros of pre-defined styles vastly outweigh the cons</h2>
<p>Pre-defined styles take some extra time (initially) to define.  In addition, content authors might feel limited when they encounter new scenarios for which pre-defined styles do not exist.</p>
<p>However, once established, pre-defined styles are easy to use, produce rich results, and create a consistent visual experience throughout the web site.  Furthermore, these styles can be easily adapted by web developers &amp; designers if needed.</p>
<p>Long-term, web site management will be much easier when in-line styling is avoided.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/do-not-use-font-styling-in-your-rich-text-wysiwyg-editor/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Modifying the width of the CKEditor Styles dropdown</title>
		<link>http://gabesumner.com/modifying-the-width-of-the-ckeditor-styles-dropdown</link>
		<comments>http://gabesumner.com/modifying-the-width-of-the-ckeditor-styles-dropdown#comments</comments>
		<pubDate>Sun, 01 May 2011 22:51:26 +0000</pubDate>
		<dc:creator>Gabe Sumner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[wysiwyg]]></category>

		<guid isPermaLink="false">http://gabesumner.com/modifying-the-width-of-the-ckeditor-styles-dropdown</guid>
		<description><![CDATA[CKEditor comes included with a handy-dandy style selector: Unfortunately this style selector defaults to a very small width.  This small width can result in larger styles being truncated: Thankfully this can be fixed with a couple of custom styles: div.cke_panel.cke_ltr.cke_rcombopanel &#8230; <a href="http://gabesumner.com/modifying-the-width-of-the-ckeditor-styles-dropdown">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>CKEditor comes included with a handy-dandy style selector:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="The style selector of CKEditor's toolbar" src="http://gabesumner.com/wp-content/uploads/2011/05/image.png" border="0" alt="The style selector of CKEditor's toolbar" width="549" height="58" /></p>
<p>Unfortunately this style selector defaults to a very small width.  This small width can result in larger styles being truncated:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="CKeditor's style selector toolbar is too small and cuts off the text." src="http://gabesumner.com/wp-content/uploads/2011/05/image1.png" border="0" alt="CKeditor's style selector toolbar is too small and cuts off the text." width="550" height="225" /></p>
<p>Thankfully this can be fixed with a couple of custom styles:</p>
<p><span id="more-345"></span></p>
<p>div.cke_panel.cke_ltr.cke_rcombopanel { width: 300px !important; }<br />
span.cke_rcombo span.cke_styles a span span.cke_text { width: 150px; }</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="CKEditor's style selector is now wider" src="http://gabesumner.com/wp-content/uploads/2011/05/image2.png" border="0" alt="CKEditor's style selector is now wider" width="550" height="188" /></p>
<h2>Where should these styles be put?</h2>
<p>For my own project, I was using the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.contentsCss">contentsCss</a> setting to apply a set of custom CSS styles to CKEditor.  Consequently, I simply put the styles shown above in this file.</p>
<p>However, these styles could also be put in the <strong>Editor.css</strong> file for the skin being used by CKEditor.  (<em>The default skin is the Kama skin.</em>)</p>
<p>Lastly, it’s possible these styles might not work with other (non-Kama) skins.</p>
<p>Best of luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://gabesumner.com/modifying-the-width-of-the-ckeditor-styles-dropdown/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

