Sunday, January 10, 2010

Nearly Free Dot Net Books at Amazon

I eagerly await the time of arrival. Like a kid in a candy store, I make plans on what I want.

No, I'm not talking about my Birthday or another Christmas so soon. No, I'm eagerly awaiting Visual Studio 2010 and the update to C# and the Dot Net Framework. But, not for the reasons you might think.

Hard on the heals of a new Visual Studio release is a flood of new Dot Net Books that are updated for the new release. And with that, all the previous release versions are going to be marked down. If history is any indicator, marked almost to the point of being free.

If you do not believe me, search for ... say .... ASP.Net 2.0 (i.e. Visual Studio 2005) and you will find hoards of books for less that a dollar (Plus 3.99 shipping).

Soon after VS2005 arrived I purchased over $1,000 dollars of 1.1 books (Cover Price) for $107 dollars!

But Wait! Why would you want OLD info? Well, new versions add to, but does not alter the Framework, and the framework is so vast that there are always parts that we wanted to learn but didn't want to fork over the $50+ per book to learn.

So, if your like me and your on a budget and want to learn as much as you can, then after March 22nd hit Amazon and load up on VS2008 books!

Tuesday, January 5, 2010

C# Yields a better StrTok Command

Here is another use of the Yield command which allows us to create looping functions that return a value for each iteration. That is actually a great description of the StrTok command in C/C++.

The C/C++ StrTok command takes two parameters, an input string and a string of delimiting characters. After the first call to StrTok, the C/C++ programmer passes a null for the input string and StrTok returns the next Token in the original input string. Sounds like an attempt to create an Enumerable function. Unfortunately standard C/C++ does not have enumerable functions.

Here is a C# enumerable function that you allows you to iterate through the tokens found in the input string. This C# version takes two parameters as well, the input string and an array of delimiting charaters.

Then using built-in power from the .net framework we:

We split the string into a string array using the delimiting characters and we yield return each element in the string array where the element in the string arrays length is greater than 0.




Code Snippet




  1. private IEnumerable<string> StrToken(string TokenizableString, char[] Delimiters)

  2. {

  3.     foreach (var Token in TokenizableString.Split(Delimiters, StringSplitOptions.RemoveEmptyEntries))

  4.     {

  5.         yield return Token;

  6.     }

  7.  

  8.     yield break;

  9. }



Tuesday, December 15, 2009

PLINQO adds 'wow' to LINQ 'cool'

Ok, I am the first to admit that I am firmly entrenched in the "Not Built Here" camp. Not only for controls but tools as well. The only tool I've let into Visual Studio for the longest time is Resharper.

I love the power of LINQ but the LINQ to SQL ORM tools have never really thrilled me.

Well, I have changed that rule and I've added PLINQO. I've looked at other tools for ORM, even LINQ to SQL and EF. Thus far I've never liked how the code that these tools generated, but the code that PLINQO generates is the BOMB! PLINQO is like LINQ on steroids, without the roid rage!

Individual files for each table, Generated code does not overwrite custom changes, custom names .... the list just goes on and on.

I could go on and on, but there is a fantastic 70 minute video tutorial here and I guaranty that within the first 10 minutes you will want to pause the video and download PLINQO!