Thursday, January 17, 2008

A coworker showed me this neat new feature of Visual Studio 2008. If you right click within the code editor and roll your mouse over Organize Usings, three options will come up; Remove Unused Usings, Sort Usings and Remove and Sort. The names are pretty self explanatory so I won't bore you and explanation of each; just wanted to pass on the good word.

sshot-2

 

kick it on DotNetKicks.com

posted on Thursday, January 17, 2008 6:33:19 PM (Eastern Standard Time, UTC-05:00)  #    Comments [3]


 Wednesday, January 16, 2008

Have you ever wanted to be able to extend a sealed class like string? With Visual Studio 2008 and C# 3.0, you now can with Extension Methods. You create these new methods to add additional custom abilities to an existing type, even if you don't have access to it. These new methods need to be static methods contained in static classes, and the first parameter should be the keyword this and the hosting type. This is demonstrated in the example below on line 8. This example takes input from the console and validates it against a regex string.

   1:  using System;
   2:  using System.Text.RegularExpressions;
   3:   
   4:  namespace ExtensionMethods
   5:  {
   6:      public static class MyClass
   7:      {
   8:          public static bool ValidPhoneNumber(this string s)
   9:          {
  10:              string valid_phone = "^[\\(]{0,1}([0-9]){3}[\\)]{0,1}[ ]?([^0-1]){1}([0-9])" +
  11:                                   "{2}[ ]?[-]?[ ]?([0-9]){4}[ ]*((x){0,1}([0-9]){1,5}){0,1}$";
  12:   
  13:              Regex regex = new Regex(@valid_phone);
  14:              return regex.IsMatch(s);
  15:          }
  16:      }
  17:      
  18:      class Program
  19:      {
  20:          static void Main(string[] args)
  21:          {
  22:              Console.Write("Please Enter Phone Number: ");
  23:              string newPhone = Console.ReadLine();
  24:   
  25:              if (newPhone.ValidPhoneNumber()) 
  26:                  Console.WriteLine("Good Phone Number");
  27:              else    
  28:                  Console.WriteLine("Bad Phone Number");
  29:   
  30:              Console.ReadLine();
  31:          }
  32:      }
  33:  }

Once the class has been created, it can be used as an extension of the string class as simply as if it was originally part of the it.

Other examples can be found at the blogs for David Hayden, or Scott Guthrie.

kick it on DotNetKicks.com

posted on Wednesday, January 16, 2008 5:34:10 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Tuesday, January 15, 2008

This is an announcement that I am moving my feeds over to feed burner this week.  The new feed is http://feeds.feedburner.com/JohnRussellPlant. This way I will be able to start tracking my readers, or lack of, better.

posted on Tuesday, January 15, 2008 3:29:52 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


Last week a co-worker let me know about these free E-books from Microsoft Press. It looks as if the LINQ book is in fact the full book while the other two on ASP.NET and SilverLight 1.0 are excerpts. More information can be found at the Microsoft Learning Portal.

 

MicrosoftLINQAJAXSilverlight

 

The free e-book includes content from three recent publications from Microsoft Press:

Introducing Microsoft LINQ by Paolo Pialorsi and Marco Russo (ISBN: 9780735623910)
This practical guide covers Language Integrated Query (LINQ) syntax fundamentals, LINQ to ADO.NET, and LINQ to XML. The e-book includes the entire contents of this printed book!

Introducing Microsoft ASP.NET AJAX by Dino Esposito (ISBN: 9780735624139)
Learn about the February 2007 release of ASP.NET AJAX Extensions 1.0, including an overview and the control toolkit.

Introducing Microsoft Silverlight 1.0 by Laurence Moroney (ISBN: 9780735625396)
Learn how to use Silverlight to simplify the way you implement compelling user experiences for the Web. Discover how to support an object-oriented program model with JavaScript.

kick it on DotNetKicks.com
posted on Tuesday, January 15, 2008 8:42:57 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]


 Sunday, January 13, 2008

Let's face it, a multiple monitor setup is the only way to go for a software developer, or any other computer professional these days. If you are still using only a single monitor, you are not working at your full potential. Here is a quote taken from lifehacker.com.

Survey after survey shows that whether you measure your productivity in facts researched, alien spaceships vaporized, or articles written, adding an extra monitor will give your output a considerable boost -- 20 percent to 30 percent, according to a survey by Jon Peddie Research.

Personally, I feel my productivity increases even more than that, and at minimal my development experience increases ten fold. I do not enjoy switching from layer upon layer of windows searching for the data I need in the proceeding window. Even Microsoft Research states this on their web sites:

You arrive at your office in the morning, sit down, look at your to do list and wonder how you're going to get it all done. If only you had a tool, a genie in a bottle, anything that would help you get more done in less time. And caffeine is out; you gave that up last week.

Microsoft researchers haven't perfected the genie, but they've found a tool that can increase your productivity by 9 to 50 percent and make your work day easier. And you can begin using it right away.

The researchers conducted user studies that proved the effectiveness of adding a second or even third monitor to your workstation, creating a wide-screen effect.

My setup at home consists of two Acer AL2216Wbd 22" Widescreen LCD monitors powered by a single Dualhead GeForce 8600GTS video card. I purchased the three of these for less than 6 hundred dollars from newegg. The cables that came with the two monitors were not long enough reach my computer, so I ordered a couple DVI cables from monoprice.com for less than $15.00 a piece. Previous, I had a much more expense 20.1" gateway monitor, but it recently bit the bucket so it was replaced with my current setup cheaper and I am loving it.  Here is a screen shot of my home workstation as it sits today. Notice that the background stretches across both monitors.

DSC01873

Windows does not do this by default, and you will need a third party program to get this effect. I use a free program called DisplayFusion from Binary Fortress Software.  It will let you adjust the images in case your two monitors run at different resolutions. This is handy if you use an LCD as a second monitor for you laptop.

sshot-1

If you need some good backgrounds, gamewallpapers is a good place to start. They have a wide assortment of some very cool backgrounds for your desktop. Another site with some nice backgrounds is dual-display and a third can be found here.

World of Warcraft

wallpaper_world_of_warcraft_05_preview

Half Life 2

wallpaper_half-life_2_01_preview

 

kick it on DotNetKicks.com
posted on Sunday, January 13, 2008 10:36:54 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]


DSC01866Last week I got my HP Media Smart Home Server EX470 setup for my home network. I must say, I really love this box. It is quite and takes very little power to operate and extends my ability to get at the data I want, when I want. Scott Hanselman mentioned on his blog that he measured the power consumption to cost around $3.00 per month @ $0.0079 per kWh. That is much cheaper than say, my Xbox 360 or home computers.

Home Server uses Windows Server 2003 SP2 as it's underlying operating system, but has many features especially designed for the home user.

These include:

  • Automatically backup of any PC on the network
  • Remote access to your files and applications including remote desktop
  • Stream your photos, music and videos to any PC or Xbox 360 on your network
  • Built in iTunes server to stream music to family members' PC
  • Duplication of designated folders across multiple hard drives
  • Centralize all shared files for your home network

There are currently two models made by HP, the EX470 and the EX475. Both comes with a standard 512mb of memory, but with a little computer know how and some help from Home Server Hacks, you can easily upgrade either machines to 2gb of RAM. The EX470 comes with a single 500gb hard drive in one of it's four drives bays, while the EX475 has two drives to bring it's standard configuration to a full 1 terabyte. All other specs between the two machines are identical. 

With the exception of setting up my the source control software Subversion on it, I am pretty much running the server as stock at the moment until I get a chance to more fully explore it's capacities. I will post more once I have delved deeper. 

kick it on DotNetKicks.com
posted on Sunday, January 13, 2008 5:30:48 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Tuesday, January 01, 2008

Rusty - Copy

John Russell Plant

My name is John, but most of my friends refer to me as Rusty. I'm a software developer, living in Clearwater, FL since January of 2005 and currently work for a web based benefit provider company called Motivano located in Tampa, FL. There I develop code in C#, VB.NET, ASP.NET and T-SQL. I've been writing code professionally for over twenty years using a variety of different languages and in varying Industries. I have been a part of the online community since the days of FidoNet running The 19th Hole BBS.  

My Interest include coding, motorcycles, sailing and gaming on Xbox Live.  Well, that is enough about me, get back to the blog.

posted on Tuesday, January 01, 2008 6:33:03 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Monday, December 10, 2007

aa718325_vs08_isHere 

It has been a while since I have posted, and I am sure everyone knows by now.  Visual Studio 2008 was released to manufacturing ( RTM ) and can be downloaded by MSDN subscribers. Product demos and trail editions can also be downloaded.

posted on Monday, December 10, 2007 4:24:20 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]