Biography:

Location: Dayton, OH
College: Cedarville University, Cedarville, OH
Degree: B.A. Management Information Systems (2002)
Certifications: Microsoft Certified Professional (MCP) 2002

Interests:

Music, Playing Guitar, Working on Cars, Home Improvement, Photography, Computers, Website Programming, Driving in the snow, NHL Hockey, Sand Volleyball, Settlers of Catan board game

Favorites:

Foods: Lasagna, Carrot Casserole, Chicken Parmesan
Sports: Hockey, Football, Volleyball, Soccer
Desserts: Peanut Butter Pie, Peanut Butter Passion ice cream
TV Shows: 24, The Office, Heroes, Mythbusters, Top Gear, Fifth Gear, Modern Marvels, Seinfeld, Simpsons


Contact Me:
Use this area to send me a note or message:
Name:
Email:
Comments:
Security Code:

Fun links you should probably check out:


Fun games you might want to play:


Current Code Samples:


Future Code Samples:

  • CAPTCHA form-protection of images using PHP and GD 2.0 library
  • Resizing images using PHP and the GD 2.0 library
  • Rotating images using PHP and the GD 2.0 library
CODE TUTORIAL: C# List Delegate Alphanumeric Sort
I've been using C# List more often recently, and had been searching around for a good alpha-numeric sort to use when sorting List objects in C#. I ended up writing my own, and it's fairly quick and efficient.

Here's a code sample you can use:
C#.NET CODE: "List Delegate Alphanumeric Sort"
List<string> ListItems = new List<string>();
ListItems.Add("12");
ListItems.Add("8");
ListItems.Add("2");
ListItems.Add("1");
ListItems.Add("7");
ListItems.Add("1A");
ListItems.Add("1B");
ListItems.Add("1a");
ListItems.Add("2a");
ListItems.Add("3");
ListItems.Add("10");
ListItems.Add("12");
ListItems.Add("4");
ListItems.Add("11");
ListItems.Add("12B");
ListItems.Add("5");
ListItems.Add("123");
ListItems.Add("6");
ListItems.Add("12A");
ListItems.Add("9");

//  Try to sort this list of ItemNos
ListItems.Sort(
    delegate(string i1, string i2)
    {
        if (i1 == i2)
        {
            return 0;
        }
        //  If i2 is not Null, but i1 is
        else if ((String.IsNullOrEmpty(i1)) && (!String.IsNullOrEmpty(i2)))
        {
            return -1;
        }
        //  If i1 is not Null, but i2 is
        else if ((!String.IsNullOrEmpty(i1)) && (String.IsNullOrEmpty(i2)))
        {
            return 1;
        }
        else
        {
           //  Loop through i1 string character by character
            int pos = 0;
            string concat1 = null;
            while (pos < i1.Length)
            {
                concat1 += Convert.ToInt32(i1[pos]).ToString("000");
                pos++;
            }

            //  Loop through i2 string character by character
            pos = 0;
            string concat2 = null;
            while (pos < i2.Length)
            {
                concat2 += Convert.ToInt32(i2[pos]).ToString("000");
                pos++;
            }

            if (concat1.Length < concat2.Length)
            {
                return -1;
            }
            else if (concat1.Length > concat2.Length)
            {
                return 1;
            }
            else
            {
                return concat1.CompareTo(concat2);
            }
        }
    }
);
Here are the sorted results:


- Justin Tubbs