Category: Development

  • Install PowerShell From Command Line

    To install PowerShell on Windows Server 2008 R2 or Hyper-V Server 2008 R2, following features needs to be installed. NetFx2-ServerCore NetFx3-ServerCore MicrosoftWindowsPowerShell Because Powershell is built on DotNet framework, DotNet 2.0 and 3.5  has to be installed prior to PowerShell installation. To install PowerShell from command line, run following from elevated command prompt DISM.exe /online…

  • Enable DotNet 3.5 from command line

    To enable DotNet 3.5 from command line, run following from elevated command prompt dism.exe /online /enable-feature /featurename:NetFx3

  • Perl Replace String in File

    This code snippet demonstrates how to replace string in file using perl. This perl script takes in an input file, replaces the all string foo with bar. my $file = $ARGV[0]; my $filetmp = "$ARGV[0].tmp"; open (INPUT, "< $file") or die("Unable to open $file"); open (TMP, "> $filetmp") or die("Unable to open $filetmp"); while(<INPUT>) {…

  • Could not load type System.ServiceModel.Activation.HttpModule

    If you install DotNet framework 4.0 on Windows Server 2008 or R2 after enabling IIS,  you might see following error when browse your application site made of ASP.NET 4.0 (or run on ASP.NET 4.0 application pool). Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. Description: An unhandled exception occurred during the execution…

  • 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 Windows 8 Camp in a Box Web Camps Training Kit Windows 7 Training Kit For Developers SQL…

  • Perl Last Element of Split

    There is an easier way to get last element on a split operation, save split result to an array and use $array[-1] and this will access last element of the arrays. Example $strings=”foo,bar,test”; my @fields = split(/,/, $strings); print $fields[-1] ;  # the last str in $strings

  • Perl Backslash in Regular Expression

    This note is for a trick to use Q and E  to escape characters for regular expression. You will find it very useful when you do string substitution and your pattern contains characters like slashes or backslashes .

  • Perl Escape Backslashes in String Substitution

    This note is for a trick to use Q and E  to escape characters for regular expression. You will find it very useful when you do string substitution and your pattern contains characters like slashes or backslashes .

  • Perl Add Directory to Path

    Say you have a directory d:bin and you want to add it to path environment at the beginning of your Perl script. Following code will do the trick. my $dir="d:\bin"; $ENV{PATH}.=";$dir"; Then $dir will be included in new $ENV{PATH}

  • 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.…