<?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>Code: Impossible</title>
	<atom:link href="http://codeimpossible.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeimpossible.com</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 15:06:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Lessons Learned</title>
		<link>http://codeimpossible.com/2010/03/10/lessons-learned/</link>
		<comments>http://codeimpossible.com/2010/03/10/lessons-learned/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:06:26 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[my-mistakes-let-me-show-you-them]]></category>
		<category><![CDATA[oh-crap]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=812</guid>
		<description><![CDATA[lessons learned this morning:
a) Even if it&#8217;s simple code you &#8220;know&#8221; will work you must test it. No excuses.
b) In programming, nothing happens by &#8220;magic&#8221;. There is a tangible reason that that thing that should be working isn&#8217;t.
c) Don&#8217;t assume something couldn&#8217;t be true simply because it doesn&#8217;t make any sense.
]]></description>
			<content:encoded><![CDATA[<p>lessons learned this morning:<br />
a) Even if it&#8217;s simple code you &#8220;know&#8221; will work you <strong>must</strong> test it. No excuses.<br />
b) In programming, nothing happens by &#8220;magic&#8221;. There is a tangible reason that that thing that should be working isn&#8217;t.<br />
c) Don&#8217;t assume something couldn&#8217;t be true simply because it doesn&#8217;t make any sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2010/03/10/lessons-learned/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>W.O.M.M. #6 &#8211; enumerateOver()</title>
		<link>http://codeimpossible.com/2010/03/07/w-o-m-m6-enumerateover/</link>
		<comments>http://codeimpossible.com/2010/03/07/w-o-m-m6-enumerateover/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 04:17:52 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jsoq]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=478</guid>
		<description><![CDATA[
I&#8217;ve been focusing more and more on  my port of Ling-to-Objects, Jsoq the past few weeks. It&#8217;s still in really early stages and I&#8217;m not quite sure about it&#8217;s actual usefulness but I&#8217;m learning a lot about JavaScript and having a ton of fun along the way!
Jsoq deals with arrays a lot. About 95% [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="works-on-my-machine-starburst" src="http://codeimpossible.com/wp-content/uploads/2009/06/works-on-my-machine-starburst.jpg" alt="works-on-my-machine-starburst" /></p>
<p>I&#8217;ve been focusing more and more on <a href="http://bitbucket.org/codeimpossible/jsoq"> my port of Ling-to-Objects, Jsoq</a> the past few weeks. It&#8217;s still in really early stages and I&#8217;m not quite sure about it&#8217;s actual usefulness but I&#8217;m learning a lot about JavaScript and having a ton of fun along the way!</p>
<p>Jsoq deals with arrays a lot. About 95% of it&#8217;s use cases involve either looping through, altering, or creating arrays. Having a ton of <code>for</code> loops in my code just seems so&#8230; not right. For loops have always seemed dirty to me. They just aren&#8217;t elegant enough. </p>
<p>Here is your normal, average, everyday <code>for</code> loop in Javascript.</p>
<pre class="prettyprint"><code>
var array = "1,2,3,4,5,6,7,8,9,10".split(',');

for(var i = -1, l = array.length; ++i &lt; l;) {
    alert(array[i]);
}
</code></pre>
<p>This works. It&#8217;s reliable and gets the message across. But what if we needed to loop over an array and get all the items that matched a condition? Using a <code>for</code> loop the code could look something like:</p>
<pre class="prettyprint"><code>
var array = [ 1, 2, 3, 4, 5, 1, 2, 3, 4 ];
var results = [];
var condition = function(i) { return i%2 == 0; };

for(var itt = -1, len = array.length; ++itt &lt; len;) {
	if( condition(array[itt]) ) {
		results.push(array[itt]);
	}
}
</code></pre>
<p>This does work, I&#8217;ve written code like this many times before, and while <em>technically</em> there isn&#8217;t anything wrong with it I think there is still room for improvement.</p>
<p>Jsoq is going to be handling arrays all over the place so the solution to this problem <em>needs</em> to be simple.</p>
<p>Here&#8217;s what I need:</p>
<ul>
<li>to loop over an entire collection and perform an action on each item.</li>
<li>If that action produces a result, the item is to be pushed into an array and returned to after the loop is done</li>
<p>.</p>
<li>Also: it needs to be readable, someone else coming along should be able to determine what this thing is doing without too much difficulty. So I had my work cut out for me. </li>
</ul>
<p>A few hours later I had a decent function that I could use to replace a lot of the <code>for</code> loops I had. After some more refactoring I was able to wipe them all out and replace them with calls to <code>enumerateOver()</code>. Here is the latest version from source control:</p>
<pre class="prettyprint"><code>
function enumerateOver(collection, work) {
	var result = [], val = [];

	if (isArray(collection)) {
		try {
			for (var i = -1, l = collection.length; ++i < l;) {
				result = work(collection[i], i);
				if (typeof result !== "undefined" &#038;&#038; result != null) {
					val.push(result);
				}
			}
		}catch (e) {
			if (e != jsoq.$break) throw(e);
		}

		if (val.length > 0) {
			return val;
		}
	}else {
		try {
			val = work(collection, 0);
		}
		catch (e) {
			if (e != jsoq.$break) throw(e);
		}
		if (typeof val !== 'undefined') {
			return val;
		}
	}
	return result == null ? [] : result;
}
</code></pre>
<p>And here is the code to replace the <code>for</code> loops above, re-written to use <code>enumerateOver()</code></p>
<pre class="prettyprint"><code>
var results2 = enumerateOver(array, function(i, c) {
     return i%2 == 0;
});
</code></pre>
<p>So by implmenting this function I was able to come up with a more readable, testable and streamlined codebase. Is this suitable for everyone? Definitely not, but I did it for a few reasons:</p>
<ol>
<li>Like I mentioned before. I&#8217;ve never been at ease with <code>for</code> loops and being able to replace them all with calls to a single function was a huge win for me</li>
<li>The normal use-case didn&#8217;t fit right. I needed to not only iterate over arrays but also return the results of work performed on those items. Doing this the &#8220;regular&#8221; way just wouldn&#8217;t work (see previous reason)</li>
<li>I thought this was a fun problem to solve</li>
</ol>
<p>If you have any feedback, good, bad, or indifferent add a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2010/03/07/w-o-m-m6-enumerateover/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using jQuery on an Iframe</title>
		<link>http://codeimpossible.com/2010/03/04/using-jquery-on-an-iframe/</link>
		<comments>http://codeimpossible.com/2010/03/04/using-jquery-on-an-iframe/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 01:10:39 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery-extensions]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=803</guid>
		<description><![CDATA[The other day I had to alter the stylesheets in a child IFrame when a user selected an item from a drop-down. My first draft was pretty ugly, it ivolved getting the DOM from the child IFrame (by getting it&#8217;s contentWindow or contentDocument property) then getting the  of the DOM and looping over all [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I had to alter the stylesheets in a child IFrame when a user selected an item from a drop-down. My first draft was pretty ugly, it ivolved getting the DOM from the child IFrame (by getting it&#8217;s <a href="http://www-archive.mozilla.org/docs/dom/domref/dom_frame_ref5.html">contentWindow</a> or <a href="http://www-archive.mozilla.org/docs/dom/domref/dom_frame_ref4.html">contentDocument</a> property) then getting the <head> of the DOM and looping over all the child items&#8230; yuck!</p>
<p>I coded up this jQuery extension method which will return a jQuery-wrapped DOM instance for any of the matched IFrames.</p>
<pre class="prettyprint"><code>
(function($) {
    $.fn.extend({
        dom: function () {
            var $this = $(this);
            var getDom = function(o) {
                if( !o || (!o.contentWindow &#038;&#038; !o.contentDocument) ) {
                    return null;
                }

                var doc = (o.contentWindow || o.contentDocument);

                return doc.document || doc;
            };

            var dom = getDom($this[0]);

            return dom === null ? $this : $(dom);
        }
    });
})(jQuery);
</code></pre>
<p>So with this, getting the styles for a child IFrame is as easy as:</p>
<pre class="prettyprint"><code>
$('iframe').dom().find('head link').each(function(index, item) {
    alert(item.href);
});
</code></pre>
<p><em>Unfortunately, this code will only work if your IFrame is hosting content that is on the same domain as its parent.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2010/03/04/using-jquery-on-an-iframe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving &#8220;$(document).ready is not a function&#8221; and other problems</title>
		<link>http://codeimpossible.com/2010/01/13/solving-document-ready-is-not-a-function-and-other-problems/</link>
		<comments>http://codeimpossible.com/2010/01/13/solving-document-ready-is-not-a-function-and-other-problems/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 01:29:29 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code-style]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=767</guid>
		<description><![CDATA[Has this ever happened to you: you&#8217;ve been working on a customer&#8217;s site, writing some really awesome jQuery flashy, fadey, scrolly, interactivey thing, you deploy it, and everything is awesome. The customer rejoices and the customer&#8217;s customers rejoice. Rejoicing is had by everyone. 
And then you get an email one day:

&#8220;Everything is broken. We&#8217;ve kidnapped [...]]]></description>
			<content:encoded><![CDATA[<p>Has this ever happened to you: you&#8217;ve been working on a customer&#8217;s site, writing some really awesome jQuery flashy, fadey, scrolly, interactivey thing, you deploy it, and everything is awesome. The customer rejoices and the customer&#8217;s customers rejoice. Rejoicing is had by everyone. </p>
<p>And then you get an email one day:</p>
<blockquote><p>
&#8220;Everything is broken. We&#8217;ve kidnapped your dog. Fix our site or you&#8217;ll never see Spartacus again.&#8221;</p></blockquote>
<p>And before you have time to wonder why you ever named your dog &#8220;Spartacus&#8221; to begin with (i mean <strong>come. on.</strong>), you&#8217;re off in debug hell. You load the site and see all sorts of weird errors:</p>
<p><code>“$().ready is not a function”</code></p>
<p><code>“$(document) doesn’t support this property or method”</code></p>
<p>Or my personal favorite: </p>
<p><code>“null is null or not an object”</code></p>
<p>You open up FireFox, activate FireBug, load the console, and type “alert($)”, press run, and instead of seeing the expected jQuery function:</p>
<pre class="prettyprint"><code>
function (E, F) {
    return new (o.fn.init)(E, F);
}
</code></pre>
<p>You instead get:</p>
<pre class="prettyprint"><code>
function $(element) {
    if (arguments.length > 1) {
        for (var i = 0, elements = [], length = arguments.length; i < length; i++) {
            elements.push($(arguments[i]));
        }
        return elements;
    }
    if (Object.isString(element)) {
        element = document.getElementById(element);
    }
    return Element.extend(element);
}
</code></pre>
<p>Or even:</p>
<pre class="prettyprint"><code>
function $(id) {
    return document.getElementById(id);
}
</code></pre>
<p><strong>DOH!</strong> Looks like another javascript library has been loaded and has overwritten the <code>$()</code> shortcut for jQuery. Woe is I. Why can’t we all just get along?!? </p>
<p>Well, we can’t stop people from including their favorite javascript libraries, but what we can do is prevent our code from suffering as a result. We’ll need a nice, big beefy, bodyguard to make sure our code isn’t messed with while it’s out clubbing with Prototype, Scriptaculous or even MooTools (who invited <em>him</em>??!?).</p>
<p>Here’s what our bodyguard function will look like</p>
<pre class="prettyprint"><code>
( function($) {

} ) ( jQuery );
</code></pre>
<p>So what this does is call our anonymous function and pass the <code>jQuery</code> object. This will scope ‘$’ to within our little function so we won’t step on anyone else’s toes (and they won’t bump into us while we’re on the dance floor and spill our drink everywhere). Okay, I think I've taken the clubbing metaphor far enough.</p>
<p>Basically this will allow our code to run and use the <code>$</code> shortcut for JQuery as if it were loaded without any of these other libraries on the page. </p>
<p>Here is what the completed code would look like:</p>
<pre class="prettyprint"><code>
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"&gt;
&lt;/script&gt;

&lt;script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript">
&lt;/script&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js" type="text/javascript">
&lt;/script&gt;

&lt;script type="text/javascript"&gt;
( function($) {
    // we can now rely on $ within the safety of our “bodyguard” function
    $(document).ready( function() { alert("nyah nyah! I’m able to use '$'!!!!");  } );
} ) ( jQuery );

//this will fail
$(document).ready( function() { alert('fail?'); } );
&lt;/script&gt;
</code></pre>
<p>I love using this simple self-calling anonymous function style when working with jQuery because it saves me from typing <code>jQuery()</code>, which really does look a lot more ugly than using the <code>$()</code> shortcut. It also protects my code from any scoping issues and lets the code function normally when <a href="http://docs.jquery.com/Core/jQuery.noConflict">jQuery is put into no conflict mode</a>. </p>
<p>My opinion, if you're doing work in jQuery on sites that you don't control 100%, you should be using this method to protect your code and your clients.</p>
<p><strong>Updated: changed link for jquery to use 1.4.1 at the google CDN (tsk, tsk, tsk I was using the googlecode.com link)</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2010/01/13/solving-document-ready-is-not-a-function-and-other-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>this.year = new Year(); this.year.Resolutions =</title>
		<link>http://codeimpossible.com/2010/01/05/this-year-new-year-this-year-resolutions/</link>
		<comments>http://codeimpossible.com/2010/01/05/this-year-new-year-this-year-resolutions/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 04:04:48 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=763</guid>
		<description><![CDATA[I&#8217;ve spent the last few days going over what I want to accomplish this year, what I think I definitely could do, what might challenge me and what is just this side of impossible. Whenever I&#8217;ve made my resolutions known in the past its always been in a passing conversation with a friend of family [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent the last few days going over what I want to accomplish this year, what I think I definitely could do, what might challenge me and what is just this side of impossible. Whenever I&#8217;ve made my resolutions known in the past its always been in a passing conversation with a friend of family member. I never wrote them down or tried to keep track of them once the conversation was over so this year I decided to post them publicly to give me that extra bit of motivation, and also I&#8217;ll be able to check back here throughout the year and see how I&#8217;m measuring up.</p>
<p>These are in no particular order.</p>
<p><strong>I need to grow more as a professional.</strong> Last year I went to my first conference (MSDEVCON) and it was a total blast. I met a lot of truly awesome and intelligent people and learned a billion things that I didn&#8217;t know before. After that I attended Stack Overflows Dev Days in Boston and it was the same experience all over again. This year My goal is to start attending more conferences/events (as many as I can afford with time and $$$) to grow myself as a professional.</p>
<p><strong>Make more mistakes. </strong>I made my fair share of mistakes in 2009 and (more importantly) I learned a lot from them: about myself, my skills, and what I am capable of. I&#8217;m addicted. I&#8217;m going to put myself more out in the open and make some more mistakes so I can learn a lot more in 2010.</p>
<p><strong>I need to lose at least 25lbs this year.</strong> I&#8217;ve let myself go over the past few years and it&#8217;s time to take my health more seriously. 25lbs probably doesn&#8217;t sound like a lot and honestly it&#8217;s a lot less than I need to lose but I&#8217;ve never been good at staying fit so hopefully I achieve this goal relatively early and am able to keep the weight off the rest of the year.</p>
<p><strong>No more sugary drinks, especially soda.</strong> I&#8217;m looking at you Mt. Dew. I&#8217;m not sure what happened but between the end of the year work rush and the holiday (fr)antics I&#8217;ve been downing soda like it&#8217;s going out of style. Time for that to end.</p>
<p><strong>Eliminate debt.</strong> This goal is a bit lofty but my goal is to eliminate 80% of all my debts this year. This is going to be a tough one to pull off, what with the recent job change and our new house but it&#8217;s needed.</p>
<p><strong>Finish </strong><em><strong>something</strong></em><strong>. </strong>I started <a href="http://code.google.com/p/myrkat" target="_blank">way</a> <a href="http://code.google.com/p/jsoq" target="_blank">too</a> <a href="http://codeimpossible.com/jsoq" target="_blank">many</a> <a href="http://whatdidijusteat.com" target="_blank">side</a> projects last year, and I finished&#8230; none. Not one project I started in 2009 saw what I would call a 1.0 release. Time to crap or get off the pot. I aim to crap. My goal will be to promote at least 2 of the projects I started in 2009 to a 1.0 release this year.</p>
<p><strong>More play.</strong> Tamara and I didn&#8217;t get a vacation last year and we are dying for some time away. This is going to be tough with all my debt elimination going on but the more debt I get rid of the more I can save.</p>
<p><strong>More sleep.</strong> Tamara reminds me all the time how little sleep I get ( about 4-5 hours a night at most ) and it really started to show during the holidays. I simply ran myself into the ground. Time to recharge and see what I can really do.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2010/01/05/this-year-new-year-this-year-resolutions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft .Net Framework Public Classes Data Dump</title>
		<link>http://codeimpossible.com/2009/12/08/microsoft-net-framework-public-classes-data-dump/</link>
		<comments>http://codeimpossible.com/2009/12/08/microsoft-net-framework-public-classes-data-dump/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 06:24:27 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=748</guid>
		<description><![CDATA[I&#8217;ve wrapped up work on v0.4 of the Jsoq Console, and the insanely strenuous release cycle for v0.1 of WhatDidIJustEat.com so I&#8217;m starting another side project tonight.
Ever been working with a programming language you&#8217;re not 100% familiar with and find yourself wondering:
Is this function a built-in function or in some included library?
What assembly is this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve wrapped up work on <a href="http://codeimpossible.com/jsoq">v0.4 of the Jsoq Console</a>, and the insanely strenuous release cycle for v0.1 of <a href="http://whatdidijusteat.com">WhatDidIJustEat.com</a> so I&#8217;m starting another side project tonight.</p>
<p>Ever been working with a programming language you&#8217;re not 100% familiar with and find yourself wondering:</p>
<blockquote><p><em>Is this function a built-in function or in some included library?<br />
What assembly is this class in again?<br />
Can I name my class XXXX without conflicting with another class?<br /></em></p></blockquote>
<p>I&#8217;ve had these questions recently and found myself annoyed and frustrated to no end (PHP, I&#8217;m looking at you) so I&#8217;ve decided to build a system to keep track of this stuff for me :D. </p>
<p>The first thing on my list (because it was the easiest) was to do a data dump of all the public classes in the .Net Framework, including the ones in my GAC, and store some metadata for each one in a database table. I&#8217;ve just finished this step and thought that this data might be useful, so I&#8217;m posting it here. </p>
<p>Currently the fields included in the data dump are:</p>
<p><code><br />
[namespace] = The namespace that the class exists in (ex: System.Collections.Generic)<br />
[class_name] = The name of the class (ex: StringBuilder)<br />
[assembly_fullname] = The display name of the assembly (ex: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)<br />
[assembly_file] = The full file path to the assembly (ex: C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll)<br />
[framework_name] = The framework that uses this class, for this dump they will all be 'Microsoft .Net'<br />
[framework_version] = The framework version that uses this class (ex: v.2.0.50727)<br />
</code></p>
<p>The .sql file takes about 18 seconds to run to completion on my AMD Athlon X2 2.53ghz machine with 4gb of RAM.</p>
<p>If you&#8217;re curious about how I generated the .sql file, below is the code I used to find all the classes. It&#8217;s not pretty but then again it was just meant to get the data into the database. Just paste the code into a new console app and run it in a command window like so:</p>
<p><code> [application_name].exe &gt; c:\classes.sql</code></p>
<p>Or, you can <a href="http://www.box.net/shared/u8vsuy9lz1">download the .sql file I&#8217;ve generated</a> (it will also create the table you need to store the data).</p>
<pre class="prettyprint"><code>
static void Main(string[] args)
{
	var dictionary = new Dictionary<string, string>(){
		{ "v2.0.50727", @"C:\Windows\Microsoft.NET\Framework\v2.0.50727" },
		{ "v3.0", @"C:\Windows\Microsoft.NET\Framework\v3.0" },
		{ "v3.5", @"C:\Windows\Microsoft.NET\Framework\v3.5" },
		{ "v???", @"c:\windows\assembly\gac" }
	};

	var types = new List<Type>();

	foreach (var pair in dictionary)
	{
		var path = pair.Value;

		var assemblies = Directory.GetFiles(path, "*.dll", SearchOption.AllDirectories);

		foreach (string file in assemblies)
		{
			try
			{
				Assembly asm = Assembly.LoadFile(file);

				foreach (Type t in asm.GetTypes())
				{
					if (t.IsPublic)
					{
						Console.WriteLine(String.Format(
							"INSERT INTO Classes (" +
								"[namespace], " +
								"class_name, " +
								"assembly_fullname, " +
								"assembly_file, " +
								"framework_name, " +
								"framework_version" +
							") " +
							"VALUES (" +
								"'{0}', " +
								"'{1}', " +
								"'{2}', " +
								"'{3}', " +
								"'Microsoft .Net', " +
								"'{4}'" +
							")",
							String.IsNullOrEmpty(t.Namespace) ?
								"GLOBAL" :
								t.Namespace,
							t.Name
								.Replace("`1", "<T>")
								.Replace("`2", "<T1,T2>")
								.Replace("`3", "<T1,T2,T3>"),
							t.Assembly.FullName,
							t.Assembly.Location,
							pair.Key == "v???" ?
								t.Assembly.GetName().Version.ToString() :
								pair.Key
						));
					}
				}
			}
			catch { }
		}
	}
}
</code></pre>
<p>If you found this useful, let me know in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2009/12/08/microsoft-net-framework-public-classes-data-dump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google DNS: 30 seconds may save you 10% or more</title>
		<link>http://codeimpossible.com/2009/12/05/google-dns/</link>
		<comments>http://codeimpossible.com/2009/12/05/google-dns/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 06:30:52 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=738</guid>
		<description><![CDATA[Being an uber geek means many things. Late-night code-a-thons just-because, intense debates about zombies vs. pirates vs ninjas (zombies ftw!) or Greedo shooting first, and a desire to have everything running as fast and efficiently as possible. 
If you agree with that last sentiment, and you follow everything Google does then you&#8217;re probably wondering if [...]]]></description>
			<content:encoded><![CDATA[<p>Being an uber geek means many things. Late-night code-a-thons just-because, intense debates about zombies vs. pirates vs ninjas (zombies ftw!) or <a href="http://en.wikipedia.org/wiki/Han_shot_first">Greedo shooting first</a>, and a desire to have everything running as fast and efficiently as possible. </p>
<p>If you agree with that last sentiment, and you follow everything Google does then you&#8217;re probably wondering if Google&#8217;s new <del datetime="2009-12-05T02:57:13+00:00">plans to eventually dominate the entire internet</del> <a href="http://code.google.com/speed/public-dns/">free domain name server lookup service</a> is going to offer you any performance benefits. Well I was wondering the same thing and here is how I determined that it was a good idea to switch.</p>
<ol>
<li><a href="http://swmirror.org/drupal/?q=node/93" target="_blank">Download the DNS Performance Test application</a>, extract the zip archive to a folder on your system and run the executable</li>
<li>The app will start and randomize it&#8217;s list of URLs. After this is done just click start and switch to the Stats tab</li>
<li>I let the app run for ~500 results to get a good sample of data. After you&#8217;re satisfied with the number of results click the stop button and note the &#8220;Average Query Time&#8221;</li>
<li>Follow <a href="http://code.google.com/speed/public-dns/docs/using.html">Googles directions for switching your DNS over</a> and then repeat steps 1-3 above</li>
</ol>
<p>After I did those steps I had an average of 213ms for my ISPs DNS and 190ms for Googles. So in my case Google is definitely faster; a 12% increase in DNS lookup performance. So it looks like I&#8217;ll be switching over. As for you, well, your mileage may vary. </p>
<p>Did you switch to google? Stay with your current provider? Or maybe you went with OpenDNS? Let me know how it worked out for you in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2009/12/05/google-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wolfram Alpha as a nutrition calculator</title>
		<link>http://codeimpossible.com/2009/12/03/wolfram-alpha-nutrition-calc/</link>
		<comments>http://codeimpossible.com/2009/12/03/wolfram-alpha-nutrition-calc/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 04:26:43 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=715</guid>
		<description><![CDATA[Turns out, Wolfram Alpha is really handy if you get curious about how many calories are in the lunch you packed for work. Check it out: 

1 apple + 1 orange
2 slices of pepperoni pizza + 1 orange
1 chocolate chip cookie + 1 ham and cheese sandwich + 20oz diet coke

]]></description>
			<content:encoded><![CDATA[<p>Turns out, <a href="http://www.wolframalpha.com/">Wolfram Alpha</a> is really handy if you get curious about how many calories are in the lunch you packed for work. Check it out: </p>
<ul>
<li><a href="http://www.wolframalpha.com/input/?i=1+apple+%2B+1+orange">1 apple + 1 orange</a></li>
<li><a href="http://www.wolframalpha.com/input/?i=2+slices+of+pepperoni+pizza+%2B+1+orange">2 slices of pepperoni pizza + 1 orange</a></li>
<li><a href="http://www.wolframalpha.com/input/?i=1+chocolate+chip+cookie+%2B+1+ham+and+cheese+sandwich+%2B+20oz+diet+coke">1 chocolate chip cookie + 1 ham and cheese sandwich + 20oz diet coke</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2009/12/03/wolfram-alpha-nutrition-calc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Performance Re-match</title>
		<link>http://codeimpossible.com/2009/12/02/javascript-performance-rematch/</link>
		<comments>http://codeimpossible.com/2009/12/02/javascript-performance-rematch/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 06:07:37 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google-chrome]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=703</guid>
		<description><![CDATA[Back in 2007 Jeff Atwood ran the top 4 web browsers through the SunSpider JavaScript Benchmark and posted his findings. It&#8217;s been close to 2 years since then and I was curious to see how FireFox 3.5, IE8, IE7 (in Compatibility Mode) and Google Chrome 4.0.249.11 would fair. 
So I did pretty much the same [...]]]></description>
			<content:encoded><![CDATA[<p>Back in 2007 <a href="http://codinghorror.com" title="Jeff Atwood's blog">Jeff Atwood</a> ran the top 4 web browsers through the <a href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" title="SunSpider JavaScript Benchmark">SunSpider JavaScript Benchmark</a> and <a href="http://www.codinghorror.com/blog/archives/001023.html" title="The Great Browser JavaScript Showdown">posted his findings</a>. It&#8217;s been close to 2 years since then and I was curious to see how FireFox 3.5, IE8, IE7 (in Compatibility Mode) and Google Chrome 4.0.249.11 would fair. </p>
<p>So I did pretty much the same thing Jeff did and here is what I found:</p>
<p><img src="http://codeimpossible.com/wp-content/uploads/2009/12/JavaScript-Performance.png" alt="JavaScript Performance Graph" title="JavaScript Performance Graph" class="alignnone size-medium wp-image-704" /></p>
<p><small><em>* System specs: Windows 7 64-bit on a Dual-Core 2.53ghz CPU with 4gb of RAM with no browser extensions</em></small></p>
<ol>
<li>Chrome kicks some serious butt over everyone else with <strong>the entire test suite running to completion in under 1 second!!</strong></li>
<li>FireFox 3.5 has some serious improvements coming in at just over 1.5 seconds total, which is about 1/10 the time it took FireFox 2.0</li>
<li>Internet Explorer 8 and Internet Explorer 7 (compat mode) are still bringing up the rear but they had a better showing than the 20+ seconds IE7 took when Jeff ran the test</li>
</ol>
<p><strong>Surprises?</strong><br />
The only thing I found surprising about the results was that if you removed the string test from both IE runs then IE8 in compatibility mode beats IE8 running normally. That doesn&#8217;t seem right to me and I seriously hope JavaScript performance is something that gets addressed in IE9. And by &#8220;addressed&#8221; I mean &#8220;fixed by replacing Trident with WebKit&#8221;.</p>
<p>So, what do these results <em>actually</em> mean? Well I guess it depends. If you use your browser to read blogs and check your gmail then you shouldn&#8217;t really care about these numbers. However, if you&#8217;re a web developer you should be paying strong attention to these numbers and how far they&#8217;ve come in <em>just 2 years</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2009/12/02/javascript-performance-rematch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>W.O.M.M. Project Euler #3</title>
		<link>http://codeimpossible.com/2009/11/25/w-o-m-m-project-euler-3/</link>
		<comments>http://codeimpossible.com/2009/11/25/w-o-m-m-project-euler-3/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 06:25:57 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=666</guid>
		<description><![CDATA[
Here we are with another excellent installment in the &#8220;Works On My Machine&#8221; series where I post some code, some thoughts and hopefully show you something interesting/cool/new. 
Today I&#8217;m going to talk briefly about Project Euler problem #3. Problem 3 asks you to find the largest prime factor of the number 600,851,475,143.
My solution is pretty [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="works-on-my-machine-starburst" src="http://codeimpossible.com/wp-content/uploads/2009/06/works-on-my-machine-starburst.jpg" alt="works-on-my-machine-starburst" /></p>
<p>Here we are with another excellent installment in the &#8220;Works On My Machine&#8221; series where I post some code, some thoughts and hopefully show you something interesting/cool/new. </p>
<p>Today I&#8217;m going to talk briefly about Project Euler problem #3. Problem 3 asks you to find the largest <a href="http://en.wikipedia.org/wiki/Prime_factor">prime factor</a> of the number 600,851,475,143.</p>
<p>My solution is pretty simple but it works:</p>
<div style="clear: both"></div>
<pre class="prettyprint"><code>
var getLargestPrimeFactor = function(num)
{
    var factors = [];
    for ( var f = 2; f < num; f++ )
    {
        if( num%f == 0 )
        {
            factors.push(f);
            num = num /f;
        }
    }
    factors.push(num);
    return factors[factors.length-1];
};

alert( getLargestPrimeFactor(600851475143));
</code></pre>
<p><a href="http://bit.ly/5VxcYK" title="Try this code!" target="_blank">Try this code!</a></p>
<p>You may have noticed that there isn't a check for a factors <del>optimus</del> primeness anywhere in there. </p>
<p>Thats because the <code>getLargestPrimeFactor()</code> function is dividing the number by it's smallest factor, and the smallest factor for any number is always prime so when we run out of factors we've got the largest prime factor. Yeah, that's pretth cool IMO.</p>
<p>I read the discussion threads for problem 3 after I solved it and I was surprised that hardly anyone removed the prime checks from their code. </p>
<p>So, problem 3 is in the bag and I feel pretty good about coming up with the prime check optimization (or lack thereof). A small bit of proof that I know what I'm doing. Sometimes :D</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2009/11/25/w-o-m-m-project-euler-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
