<?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>The Why and The How &#187; General</title> <atom:link href="http://www.thewhyandthehow.com/category/general/feed/" rel="self" type="application/rss+xml" /><link>http://www.thewhyandthehow.com</link> <description>Just another WordPress weblog</description> <lastBuildDate>Fri, 09 Jul 2010 02:32:51 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.8.4</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Choose better passwords</title><link>http://www.thewhyandthehow.com/choose-better-passwords/</link> <comments>http://www.thewhyandthehow.com/choose-better-passwords/#comments</comments> <pubDate>Tue, 29 Sep 2009 16:49:24 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[Tutorial]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=760</guid> <description><![CDATA[A friend of mine recently fell victim to the Facebook 419 scam (basically someone logs into your Facebook account and asks your friends for money).
There are lots of ways bad things can happen to your computer and your online accounts, but if you use weak passwords, you&#8217;re increasing the risk that something bad will eventually [...]]]></description> <content:encoded><![CDATA[<p>A friend of mine recently fell victim to the <a
href="http://www.facebook.com/help.php?page=797">Facebook 419 scam</a> (basically someone logs into your Facebook account and asks your friends for money).</p><p>There are lots of ways bad things can happen to your computer and your online accounts, but if you use weak passwords, you&#8217;re increasing the risk that something bad will eventually happen to you. There are lots of articles about what makes a <a
href="http://en.wikipedia.org/wiki/Password_strength#Guidelines_for_strong_passwords">strong password</a>, but I want to tell you how to create a strong password that&#8217;s easy for you to remember. If you have to write down your strong passwords, then you probably haven&#8217;t accomplished much.</p><p>If you read the Wikipedia article above, you&#8217;ll see that one recommendation is that passwords should be 12-14 characters long. If you&#8217;re like most of us, creating a password of that length that includes numbers, letters and special characters can seem daunting. Let me share some tricks I&#8217;ve learned in the past decade or so that I&#8217;ve been working online.</p><p>First of all, passwords containing any part of your birthday or anniversary are usually a bad idea. Especially if that information is displayed in your account online (Facebook). Also passwords that contain your spouse&#8217;s name, your kids names, etc. aren&#8217;t going to be too tricky in this world of social networking.</p><p>So, what do you choose? My favorite method right now is using songs, poems or other text you have memorized in the course of your lifetime to create a long, but easy-to-remember password.</p><p>Here&#8217;s how it works.</p><ol><li>Choose your text. For the example, I&#8217;m going to use the first line of the Gettysburg address, &#8220;Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.&#8221;</li><li>Now reduce this to just the first 14 words as such: &#8220;Four score and seven years ago our fathers brought forth, upon this continent&#8221;</li><li>Now just use the first letter of each word with proper capitalization and punctuation and you suddenly have a very good password: &#8216;Fsasyaofbf,utc&#8217;.</li></ol><p>Notice that the password contains uppercase and lowercase letters and one special character, a comma. Yes, keep the comma in the password. You could also substitute the actual numbers into the text as such: &#8216;4sa7yaofbf,utc&#8217;. Now the password contains numbers, letters and special characters. If you just look at the password it appears completely random, but it&#8217;s so easy to remember.</p><p>The same thing applies to songs. Perhaps you&#8217;re a fan of Sean Kingston, so you choose the chorus of &#8220;Fire Burning&#8221; which is &#8220;Somebody call 911 Shawty fire burning on the dance floor&#8230;&#8221; Your new password is &#8216;Sc911Sfbotdf&#8217;.</p><p>If you&#8217;re a Bible reader, you have many, many ways to create complex passwords. For example you may include the scriptural reference in addition to a portion of the referenced passage. You might choose John 3:16, &#8220;For God so loved the world, that he gave his only begotten Son&#8230;&#8221; to create the password, &#8216;J3:16FGsltw,thghobS&#8217;. That one is 19 characters long, contains uppercase and lowercase letters, numbers and two special characters, but it&#8217;s amazingly simple to remember.</p><p>Using this technique, you can also create a set of strong passwords that you can use on different sites. Perhaps you associate the first letter of the site name with an author, scripture or recording artist/song. Twitter then becomes related to Thoreau or Thessalonians or Til Tuesday, while Facebook is related to Faulkner or First Timothy or Fatboy Slim.</p><p>My best recommendation is to start right away with at least one strong password. Get rid of your 4-6 character passwords. Get rid of your birthday or name-based passwords. Pick something that you&#8217;ve already memorized and make a password that really works.</p><p><strong>Last note</strong>: Unfortunately not all web sites allow you to be completely creative with your passwords. Some sites don&#8217;t allow special characters. Other&#8217;s set limits on the length of a password. Hopefully that will change soon, but until then, you might have to tweak some of your choice to fit some of the sites you use. Don&#8217;t let that discourage you from using better passwords on the sites that allow it.</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/choose-better-passwords/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Doing more at once</title><link>http://www.thewhyandthehow.com/doing-more-at-once/</link> <comments>http://www.thewhyandthehow.com/doing-more-at-once/#comments</comments> <pubDate>Wed, 17 Jun 2009 17:48:26 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[General]]></category> <category><![CDATA[database]]></category> <category><![CDATA[facebook]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=736</guid> <description><![CDATA[I&#8217;ve been doing a lot of work with curl_multi in PHP lately because it just makes sense to do as much work in parallel as possible (in most cases). I&#8217;ll be writing up my experiences with curl_multi later.
So, yesterday&#8217;s announcement by the Facebook development team about fql.multiquery couldn&#8217;t have come at a better time for [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of work with <a
href="http://us2.php.net/manual/en/function.curl-multi-exec.php">curl_multi in PHP</a> lately because it just makes sense to do as much work in parallel as possible (in most cases). I&#8217;ll be writing up my experiences with curl_multi later.</p><p>So, yesterday&#8217;s announcement by the Facebook development team about <a
href="http://developers.facebook.com/news.php?blog=1&#038;story=257">fql.multiquery</a> couldn&#8217;t have come at a better time for me. Experienced web developers (and multi-tiered application developers in general) have all learned that performing work in the proper tier is always the most efficient way to work. Data should be managed in the database tier and as separately from the application tier as possible. This announcement from the Facebook development team is great news for Facebook application developers everywhere. Kudos to them!</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/doing-more-at-once/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Google Chrome for Linux</title><link>http://www.thewhyandthehow.com/google-chrome-for-linux/</link> <comments>http://www.thewhyandthehow.com/google-chrome-for-linux/#comments</comments> <pubDate>Wed, 10 Jun 2009 17:18:24 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[browser]]></category> <category><![CDATA[google]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=728</guid> <description><![CDATA[On Monday I downloaded Google&#8217;s Chrome browser for Ubuntu to test it out (against all warnings).
I&#8217;m happy to say that despite the missing features, this browser is absolutely amazing on Ubuntu. It&#8217;s lightning fast and very stable. I can&#8217;t browse to pages that require HTTP AUTH &#8212; but that&#8217;s the only thing I&#8217;ve found that [...]]]></description> <content:encoded><![CDATA[<p>On Monday I downloaded Google&#8217;s <a
href="http://dev.chromium.org/getting-involved/dev-channel">Chrome browser for Ubuntu</a> to test it out (<a
href="http://blog.chromium.org/2009/06/danger-mac-and-linux-builds-available.html">against all warnings</a>).</p><p>I&#8217;m happy to say that despite the missing features, this browser is absolutely amazing on Ubuntu. It&#8217;s lightning fast and very stable. I can&#8217;t browse to pages that require HTTP AUTH &#8212; but that&#8217;s the only thing I&#8217;ve found that I didn&#8217;t notice in the limitations documentation.</p><p>Unfortunately Firefox on Ubuntu is not great, so I&#8217;m hoping that soon Chrome will be my browser of choice. Or I could just get a Mac.</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/google-chrome-for-linux/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Memcache, memcache, memcache!</title><link>http://www.thewhyandthehow.com/memcache-memcache-memcache/</link> <comments>http://www.thewhyandthehow.com/memcache-memcache-memcache/#comments</comments> <pubDate>Wed, 20 May 2009 23:31:29 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[REST]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[memcache]]></category> <category><![CDATA[programming]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=706</guid> <description><![CDATA[Possibly the single-most important piece of advice I give to every software developer right now is to use memcache (or memcached to be specific). I&#8217;ve become an evangelist of the software since working for Squidoo.
Memcache is just exactly what it says it is &#8212; a memory cache daemon (service). It&#8217;s lightweight and very fast and [...]]]></description> <content:encoded><![CDATA[<p>Possibly the single-most important piece of advice I give to every software developer right now is to <strong>use <a
href="http://www.danga.com/memcached/">memcache</a></strong> (or memcached to be specific). I&#8217;ve become an evangelist of the software since working for <a
href="http://www.squidoo.com/building-squidoo">Squidoo</a>.</p><p>Memcache is just exactly what it says it is &#8212; a memory cache daemon (service). It&#8217;s lightweight and very fast and can be used for all kinds of caching: page, database, remote data, etc., etc.</p><p>I use it on this blog in conjunction with fetching the Twitter comments that appear in the right-hand sidebar on the home page, for example. Here&#8217;s the general pseudo code for how memcache is used:</p><pre>
  key = generate_cache_key()
  if (value = is_key_in_cache(key))
    return value
  get_uncached_value() // DB, REST, complex code, etc.
  save_to_cache(key, value)
</pre><p>My actual implementation for the Twitter backtweets looks something like this:</p><div
id="wp_codebox_msgheader"><span
class="right"><a
href="javascript:;" onclick="toggle_collapse('p7063');">[<span
id="p7063_symbol">-</span>]</a><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p706code3'); return false;">View Code</a> PHP</span><div
class="codebox_clear"></div></div><div
id="wp_codebox"><table
width="100%" ><tr
id="p7063"><td
class="code" id="p706code3"><pre class="php"><span style="color: #000033;">$uri</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://backtweets.com/search.json?q=www.thewhyandthehow.com&amp;key=API-KEY'</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$cache_key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'rest-service-'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$uri</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$result</span> <span style="color: #339933;">=</span> Helpers<span style="color: #339933;">::</span><span style="color: #004000;">cacheGet</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$cache_key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
  <span style="color: #b1b100;">return</span> <span style="color: #000033;">$result</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000033;">$result</span> <span style="color: #339933;">=</span> Helpers<span style="color: #339933;">::</span><span style="color: #004000;">remoteLoad</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$uri</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// check valid $result here</span>
&nbsp;
Helpers<span style="color: #339933;">::</span><span style="color: #004000;">cacheSet</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$cache_key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$result</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000033;">$result</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>The helper functions look like this (class declaration not shown for brevity):</p><div
id="wp_codebox_msgheader"><span
class="right"><a
href="javascript:;" onclick="toggle_collapse('p7064');">[<span
id="p7064_symbol">-</span>]</a><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p706code4'); return false;">View Code</a> PHP</span><div
class="codebox_clear"></div></div><div
id="wp_codebox"><table
width="100%" ><tr
id="p7064"><td
class="code" id="p706code4"><pre class="php">    <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.php.net/static"><span style="color: #990000;">static</span></a> <span style="color: #000000; font-weight: bold;">function</span> getCache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>self<span style="color: #339933;">::</span><span style="color: #000033;">$cache</span> <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #000033;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Memcache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000033;">$temp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span>MEMCACHE_HOST<span style="color: #339933;">,</span> MEMCACHE_PORT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         self<span style="color: #339933;">::</span><span style="color: #000033;">$cache</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$temp</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> self<span style="color: #339933;">::</span><span style="color: #000033;">$cache</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/**
     * set a value to the memcache
     *
     * @param string key name
     * @param mixed value
     * @param integer timeout (default 1 day)
     * @param boolean compression flag
     * @return boolean success
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.php.net/static"><span style="color: #990000;">static</span></a> <span style="color: #000000; font-weight: bold;">function</span> cacheSet<span style="color: #009900;">&#40;</span><span style="color: #000033;">$key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$value</span><span style="color: #339933;">,</span> <span style="color: #000033;">$timeout</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">86400</span><span style="color: #339933;">,</span> <span style="color: #000033;">$compress</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000033;">$cache</span> <span style="color: #339933;">=</span> self<span style="color: #339933;">::</span><span style="color: #004000;">getCache</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$timeout</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000033;">$timeout</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/min"><span style="color: #990000;">min</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$timeout</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2592000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$compress</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000033;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$value</span><span style="color: #339933;">,</span> MEMCACHE_COMPRESSED<span style="color: #339933;">,</span> <span style="color: #000033;">$timeout</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000033;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$value</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000033;">$timeout</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/**
     * get an item from the cache
     *
     * @param string key
     * @return mixed value or false
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.php.net/static"><span style="color: #990000;">static</span></a> <span style="color: #000000; font-weight: bold;">function</span> cacheGet<span style="color: #009900;">&#40;</span><span style="color: #000033;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000033;">$cache</span> <span style="color: #339933;">=</span> self<span style="color: #339933;">::</span><span style="color: #004000;">getCache</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #000033;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>As you can see the code is very simple. The <strong>cacheGet</strong> function is trivial, so no discussion is needed. The <strong>cacheSet</strong> function is a little more complex, but basically that is to support a very simple calling convention and to ensure that the parameters are sane. One obviously missing check is to ensure that the Memcache variable returned by <strong>getCache</strong> is valid &#8212; I guess I have some work to do.</p><p>The advantage for using caching in this manner should be obvious. Instead of requiring an actual HTTP request per pageview, this method keeps a copy around for 20 minutes before initiating another request to the <a
href="http://backtweets.com/">backtweets.com</a> servers. This is friendly to the remote servers while also increasing the responsiveness of my application.</p><p>This logic applies to any big, slow or heavy processes that might occur on a web server, not just remote HTTP requests. If your application generates lots of mostly-static HTML markup that is re-used or requested frequently, it could be cached in memcache. If you have any big or frequently-requested database queries, throw the results in memcache and take the load off of your DB server.</p><p>AND&#8230;</p><p>Since memcache is based on TCP/IP, it doesn&#8217;t have to run locally relative to your application server. Have one big memcache box, or two, or three, and make requests from all of your application servers.</p><p>If your application is falling over because of load, you might want to take a look at the problem spots. You&#8217;ll probably find that using memcache will reduce overall load on your database and application servers and increase the responsiveness of your site.</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/memcache-memcache-memcache/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Use Twitter, Facebook, OAuth or OpenID for login?</title><link>http://www.thewhyandthehow.com/use-twitter-facebook-oauth-or-openid-for-login/</link> <comments>http://www.thewhyandthehow.com/use-twitter-facebook-oauth-or-openid-for-login/#comments</comments> <pubDate>Wed, 22 Apr 2009 16:41:23 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[General]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[authentication]]></category> <category><![CDATA[connect]]></category> <category><![CDATA[facebook]]></category> <category><![CDATA[oauth]]></category> <category><![CDATA[openid]]></category> <category><![CDATA[twitter]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=580</guid> <description><![CDATA[Now that OAuth is officially available for accessing the Twitter API, it&#8217;s technically possible to use Twitter&#8217;s services as an authentication method for logging into your web site. In fact, when setting up a new Twitter OAuth application, there&#8217;s an option suggesting that very use.This is not a new concept, but with the recent proliferation [...]]]></description> <content:encoded><![CDATA[<p>Now that OAuth is officially available for accessing the <a
href="http://apiwiki.twitter.com/">Twitter API</a>, it&#8217;s technically possible to use Twitter&#8217;s services as an authentication method for logging into your web site. In fact, when <a
href="http://twitter.com/oauth_clients/new">setting up a new Twitter OAuth application</a>, there&#8217;s an option suggesting that very use.</p><p><a
href="http://www.thewhyandthehow.com/wp-content/uploads/2009/04/twitter-authentication.png"><img
src="http://www.thewhyandthehow.com/wp-content/uploads/2009/04/twitter-authentication.png" alt="twitter-authentication" title="twitter-authentication" width="422" height="133" class="alignnone frame size-full wp-image-581" /></a></p><p>This is not a new concept, but with the recent proliferation of high-profile services such as Twitter OAuth and Facebook Connect, I think it&#8217;s time to discuss the pros and cons of using a third-party authentication system for your web site.</p><h4>Pros</h4><p>One of the most obvious advantages of using any third-party authentication system including <a
href="http://openid.net/">OpenID</a> is that you don&#8217;t have to develop the complex systems necessary to validate user registrations, avoid duplicate or spam registrations or manage all of the registration messaging and support. That&#8217;s a big deal. If your registration system is too complex because you are trying to ensure that only legitimate users can register, you will undoubtedly lose some potential users who simply find the system too hard to use. Tying into established accounts reduces the barriers to entry for your site.</p><p>Another consideration for using a third-party authentication system is the additional features of the third-party service. If you intend to update the user&#8217;s Facebook or Twitter status, you&#8217;ll eventually need to authorize your user with that service. You may be able to address two needs at one time.</p><p>Finally, there is a <em>soft</em> benefit to using a third-party authentication system and that is the added trust. It&#8217;s likely that if you use a trusted system or service, your own web site will be implicitly trusted more.</p><h4>Cons</h4><p>Using a third-party system does not remove the necessity to keep some user information in a local database or provide some session and cookie management functions. Your web site will probably require additional user information that is not provided by any of the third-party services. Depending on how much of that information is required, using a third-party service may simply add another step to the registration process &#8212; increasing the barriers to entry.</p><p>Many third-party applications are still evolving. Twitter&#8217;s OAuth has only been available for about a month. Facebook Connect is less than a year old and has changed quite drastically (for the better) since its release. OpenID is much more mature as a development tool, but adoption in the user world is still relatively low.</p><h4>Gotchas</h4><p><em>Some things to think about &#8212; things that may be pros or cons depending on how your site works with the third-party services.</em></p><p>An advantage of using a third-party for authentication is the fact that there are many to choose from (Twitter, Facebook Connect, OpenID, etc.) so many of your users  will already have established accounts with the other sites. But what do you do if your potential user is not connected with any of the third-party sites you use? Consider your audience before committing to a third-party-only authentication solution. If your audience is the bleeding edge web community or if your service is an add-on to the third-party service, you&#8217;re golden. Otherwise you may alienate potential users who don&#8217;t have and don&#8217;t want to be a part of the Twitter-Facebook-etc crowd.</p><p>What happens to your users if they decide to leave the third-party site or are banned from using it in the future? People do stop using Facebook, Twitter and other services. People close their GMail accounts (<a
href="http://code.google.com/apis/accounts/docs/OAuth.html">Google provides third-party authentication</a>) and occasionally people are banned from other sites for violations of terms. If your site is not directly related to the third-party site (for example a Twitter search site would be directly related to Twitter), you probably want to make sure that your users can login on your site whether they have an active account anywhere else.</p><h4>What to do?</h4><p>I suggest that most sites still need to have a local user login system of some sort. This is to ensure that your users remain your users. Users will not understand or care to know why they can no longer access your site after canceling their Facebook account, they&#8217;ll just know that you&#8217;ve excluded them and they&#8217;ll be upset. No amount of technical mumbo-jumbo will convince them otherwise.</p><p>I do encourage the use of third-party authentication systems to add value to your site. There are several reasons to do this:<ul><li>Providing additional value-added connections to the third-party services such as updating profile information or status</li><li>Providing social graph information such as which friends of the current user also use your site</li><li>Gathering additional authentication information for your site</li></ul><h4>Recommendations</h4><p>Build a simple login system for your site. Limit the amount of information you gather to the absolute minimum you need to provide basic login/account services. This should include a user identifier, password and some method for recovering a lost password. Consider this your first tier of authentication. First-tier users get read access to all of your site and some level of personalization based on their account information.</p><p>Next, if your site allows publishing of any information, add a second level of authentication. Since your first-tier users didn&#8217;t do anything to prove they aren&#8217;t bad robots, they don&#8217;t get to publish. This is where you can get creative. Second-tier authentication may be via email (not my preference) or via a third-party authentication system. Choose a third-party that you trust, then have your users authenticate themselves with that third-party and record the authorization information in your user database. Consider the user a second-tier user at that point and enable additional options and services on your site.</p><p>The advantages of this tiered approach are many.</p><ul><li>You maintain a local database of users</li><li>You can provide as many tiers of trust as you need with different authentication methods as seem appropriate</li><li>You can provide alternate authentication methods for each tier so your users have many options to authenticate</li><li>If any one of the third-party authentication services disappears or revokes access to a user or group of users, you can provide an alternate method</li><li>You reduce the barriers to entry to your web site</li><li>Your users only encounter authentication barriers as they seek to increase their interaction with your site</li></ul><p>Perhaps at some point in the future, OpenID and OAuth or some new thing will be truly ubiquitous and provide all of the features required for completely hands-off authentication services, but right now I don&#8217;t think we&#8217;re there. Until then, consider a tiered authentication system that provides the best options for you, your site and your users.</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/use-twitter-facebook-oauth-or-openid-for-login/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Get latitude/longitude of Google map</title><link>http://www.thewhyandthehow.com/get-latitudelongitude-of-google-map/</link> <comments>http://www.thewhyandthehow.com/get-latitudelongitude-of-google-map/#comments</comments> <pubDate>Fri, 10 Apr 2009 23:51:18 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[geolocation]]></category> <category><![CDATA[google map]]></category> <category><![CDATA[latitude]]></category> <category><![CDATA[longitude]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=486</guid> <description><![CDATA[I do a fair amount of work where I need to quickly get the latitude and longitude of a given address. Most of the time I just head over to maps.google.com and type in the address, then use the link button and copy/paste just the latitude and longitude. I find this method to be workable [...]]]></description> <content:encoded><![CDATA[<p>I do a fair amount of work where I need to quickly get the latitude and longitude of a given address. Most of the time I just head over to <a
href="http://maps.google.com">maps.google.com</a> and type in the address, then use the link button and copy/paste just the latitude and longitude. I find this method to be workable in most cases, but I found a little <a
href="http://www.tech-recipes.com/rx/2403/google_maps_get_latitude_longitude_values/">Javascript snippet</a> that works well to display exactly what I need in a prompt.</p><p><a
href="http://www.thewhyandthehow.com/wp-content/uploads/2009/04/menu.png"><img
src="http://www.thewhyandthehow.com/wp-content/uploads/2009/04/menu.png" alt="menu" title="menu" width="144" height="270" class="alignleft size-full wp-image-487" /></a>The Javascript method works well, but it&#8217;s a little inconvenient when I&#8217;m copying and pasting several addresses, the JS code and the resulting geolocations in one session. Today I was doing this again and it struck me how convenient it would be to have a browser button that would do what the Javascript does. So I set that up.</p><p>In Firefox, I simply added a custom bookmark to my Bookmarks toolbar (View, Toolbars, Bookmark Toolbars). To do this, assuming the Bookmark toolbar is visible, right click (or control click for Mac users) on it and select New Bookmark. In the properties box, enter this Javascript into the location field:</p><div
id="wp_codebox_msgheader"><span
class="right"><a
href="javascript:;" onclick="toggle_collapse('p4866');">[<span
id="p4866_symbol">-</span>]</a><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p486code6'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
id="wp_codebox"><table
width="100%" ><tr
id="p4866"><td
class="code" id="p486code6"><pre class="javascript">javascript<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">prompt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,</span>gApplication.<span style="color: #006600;">getMap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">getCenter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p><a
href="http://www.thewhyandthehow.com/wp-content/uploads/2009/04/properties.png"><img
src="http://www.thewhyandthehow.com/wp-content/uploads/2009/04/properties-300x200.png" alt="properties" title="properties" width="300" height="200" class="alignright size-medium wp-image-488" /></a>Now you have a button that will display the latitude and longitude of the current map (on the Google maps site) in a convenient Javascript prompt box. Like I said, this isn&#8217;t going to change your life, but it might save you a few cycles &#8230; and that&#8217;s worth something.</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/get-latitudelongitude-of-google-map/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>The right tools</title><link>http://www.thewhyandthehow.com/the-right-tools/</link> <comments>http://www.thewhyandthehow.com/the-right-tools/#comments</comments> <pubDate>Tue, 31 Mar 2009 18:34:58 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[General]]></category> <category><![CDATA[learning]]></category> <category><![CDATA[skills]]></category> <category><![CDATA[tools]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=407</guid> <description><![CDATA[To a man with a hammer, everything looks like a nail.
Mark TwainI recently took down a pool fence. It required cutting sections of steel fencing, removing rusty nuts from large bolts in the ground and walls, and cutting bolts. I had been delaying this job for a long time because I&#8217;m not a handyman and [...]]]></description> <content:encoded><![CDATA[<div
class="quote">To a man with a hammer, everything looks like a nail.<p
class="quote-by"><a
href="http://48facets.wordpress.com/2007/10/20/everything-looks-like-a-nail/">Mark Twain</a></p></div><p>I recently took down a pool fence. It required cutting sections of steel fencing, removing rusty nuts from large bolts in the ground and walls, and cutting bolts. I had been delaying this job for a long time because I&#8217;m not a handyman and I don&#8217;t have many tools. I had to buy a new wrench and I had to find something to cut the bolts and the fence. Fortunately, my neighbor had the cutting tool and was willing to let me borrow it. As I spent the better part of Saturday afternoon working, I couldn&#8217;t help but think about the saying, &#8220;To a man with a hammer, everything looks like a nail.&#8221;</p><p>I&#8217;ve worked with a lot of programmers and programmer types in my career and I&#8217;ve found that there are many who have a single tool in their box. It may be a programming language or it may be a toolkit or it may be an application that can be scripted or customized with macros. For those people, the solution to every problem is always considered from the point of view of their favorite tool. The best software developers, however, have a rich set of tools and a mindset to approach solutions from multiple perspectives. Sometimes the solution is based on a toolkit or application. Sometimes it&#8217;s best served by writing a new application in a high-level programming language. Sometimes it requires working at the database level with triggers or stored procedures.</p><p>When presented with a problem, the best developers don&#8217;t rush to their toolbox. Instead, the best programmers identify the scope of the problem, consider several options and ask colleagues for input &#8212; perhaps borrowing the right tool &#8212; before developing a solution.</p><p>It&#8217;s an amazingly rewarding experience to accomplish something new and acquire a new skill. I suppose I could have taken down my pool fence using nothing but a big hammer, but the result would have been disappointing and I would have learned nothing new. By contrast, I found a great deal of satisfaction in the process of doing something I&#8217;ve never done before &#8212; and I love the results. It&#8217;s likely that I&#8217;ll never take down another pool fence in my lifetime, but I learned a few skills that I can apply to all kinds of project that might come up in the future.</p><p>When is the last time you added a new tool to your box?</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/the-right-tools/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Your choice</title><link>http://www.thewhyandthehow.com/your-choice/</link> <comments>http://www.thewhyandthehow.com/your-choice/#comments</comments> <pubDate>Thu, 19 Mar 2009 11:31:10 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[Business]]></category> <category><![CDATA[General]]></category> <category><![CDATA[satisfaction]]></category> <category><![CDATA[work]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=334</guid> <description><![CDATA[On my flight home from Chicago to Phoenix Tuesday, I sat behind someone who spent the first twenty minutes of the flight complaining about how much she hates living in Phoenix and wishes she could move back to Chicago. She moved from Chicago in 1988 and has apparently lamented the move for the past 21 [...]]]></description> <content:encoded><![CDATA[<p>On my flight home from Chicago to Phoenix Tuesday, I sat behind someone who spent the first twenty minutes of the flight complaining about how much she hates living in Phoenix and wishes she could move back to Chicago. She moved from Chicago in 1988 and has apparently lamented the move for the past 21 years. I don&#8217;t get it. If you hate where you live, move. If you don&#8217;t hate it enough to move for 21 years, it must not really be that bad.</p><p>Are you doing what you want to be doing today? Does your work frustrate you or inspire you? Are you happy where you are? If not, move. Really, move your feet. Start living your dreams. Take one step toward your goals. If you are unhappy, make change.</p><p>When I meet with my colleagues at Squidoo, I&#8217;m reminded how incredibly cool my job is and how amazing the people are that I work with. I get inspired. I hope everyone works with people and in places that are inspiring. If you are not, go out and find that place. It changes everything.</p><p>It&#8217;s <strong>your</strong> choice.</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/your-choice/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Don&#8217;t reinvent the wheel</title><link>http://www.thewhyandthehow.com/dont-reinvent-the-wheel/</link> <comments>http://www.thewhyandthehow.com/dont-reinvent-the-wheel/#comments</comments> <pubDate>Thu, 05 Mar 2009 03:45:34 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Networking]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[connect]]></category> <category><![CDATA[facebook]]></category> <category><![CDATA[friend]]></category> <category><![CDATA[integration]]></category> <category><![CDATA[social]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=263</guid> <description><![CDATA[As a programmer I&#8217;ve heard the phrase &#8220;don&#8217;t reinvent the wheel&#8221; dozens (if not hundreds) of times in my career. It&#8217;s generally a reference to reusing existing source code to perform routine, well-defined programming tasks &#8212; stuff like sorting, searching, parsing and much more.
Within the past few years, however, the scope of what can be [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.thewhyandthehow.com/wp-content/uploads/2009/03/reinvent-wheel.jpg"><img
src="http://www.thewhyandthehow.com/wp-content/uploads/2009/03/reinvent-wheel-300x218.jpg" alt="reinvent-wheel" title="reinvent-wheel" width="300" height="218" class="right size-medium wp-image-269" /></a>As a programmer I&#8217;ve heard the phrase &#8220;don&#8217;t reinvent the wheel&#8221; dozens (if not hundreds) of times in my career. It&#8217;s generally a reference to reusing existing source code to perform routine, well-defined programming tasks &#8212; stuff like sorting, searching, parsing and much more.</p><p>Within the past few years, however, the scope of what can be accomplished by relatively simple integration and reuse &#8212; especially on the web &#8212; has grown significantly. For example, one thing you&#8217;ve probably seen is the common use of those funny login pictures that ask you to type in letters to prove you&#8217;re human. For a while, every web site manager that wanted to have that functionality had to build it herself or hire someone to do it. Today it&#8217;s as simple as integrating with a service like <a
href="http://recaptcha.net/">reCAPTCHA</a>. Additionally, you&#8217;ve probably seen plug-in functions for polls, guestbooks and many other standard web site features.</p><p>Recently, the pace of development in integration with major services has accelerated again. Google has released <a
href="http://www.google.com/friendconnect/">Google Friend Connect</a> and Facebook has released <a
href="http://developers.facebook.com/connect.php">Facebook Connect</a>, both of which provide deep integration into existing social networks such as MySpace and Facebook. These integration platforms are still evolving but the implications are huge.</p><p>By properly integrating with the existing social networks, a site can provide rich social interactions within existing networks of friends <strong>without reinventing the wheel</strong>. And frankly with Facebook growing at a rate of <a
href="http://www.allfacebook.com/2009/02/facebook-now-growing-by-over-700000-users-a-day/">700,000 new users per day</a>, the chance of your site competing head to head with them is extremely low. Don&#8217;t compete. Don&#8217;t reinvent. <strong>Integrate</strong>.</p><h4>Integration is the key</h4><p>Rather than trying to be the next Facebook, take your unique value to the existing networks on Facebook by <strong>bringing them to your site</strong>. Amazingly, it doesn&#8217;t take a degree in computer science to get some basic integrations working on your web site. Realistically, it <em>might</em> take a degree in computer science to do some more complex integrations (and to read the current documentation). To give a perspective, it took me several weeks (with an incredible support team) to integrate Facebook with <a
href="http://www.squidoo.com/">Squidoo</a>. To add the Facebook comment boxes on this blog took about 30 minutes.</p><h4>That&#8217;s interesting, but so what?</h4><p>I decided to disable the normal Wordpress comment system and just use Facebook&#8217;s new comment box today. The advantage is that when you post a comment on any page of this site, you also (optionally) post that same comment on your Facebook profile with an link back to my site. If you care enough to comment <strong>and</strong> tell your friends that you made a comment, it implies that you believe your friends will be interested in your opinion of my site. Assuming they are, they click through to my site, make a comment and the thread continues. Suddenly my site is a part of your social network and you didn&#8217;t have to go out of your way to make it so. I reduced a <a
href="http://www.thewhyandthehow.com/no-man-is-an-island/">barrier</a> and we all benefit.</p><p>The Facebook comment box is just one small piece of Facebook Connect. There are similar tools offered through Google Friend Connect for integrating with other social networks (including MySpace). As I said earlier, these tools are very new and rapidly evolving, but it&#8217;s very exciting. Right now if you&#8217;re managing a web site or building a new one (or just thinking about it) consider the list of features you&#8217;d love to have. If they include <strong>commenting</strong>, <strong>user registration</strong>, <strong>friend invitations</strong> and <strong>broad publication</strong> of user actions, you might be able to cross them off your to-do list and simply integrate.</p><h4>Imagine</h4><p>Consider how much energy you can focus on the core purpose of your web site if you don&#8217;t have to build technologies to compete against the clearly-dominant market leaders in social networking. I&#8217;m so excited about these emerging technologies that I can barely write this post. There&#8217;s so much more to talk about, so many examples of how to do it and so many ideas for where it can best be utilized.</p><h4>Next steps&#8230;</h4><p>This is going to be a core topic for the next few months (rough guess) as I build samples, give concrete examples and provide code to help you integrate with as little frustration as possible. I&#8217;m going to focus on Facebook Connect because I haven&#8217;t built anything more than a sample application using Google Friend Connect yet.</p><p>I&#8217;d love to get your feedback! What do you want to know? How would you use Facebook Connect if you could? Ask questions even if you&#8217;re not sure what the questions are!</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/dont-reinvent-the-wheel/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Don&#8217;t fear the propeller head</title><link>http://www.thewhyandthehow.com/dont-fear-the-propeller-head/</link> <comments>http://www.thewhyandthehow.com/dont-fear-the-propeller-head/#comments</comments> <pubDate>Sat, 14 Feb 2009 13:51:07 +0000</pubDate> <dc:creator>Blake Schwendiman</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Technology]]></category><guid
isPermaLink="false">http://www.thewhyandthehow.com/?p=58</guid> <description><![CDATA[Because this is a blog about web technologies and because I am a real nerd at heart, there are definitely going to be times when I focus on the implementation of the ideas presented. That means you might run into code samples, technical documents and other propeller-head information.
When that happens, I&#8217;ll go out of my [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.thewhyandthehow.com/wp-content/uploads/2009/02/propeller-head-nerd-200x300.jpg" alt="propeller-head-nerd" title="propeller-head-nerd" width="200" height="300" class="left size-medium wp-image-61" />Because this is a blog about web technologies and because I am a <a
href="/about/">real nerd at heart</a>, there are definitely going to be times when I focus on the implementation of the ideas presented. That means you might run into code samples, technical documents and other propeller-head information.</p><p>When that happens, I&#8217;ll go out of my way to ensure that I clearly mark the message so that you know. If you&#8217;re not developing (or managing the development) of a site, you can skip over the posts if you like.</p><p>If I geek out too much, let me know!</p> ]]></content:encoded> <wfw:commentRss>http://www.thewhyandthehow.com/dont-fear-the-propeller-head/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss><!--
This site's performance optimized by W3 Total Cache:

W3 Total Cache improves the user experience of your blog by caching
frequent operations, reducing the weight of various files and providing
transparent content delivery network integration.

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 10/17 queries in 0.009 seconds using memcached

Served from: a2.c0.354a.static.theplanet.com @ 2010-09-10 03:26:06 -->