<?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>Brian Wigginton &#187; Uncategorized</title>
	<atom:link href="http://www.bwigg.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bwigg.com</link>
	<description>Lab and Nerdery</description>
	<lastBuildDate>Fri, 03 Feb 2012 04:15:48 +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>JavaScript Closures</title>
		<link>http://www.bwigg.com/2011/12/javascript-closures/</link>
		<comments>http://www.bwigg.com/2011/12/javascript-closures/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 01:12:19 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/?p=289</guid>
		<description><![CDATA[Javascript closures can be confusing at first. They're not, and hopefully this analogy will help drive home the concept. A Man's Secret - An Analogy A man possess a secret book, which he cannot let anyone else know about. He decides the only way to keep the book truly secret is to memorize the entire [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript closures can be confusing at first. They're not, and hopefully this analogy will help drive home the concept.</p>
<p><strong>A Man's Secret - An Analogy</strong></p>
<p>A man possess a secret book, which he cannot let anyone else know about. He decides the only way to keep the book truly secret is to memorize the entire thing and then bury the book so no one can find it. Later in his years he bears a son. Once his son grows old enough, the father digs up the book and begins having his son commit the entire book to memory. Years later, he has his son rewrite the entire book cover to cover from memory on paper. When the son successfully completes the task, and the father is satisfied that his son truly has the book memorized in it's entirety, the book and the copy of the book the son just wrote are thrown into a fire, completely eliminating any evidence that the book actually existed. A few years later the father dies, leaving the son on his own, with the book committed to memory.</p>
<p>This is similiar to how a javascript closure works. See the following code.</p>
<p><strong>Code Example</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> father <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// this is declared as a private variable</span>
    <span style="color: #003366; font-weight: bold;">var</span> secretBook <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Book of Secrets'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">bearSon</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
            whatWasTheBookYourFatherTaughtYou<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>secretBook<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// the father won't tell anyone about the book he has</span>
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>father.<span style="color: #660066;">secretBook</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// undefined</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// the father bears a son</span>
son <span style="color: #339933;">=</span> father.<span style="color: #660066;">bearSon</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// the father dies</span>
father <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// the son still knows the book his father taught him</span>
son.<span style="color: #660066;">whatWasTheBookYourFatherTaughtYou</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Book of Secrets</span></pre></div></div>

<p>secretBook was declared inside the father function and is a private variable, inaccessible to anything outside the father function. The father function <em>closes </em>around the variables declared inside of it. Anything defined inside the father function has access to it, even once the father function has executed and been undefined. The bearSon method returns a new object that contains a function called whatWasTheBookYourFatherTaughtYou.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2011/12/javascript-closures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strange Rendering of Fonts in Firefox 3</title>
		<link>http://www.bwigg.com/2008/06/strange-rendering-of-fonts-in-firefox-3/</link>
		<comments>http://www.bwigg.com/2008/06/strange-rendering-of-fonts-in-firefox-3/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 03:40:18 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/?p=20</guid>
		<description><![CDATA[Firefox 3 was having some font rendering issues on my machine. Certain web sites were displaying a wierd bold looking font in place of the default font described in the CSS. See this screenshot. After doing some searching around the internet I found out the issue. Early in the year I had installed Adobe Type [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox 3 was having some font rendering issues on my machine. Certain web sites were displaying a wierd bold looking font in place of the default font described in the CSS. <a href="http://www.bwigg.com/screenies/firefox_fonts.png" target="_blank">See this screenshot</a>. After doing some searching around the internet I found out the issue.</p>
<p>Early in the year I had installed Adobe Type Manager and added a bunch of Helvetica Postscript Type-1 fonts. These were for some reason being used as Firefox's default font. Removing them from the system fixed the issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2008/06/strange-rendering-of-fonts-in-firefox-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learning a New Language</title>
		<link>http://www.bwigg.com/2008/01/learning-a-new-language/</link>
		<comments>http://www.bwigg.com/2008/01/learning-a-new-language/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 20:10:53 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/wordpress/?p=6</guid>
		<description><![CDATA[Larry O'Brien over at knowing.net has a great series called 15 Exercises to Know a Programming Language, It's an older article but after going through parts 1-3, theres really nothing in there that changes often enough to warrant any kind of an update. Part 1 gets you used to using some of the more basic [...]]]></description>
			<content:encoded><![CDATA[<p>Larry O'Brien over at <a title="Knowing.net" href="http://www.knowing.net" target="_blank">knowing.net</a> has a great series called <a title="15 Exercises for Learning a New Programming Language" href="http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-1/" target="_blank">15 Exercises to Know a Programming Language</a>, It's an older article but after going through parts 1-3, theres really nothing in there that changes often enough to warrant any kind of an update.</p>
<ul>
<li><a title="Part 1" href="http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-1/">Part 1</a> gets you used to using some of the more basic features of a language including, calculations, the standard libraries,  file i/o, GUI development, and debugging.</li>
<li><a title="Part 2" href="http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-2-data-structures/">Part 2</a> introduces some more advanced data structures, object oriented programming,  idioms, memory issues, design patterns, and concurrency.</li>
<li><a title="Part 3" href="http://www.knowing.net/index.php/2006/06/16/15-exercises-to-know-a-programming-language-part-3-libraries-frameworks-and-mashups/" target="_blank">Part 3</a> presents web interaction, libraries, encryption, and databases.</li>
</ul>
<p>There's obviously a lot to learn when starting to cover a new language. Larry's posted some great ideas for getting used to a new language, and once you accomplish all these, you go from playing with the language to knowing the language.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2008/01/learning-a-new-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux w/ Mac Scrolling</title>
		<link>http://www.bwigg.com/2007/08/linux-w-mac-scrolling/</link>
		<comments>http://www.bwigg.com/2007/08/linux-w-mac-scrolling/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 05:38:06 +0000</pubDate>
		<dc:creator>bawigga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bwigg.com/wordpress/?p=4</guid>
		<description><![CDATA[Is it possible to make it so that I laptop running synaptic drivers can make it so that you can scroll pages with two fingers on the pad? Update: Thanks to okke in the comments, all you have to do is add a line to your xorg.conf file to enable 2 finger scrolling. There's a [...]]]></description>
			<content:encoded><![CDATA[<p>Is it possible to make it so that I laptop running synaptic drivers can make it so that you can scroll pages with two fingers on the pad?</p>
<p><strong>Update:</strong> Thanks to okke in the comments, all you have to do is add a line to your xorg.conf file to enable 2 finger scrolling. There's a <a href="http://gentoo-wiki.com/HARDWARE_Synaptics_Touchpad" title="Synaptic 2 Finger Scrolling">wiki entry</a> on the Gentoo Wiki about doing so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bwigg.com/2007/08/linux-w-mac-scrolling/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

