Category Archives: Development

Microsoft Training Kits

The Microsoft Training Kit is free download that contains useful training resources. Here is a list of some latest useful training kits, the training content includes demo, videos, presentations, hands on lab and some code samples. Enjoy it

Update History

  • 2010 Apr – Add Silverlight 4 Training
  • 2010 May – Add Office 2010 and SharePoint 2010 Training Kit
  • 2010 June – Add Windows Azure Training Kit
  • 2010 Aug – Update SQL Server 2008 R2 & Windows Azure Training Kit
  • 2010 Sep – Add Windows Phone 7 Training Kit
  • 2010 Dec – Add VS LightSwitch & Lync Server 2010 Training Kit
  • 2011 March – Add PHP on Windows SQL Server Training Kit
  • 2012 March – Add SQL Server 2012 Developer Training Kit
  • 2012 April – Add Windows Server 8 HOL
  • 2012 June – Add Azure Training Kit
  • 2012 Dec – Add Windows Phone 8 Training Kit

Visual Studio Themes and Color Schemes

I just came cross this site http://studiostyles.info/ which provides Visual Studio color schemes for free download. All color schemas work for both Visual Studio 2008 and 2010. Every schema has screenshots so you can see how it looks like before downloading it.

You can follow following steps to import the color schema into Visual Studio.

  1. In Visual Studio, choose Tools > Import and Export Settings
  2. Choose Import Selected Environment Settings and select whether you want to back up your existing settings or not
  3. Click Browse to choose the file you downloaded.
  4. You get a choice which settings you want to import – choose all of them since the file only contains color settings and won’t touch your other VS settings.
  5. Click Finish and you’ll see the new colors.

Note: if you save the file to My Documents > Visual Studio 2010 > Settings, you’ll have quick access to choose the settings file in step 3 above.

Continue reading

Perl Redirect Command Output

In Perl, you can execute external commands using system() or “. However, system and “ does not redirect command output to console and this results people who runs your perl script can’t see it. This also make debug much harder. Perl does not have a build in switch that equals to batch scripts’ “@echo on”, however this can be worked around by creating a ExecuteCommand subroutine.

sub ExecuteCommand {
my $cmd= $_;
my @cmdoutput = `$cmd`;
for $line (@cmdoutput) {
print $line;
}

Now just change your code from system($command) or `$command` to ExecuteCommand($command) and you will see all command output are redirected to console. Continue reading

How to Validate URL in C#

I searched google for how to validate URL in C# and most results say using a regular expression. Eventually I found Uri.TryCreate which is a built in method in C# to check if a string is a valid URL

Uri uri = null;

if (!Uri.TryCreate(url, UriKind.Absolute, out uri) || null == uri)

{

    //Invalid URL

    return false;

}

 

Reference:

http://msdn.microsoft.com/en-us/library/ms131572(v=VS.90).aspx

SpellChecker in WPF4 TextBox

TextBox and RichTextBox in WPF4 has the built in SpellChecker functionality. It’s currently available in following four languages

  • #LID 1033 – English
  • #LID 3082 – Spanish
  • #LID 1031 – German
  • #LID 1036 – French

Enable SpellChecker functionality on TextBox or RichTextBox is as easy as just setting SpellCheck.IsEnabled to True on the controls.

   <TextBox SpellCheck.IsEnabled="True" />

Continue reading

CopySourceAsHtml for Visual Studio 2010

CopySourceAsHtml is an add-in for Microsoft Visual Studio 2008 that allows you be able to quickly get your code as HTML from Visual Studio, just like being able to save it as a HTML file from the Save As dialog. It’s very helpful if you frequently post code to blog or send code in email.

I recently switched to Visual Studio 2010 and noticed this plug in is not ready for Visual Studio 2010 yet. Here is how you can get it work for Visual Studio before CopySourceAsHtml owner releases an official update to support Visual Studio 2010.

Continue reading