Attention: We are retiring the ASP.NET Community Blogs. Learn more >

ShowUsYour<Blog>

Irregular expressions regularly

  • SizeOf

    using System;
    using System.Reflection ;
    using System.Runtime ;

    namespace ConsoleTests
    {
     
    /// <summary>
     /// Summary description for TestSizeOf.
     /// </summary>
     public class TestSizeOf
     {
           
    static void Main(string[] args)
            {
                Student[] students =
    new Student[3] ;
               
    string[] names = new string[] {"darren", "paul", "harry"} ;
               
    int[] ages = new int[] {18,21,32} ;
               
    string[] descriptions = new string[] {
                                   
    "A",
                                   
    "This is a medium description",
                                   
    "This is a slightly longer description"
                                } ;
               
               
    for(int i = 0; i <= names.GetUpperBound(0); i++)
                {
                    students[i] =
    new Student(names[i],ages[i],descriptions[i]) ;
                   
    int studentSize = students[i].GetSize() ;
                    Console.WriteLine(
    "The size of {0} is {1}{2}", names[i], studentSize, Environment.NewLine ) ;
                }
               

                Console.Read() ;
      }
     }

       
    public class Student
        {
           
    string name ;
           
    int age ;
           
    string description ;

           
    public Student(string name, int age, string description)
            {
               
    this.name = name ;
               
    this.age = age ;
               
    this.description = description ;
            }

           
    public int GetSize()
            {
               
    return 24 + (4 + (name.Length * 8) + (description.Length * 8)) ;
            }
        }
    }

  • Week in review

    Here's some of the really cool things that I've seen this week...

  • VS.NET & Source Safe tip

    <Tip TipAuthor="J. Ambrose Little" TipAuthorUrl="http://www.aspalliance.com/Ambrose/">
         <Question>
              If a file is checked out in VSS, I would like to see who has the file
              checked out through Visual Studio.Net.  That would save a trip back to
              the VSS client to try to track the person down.
         </Question>
         <Answer>
              There are two ways (that I know of).  One is to add the source control
              toolbar to your toolbars and choose the properties button, which has a
              status tab, IIRC.  The other is to select the file and go to
              File -> Source Control -> Properties.
         </Answer>
    </Tip>

  • The magician's nephew

    The Narnia series of books is my favourite series, and Digory Kirke is my favourite character in the series. I can relate to his character in many ways; he lives in two worlds, he constantly being tempted to do the wrong thing :-) and in the end things seem to work out well for him. Narnia is a simple story told simply and elegantly, the depth of the characters is simply amazing.

  • Kickstarter.net

    Recently I've been trialling a product called Kickstarter [ Kickstarter website ] with a view to using it for:

    • Stored Procudure generation
    • Data Access Layer code generation
    • Business Objects code generation
    • Web Forms Creation