Blog Moved ....

ScottCate.com

community

frenz

my book(s)

my products

November 2005 - Posts

SCC Vault :: Maintenance Plan

myKB.com Knowledge Base Software, uses Vault by SourceGear, for our source code control. I've noticed the size of the Vault SQL database naturally increasing.

I'm wondering what others do to maintain their SCC database. Do you just let it grow forever and ever? We have daily, weekly, and monthly backups to DVD for almost everyday of the life of this database, so having a backup is not an issue, but what to delete, how to delete, etc.

Do you know if in any of the Vault Clients, there is a clean up routine? Maybe something that says, Delete all the history of a project, just keeping what's current? I snooped around, and didn't see any type of Archive options in the Admin Client.

Thanks for your feedback.

KBAlertz says happy thanksgiving!

I changed our logo for today.

What do you guys think?

KBAlertz Turkey

For those that may not be familar with KBAlertz.com, we monitor the Microsoft KB, and have both Email and RSS feeds for every technology. As an ASP.net MVP, I'm happy to share, that our most popular monitored technology is ASP.net :)

Here's are some direct links.

Here is a link to All Technologies, and All RSS Feeds.

ASP.net 1.1 KB Articles
ASP.net 1.1 RSS Feed

ASP.net 2.0 KB Articles
ASP.net 2.0 RSS Feed

This will help you understand C# Constructor Overloads and Inheritance

The below example is a pretty easy example to walk, that shows you how C# contructors work with both overloads and inheritance. This is a question that comes up pretty often, so I thought I'de throw together a quick console application, that uses a tiny bit of inheritance, and ctor (ctor is a common shortcut for constructor) overloading.

There is also a pretty easy to find lesson with the use of the keywrod virtual., which simply means that the method is as defined for the entire chain of object, unless it is OVERRIDEn in the concreate class.

The sample has a base class of Type Person. Then we have a HistoricalFigure class that inherits from Person, as all Historical people are in fact persons to begin with. So we know that every HistoricalFigure will for example, have a BirthDate, which is a property of Person.

3 classes total

  • TestConsole (for visual output)
  • Person
  • HistoryFigure

TestConsole.cs

    1 using System;
    2 
    3 namespace TestConsole
    4 {
    5     /// <summary>
    6     /// Summary description for main.
    7     /// </summary>
    8     public class TestConsole
    9     {
   10         private TestConsole() {}
   11         public static void Main(string[] args)
   12         {
   13             Person p = new Person("Cameron Cate");
   14             Console.WriteLine(p.HowOld());
   15 
   16             p = new Person("Scott Cate", new DateTime(1973,6,24));
   17             Console.WriteLine(p.HowOld());
   18 
   19             HistoryFigure h = new HistoryFigure("Thomas Jefferson", new DateTime(1743,4,13), new DateTime(1826,7,4));
   20             Console.WriteLine(h.HowOld());
   21 
   22             h = new HistoryFigure("President Bill Clinton", new DateTime(1946,8,19));
   23             Console.WriteLine(h.HowOld());
   24 
   25             Console.Read();
   26         }
   27     }
   28 }


 Person.cs

    1 using System;
    2 
    3 namespace TestConsole
    4 {
    5     /// <summary>
    6     /// Summary description for Person.
    7     /// </summary>
    8     public class Person
    9     {
   10         public Person(string Name) : this(Name, DateTime.Now) {}
   11 
   12         public Person(string Name, DateTime Birthdate)
   13         {
   14             _Name = Name;
   15             _Birthdate = Birthdate;
   16         }
   17 
   18         private string _Name;
   19         public virtual string Name
   20         {
   21             get {    return _Name; }
   22             set { _Name = value; }
   23         }
   24 
   25         private DateTime _Birthdate;
   26         public DateTime Birthdate
   27         {
   28             get {    return _Birthdate; }
   29             set { _Birthdate = value; }
   30         }
   31 
   32         private DateTime _DeathDate;
   33         public DateTime DeathDate
   34         {
   35             get {    return _DeathDate; }
   36             set { _DeathDate = value; }
   37         }
   38 
   39         /// <summary>
   40         /// Calculate Years Old. I'm not sure if this is the best
   41         /// calculation method, but it works.
   42         /// </summary>
   43         /// <summary>
   44         /// Calculate Life Span
   45         /// </summary>
   46         public int YearsOld
   47         {
   48             get
   49             {
   50                 TimeSpan alive;
   51                 if(DeathDate == DateTime.MinValue)
   52                     alive = new TimeSpan(DateTime.Now.Ticks - Birthdate.Ticks);
   53                 else
   54                     alive = new TimeSpan(DeathDate.Ticks - Birthdate.Ticks);
   55                 return (int)alive.TotalDays/365;
   56             }
   57         }
   58 
   59         /// <summary>
   60         /// Helper method to write out the person's age, virtual means that
   61         /// this method stands fro all objects inheriting from person, UNLESS
   62         /// it's OVERRIDEn in the concreate class (See HistoryFigure)
   63         /// </summary>
   64         /// <returns></returns>
   65         public virtual string HowOld()
   66         {
   67             return string.Format("{0} is {1} years old.",Name,YearsOld);
   68         }
   69     }
   70 }


HistoryFigure.cs

    1 using System;
    2 
    3 namespace TestConsole
    4 {
    5     /// <summary>
    6     /// Summary description for HistoryFigure.
    7     /// </summary>
    8     public class HistoryFigure : Person
    9     {
   10         //Notice there is no (string Name) ctor;
   11 
   12         public HistoryFigure(string Name, DateTime Birthdate) : base(Name, Birthdate) {}
   13 
   14         public HistoryFigure(string Name, DateTime Birthdate, DateTime DeathDate) : base(Name, Birthdate) 
   15         {
   16             //Name & Birthdate will be set in base ctor
   17             base.DeathDate = DeathDate;
   18         }
   19 
   20         public override string Name
   21         {
   22             get { return string.Format("Historical Figure \"{0}\"", base.Name); }
   23             set { base.Name = value; }
   24         }
   25 
   26 
   27         /// <summary>
   28         /// Overrides base Age
   29         /// </summary>
   30         /// <returns></returns>
   31         public override string HowOld()
   32         {
   33             if(DeathDate == DateTime.MinValue)
   34                 return base.HowOld();
   35             else
   36                 return string.Format("{0} died {1}, and was {2} years old.",Name,DeathDate.ToShortDateString(),YearsOld);
   37         }
   38 
   39     }
   40 }

Looking for A human on a customer service line?

Do you have the phone system blues?

This will help you actually talk to a real live human being in customer service in some of the worlds most popular companies.

(Who makes this stuff?)

http://www.paulenglish.com/ivr/

How do I replace Notepad.exe with NotePad2.exe?

If I simply delete Notepad.exe, and replace the exe with NotePad2.exe, the OS replaces it with the original.

I remember about 5 years ago, at Comdex seeing a demo of an Office feature, where the MS Polished Demonstrator opened a dos prompt, and deleted word.exe (or whatever it was). Then proceeded to go open word, and of course it worked, with the OS doing a re-write of the word.exe.

Cool feature I thought. Monitor the essential files, and replace them upon corruption, deletion, virus attachment, etc. Now it seems to be biting me.

How can I tell the OS to trust me, that I really want to replace Notepad.exe with Notepad2.exe

Thanks.

Microsoft-ACE

Very nice of Microsoft to do this type of recognition.


Dear Scott Cate,

Thank you for being a great contributor to Microsoft Visual Studio 2005.

You have been nominated to receive the Award for Customer Excellence. This award recognizes your extraordinary contribution to the Visual Studio 2005 product...


Thank you back!

 

VS2003 Crash when Attach To Process

I have an irritation that I've been living with for a while, and I was wondering if anyone else has experienced, and possibly found a solution to this problem.

The way I debug my asp.net applications is to attach to the process. This way, I can' already be logged into a site, 6 or 7 steps into the project, attach to the process, and just debug when I need to. There are other ways, but that's not part of my question or problem.

When I press CTRL+ALT+D (my custom shortcut key) it brings up the processes window, and I can attach to the process, and go on my way.

The problem:

About 10% of the time, (after I press CTRL+ALT+D, and before the Process Dialog appears), VS will pause for about 3 seconds, and then crash with a dialog box, allowing me to restart. This is terribly painful, because it doesn't remember it's state. So the breakpoints I had set, the files that were open, and all the other settings, are lost, and I'm to start over.

Fortunately, I've compiled, so all the files are saved, so I don't lose any work, but it's still a pain point.

The only add-in I have installed (before today with my previous post) is CodeRush from DeveloperExpress. I've tested this by disabling the add-in, and it still crashes about 10% of the time when I try to attach to a process.

What do you think?

Copy Source as HTML

I'm testing a new util I've downloaded from Colin Coller's Blog, called CopySourceAsHtml. So far it's working great with a much better UI than I expected. when you right click, "Copy as HTML" you're given a great dialog box, that is very feature rich, with everything I could think of for copying code. It even has a "remove indentation" which I'm guessing will left justify the code when I paste it.

So for the frist time, here goes. I'll press enter, enter + CTRL-V, and you'll see the results from a random method in my code.

   15 /// <summary>
   16 /// Helper method to add a string to a string array. Returns the string array, once size bigger
   17 /// with the new added string in position 0
   18 /// </summary>
   19 /// <param name="toAdd">New string to add to original string[]</param>
   20 /// <param name="original">orignial string array, new string will be added in postion 0</param>
   21 /// <returns>string array with new string in position 0</returns>
   22 public static string[] AddStringToStringArray( string toAdd, string[] original )
   23 {
   24     string[] returnString = null;
   25 
   26     if( original == null )
   27     {
   28         returnString = new string[1];
   29         returnString[ 0 ] = toAdd;
   30     }
   31     else
   32     {
   33         returnString = new string[original.Length + 1];
   34 
   35         for( int i = 0; i < returnString.Length - 1; i++ )
   36         {
   37             returnString[ i ] = original[ i ];
   38         }
   39 
   40         returnString[ original.Length ] = toAdd;
   41     }
   42     return returnString;
   43 }

I did have to go back and replace each line with a soft return, rather than a hard break. It seems that when I pasted the code, each line took two spaces, like it was surrounded with a <P> tag. So I had to change those to <br /> tags, and the code seemed to paste nicely. We'll see what happens when I save it.

Posting Code

What is the best method for posting code in the .Text version running on webloga.asp.net? I've tried a few code beautifiers, and they all seem to get mangled in the save.

What have you found that works best?

Maybe a *.gif screen shot :), no good for search, but sure good for readability :)

2 new SQL Server 2005 KB Articles

These are great articles as an introduction if you're just getting started with SQL 2005.

910229   SQL Server 2005 Express Edition Readme

910228   SQL Server 2005 Readme and installation requirements

More Posts Next page »