<?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 } &#187; .NET</title>
	<atom:link href="http://codeimpossible.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeimpossible.com</link>
	<description>this = HowI.Roll();</description>
	<lastBuildDate>Thu, 29 Jul 2010 02:58:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Migrating Asp.net MVC Projects from MVC 1.0 to 2.0</title>
		<link>http://codeimpossible.com/2010/04/06/migrating-asp-net-mvc-projects-from-mvc-1-0-to-2-0/</link>
		<comments>http://codeimpossible.com/2010/04/06/migrating-asp-net-mvc-projects-from-mvc-1-0-to-2-0/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 06:35:35 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://codeimpossible.com/?p=837</guid>
		<description><![CDATA[The Asp.net Mvc 2.0 RTM came out last month and a lot of people are converting their projects over. If you&#8217;re just starting to manually move your projects over then stop what you are doing, download and run the Mvc Converter. It will save you eons of time and frustration.
If you are like me, however, [...]]]></description>
			<content:encoded><![CDATA[<p>The<a href="http://haacked.com/archive/2010/03/11/aspnet-mvc2-released.aspx" target="_blank"> Asp.net Mvc 2.0 RTM came out last month</a> and a lot of people are converting their projects over. If you&#8217;re just starting to manually move your projects over then stop what you are doing, <a href="http://weblogs.asp.net/leftslipper/archive/2010/03/10/migrating-asp-net-mvc-1-0-applications-to-asp-net-mvc-2-rtm.aspx" target="_blank">download and run the Mvc Converter</a>. It will save you eons of time and frustration.</p>
<p>If you are like me, however, and started porting your project over manually and are now knee deep in WTFBBQ sauce then follow the steps below and your project should be up and running in no time.</p>
<p>1. Back up your project. Just in case.</p>
<p>2. Open your project file(s) inside your favorite text editor (one with a decent find/replace system). Open the Find &amp; Replace dialog and find <code>"603c0e0b-db56-11dc-be95-000d561079b0"</code>, replacing it with <code>"F85E285D-A4E0-4152-9332-AB1D724D3325"</code>. My project turned up 1 result.</p>
<p>3. Open the Web.Config files in the root of the project and the root of the /Views folder. Open the Find &amp; Replace dialog again, this time searching for <code>"System.Web.Mvc, Version=1.0.0.0"</code> and replacing it with <code>"System.Web.Mvc, Version=2.0.0.0"</code>.</p>
<p>4. Add the following BindingRedirect to the bottom of the root Web.Config, just before the &lt;/Configuration&gt; node.</p>
<pre class="prettyprint"><code>
&lt;runtime&gt;
  &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/&gt;
      &lt;bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/&gt;
    &lt;/dependentAssembly&gt;
  &lt;/assemblyBinding&gt;
&lt;/runtime&gt;
</code></pre>
<p>5. Open the solution in Visual Studio and replace the references to System.Web.Mvc 1.0 with the 2.0 assembly.<br />
6. Finally, and only if you really need them, open a new MVC 2.0 project and copy all the files in the /Scripts folder to your project. </p>
<p>Enjoy your freshly migrated project!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2010/04/06/migrating-asp-net-mvc-projects-from-mvc-1-0-to-2-0/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>Jquery + MVC = Web Dev Heaven</title>
		<link>http://codeimpossible.com/2008/10/02/jquery_plus_mvc_equals_web_dev_heaven/</link>
		<comments>http://codeimpossible.com/2008/10/02/jquery_plus_mvc_equals_web_dev_heaven/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 02:43:35 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pistalwhipped.wordpress.com/?p=216</guid>
		<description><![CDATA[So Jquery is going to become part of Asp.net MVC. First off, congrats to the Jquery team. They&#8217;ve put out a really awesome product. Second, congrats to Microsoft for catching every .Net developer completely by surprise, proving, again, that they are listening to the community.
I never really got into the microsoft javascript libraries that shipped [...]]]></description>
			<content:encoded><![CDATA[<p>So <a href="http://www.hanselman.com/blog/jQueryToShipWithASPNETMVCAndVisualStudio.aspx" target="_blank">Jquery is going to become part of Asp.net MVC</a>. First off, congrats to <a href="http://jquery.com/" target="_blank">the Jquery team</a>. They&#8217;ve put out a really awesome product. Second, congrats to Microsoft for catching every .Net developer completely by surprise, proving, again, that they are listening to the community.</p>
<p>I never really got into the microsoft javascript libraries that shipped with the ajax control toolkit because I found that I could do things much faster using external javascript libraries .</p>
<p>It will be interesting to see what Microsoft contributes back to the Jquery community in later updates to the ASP MVC product.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2008/10/02/jquery_plus_mvc_equals_web_dev_heaven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prototype to C#: Try.These()</title>
		<link>http://codeimpossible.com/2008/10/01/prototype-to-c-trythese/</link>
		<comments>http://codeimpossible.com/2008/10/01/prototype-to-c-trythese/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 05:55:25 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[try.these()]]></category>
		<category><![CDATA[try/catch]]></category>

		<guid isPermaLink="false">http://pistalwhipped.wordpress.com/?p=209</guid>
		<description><![CDATA[The prototype javascript library has a class (Try) and function called these(). This function accepts an array of functions as it&#8217;s sole argument and it will execute each function in the array, in the order they are added, and return the result from the first function that executes without error. If none of the functions [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.prototypejs.org" target="_blank">prototype javascript library</a> has a class (Try) and function called these(). This function accepts an array of functions as it&#8217;s sole argument and it will execute each function in the array, in the order they are added, and return the result from the first function that executes without error. If none of the functions executes successfully undefined is returned.</p>
<p>For example:</p>
<pre><code class="prettyprint">
var i = Try.These(
    function() { return 9 / 0; },
    function() { return 1; }
);
</code></pre>
<p>If we ran the sample above i would equal 1 because the first function would encounter a division by zero error. However:</p>
<pre><code class="prettyprint">
var h = 0;
var i = Try.These(
    function() { return 9 / h; },
    function() { return 1 / h; }
);
</code></pre>
<p>i will equal undefined in this example.</p>
<p>With the .Net framework&#8217;s generics library we can achieve roughly the same results. We won&#8217;t be able to assign an undefined value to the result but we can play around with the default keyword. :D</p>
<pre><code class="prettyprint">
public class Try
{
    public static T These(params Func[] delegates)
    {
        for (int i = 0; i &lt;= delegates.Length - 1; i++)
        {
            try
            {
                return (T)delegates[i]();
            }
            catch
            {

            }
        }
        return default(T);
    }
}
</code></pre>
<p>So for example:</p>
<pre><code class="prettyprint">
static void Main(string[] args)
{
    int i = 0;
    int y = Try.These(
        delegate() {
            int x = 0;
            return i / x;
        },

        delegate() {
            return ++i;
    });

    Console.Write("y is " + y.ToString());
}
</code></pre>
<p>Will output</p>
<p><code>y is 0</code></p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2008/10/01/prototype-to-c-trythese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enumerate windows users&#039; groups</title>
		<link>http://codeimpossible.com/2008/04/08/enumerate-windows-users-groups/</link>
		<comments>http://codeimpossible.com/2008/04/08/enumerate-windows-users-groups/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 20:49:03 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pistalwhipped.wordpress.com/?p=142</guid>
		<description><![CDATA[The code below will enumerate which groups a domain /  local user belongs to.
[sourcecode language="csharp"]
private static string GetUserGroups(string strUser)
{
    string groups = &#8220;&#8221;;
    DirectoryEntry de = null;
    try
    {
        string entryName = String.Format(&#8220;WinNT://{0},user&#8221;,
   [...]]]></description>
			<content:encoded><![CDATA[<p>The code below will enumerate which groups a domain /  local user belongs to.</p>
<p>[sourcecode language="csharp"]</p>
<p>private static string GetUserGroups(string strUser)<br />
{<br />
    string groups = &#8220;&#8221;;<br />
    DirectoryEntry de = null;<br />
    try<br />
    {</p>
<p>        string entryName = String.Format(&#8220;WinNT://{0},user&#8221;,<br />
            strUser.Replace(&#8220;\\&#8221;, &#8220;/&#8221;));</p>
<p>        de = new DirectoryEntry(entryName);</p>
<p>        object oGroups = de.Invoke(&#8220;Groups&#8221;);<br />
        foreach (object o in (IEnumerable)oGroups)<br />
        {<br />
            DirectoryEntry group =<br />
                new DirectoryEntry(oGroups);<br />
            groups += group.Name + &#8220;,&#8221;;<br />
        }<br />
    }<br />
    catch (Exception)<br />
    {<br />
        throw;<br />
    }<br />
    return groups;<br />
}</p>
<p>[/sourcecode]</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2008/04/08/enumerate-windows-users-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Extension Methods</title>
		<link>http://codeimpossible.com/2008/03/20/c-extension-methods/</link>
		<comments>http://codeimpossible.com/2008/03/20/c-extension-methods/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 20:57:10 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://pistalwhipped.wordpress.com/?p=115</guid>
		<description><![CDATA[So over the last few days I&#8217;ve been screwing around with C# extension methods in Visual C# 2008 Express and I have to say they are fast becoming my favorite addition to the .NET framework. What started me on extensions was the fact that in Perl you can do the following with string manipulation:

[sourcecode language="python"]
#!/usr/bin/perl
# [...]]]></description>
			<content:encoded><![CDATA[<p>So over the last few days I&#8217;ve been screwing around with C# extension methods in Visual C# 2008 Express and I have to say they are fast becoming my favorite addition to the .NET framework. What started me on extensions was the fact that in Perl you can do the following with string manipulation:</p>
<p><span id="more-115"></span></p>
<p>[sourcecode language="python"]<br />
#!/usr/bin/perl<br />
# set a string variable<br />
$var= &#8220;=&#8221;;<br />
# repeat it<br />
print($var x 7);<br />
[/sourcecode]</p>
<p>&#8212;&#8212;&#8212; output &#8212;&#8212;&#8212;<br />
=======</p>
<p>Which is a relatively easy syntax compared to what you would have to do in C#. I was able to replicate this feature of Perl easily with the following code in C#:</p>
<p>[sourcecode language="csharp"]<br />
public static class StringExt<br />
{<br />
    public static string Replicate(this string s, int times)<br />
    {<br />
        string hold = s;<br />
        for (int i = 1; i <= times &#8211; 1; i++)<br />
        {<br />
            hold += s;<br />
        }</p>
<p>        return hold;<br />
    }<br />
}</p>
<p>//replicate a string a number of times</p>
<p>Console.WriteLine( &#8220;=&#8221;.Replicate(7) );[/sourcecode]</p>
<p>&#8212;&#8212;&#8212; output &#8212;&#8212;&#8212;<br />
=======</p>
<p>Not bad!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2008/03/20/c-extension-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>runat=&#8221;server&#8221; why??? Why!?!</title>
		<link>http://codeimpossible.com/2007/12/26/runatserver-why-why/</link>
		<comments>http://codeimpossible.com/2007/12/26/runatserver-why-why/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 05:27:37 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.pistalwhipped.net/bl/og/2007/12/26/runatserver-why-why/</guid>
		<description><![CDATA[
I know I&#8217;m not the first .net programmer to ask this question and I don&#8217;t think I&#8217;ll be the last. Why, oh why must we constantly include the runat=&#8221;server&#8221; attribute in our custom and pre-compiled web control declarations? To me it seems like this is unnecessary bloat that could be re-tooled to save developers more [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img src="http://www.pistalwhipped.net/up/loads/2007/12/frustration2-thumb.jpg" alt="copyright (c) www.esl-lesson-plan.com 2007" height="287" width="354" /></p>
<p>I know I&#8217;m not the first .net programmer to ask this question and I don&#8217;t think I&#8217;ll be the last. Why, oh why must we constantly include the runat=&#8221;server&#8221; attribute in our custom and pre-compiled web control declarations? To me it seems like this is unnecessary bloat that could be re-tooled to save developers more time and reduce headaches caused by forgetting it&#8217;s inclusion.<span id="more-82"></span></p>
<p>I&#8217;m not asking for the runat=&#8221;server&#8221; attribute to be removed. Not at all. I&#8217;m just stating that I think it was implemented in an inconvenient way and should be re-thought and re-designed. A blogger named <a href="http://www.mikeschinkel.com/" target="_blank">Mike Schinkel</a> posed <a href="http://www.mikeschinkel.com/blog/whyrunatserverforaspnet/" target="_blank">the same question</a> and a commenter replied:</p>
<blockquote><p>I understand your point, but the importance of [runat="server"] is more for consistency and extensibility. If the developer has to mark some tags some ways (ie an &#8220;asp:&#8221; prefix) and in other cases using runat, then it creates more confusion. Also, this simplifies what is sent directly to the user agent as a Response.Write and what needs to be parsed by the ASP.NET engine. What if some user agent of the future has a name collision with one of the ASP.NET tags, it would be difficult otherwise to tell ASP.NET to ignore a tag.</p></blockquote>
<p><strong>&#8220;..is more for consistency and extensibility.&#8221;</strong></p>
<blockquote><p>&#8220;Consistency is the last refuge of the unimaginative.&#8221;<br />
- Oscar Wilde</p></blockquote>
<p>I&#8217;m not sure why this person chose to argue consistency as one of his main points but it&#8217;s a poor choice. He may as well have just said &#8220;it is just done this way&#8221;. The runat attribute is required on all custom, pre-compiled or otherwise included web controls so why must it be specifically declared? Think about it in programming terms. If you have a literal string or integer littered throughout a class or function how likely would it be for you to replace that with a declared variable? I would do it 99% of the time.</p>
<p><strong>&#8220;&#8230;this simplifies what&#8230;needs to be parsed by the ASP.NET engine.&#8221;</strong></p>
<p>Okay, apparently they (Microsoft) have never heard of Regular Expressions? Why must we specifically tell the ASP.NET engine which controls are server controls when the work is already done via the Page\Controls section of the web.Config when we include a control library? This seems overly redundant to me and reeks of poor implementation. The runat=&#8221;server&#8221; attribute is more like a legacy feature from 1.0 that for one reason or another (probably it&#8217;s deep integration with the compiler and rendering engine) has not been removed yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2007/12/26/runatserver-why-why/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Weekend reading</title>
		<link>http://codeimpossible.com/2007/09/01/weekend-reading/</link>
		<comments>http://codeimpossible.com/2007/09/01/weekend-reading/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 02:02:13 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pistalwhipped.net/bl/og/2007/09/01/weekend-reading/</guid>
		<description><![CDATA[On the way out the door on friday my boss handed me two copies of &#8220;CoDe Magazine&#8221; for me to look at because they had sent him too many copies. I briefly glanced at the covers and saw some interesting things. The very first thing I noticed was that one issue had, on the cover, [...]]]></description>
			<content:encoded><![CDATA[<p>On the way out the door on friday my boss handed me two copies of &#8220;CoDe Magazine&#8221; for me to look at because they had sent him too many copies. I briefly glanced at the covers and saw some interesting things. The very first thing I noticed was that one issue had, on the cover, an image of the Master Chief from Halo3 with &#8220;XNA: Ready for Prime Time?&#8221; in a huge, bold font. The other front page bullets for that issue indicated that the issue focused intensely on XNA and game development. The second thing I noticed was that the other issue included a &#8220;13-step Crash Course for Using LINQ&#8221;.</p>
<p>I tried desperately to hide the drool that had started to form at the corners of my mouth as I said &#8220;Sure, I think these might be alright&#8221;. So I stuffed them into my backpack like a theif with a fist full of unmarked bills and headed home. I just got done reading both issues and enjoyed their content, albeit one more than the other, so much that I felt compelled to note it here.</p>
<p>I figure I would go over them in order of their publication (one covers July/August, the other September/October).</p>
<p>July / August (vol. 8, issue 4)<br />
Sadly this is the issue that I was least impressed with. Not because it was a &#8220;horrible&#8221; publication. it just didn&#8217;t cover as many topics that interested me as the other issue. In fact it only covered one. Linq. Linq is Microsofts&#8217; latest &#8220;wow&#8221; feature for .NET 3.5 (codename: &#8220;Orcas&#8221;) and is quite possibly the coolest god damned thing I have ever seen but since this is just a review of a magazine I&#8217;ll save my fanfare for LINQ for another day. The article, for those interested can be found <a href="http://www.code-magazine.com/Article.aspx?quickid=0707051" target="_blank">here</a>.</p>
<p>September / October (vol. 8, issue 5)<br />
This issue had a lot to offer that interested me. There was a great write-up featuring <a href="http://www.code-magazine.com/Article.aspx?quickid=0709031" target="_blank">productivity tips SQL 2005</a> which I think every developer should read. Items of note: Pivot, Output Into, CTEs and Recursive Queries. Really, really cool stuff.</p>
<p>The next part was all about Microsofts&#8217; XNA game development framework. There were two great articles covering XNA &#8220;<a href="http://www.code-magazine.com/Article.aspx?quickid=0709041" target="_blank">XNA: Ready for Prime Time?</a>&#8221; and &#8220;<a href="http://www.code-magazine.com/Article.aspx?quickid=0709051" target="_blank">Introducing XNA Game Studio Express</a>&#8221; both worth reading if you have any interest in game design and programming or if you just want to get a really good grasp on why there is so much resistance to managed code frameworks.</p>
<p>There was also a great article covering <a href="http://www.code-magazine.com/Article.aspx?quickid=0709101" target="_blank">Lambda Expressions</a> which are another great upcoming feature in .NET 3.5.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2007/09/01/weekend-reading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide system tray in C#</title>
		<link>http://codeimpossible.com/2007/06/26/hide-system-tray-in-c/</link>
		<comments>http://codeimpossible.com/2007/06/26/hide-system-tray-in-c/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 17:29:20 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pistalwhipped.net/bl/og/2007/06/26/hide-system-tray-in-c/</guid>
		<description><![CDATA[In most of our customer-oriented kiosk applications it is necessary to hide the system task bar so that in case of a crash the end user won&#8217;t be able to muck around with the computer. Yes, we restrict the user&#8217;s account via registry edits but the task is still available to them if the application [...]]]></description>
			<content:encoded><![CDATA[<p>In most of our customer-oriented kiosk applications it is necessary to hide the system task bar so that in case of a crash the end user won&#8217;t be able to muck around with the computer. Yes, we restrict the user&#8217;s account via registry edits but the task is still available to them if the application exits.<span id="more-23"></span></p>
<p>Or is it?</p>
<p>Enter our nifty little code solution:</p>
<pre>using System;
using System.Runtime.InteropServices;
class TaskBarController
{
    [DllImport("user32.dll")]
    private static extern int FindWindow(string className,
    string windowText);

    [DllImport("user32.dll")]
    private static extern int ShowWindow(int hwnd, int command);

    public static void HideTaskbar()
    {
        int hwnd = FindWindow("Shell_TrayWnd","");
        ShowWindow( hwnd, 0 );
    }
    public static void ShowTaskbar()
    {
        int hwnd = FindWindow("Shell_TrayWnd","");
        ShowWindow( hwnd, 5 );
    }
}</pre>
<p>And there you have it. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2007/06/26/hide-system-tray-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;That&#8221; Keyword</title>
		<link>http://codeimpossible.com/2007/06/18/that-keyword/</link>
		<comments>http://codeimpossible.com/2007/06/18/that-keyword/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 13:06:13 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pistalwhipped.net/bl/og/2007/06/18/that-keyword/</guid>
		<description><![CDATA[Brian Keller posed a question to the readers of his blog asking what we thought, if there were such a thing, the &#8220;that&#8221; keyword should do in C#. What a fantastic idea! My suggestion &#8211; the that keyword would be used to allow access to inherited classes from the base class. IE:

public class MyBase
{
  [...]]]></description>
			<content:encoded><![CDATA[<p>Brian Keller <a href="http://blogs.msdn.com/briankel/archive/2004/09/23/233212.aspx" target="_blank">posed a question</a> to the readers of his blog asking what we thought, if there were such a thing, the &#8220;that&#8221; keyword should do in C#. What a fantastic idea! My suggestion &#8211; the that keyword would be used to allow access to inherited classes from the base class. <span id="more-19"></span>IE:</p>
<pre>
public class MyBase
{
    public MyBase()
    {
 	//only call CallToMethod() in a specific class
 	if( typeof(that).ToString().Equals("MyChild") )
 		that.CallToMethod();
    }
}

public class MyChild : MyBase
{
    public void CallToMethod()
    {
        // more code goes here...
    }
}</pre>
<p>Yeah I know it&#8217;s really dangerous and would definitely have some overhead associated with it but the functionality would be awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://codeimpossible.com/2007/06/18/that-keyword/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
