<?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 Devign Path</title>
	<atom:link href="http://thedevignpath.com/feed" rel="self" type="application/rss+xml" />
	<link>http://thedevignpath.com</link>
	<description>design + development = devign</description>
	<lastBuildDate>Sat, 28 Aug 2010 12:16:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>mysysgit git error &#8211; Permission denied (publickey)</title>
		<link>http://thedevignpath.com/archives/89</link>
		<comments>http://thedevignpath.com/archives/89#comments</comments>
		<pubDate>Sat, 28 Aug 2010 11:27:15 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/89</guid>
		<description><![CDATA[I was trying to push some changes to GitHub using mysysgit and kept getting this “Permission denied” error. The problem was with my public keys. I changed my email address when I set - git config user.email “emailaddress” Clever, I (&#8230;)</p><p><a href="http://thedevignpath.com/archives/89">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I was trying to push some changes to GitHub using <a href="http://code.google.com/p/msysgit/">mysysgit</a> and kept getting this “Permission denied” error. The problem was with my public keys. I changed my email address when I set -</p>
<p> <code>git config user.email “emailaddress”</code>
<p>Clever, I know :] Anyway, so what I did to get around it was &#8211; </p>
<ul>
<li>go into &#8211; C:\Users\username\.ssh </li>
<li>If there&#8217;s a file there called &#8216;id_rsa.pub&#8217; or &#8216;id_rsa&#8217; delete both of them. If there isn&#8217;t no worries. </li>
<li>Next right click on the folder of your git repository and select &#8216;Git GUI here&#8217; </li>
<li>Select Help &gt; Show SSH key </li>
<li>This should be empty and what we want to do here is click generate key </li>
<li>Follow the prompts until you get your public key </li>
<li>Click copy to clipboard </li>
<li>What we want to do now is save this public key on our GitHub account. So go to your Account Settings on GitHub and select the public keys link </li>
<li>Click add public key and give it some meaningful name. I used the user identifier after the &#8216;==&#8217; </li>
</ul>
<p>I hope that works for you and saves you some time. Live long and prosper. </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/89/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu and Windows 7: the best of both worlds</title>
		<link>http://thedevignpath.com/archives/87</link>
		<comments>http://thedevignpath.com/archives/87#comments</comments>
		<pubDate>Fri, 20 Aug 2010 21:43:45 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/87</guid>
		<description><![CDATA[I found a way to share folders between my Ubuntu virtual machine and Windows 7. Here’s why. I’ve been getting into server side JavaScript recently with node.js and it is a lot of fun. But the downside is that it&#8217;s (&#8230;)</p><p><a href="http://thedevignpath.com/archives/87">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I found a way to share folders between my Ubuntu virtual machine and Windows 7. Here’s why.</p>
<p>I’ve been getting into server side JavaScript recently with <a href="http://nodejs.org/">node.js</a> and it is a lot of fun. But the downside is that it&#8217;s constantly changing and I have to use git a lot. I find it easier to get my head around git in the command line than the Windows GUI. Go figure. And I would love to try and use Visual Studio to code some JavaScript because it’s faster than other JAVA based IDEs on Windows and I saw <a href="http://developerdeveloperdeveloper.com/gulon/">Scott Gu using it at the Guathon</a> and I was well impressed.</p>
<p>Also, I want to be able to have the command line goodness of Linux and all the luxuries of Windows (including playing music files of any format I want). I did think about buying a Mac if only for <a href="http://www.panic.com/coda/">Coda</a>. Drool.</p>
<p>Here’s how. Get a Ubuntu virtual machine up and running. The <a href="http://releases.ubuntu.com/jaunty/">Ubuntu 9 iso</a> and the <a href="http://www.vmware.com/products/player/">VMware player</a> worked for me. The rest goes something like this -</p>
<p>In Ubuntu</p>
<ul>
<li>Create a new folder </li>
<li>Right click on it and select &quot;Sharing options&quot; </li>
<li>Check &quot;Share this folder&quot; and &quot;Allow others to create and delete files in this folder&quot; </li>
<li>Download Samba Server configuration </li>
<li>Add a share &#8211; using the new folder you created previously </li>
<li>Add a user &#8211; with a username and password </li>
</ul>
<p>In Windows </p>
<ul>
<li>Go to My Network </li>
<li>Log in to folder using user name and password set in Ubuntu </li>
</ul>
<p><u>Note:</u>     <br />Ubuntu permissions override Samba permissions which is why we have to share the folder in Ubuntu first before we can create/modify files/folders in Windows.</p>
<p>If in Windows you get the error message &quot;Multiple connections to a server or shared resource by the same use etc..&quot; open up the command prompt and run &quot;net use * /delete&quot; this will delete current users saved by Windows.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/87/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How buildings learn</title>
		<link>http://thedevignpath.com/archives/84</link>
		<comments>http://thedevignpath.com/archives/84#comments</comments>
		<pubDate>Sun, 15 Aug 2010 19:31:41 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/?p=84</guid>
		<description><![CDATA[I was listening to a podcast a few weeks ago (I think it&#8217;s this one) when someone gave a shout-out to this BBC series now on Google video. Apart from being interesting in it&#8217;s own right, the reason I was (&#8230;)</p><p><a href="http://thedevignpath.com/archives/84">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I was listening to a podcast a few weeks ago (I think it&#8217;s this one) when someone gave a shout-out to this BBC series now on <a href="http://www.google.com/search?q=how+buildings+learn&amp;tbo=p&amp;tbs=vid:1&amp;source=vgc&amp;aq=f&amp;qscrl=1">Google video</a>.</p>
<p>Apart from being interesting in it&#8217;s own right, the reason I was watching it was to see what design principles I could apply to my code practice. On a side note, I agree with <a href="http://oreilly.com/catalog/9780596154790/">Effective UI</a> that software design is more like warfare than building construction. Anyway, here&#8217;s what made sense to me.</p>
<p>The best buildings are -</p>
<ul>
<li>Built to change &#8211; by the user for the user because not all use cases can be predicted before hand. Write code looking ahead to make it easier for someone else to understand and change.</li>
<li>Valuable because they are disposable &#8211; can be re-purposed easily and therefore develop a rich history. Disposable code? Umm. . how about making better interfaces so modifications don&#8217;t break things.</li>
<li>Make problems visible &#8211; easier to maintain. Less fancy designs.</li>
</ul>
<p>What I found insightful is that (if the narrative is to be believed) architects are reluctant to learn from their mistakes e.g. flat roofs are notorious for leakage but are popular and that a lot of problems can be solved by adopting a user focused design approach. It looks  suspiciously agile! <a href="http://video.google.com/videoplay?docid=6141960341438553915#">Go to time stamp 16:20</a>. I&#8217;ve become quite keen on user centred design and usability in general recently. More on that later.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/84/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coupling &#8211; not the dating kind</title>
		<link>http://thedevignpath.com/archives/81</link>
		<comments>http://thedevignpath.com/archives/81#comments</comments>
		<pubDate>Sun, 15 Aug 2010 19:04:39 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/?p=81</guid>
		<description><![CDATA[I just watched Grand Unified Theory of Software Design by Jim Weirich on Vimeo and I found it quite insightful. The main aim of his talk as I understand is to come up with an object way of recognizing and (&#8230;)</p><p><a href="http://thedevignpath.com/archives/81">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I just watched <a href="http://vimeo.com/10837903">Grand Unified Theory of Software Design by Jim Weirich</a> on Vimeo and I found it quite insightful.</p>
<p>The main aim of his talk as I understand is to come up with an object way of recognizing and talking about good code design and more specifically code coupling. He referenced the idea of <a href="http://en.wikipedia.org/wiki/Connascence_(computer_science)">&#8216;connascence&#8217; </a> which basically means &#8220;things which change together&#8221;. There are different types of &#8216;connascence&#8217; (I wonder when I&#8217;ll get bored of using quotes on that word).</p>
<p><strong>Types of &#8216;connascence&#8217;</strong></p>
<ol>
<li>name &#8211; method name and method call. When the name of a method changes you have to change the corresponding method calls. This is the weakest type of coupling and we refactor code in this direction.</li>
<li>position &#8211; order specific process. Think of an array as opposed to a hash or collection of some sort &#8211; the latter is better. By using a collection/hash we reduce our coupling to &#8216;connascence of name&#8217;.</li>
<li>meaning &#8211; variables mean arbitrary things that need to be understood to use them properly. Use constants instead.</li>
<li>contranescene &#8211; namespace conflicts. Ever heard of <a href="http://api.jquery.com/jQuery.noConflict/">jQuery.noConflict</a>()? Make your variables play nice with each other by using namespaces.</li>
<li>algorithm &#8211; duplication of algorithm in more than one place. I usually spot this very quickly.</li>
<li>timing ie. race conditions. This happens when a function or process finishes sooner or later than it is expected to. In JavaScript callbacks are really useful.</li>
<li>execution &#8211; order of execution matters.</li>
<li>identity &#8211; objects have to be the same.</li>
</ol>
<p>Coupling drives me crazy and I need to get better at reducing it. It&#8217;s scary when I want to change some code and I keep wondering if some function far away is going to break. (Tip: keep related functions close together). I found this mnemonic  <a href="http://en.wikipedia.org/wiki/Solid_(object-oriented_design)">SOLID </a>helpful. Maybe I should write each letter on a finger. <img src='http://thedevignpath.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/81/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using python IRB generates this error &quot;ImportError settings cannot be imported because environment variable %s is undefined&quot;</title>
		<link>http://thedevignpath.com/archives/79</link>
		<comments>http://thedevignpath.com/archives/79#comments</comments>
		<pubDate>Fri, 02 Jul 2010 21:13:20 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/79</guid>
		<description><![CDATA[This is being caused because &#34;Unfortunately, the tagging module&#8217;s __init__.py file globally imports some models which rely on the rest of Django&#8217;s infrastructure to be up and running (hence the need for settings).&#34; Option 1: launch the python IRB by (&#8230;)</p><p><a href="http://thedevignpath.com/archives/79">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is being caused because &quot;Unfortunately, the tagging module&#8217;s __init__.py file globally imports some models which rely on the rest of Django&#8217;s infrastructure to be up and running (hence the need for settings).&quot;</p>
<ul>
<li>Option 1: launch the python IRB by using &quot;python manage.py shell&quot;</li>
<li>Option 2: in python IRB enter &quot;from django.conf import settings; settings.configure()&quot;</li>
</ul>
<p><a href="http://goo.gl/YtZJ">http://goo.gl/YtZJ</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/79/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run multiple versions of Firefox simultaneously</title>
		<link>http://thedevignpath.com/archives/78</link>
		<comments>http://thedevignpath.com/archives/78#comments</comments>
		<pubDate>Fri, 02 Jul 2010 21:11:06 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/78</guid>
		<description><![CDATA[Install two versions of Firefox. Version A and B in separate folders. Launch Firefox profile managment by running &#34;firefox -P&#34; in Run window (Window + R). Create a new profile. It&#8217;s sensible to name the&#160; profile the version of Firefox (&#8230;)</p><p><a href="http://thedevignpath.com/archives/78">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<ul>
<li>Install two versions of Firefox. Version A and B in separate folders.</li>
<li>Launch Firefox profile managment by running &quot;firefox -P&quot; in Run window (Window + R).</li>
<li>Create a new profile. It&#8217;s sensible to name the&#160; profile the version of Firefox that you wish to run &quot;firefox_A&quot;.</li>
<li>Click on &quot;Choose folder&quot; to set where the profile will be stored. In this folder is where profile information such as add-ons will be stored. Again it is sensible to use the target Firefox version number.</li>
<li>Create a shortcut to Version A of Firefox.</li>
<li>Right click and select the properties of the shortcut.</li>
<li>In the target field specify which Firefox profile should be used by appending at the end of the field &quot;-P firefox_A -no-remote&quot;. Include a space between the closing quote. e.g. &quot;C:\Program Files\Mozilla Firefox 3.6\firefox.exe&quot; -P firefox_A -no-remote.</li>
<li>Done!</li>
<li>Do the same for Version B of Firefox.</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/78/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brave New World of HTML5: The &quot;No, I&#8217;m not Bruce Lawson&quot; Edition by Patrick Lauke</title>
		<link>http://thedevignpath.com/archives/77</link>
		<comments>http://thedevignpath.com/archives/77#comments</comments>
		<pubDate>Fri, 02 Jul 2010 21:07:50 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/77</guid>
		<description><![CDATA[@WebDirections London 2010 What it is: HTML5 is anything but Opera started it in reaction to XHTML 2.0 via Web Application 1.0 with WHAT-WG. Joined forces with Mozilla, Apple, Microsoft and Google. HTML5 supports existing standards with additional features Features: (&#8230;)</p><p><a href="http://thedevignpath.com/archives/77">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h2>@WebDirections London 2010</h2>
<p>What it is:</p>
<ul>
<li>HTML5 is anything but Opera started it in reaction to XHTML 2.0 via Web Application 1.0 with WHAT-WG. Joined forces with Mozilla, Apple, Microsoft and Google.</li>
<li>HTML5 supports existing standards with additional features </li>
</ul>
<p>Features:</p>
<ul>
<li>&lt;!dochtml /&gt; is used to kick browser into standards mode     <br />Mark-up is loose but browser behaviour is strict. Mark-up is not case-sensitive, you don&#8217;t need quote marks but browser behaviour relative to mark-up is well defined.</li>
<li>New elements &#8211; header, nav, article, footer, section etc. machine readable and in older browsers it is styled as in-line elements. To render as block level elements use CSS and IE use document.createElement(&#8216;header&#8217;);</li>
<li>Canvas</li>
<li>Audio (mp3, ogg vorbis, WAV) [not that accessible]</li>
<li>Video &#8211; API controls plays nice with the rest of the page and it&#8217;s accessible (H.264 [Apple] vs. Ogg Theora vs WebM [Google]). Browser will check source of video element in cascading order &#8211; top to bottom. </li>
</ul>
<p>NB: Chrome prefers WebM. There&#8217;s a bug in Safari iPad that causes it to only check the first .mp4 file source.    <br />Web forms &#8211; use built in&#160; validation and new input types. Use feature detection.    <br />Anchor elements can be used around block level elements. </p>
<p>Questions</p>
<ul>
<li>Is it a flash killer? Not really, there is a valid place for flash.</li>
<li>How were the new elements chosen? Scooby Doo algorithm. Google made a short list from the most used identifiers and then made decisions based on those. </li>
</ul>
<p>You can start using it today!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/77/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Register a nick name on IRC</title>
		<link>http://thedevignpath.com/archives/75</link>
		<comments>http://thedevignpath.com/archives/75#comments</comments>
		<pubDate>Tue, 01 Jun 2010 21:51:46 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[nick name]]></category>
		<category><![CDATA[pidgin]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/75</guid>
		<description><![CDATA[Maybe you want to get involved on an open-source project and want to open up some lines of communication via IRC. It wasn’t as straight forward as I hoped so here’s the 411 (how-to). Install Pidgin Add account. Select server (&#8230;)</p><p><a href="http://thedevignpath.com/archives/75">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Maybe you want to get involved on an open-source project and want to open up some lines of communication via IRC. It wasn’t as straight forward as I hoped so here’s the 411 (how-to).</p>
<ul>
<li>Install <a href="http://pidgin.im/download/">Pidgin</a></li>
<li>Add account. </li>
<li>Select server e.g. IRC freenode enter username and password</li>
<li>Tick checkbox next to account name to connect to server</li>
<li>Nick server window will open a window with the message that your username &quot;is not a registered nickname.&quot;</li>
<li>In the input area at the bottom of window enter &#8211; </li>
</ul>
<pre class="csharpcode">/msg nickserv register your_password your_email_address</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<ul>
<li>An email will be sent to your email accout to verify it.</li>
<li>Copy the command from verification email and paste it into the input window.</li>
</ul>
<p>Why make it easy when it can be hard? (sarcasm).</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/75/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip of the Day: no SVN for Chrome extensions</title>
		<link>http://thedevignpath.com/archives/74</link>
		<comments>http://thedevignpath.com/archives/74#comments</comments>
		<pubDate>Tue, 01 Jun 2010 21:45:23 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[tip of the day]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/74</guid>
		<description><![CDATA[It is futile trying to get chrome samples via SVN. It&#8217;s not possible!!]]></description>
			<content:encoded><![CDATA[<p>It is futile trying to get chrome samples via <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/ ">SVN</a>. It&#8217;s <a href="http://code.google.com/chrome/extensions/samples.html#viewsource">not possible</a>!! </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use browser back-button functionality with JavaScript</title>
		<link>http://thedevignpath.com/archives/70</link>
		<comments>http://thedevignpath.com/archives/70#comments</comments>
		<pubDate>Sun, 28 Feb 2010 10:03:43 +0000</pubDate>
		<dc:creator>iampeterbanjo</dc:creator>
				<category><![CDATA[Development Tutorials]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://thedevignpath.com/archives/70</guid>
		<description><![CDATA[Use jQuery BBQ plugin in combination with hash change plugin to listen for window has change events. Let’s assume that you have a button with an ID of ‘button’. Let’s assume it does something useful like close a pop-up but (&#8230;)</p><p><a href="http://thedevignpath.com/archives/70">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Use <a href="http://benalman.com/projects/jquery-bbq-plugin/">jQuery BBQ plugin</a> in combination with <a href="http://benalman.com/projects/jquery-hashchange-plugin/">hash change plugin</a> to listen for window has change events. </p>
<p>Let’s assume that you have a button with an ID of ‘button’. Let’s assume it does something useful like close a pop-up but it can do anything really.</p>
<p>e.g. </p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="rem">//listen for hash tag changes so we can remove the popup</span></pre>
<pre><span class="lnum">   2:  </span>$(window).bind(<span class="str">'hashchange'</span>,</pre>
<pre><span class="lnum">   3:  </span>    <span class="kwrd">function</span>(<span class="kwrd">event</span>){</pre>
<pre><span class="lnum">   4:  </span>        <span class="rem">//did we add or substract the hash?</span></pre>
<pre><span class="lnum">   5:  </span>        <span class="kwrd">var</span> currentHash = window.location.hash;</pre>
<pre><span class="lnum">   6:  </span>        currentHash = currentHash.slice(1);                    </pre>
<pre><span class="lnum">   7:  </span>        <span class="kwrd">if</span>(window.console &amp;&amp; debug){</pre>
<pre><span class="lnum">   8:  </span>            console.log([<span class="str">'listings.js: hashchange event detected. currentHash is '</span>, currentHash ].join(<span class="str">''</span>));</pre>
<pre><span class="lnum">   9:  </span>        } </pre>
<pre><span class="lnum">  10:  </span>&#160;</pre>
<pre><span class="lnum">  11:  </span>        <span class="kwrd">if</span>(currentHash === <span class="str">'close'</span> || currentHash === <span class="str">''</span>){</pre>
<pre><span class="lnum">  12:  </span>            <span class="rem">//remove event listener to prevent premature trigger</span></pre>
<pre><span class="lnum">  13:  </span>            $(window).unbind(<span class="str">'hashchange'</span>); </pre>
<pre><span class="lnum">  14:  </span>            <span class="kwrd">if</span>(window.console &amp;&amp; debug){</pre>
<pre><span class="lnum">  15:  </span>                console.log(<span class="str">'listings.js: haschange event unbound '</span>);</pre>
<pre><span class="lnum">  16:  </span>                console.log([<span class="str">'listings.js: haschange event.trigger is '</span>,<span class="kwrd">event</span>.target].join(<span class="str">''</span>));</pre>
<pre><span class="lnum">  17:  </span>           } </pre>
<pre><span class="lnum">  18:  </span>&#160;</pre>
<pre><span class="lnum">  19:  </span>            $(<span class="str">&quot;#button&quot;</span>).trigger(<span class="str">'click'</span>);</pre>
<pre><span class="lnum">  20:  </span>        } <span class="kwrd">else</span> {</pre>
<pre><span class="lnum">  21:  </span>            <span class="kwrd">if</span>(window.console &amp;&amp; debug){</pre>
<pre><span class="lnum">  22:  </span>                console.log(<span class="str">'hash is not empty. doing nothing.'</span>);</pre>
<pre><span class="lnum">  23:  </span>            } </pre>
<pre><span class="lnum">  24:  </span>        } </pre>
<pre><span class="lnum">  25:  </span>        <span class="kwrd">event</span>.preventDefault();</pre>
<pre><span class="lnum">  26:  </span>    }</pre>
<pre><span class="lnum">  27:  </span>);</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<h3>What’s with the Array.join(‘’) method? </h3>
<p>Well <a href="http://code.google.com/speed/">I learnt from Google</a> that this method <a href="http://code.google.com/speed/articles/optimizing-javascript.html">is faster</a> than concatenating a string with ‘+’. I’m always learning new ways to write better code.</p>
<h3>Recommended reading</h3>
<p><a href="https://developer.mozilla.org/En/DOM/Window.location">https://developer.mozilla.org/En/DOM/Window.location</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://thedevignpath.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thedevignpath.com/archives/70/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
