<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Programmers Unlimited</title>
	<atom:link href="http://programmersunlimited.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmersunlimited.wordpress.com</link>
	<description>Knowledge is power</description>
	<lastBuildDate>Fri, 27 Jan 2012 20:10:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='programmersunlimited.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Programmers Unlimited</title>
		<link>http://programmersunlimited.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://programmersunlimited.wordpress.com/osd.xml" title="Programmers Unlimited" />
	<atom:link rel='hub' href='http://programmersunlimited.wordpress.com/?pushpress=hub'/>
		<item>
		<title>PostSharp with projects targeted at x64</title>
		<link>http://programmersunlimited.wordpress.com/2012/01/27/postsharp-with-projects-targeted-at-x64/</link>
		<comments>http://programmersunlimited.wordpress.com/2012/01/27/postsharp-with-projects-targeted-at-x64/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 20:02:35 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=414</guid>
		<description><![CDATA[I’ve been working with a project that processes a large set of data so I’m targeting x64 only. I needed to apply my performance and logging aspects to check execution times of each method but when I went to compile I received a build error from PostSharp “Platform mismatch. You cannot run PostSharp on a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=414&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’ve been working with a project that processes a large set of data so I’m targeting x64 only. I needed to apply my performance and logging aspects to check execution times of each method but when I went to compile I received a build error from PostSharp</p>
<p><em>“Platform mismatch. You cannot run PostSharp on a 64-bit application from a 32-bit operating system.”</em></p>
<p>It was obvious that PostSharp was trying to run it’s post processor in x86 mode because my OS is 64-bit and the project is targeting x64 only. The question was &#8220;how do I tell PostSharp to work in x64 mode?&#8221;. The answer to resolving this issue is pretty easy because the developers at SharpCrafters have come through once again with great tooling for their product. You simply need to go into the project properties and click on the PostSharp tab, then set the “Processor Architecture” to x64. After that, you’re good to go.</p>
<p><a href="http://programmersunlimited.files.wordpress.com/2012/01/ps-tab.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="ps-tab" src="http://programmersunlimited.files.wordpress.com/2012/01/ps-tab_thumb.jpg?w=694&#038;h=403" alt="ps-tab" width="694" height="403" border="0" /></a></p>
<p>What else can you do in here? Well you can also enable/disable PostSharp, enable/disable support for obfuscation and pass in additional properties to PostSharp just to name a few.</p>
<p>If you don’t have the latest version of PostSharp, grab it from <a href="http://www.sharpcrafters.com/postsharp/download">PostSharp 2.1</a> and if you’re new to AOP or PostSharp, have a look at <a href="http://programmersunlimited.wordpress.com/postsharp-principals/">PostSharp Principals</a> to quickly get to speed with PostSharp.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=414&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2012/01/27/postsharp-with-projects-targeted-at-x64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2012/01/ps-tab_thumb.jpg" medium="image">
			<media:title type="html">ps-tab</media:title>
		</media:content>
	</item>
		<item>
		<title>DataTables != Thread Safe</title>
		<link>http://programmersunlimited.wordpress.com/2012/01/26/datatables-thread-safe/</link>
		<comments>http://programmersunlimited.wordpress.com/2012/01/26/datatables-thread-safe/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 19:55:49 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=405</guid>
		<description><![CDATA[The title of this post might seem really silly considering MSDN specifically says they aren’t thread safe, but there’s more to it than that. It says DataTables are not thread safe for WRITE operations which is a major &#8216;”Duh” statement, but in reality they are not safe for some read operations. I’ve been having some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=405&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The title of this post might seem really silly considering MSDN specifically says they aren’t thread safe, but there’s more to it than that. It says DataTables are not thread safe for WRITE operations which is a major &#8216;”Duh” statement, but in reality they are not safe for some read operations. I’ve been having some strange issues with DataRows in parallel loops so I started to investigate.</p>
<p>I saw a post stating that DataTable.Select() is actually a write operation so it isn’t thread safe and requires a lock. I don’t see anything on MSDN about this. So I got to thinking and that’s when I opened up dotPeek. What did I find?</p>
<p>DataTable.NewRow() is not thread safe! The point of this method is to create a new row with the same schema as the table. According to MSDN you have to then add that row to the table&#8217;s DataRowCollection, it is not automatically added to the row collection when calling NewRow(). This, for the most part, is a read operation which would be thread safe. BUT, at one point in the internals, a call to NewRow(int) is made which creates the new record object, then sets that record to a class scoped field before passing it along to a DataRowBuilder. This is where it is no longer thread safe.</p>
<p>I was seeing so many problems because I was using NewRow() in a parallel loop and data was being corrupted at the end. This was why. To combat this, I generated a cache of new rows before the parallel loop, in a ConcurrentBag&lt;DataRow&gt; and then use a TryTake() inside of the loop. No more problems.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/405/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=405&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2012/01/26/datatables-thread-safe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>
	</item>
		<item>
		<title>Change Request Pattern &#8211; Parallelism and non thread safe collections</title>
		<link>http://programmersunlimited.wordpress.com/2012/01/24/change-request-pattern-parallelism-and-non-thread-safe-collections/</link>
		<comments>http://programmersunlimited.wordpress.com/2012/01/24/change-request-pattern-parallelism-and-non-thread-safe-collections/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 22:48:49 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://programmersunlimited.wordpress.com/?p=399</guid>
		<description><![CDATA[My current project makes heavy use of DataTables and parallel processing via the TPL. DataTables are not thread safe and really bite the dust hard when asked to do more than one thing at once. My project breaks up operations that need to be performed on a DataTable into groups that can be executed concurrently. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=399&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My current project makes heavy use of DataTables and parallel processing via the TPL. DataTables are not thread safe and really bite the dust hard when asked to do more than one thing at once.</p>
<p>My project breaks up operations that need to be performed on a DataTable into groups that can be executed concurrently. In total that are about 15 groups each with 2-5 concurrent processes. Each process works with certain columns on a DataRow but still, the DataTable can&#8217;t handle more than one change request at a time or it just has a stroke. It&#8217;s very annoying. I could easily combat this by using POCOs instead of DataTables but it isn&#8217;t an option. So how do I do it? Using what I call the Change Request pattern.</p>
<p>The concept is simple, there are operations reading and making changes to each row in the DataTable. Usually data correction, number crunching, etc. Instead of writing the new value back to the DataColumn, it queues up the change in a thread safe collection using a POCO to describe what has to change. When the operations in the group have finished, the changes are processed one-by-one in a thread safe manner.</p>
<p><pre class="brush: csharp;">
private void DoWork(DataTable table)
{
    var chgcrd = new ChangeCoordinator(table);
   
    Task t1 = Task.Factory.StartNew(new Action(() =&gt; { UpdateColumn1(table, chgcrd); }));
    Task t2 = Task.Factory.StartNew(new Action(() =&gt; { UpdateColumn2(table, chgcrd); }));

    Task.WaitAll(t1, t2);

    chgcrd.ProcessChanges();
}

private void UpdateColumn2(DataTable table, ChangeCoordinator changes)
{
    Parallel.For(0, table.Rows.Count, new Action&lt;int&gt;((i) =&gt;
    {
        int oldValue = table.Rows[i].Field&lt;int&gt;(&quot;column2&quot;);
        int newValue = oldValue * 5;
        long rowId = table.Rows[i].Field&lt;long&gt;(&quot;id&quot;);

        changes.ScheduleChange(new ChangeRequest(rowId, &quot;column2&quot;, newValue));
    }));
}

private void UpdateColumn1(DataTable table, ChangeCoordinator changes)
{
    Parallel.For(0, table.Rows.Count, new Action&lt;int&gt;((i) =&gt;
    {
        int oldValue = table.Rows[i].Field&lt;int&gt;(&quot;column1&quot;);
        int newValue = oldValue * 2;
        long rowId = table.Rows[i].Field&lt;long&gt;(&quot;id&quot;);

        changes.ScheduleChange(new ChangeRequest(rowId, &quot;column1&quot;, newValue));                
    }));
}
</pre></p>
<p><pre class="brush: csharp;">
public class ChangeRequest
{
    public long ID { get; set; }
    public string Column { get; set; }
    public object Value { get; set; }

    public ChangeRequest(long id, string column, object value)
    {
        this.ID = id;
        this.Column = column;
        this.Value = value;
    }
}
</pre></p>
<p><pre class="brush: csharp;">
public class ChangeCoordinator
{  
    public ChangeCoordinator(DataTable table) 
    {
        _table = table;
    }

    private ConcurrentBag&lt;ChangeRequest&gt; _changes = new ConcurrentBag&lt;ChangeRequest&gt;();
    private DataTable _table;

    public void ScheduleChange(ChangeRequest request)
    {
        _changes.Add(request);
    }

    public void ProcessChanges()
    {
        ChangeRequest cr;
            
        while(_changes.TryTake(out cr)) 
        {
            var row = _table.Rows.Find(cr.ID);
            if (row == null) { continue; }

            row[cr.Column] = cr.Value;
        }

        _table.AcceptChanges();            
    }
}
</pre></p>
<p>The code is a dumbed down version of what I&#8217;ve implemented, just to show the basic concept. The applications are numerous but I chose to use the DataTable example because it&#8217;s a thorn in my side at the moment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/399/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=399&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2012/01/24/change-request-pattern-parallelism-and-non-thread-safe-collections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>
	</item>
		<item>
		<title>Indexing DataTables</title>
		<link>http://programmersunlimited.wordpress.com/2012/01/24/indexing-datatables/</link>
		<comments>http://programmersunlimited.wordpress.com/2012/01/24/indexing-datatables/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 18:34:42 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=392</guid>
		<description><![CDATA[That’s right, I’m still using DataTables. Why? Because they best fit the requirements for what I am doing. I’m also taking advantage of parallel processing via the TPL. A lot of the operations I need to do would be much easier via PLINQ and POCO’s such as joins, grouping and searching. Because I’m working with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=392&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>That’s right, I’m still using DataTables. Why? Because they best fit the requirements for what I am doing. I’m also taking advantage of parallel processing via the TPL. A lot of the operations I need to do would be much easier via PLINQ and POCO’s such as joins, grouping and searching.</p>
<p>Because I’m working with many disparate DataTables and the join predicates are complex it just isn’t feasible (performance wise) to use DataRelation. To get a working prototype I decided to just use nested loops to find matching DataRows but I’ve found that nested loops when using the TPL results in poor performance and is generally a bad idea when working with large item sets anyway.</p>
<p>Normally I would build a HashTable and create a key from each row based on the columns in the predicate, then use that to match rows with a single loop. However, when using parallel loops, one has to take care to avoid concurrency/multi-threading issues that arise with non thread safe collections. Dictionary&lt;K,V&gt; is normally satisfactory when using them, but they are not thread safe. ConcurrentDictionary&lt;K,V&gt; would seem like an obvious candidate to replace the normal dictionary, but it buckles under the pressure. Memory consumption goes through the roof even for simple, small data processing and performance takes a serious hit.</p>
<p>Another issue with my row key by column approach is that the code has to be written each time and normally I use string concatenation for the keys. Instead, I wanted a nice way to build an index that I can easily query, but I also wanted a generic solution so any key could be used.</p>
<p>I went with the following method</p>
<p><pre class="brush: csharp;">
public static Dictionary&lt;TKey, List&lt;DataRow&gt;&gt; BuildIndex&lt;TKey&gt;(this DataTable source, Func&lt;DataRow, TKey&gt; processRow)
{
    ConcurrentBag&lt;Index&lt;TKey, DataRow&gt;&gt; indexBag = new ConcurrentBag&lt;Index&lt;TKey, DataRow&gt;&gt;();

    Parallel.For(0, source.Rows.Count, new Action&lt;int&gt;((i) =&gt;
        {
            indexBag.Add(new Index&lt;TKey, DataRow&gt;()
            {
                Key = processRow(source.Rows[i]),
                Row = source.Rows[i]
            });

        }));

    var result = (from i in indexBag
                    group i by i.Key into g
                    select g
                        ).ToDictionary(c =&gt; c.Key, d =&gt; d.Select(e=&gt;e.Row).ToList() );

    return result;
}
</pre><br />
<pre class="brush: csharp;">
private class Index&lt;TKey, URow&gt;
{
    public TKey Key { get; set; }
    public URow Row { get; set; }
}
</pre></p>
<p>This method  takes in a generic type TKey to define the index key and then requires a predicate to build the key from each row. The performance of this is excellent. The generic Index model is simply a nice way to organize the keys as things are being built. I chose to return a dictionary because I’m satisfied with the performance and functionality and since it’s only being used for reading and not writing, we don’t need a thread safe collection. I could have easily went with a IEnumerable&lt;Index&lt;TKey,URow&gt;&gt; but why bother?</p>
<p>Since this ends up as an extension method, using it is pretty simple.</p>
<p><pre class="brush: csharp;">
private void Loop(DataTable table1, DataTable table2)
{
    //Build index for table2
    var idx = table2.BuildIndex&lt;Tuple&lt;int, long, int&gt;&gt;((dr) =&gt;
    {
        return new Tuple&lt;int, long, int&gt;(
            dr.Field&lt;int&gt;(&quot;userid&quot;),
            dr.Field&lt;long&gt;(&quot;orderid&quot;),
            dr.Field&lt;int&gt;(&quot;domainid&quot;));
    });

    //Loop over table1
    Parallel.For(0, table1.Rows.Count, new Action&lt;int&gt;((i) =&gt;
    {
        var rowKey = new Tuple&lt;int, long, int&gt;(
            table1.Rows[i].Field&lt;int&gt;(&quot;userid&quot;),
            table1.Rows[i].Field&lt;long&gt;(&quot;orderid&quot;),
            table1.Rows[i].Field&lt;int&gt;(&quot;domainid&quot;));

        if (idx.ContainsKey(rowKey))
        {
            //Exists
        }
        else
        {
            //Doesn't exist
        }
    }));
}

private void Join(DataTable table1, DataTable table2)
{
    //Build index for table1
    var idx1 = table1.BuildIndex&lt;Tuple&lt;int, long, int&gt;&gt;((dr) =&gt;
    {
        return new Tuple&lt;int, long, int&gt;(
            dr.Field&lt;int&gt;(&quot;userid&quot;),
            dr.Field&lt;long&gt;(&quot;orderid&quot;),
            dr.Field&lt;int&gt;(&quot;domainid&quot;));
    });

    //Build index for table2
    var idx2 = table2.BuildIndex&lt;Tuple&lt;int, long, int&gt;&gt;((dr) =&gt;
    {
        return new Tuple&lt;int, long, int&gt;(
            dr.Field&lt;int&gt;(&quot;userid&quot;),
            dr.Field&lt;long&gt;(&quot;orderid&quot;),
            dr.Field&lt;int&gt;(&quot;domainid&quot;));
    });

    //Do a join
    var joined = from i in idx1
                    join j in idx2 on i.Key equals j.Key
                    select new { Key = i.Key, t1Rows = i.Value, t2Rows = j.Value };

}
</pre></p>
<p>Tuples are great to use as keys because they’re immutable and have a smaller footprint than strings (generally speaking).</p>
<p>Conclusion: If I could use POCOs instead of DataTables I certainly would but for now I do what I can. I find the indexing method I’ve come up with a great way to work around performance and threading issues (even when only reading) of DataTables.</p>
<p>I’m interested in hearing your thoughts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/392/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/392/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/392/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=392&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2012/01/24/indexing-datatables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>
	</item>
		<item>
		<title>Learn T4 with my PluralSight course</title>
		<link>http://programmersunlimited.wordpress.com/2012/01/18/learn-t4-with-my-pluralsight-course/</link>
		<comments>http://programmersunlimited.wordpress.com/2012/01/18/learn-t4-with-my-pluralsight-course/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 21:02:05 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://programmersunlimited.wordpress.com/?p=381</guid>
		<description><![CDATA[My new course on T4 (Text Template Transformation Toolkit) has gone live and it&#8217;s ready for your viewing pleasure. If you have any feed back, please send it to me. T4 Templates on PluralSight.com This course introduces T4, Microsoft’s code generation tool that comes with Visual Studio. The Text Template Transformation Toolkit dynamically produces text [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=381&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My new course on T4 (Text Template Transformation Toolkit) has gone live and it&#8217;s ready for your viewing pleasure. If you have any feed back, please send it to me.</p>
<p><img class="size-full wp-image-382 alignleft" title="dustin-davis-v1" src="http://programmersunlimited.files.wordpress.com/2012/01/dustin-davis-v1.png" alt="" width="93" height="98" border="0" /><a href="http://www.pluralsight-training.net/microsoft/Courses/TableOfContents?courseName=t4-templates">T4 Templates on PluralSight.com</a></p>
<blockquote><p>This course introduces T4, Microsoft’s code generation tool that comes with Visual Studio. The Text Template Transformation Toolkit dynamically produces text of any type and is used for code and document generation.</p>
<p>Discover how to reduce development time, bugs and maintenance by building reusable templates. This course covers T4 template building blocks, extending templates with custom functionality and debugging the template execution process.</p>
<p>MVC and Entity Framework, among others, can be customized and extended through T4 templates. It also covers, how to customize MVC controllers using the default templates and the MVCScaffolding package, and customizing entities by adding validation attributes.</p>
<p>Dustin tops it all off with real world uses of T4 including generating, and automatically synchronizing, code based on external resources, and combining T4 with other technologies to produce powerful templates.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/381/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=381&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2012/01/18/learn-t4-with-my-pluralsight-course/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2012/01/dustin-davis-v1.png" medium="image">
			<media:title type="html">dustin-davis-v1</media:title>
		</media:content>
	</item>
		<item>
		<title>Exposing internal methods in 3rd party assemblies for external use</title>
		<link>http://programmersunlimited.wordpress.com/2011/08/16/exposing-internal-methods-in-3rd-party-assemblies-for-external-use/</link>
		<comments>http://programmersunlimited.wordpress.com/2011/08/16/exposing-internal-methods-in-3rd-party-assemblies-for-external-use/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 17:57:15 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=370</guid>
		<description><![CDATA[To start out, I’m going to state that I don’t condone this, but if you need it then you need it. I expect to get some nasty comments about pattern violation this or encapsulation that so go ahead and send them in. This is just an extension of my previous post about modifying 3rd party [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=370&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To start out, I’m going to state that I don’t condone this, but if you need it then you need it. I expect to get some nasty comments about pattern violation this or encapsulation that so go ahead and send them in. This is just an extension of my previous post about modifying 3rd party assemblies and the power of PostSharp.</p>
<h2>The Evil API</h2>
<p>I was working with an API recently that had me using ILSpy to figure anything out. At some point I needed to make use of some code while inheriting a class and overriding a virtual method. So I copied out some code from ILSpy into Visual Studio when I realized that an important method call was broken because that method was internal only. DOH! Due to reasons I won’t explain, I didn’t actually modify the assembly, I just went another way, but if I could have I would have just exposed the method.</p>
<p>Here is our own little evil API</p>
<p><pre class="brush: csharp;">
namespace Example.API
{
    public class Calculator
    {
        public int ProcessValue(int x)
        {
            return SuperSpecialCalculation(x, x);
        }

        internal int SuperSpecialCalculation(int x, int y)
        {
            return x + y;
        }

    }
}
</pre></p>
<p>Two methods, a public and an internal. We need access to the internal!</p>
<h2>The Apsect and Provider</h2>
<p>I’m sure there are better ways, but I decided to just introduce a public method using the same signature as the internal method and it will just act as a wrapper. So we need an aspect that imports the expected internal method (target) and introduces our wrapper method. Then we need a provider to tell PostSharp where to apply our aspect. For more information on aspect providers, see PostSharp Principals <a href="http://www.sharpcrafters.com/blog/post/PostSharp-Principals-Day-12-e28093-Aspect-Providers-e28093-Part-1.aspx">day 12</a> &amp; <a href="http://www.sharpcrafters.com/blog/post/PostSharp-Principals-Day-13-e28093-Aspect-Providers-e28093-Part-2.aspx">day 13</a>. For more information on introduction, see PostSharp Principals <a href="http://www.sharpcrafters.com/blog/post/PostSharp-Principals-Day-14-e28093-Introducing-members-and-interfaces-Part-1.aspx">day 13</a> &amp; <a href="http://www.sharpcrafters.com/blog/post/PostSharp-Principals-Day-15-e28093-Introducing-members-and-interfaces-Part-2.aspx">day 14</a>.</p>
<p><pre class="brush: csharp;">
namespace InternalToPublic
{
    //Aspect Provider
    public class AspectProvider : IAspectProvider
    {
        public IEnumerable&lt;AspectInstance&gt; ProvideAspects(object targetElement)
        {
            List&lt;AspectInstance&gt; targets = new List&lt;AspectInstance&gt;();

            var targetType = ((Assembly)targetElement).GetTypes().FirstOrDefault(c =&gt; c.Name.Equals(&quot;Calculator&quot;));

            if (targetType == null) { return targets; }

            targets.Add(new AspectInstance(targetType, new ExposeSuperSpecialCalculation()));

            return targets;
        }

    }

    //Aspect
    [Serializable]
    public class ExposeSuperSpecialCalculation : InstanceLevelAspect
    {
        [ImportMember(&quot;SuperSpecialCalculation&quot;, IsRequired = true, Order = ImportMemberOrder.BeforeIntroductions)]
        public Func&lt;int, int, int&gt; InternalMethod;

        [IntroduceMember]
        public int SuperSpecialCalculationPublic(int x, int y)
        {
            return InternalMethod(x, y);
        }
    }
}
</pre></p>
<h2>Modify!</h2>
<p>Just as in the previous post, we run a batch file to do the modifications to the assembly.</p>
<p><pre class="brush: plain;">
@&quot;C:\Program Files (x86)\PostSharp 2.1\Release\postsharp.4.0-x86-cil.exe&quot; &quot;Example.API.dll&quot; /p:AspectProviders=InternalToPublic.AspectProvider,InternalToPublic /p:Output=output\Example.API.dll
@copy /y InternalToPublic.dll .\Output
@copy /y PostSharp.dll .\Output
@pause
</pre></p>
<h2>Test</h2>
<p>Now we just need to make sure it’s all working. Create a new project and reference the modified Example.API.dll, InternalToPublic.dll and PostSharp.dll.</p>
<p><pre class="brush: csharp;">
namespace Example.TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Example.API.Calculator c = new API.Calculator();
            Console.WriteLine(c.ProcessValue(10));
            Console.WriteLine(c.SuperSpecialCalculationPublic(10, 20));
            Console.ReadKey();
        }
    }
}
</pre></p>
<p>The output is as expected</p>
<p><pre class="brush: plain;">
20
30
</pre></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://programmersunlimited.wordpress.com/2011/08/16/exposing-internal-methods-in-3rd-party-assemblies-for-external-use/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://programmersunlimited.wordpress.com/2011/08/16/exposing-internal-methods-in-3rd-party-assemblies-for-external-use/" alt="kick it on DotNetKicks.com" border="0" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=370&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2011/08/16/exposing-internal-methods-in-3rd-party-assemblies-for-external-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://programmersunlimited.wordpress.com/2011/08/16/exposing-internal-methods-in-3rd-party-assemblies-for-external-use/" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>PostSharp: Why are my arguments null?!</title>
		<link>http://programmersunlimited.wordpress.com/2011/08/01/postsharp-why-are-my-arguments-null/</link>
		<comments>http://programmersunlimited.wordpress.com/2011/08/01/postsharp-why-are-my-arguments-null/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 19:28:51 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=361</guid>
		<description><![CDATA[I see this question a lot. The developer has created an aspect and when they are stepping through they are seeing that the advice method arguments are null. The most common example of this is the MethodExecutionArgs.Exception. We can easily reproduce this “issue”. Example If you compile this code and step through it, the args [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=361&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I see this question a lot. The developer has created an aspect and when they are stepping through they are seeing that the advice method arguments are null. The most common example of this is the MethodExecutionArgs.Exception. We can easily reproduce this “issue”.</p>
<h2>Example</h2>
<p>If you compile this code and step through it, the args parameter will be null.</p>
<p><pre class="brush: csharp;">
[LogAspect]
class Program
{
    static void Main(string[] args)
    {
        throw new Exception(&quot;test exception&quot;);
    }
}

[Serializable]
public class LogAspect : OnExceptionAspect
{
    public override void OnException(MethodExecutionArgs args)
    {
        Console.Write(&quot;There was an error&quot;);
    }
}
</pre></p>
<p><a href="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargs1.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="PostSharpNullArgs1" src="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargs1_thumb.jpg?w=635&#038;h=182" alt="PostSharpNullArgs1" width="635" height="182" border="0" /></a></p>
<p>So what’s going on? Well if you use ILSpy and look at the compiled result, you’ll see that PostSharp uses optimizations that include ignoring unused properties.</p>
<p><a href="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargsilspy1.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="PostSharpNullArgsILSpy1" src="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargsilspy1_thumb.jpg?w=655&#038;h=141" alt="PostSharpNullArgsILSpy1" width="655" height="141" border="0" /></a></p>
<p>See how the OnException method has been decorated with multiple MethodExecutionAdviceOptimizations flags? The entire list for this aspect is:</p>
<p>MethodExecutionAdviceOptimization(<br />
MethodExecutionAdviceOptimizations.IgnoreGetMethod <br />
| MethodExecutionAdviceOptimizations.IgnoreSetFlowBehavior<br />
| MethodExecutionAdviceOptimizations.IgnoreGetArguments<br />
| MethodExecutionAdviceOptimizations.IgnoreSetArguments<br />
| MethodExecutionAdviceOptimizations.IgnoreGetInstance <br />
| MethodExecutionAdviceOptimizations.IgnoreSetInstance<br />
| <span style="text-decoration:underline;">MethodExecutionAdviceOptimizations.IgnoreGetException</span> <br />
| MethodExecutionAdviceOptimizations.IgnoreGetReturnValue<br />
| MethodExecutionAdviceOptimizations.IgnoreSetReturnValue <br />
| MethodExecutionAdviceOptimizations.IgnoreGetMethodExecutionTag<br />
| MethodExecutionAdviceOptimizations.IgnoreSetMethodExecutionTag <br />
| MethodExecutionAdviceOptimizations.IgnoreEventArgs<br />
)</p>
<p>Notice the IgnoreGetException flag? That’s why it’s null when stepping through the aspect. Change the aspect to</p>
<p><pre class="brush: csharp;">
[LogAspect]
class Program
{
    static void Main(string[] args)
    {
        throw new Exception(&quot;test exception&quot;);
    }
}

[Serializable]
public class LogAspect : OnExceptionAspect
{
    public override void OnException(MethodExecutionArgs args)
    {
        Exception e = args.Exception; //Now we're using Exception so it won't be null
        Console.Write(&quot;There was an error&quot;);
    }
}
</pre></p>
<p>and rebuild. When you step through this time, args is not null and neither is args.Exception.</p>
<p><a href="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargs2.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="PostSharpNullArgs2" src="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargs2_thumb.jpg?w=635&#038;h=127" alt="PostSharpNullArgs2" width="635" height="127" border="0" /></a></p>
<p>Looking at ILSpy again, you no longer see the IgnoreGetException flag.</p>
<p>MethodExecutionAdviceOptimization(<br />
MethodExecutionAdviceOptimizations.IgnoreGetMethod<br />
| MethodExecutionAdviceOptimizations.IgnoreSetFlowBehavior<br />
| MethodExecutionAdviceOptimizations.IgnoreGetArguments<br />
| MethodExecutionAdviceOptimizations.IgnoreSetArguments<br />
| MethodExecutionAdviceOptimizations.IgnoreGetInstance<br />
| MethodExecutionAdviceOptimizations.IgnoreSetInstance<br />
| MethodExecutionAdviceOptimizations.IgnoreGetReturnValue<br />
| MethodExecutionAdviceOptimizations.IgnoreSetReturnValue<br />
| MethodExecutionAdviceOptimizations.IgnoreGetMethodExecutionTag<br />
| MethodExecutionAdviceOptimizations.IgnoreSetMethodExecutionTag<br />
)</p>
<h2>Answer</h2>
<p>So why are the arguments null? Because you’re not using them.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://programmersunlimited.wordpress.com/2011/08/01/postsharp-why-are-my-arguments-null/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://programmersunlimited.wordpress.com/2011/08/01/postsharp-why-are-my-arguments-null/" alt="kick it on DotNetKicks.com" border="0" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=361&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2011/08/01/postsharp-why-are-my-arguments-null/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargs1_thumb.jpg" medium="image">
			<media:title type="html">PostSharpNullArgs1</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargsilspy1_thumb.jpg" medium="image">
			<media:title type="html">PostSharpNullArgsILSpy1</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/08/postsharpnullargs2_thumb.jpg" medium="image">
			<media:title type="html">PostSharpNullArgs2</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://programmersunlimited.wordpress.com/2011/08/01/postsharp-why-are-my-arguments-null/" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Applying aspects to 3rd party assemblies using PostSharp</title>
		<link>http://programmersunlimited.wordpress.com/2011/07/27/applying-aspects-to-3rd-party-assemblies-using-postsharp/</link>
		<comments>http://programmersunlimited.wordpress.com/2011/07/27/applying-aspects-to-3rd-party-assemblies-using-postsharp/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 18:17:43 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=328</guid>
		<description><![CDATA[[Related Article: Introduction to Aspect Oriented Programming and PostSharp] There is undocumented functionality in PostSharp 2.1 (2.1.2.3 or higher) that allows us to apply aspects to assemblies that we don’t have the source code for. I’m going to show you how this works, but first I have state that this functionality is undocumented because it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=328&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>[Related Article: <a href="http://dotnetslackers.com/articles/net/Introduction-to-Aspect-Oriented-Programming-and-PostSharp.aspx">Introduction to Aspect Oriented Programming and PostSharp</a>]</p>
<p>There is undocumented functionality in PostSharp 2.1 (2.1.2.3 or higher) that allows us to apply aspects to assemblies that we don’t have the source code for. I’m going to show you how this works, but first I have state that this functionality is undocumented because it isn’t officially supported by PostSharp. Proceed at your own risk.</p>
<h2>Setup</h2>
<p>If you do not have <a href="http://www.sharpcrafters.com/downloads/postsharp-2.1">PostSharp 2.1.2.3</a> (at this point it’s CTP 3) then get it and install it. We will create two projects, a console project that we’ll be using as our dummy and a class library that is going to hold our aspect provider. I highly recommend that you read through the <a href="http://www.sharpcrafters.com/blog/author/Dustin-Davis.aspx">PostSharp Principals</a> series if you are not familiar with PostSharp or aspect providers.</p>
<p>We will also have a folder called ‘Lab’ which we’ll store all our needed files in. Create the Lab folder and then create a subfolder under Lab called Output.</p>
<p>Note: I’m targeting .NET 4.0.</p>
<h2>Code</h2>
<p>The proceeding code is going to be our dummy executable that we will apply aspects to. Go ahead and start a new console project in Visual Studio called DummyApp. No need to reference PostSharp or any other assemblies. Replace the code in Program.cs with the following:</p>
<p><pre class="brush: csharp;">
namespace DummyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            ExampleClass ec = new ExampleClass();

            ec.Method1();
            ec.Method2();

            Console.ReadKey();
        }
    }

    public class ExampleClass
    {
        public void Method1()
        {
            Console.WriteLine(&quot;Method1()&quot;);
        }

        public void Method2()
        {
            Console.WriteLine(&quot;Method2()&quot;);
        }
    }
}
</pre></p>
<p>Build the project and copy DummyApp.exe to the Lab folder.</p>
<p>Now for the aspect provider. Create a new class library project and call it MyProviders. Add a reference to PostSharp. Add a new class file and name it TraceAspect.cs. Add the following code:</p>
<p><pre class="brush: csharp;">
[Serializable]
public class SomeTracingAspect : IOnMethodBoundaryAspect
{
    public void OnEntry(MethodExecutionArgs args)
    {
        Console.WriteLine(&quot;Entering method: {0}.{1}&quot;, args.Method.DeclaringType.Name, args.Method.Name);
    }

    public void OnException(MethodExecutionArgs args)
    {
    }

    public void OnExit(MethodExecutionArgs args)
    {
        Console.WriteLine(&quot;Exiting method: {0}.{1}&quot;, args.Method.DeclaringType.Name, args.Method.Name);
    }

    public void OnSuccess(MethodExecutionArgs args)
    {
    }

    public void RuntimeInitialize(MethodBase method)
    {
    }

}
</pre></p>
<p>Our aspect is nothing special, just an aspect that implements IOnMethodBoundary and we are just adding code to the OnEntry and OnExit advices.</p>
<p>Add another class file and name it TraceAspectProvider.cs then add the following code:</p>
<p><pre class="brush: csharp;">
public class TraceAspectProvider : IAspectProvider
{
    readonly SomeTracingAspect aspectToApply = new SomeTracingAspect();

    public IEnumerable ProvideAspects(object targetElement)
    {
        Assembly assembly = (Assembly)targetElement;

        List instances = new List();
        foreach (Type type in assembly.GetTypes())
        {
            ProcessType(type, instances);
        }

        return instances;
    }

    private void ProcessType(Type type, List instances)
    {
        foreach (MethodInfo targetMethod in type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly))
        {
            instances.Add(new AspectInstance(targetMethod, aspectToApply));
        }

        foreach (Type nestedType in type.GetNestedTypes())
        {
            ProcessType(nestedType, instances);
        }
    }
}
 </pre></p>
<p>This is how we tell PostSharp what targets to work with and what aspects to apply to those targets. We implement the IAspectProvider interface and satisfy its required ProvideAspects method. PostSharp invokes the ProvideAspects method passing in a System.Reflection.Assembly instance for the target assembly we’re trying to modify. Using reflection, we&#8217;ll get all of the types in the target assembly and process each one by calling our ProcessType method.</p>
<p>In the ProcessType method, we again use reflection to discover all of the methods in the given type that are public and not static. For each applicable method we create a new AspectInstance and add it to the instances list that we’ll be giving back to PostSharp for processing. Then we do some recursion to process any nested types.</p>
<p>When we create a new AspectInstance, we’re passing in to the first parameter the System.Reflection.MethodInfo instance we received from GetMethods(). This parameter can take System.Type, most of the System.Reflection types such as FieldInfo, EventInfo etc and also PostSharp.Reflection.LocationInfo. If we were attempting to apply a LocationInterception aspect, we would pass in a System.Reflection.PropertyInfo type for our intended target.</p>
<p>The second parameter requires an instance of IAspect that will be applied to the target. This is where we supply our desired aspect. We’ve declared and instantiated a class member of type SomeTracingAspect for this purpose so we supply this instance to satisfy the parameter.</p>
<p>Build the project and copy the MyProviders.dll and PostSharp.dll to the Lab folder.</p>
<h2>Modify!</h2>
<p>Now we’re all ready to go. The last step is to actually perform the transformations. To do this we just need to run the PostSharp command line interface with some specific options. I recommend creating a batch file to do this because it could be a lot of typing.</p>
<p><pre class="brush: plain;">
@&quot;C:\Program Files (x86)\PostSharp 2.1\Release\postsharp.4.0-x64-cil.exe&quot; &quot;DummyApp.exe&quot; /p:AspectProviders=MyProviders.TraceAspectProvider,MyProviders /p:Output=output\DummyApp.exe /attach
@copy /y MyProviders.dll .\Output
@copy /y PostSharp.dll .\Output
@pause
</pre></p>
<p>Your PostSharp path may vary. You will also need to choose the correct version of PostSharp CIL executable to run. If you’re working with assemblies targeting .NET 3.5 then use the 2.0 version. If you’re working with assemblies targeting .NET 4.0 then use the 4.0 version and of course, choose the appropriate architecture type (x86, x64). For example:</p>
<ul>
<li>postsharp.2.0-x86-cil.exe</li>
<li>postsharp.2.0-x64-cil.exe</li>
<li>postsharp.4.0-x86-cil.exe</li>
<li>postsharp.4.0-x64-cil.exe</li>
</ul>
<p>The first argument we pass in is the path to the target, DummyApp.exe. The target doesn’t have to be an executable, it can be a library (DLL).</p>
<p>Next we tell PostSharp which aspect provider to use. We do this using the /P argument which allows us to set PostSharp properties (Usage: /P:name=value). Of course we want to use the aspect provider we just built so we specify the fully qualified type name followed by a comma then the assembly name.</p>
<p>PostSharp requires an Output to be provided so we use the /P argument again this time setting the ‘Output’ property to our destination. We don’t want to modify the source so we tell PostSharp to put the result in the output folder.</p>
<p>Optionally we can specify the /attach argument which allows us to attach to Visual Studio to step through the provider (in case there are issues).</p>
<p>When we run the batch file, PostSharp goes to work. When it’s done we see that the output folder has a copy of DummyApp.exe. When we run it we see that our aspect has been applied.</p>
<p><pre class="brush: plain;">
Entering method: ExampleClass.Method1
Method1()
Exiting method: ExampleClass.Method1
Entering method: ExampleClass.Method2
Method2()
Exiting method: ExampleClass.Method2
</pre></p>
<p>We can also use ILSpy to look at the resulting assembly.</p>
<p><a href="http://programmersunlimited.files.wordpress.com/2011/07/dummyapp-ilspy.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="DummyApp-ILSpy" src="http://programmersunlimited.files.wordpress.com/2011/07/dummyapp-ilspy_thumb.jpg?w=899&#038;h=357" alt="DummyApp-ILSpy" width="899" height="357" border="0" /></a></p>
<p>In another post we’ll go over applying an EventInterceptionAspect based aspect and how to setup project build options to automatically run this process.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://programmersunlimited.wordpress.com/2011/07/27/applying-aspects-to-3rd-party-assemblies-using-postsharp/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://programmersunlimited.wordpress.com/2011/07/27/applying-aspects-to-3rd-party-assemblies-using-postsharp/" alt="kick it on DotNetKicks.com" border="0" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/328/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=328&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2011/07/27/applying-aspects-to-3rd-party-assemblies-using-postsharp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/07/dummyapp-ilspy_thumb.jpg" medium="image">
			<media:title type="html">DummyApp-ILSpy</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://programmersunlimited.wordpress.com/2011/07/27/applying-aspects-to-3rd-party-assemblies-using-postsharp/" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Most Valuable Member 2010-2011</title>
		<link>http://programmersunlimited.wordpress.com/2011/07/13/most-valuable-member-2010-2011/</link>
		<comments>http://programmersunlimited.wordpress.com/2011/07/13/most-valuable-member-2010-2011/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 23:04:12 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[User Group]]></category>

		<guid isPermaLink="false">https://programmersunlimited.wordpress.com/?p=317</guid>
		<description><![CDATA[Every July, the Inland Empire .NET User’s Group holds its annual Most Valuable Member event to honor the group’s members who have gone above and beyond for their group and community. The MVM content uses a points based system where any member can submit points for one or more qualifying activities such as helping to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=317&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://programmersunlimited.files.wordpress.com/2011/07/badgeeventbrite.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border:0;margin:0 10px 0 0;" title="badgeeventbrite" src="http://programmersunlimited.files.wordpress.com/2011/07/badgeeventbrite_thumb.png?w=204&#038;h=204" alt="badgeeventbrite" width="204" height="204" align="left" border="0" /></a>Every July, the <a href="http://www.iedotnetug.org">Inland Empire .NET User’s Group</a> holds its annual Most Valuable Member event to honor the group’s members who have gone above and beyond for their group and community. The MVM content uses a points based system where any member can submit points for one or more qualifying activities such as helping to setup a meeting and speaking at a user group.</p>
<p>I’ve been a member of the<a href="http://www.iedotnetug.org/"> Inland Empire .NET User’s Group </a>since 2008 but only since July 2010 have I participated in the MVM contest. I spent the entire year speaking at user groups and code camp, attending meetings and helping with setup and tear down, writing book reviews and whatever else I could do to help out the community and earn MVM points. It paid off. I blew away the competition.</p>
<p>So what does it mean to win the Most Valuable Member content? It means recognition, notoriety and a huge bag of loot &amp; swag that equates to a king’s ransom. Thanks to <a href="http://twitter.com/#!/latringo">James Johnson</a>, the group’s founder and president, the prize packages awarded to the top three members are nothing less than overwhelming. James has some magic voodoo that he uses to woo the group’s sponsors into generously filling the loot bags and providing a catered meal at a fancy hotel.</p>
<p>In addition to a nicely framed award, the winners received laptop bags with a nicely embroidered Visual Studio logo on them (thanks to Microsoft) that were filled with goods. Since I was the Most Valuable Member, my bag was the heaviest. Here is what was in my bag</p>
<h3>Swag</h3>
<p>Pens, stickers, t-shirts and thumb drives from the group’s many sponsors including <a href="http://www.red-gate.com">Red-Gate</a>, <a href="http://www.componentone.com">ComponentOne</a>, <a href="http://www.devexpress.com">DevExpress</a> and <a href="http://www.telerik.com">Telerik</a>.</p>
<h3>Books</h3>
<p>I would estimate that I received 200lbs of books from our book sponsors, <a href="http://www.wrox.com">Wrox</a>, <a href="http://www.apress.com/">Apress</a> and <a href="http://www.oreilly.com/">O`Reilly</a>. Not only did I get a laptop bag full of books, but I was also handed a giant box full of more books (they wouldn’t fit in the bag is what James told me).</p>
<p><a href="http://programmersunlimited.files.wordpress.com/2011/07/imagejpeg_4.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="imagejpeg_4" src="http://programmersunlimited.files.wordpress.com/2011/07/imagejpeg_4_thumb.jpg?w=410&#038;h=248" alt="imagejpeg_4" width="410" height="248" border="0" /></a><br />
<em>Left to right: Ayyappan, Oscar, Myself, James.</em></p>
<p>In addition to all of those books I also received certificates for 10 books of my choosing from each publisher. That’s an additional 30 books. <a href="http://www.oreilly.com/">O`Reilly</a> also provided a 1 year subscription to <a href="http://my.safaribooksonline.com/home?subpage=hometab1">Safari Books Online</a>.</p>
<p>Total book count: 42</p>
<p><a href="http://programmersunlimited.files.wordpress.com/2011/07/imag0247.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="IMAG0247" src="http://programmersunlimited.files.wordpress.com/2011/07/imag0247_thumb.jpg?w=407&#038;h=246" alt="IMAG0247" width="407" height="246" border="0" /></a></p>
<h3>Software</h3>
<p>What would a user group be without software to give away? In my bag were countless envelopes each containing a license for a software package from each of the group’s sponsors.</p>
<ul>
<li><a href="http://www.red-gate.com/products/dotnet-development/dotnet-developer-bundle/">Red-Gate Developers Bundle</a></li>
<li><a href="http://www.jetbrains.com/profiler/">JetBrains dotTrace</a></li>
<li><a href="http://www.techsmith.com/camtasia/">TechSmith Camtasia Studio</a></li>
<li><a href="http://www.EmailVerify.net">EmailVerify.net</a></li>
<li><a href="http://www.pluralsight.com">PluralSight annual subscription</a></li>
<li><a href="http://www.devexpress.com/Subscriptions/DXperience/">DevExpress DXperience Enterprise subscription</a></li>
<li><a href="http://www.telerik.com/purchase.aspx?application">Telerik Ultimate Collection</a></li>
<li><a href="http://www.sharpcrafters.com">SharpCrafters PostSharp Professional License</a></li>
<li><a href="http://www.infragistics.com/dotnet/netadvantage.aspx#Overview">Infragistics Net Advantage</a></li>
</ul>
<p>If all of that weren’t enough, James had some very nice words to say about me and the other winners.</p>
<p>What an excellent night. Thanks to James for putting it all together and making it happen, year after year!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=317&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2011/07/13/most-valuable-member-2010-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/07/badgeeventbrite_thumb.png" medium="image">
			<media:title type="html">badgeeventbrite</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/07/imagejpeg_4_thumb.jpg" medium="image">
			<media:title type="html">imagejpeg_4</media:title>
		</media:content>

		<media:content url="http://programmersunlimited.files.wordpress.com/2011/07/imag0247_thumb.jpg" medium="image">
			<media:title type="html">IMAG0247</media:title>
		</media:content>
	</item>
		<item>
		<title>Review: .NET Windows Development: Everyday Tips, Tricks &amp; Optimization</title>
		<link>http://programmersunlimited.wordpress.com/2011/06/07/review-net-windows-development-everyday-tips-tricks-optimization/</link>
		<comments>http://programmersunlimited.wordpress.com/2011/06/07/review-net-windows-development-everyday-tips-tricks-optimization/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 15:58:14 +0000</pubDate>
		<dc:creator>programmersunlimited</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://programmersunlimited.wordpress.com/?p=282</guid>
		<description><![CDATA[.NET Windows Development: Everyday Tips, Tricks &#38; Optimization By Alberto Población &#8220;What comes after the &#8220;&#8230;For Dummies&#8221; book? There is a big gap between the introductory/beginner books and the rest of them. Beginners looking for that next step usually find it to be a steep climb. This book helps to fill that gap.&#8221; &#8211; Dustin [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=282&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="text-align:left;">.NET Windows Development: Everyday Tips, Tricks &amp; Optimization</h1>
<h2 style="text-align:left;">By Alberto Población</h2>
<blockquote>
<p style="text-align:left;">&#8220;What comes after the &#8220;&#8230;For Dummies&#8221; book? There is a big gap between the introductory/beginner books and the rest of them. Beginners looking for that next step usually find it to be a steep climb. This book helps to fill that gap.&#8221; &#8211; Dustin Davis</p>
</blockquote>
<p style="text-align:left;"><a href="http://www.amazon.com/NET-Windows-Development-Everyday-Optimization/dp/8493548936/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1307458970&amp;sr=1-1">Amazon: $37.00 </a></p>
<p style="text-align:left;">I recently received my copy of &#8220;.NET Windows Development: Everyday Tips, Tricks &amp; Optimization&#8221;. I was pleasantly surprised when I saw how thin it was. There is only about 250 pages which is exactly how I like my tech books. Some readers like the bible style books with 1000+ pages, but this isn&#8217;t that type of book.</p>
<p style="text-align:left;">&#8220;.NET Windows Development: Everyday Tips, Tricks &amp; Optimization&#8221; is packed with problem/solution/better solution sections with necessary details where required. There is little, if any, fluff or filler in this book and I appreciate that. Reading is time-consuming and I dislike wasting my time on filler. I usually skim over what I think is wasteful material and try to get back to the good stuff, but sometimes I end up missing something.</p>
<p style="text-align:left;">The book contains seven chapters of which each is dedicated to its own topic. There is no lead-in so you can jump around the chapters in any order you wish. As the title suggests, each chapter contains either tips &amp; tricks for solving some common issues or improving performance or right-to-the-point introductory text of a feature set.</p>
<ul>
<li>
<div style="text-align:left;"><strong>Accessing Data</strong> - this chapter focuses on data access and performance using easy to implement techniques. I especially found the use of SqlBulkCopy helpful.</div>
</li>
<li>
<div style="text-align:left;"><strong>New features in Windows 7</strong> &#8211; I found this chapter very interesting as it shows how your applications can integrate with all of the new Windows 7 features such as jump lists and icon overlays.</div>
</li>
<li>
<div style="text-align:left;"><strong>Using Graphics</strong> - This chapter focuses on GDI via the System.Drawing namespace.</div>
</li>
<li>
<div style="text-align:left;"><strong>Creative Use of Serialization</strong> - This is one of those chapters where beginners will benefit. The author introduces serialization (Xml, Binary, Soap) and when to use each and then dives into the how by exploring some uses for serialization.</div>
</li>
<li>
<div style="text-align:left;"><strong>Some Uses for Reflection</strong> &#8211; Just as the previous chapter, an introduction that wastes no time.</div>
</li>
<li>
<div style="text-align:left;"><strong>Various Techniques that Should Be Well Known, But Sometimes Aren&#8217;t</strong> &#8211; Various techniques including encoding.</div>
</li>
<li>
<div style="text-align:left;"><strong>A Few Tips for Windows Forms Applications</strong> &#8211; Various topics concerning Windows Forms. I enjoyed reading about the new Windows 7 dialogs.</div>
</li>
</ul>
<p style="text-align:left;">Since this book focuses on Windows Forms instead of WPF,it might be considered outdated even though it was written in 2010. On the contrary, I believe this is what gives the book more respectability. Getting to the point without worrying about the latest and greatest is so refreshing. The contents of this book are still relevant to today&#8217;s development and just about everyone can find something to take away and apply to their daily work.</p>
<p style="text-align:left;">The price for the book is a bit steep at $37.00 (from Amazon), but overall I recommend this book especially to beginners who need that next step to be a small one.</p>
<p style="text-align:left;"><strong>Amazon</strong><br />
<a href="http://www.amazon.com/NET-Windows-Development-Everyday-Optimization/dp/8493548936/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1307458970&amp;sr=1-1">http://www.amazon.com/NET-Windows-Development-Everyday-Optimization/dp/8493548936/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1307458970&amp;sr=1-1</a></p>
<p style="text-align:left;"><strong>CampusMVP</strong><br />
<a href="http://campusmvp.net/">http://campusmvp.net/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmersunlimited.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmersunlimited.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmersunlimited.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmersunlimited.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmersunlimited.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmersunlimited.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmersunlimited.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmersunlimited.wordpress.com/282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmersunlimited.wordpress.com&amp;blog=14241067&amp;post=282&amp;subd=programmersunlimited&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmersunlimited.wordpress.com/2011/06/07/review-net-windows-development-everyday-tips-tricks-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9e4d72e0a29be3bf43a6c8e0cbd656d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">programmersunlimited</media:title>
		</media:content>
	</item>
	</channel>
</rss>
