Blog

  • Windows Live Writer 4 New Features

    Windows Live Writer is the most popular blog client tool. Microsoft recently released Windows Live Writer 4 as part of new Windows Live Essentials Beta launch. I tried it and it looks great. Here is what’s new.

    New Ribbon UI

    Live Writer 4 has same Ribbon style menu as Office 2010. Actually this applies to other Windows Live wave 4 products, Live Mail, Photo Gallery etc.

    image

    (more…)

  • 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>) {
        if(/foo/) {
            s/foo/bar/;   # replace foo with bar   
        }
        print TMP $_;
    }
    close(INPUT);
    close(TMP);
    rename $filetmp, $file;

  • 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 of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.TypeLoadException: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.

    Cause & Solution

    If IIS is enabled after DotNet 4 installation then ASP.NET is not registered with IIS. You will see the error if your site is targeting ASP.NET 4. To resolve this issue, run the following from elevated command line to register ASP.NET 4:

    aspnet_regiis.exe /iru

    The aspnet_regiis.exe file can be found in either

    • %windir%Microsoft.NETFrameworkv4.0.30319
    • %windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit machine)

    More info for ASP.NET IIS Registration Tool (Aspnet_regiis.exe) can be found at http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

  • WordPress 3.0 Cannot Export

    WordPress 3.0 is finally released with some great new features.

    I just upgraded my site to 3.0 today. The upgrade was smooth, however, I find that export doesn’t work any more. When I try to push export button to download posts xml file locally, I get following error.

    Warning: Illegal offset type in isset or empty in /home/content/22/5401722/html/wp-includes/taxonomy.php on line 176
    Warning: Cannot modify header information – headers already sent by (output started at /home/content/22/5401722/html/wp-includes/taxonomy.php:176) in /home/content/22/5401722/html/wp-admin/includes/export.php on line44
    Warning: Cannot modify header information – headers already sent by (output started at /home/content/22/5401722/html/wp-includes/taxonomy.php:176) in /home/content/22/5401722/html/wp-admin/includes/export.php on line45
    Warning: Cannot modify header information – headers already sent by (output started at /home/content/22/5401722/html/wp-includes/taxonomy.php:176) in /home/content/22/5401722/html/wp-admin/includes/export.php on line46

    WordPress FAQ suggests checking spaces in wp-config.php and remove blank spaces before <?php tag or after ?> tag, I try and it does not help.

    After trying deactivate on every single plug-in, I figure out it’s the plug-in Simple Tags that breaks WordPress 3.0 new export feature. Before Simple Tags owner releasing a fix, you can temp workaround this issue by deactivating Simple Tags plugin. After that, you will be able to get exported xml file to save.

  • OneNote 2010 New Features

    Office 2010 has a few great new features and improvements which make sharing and collaboration easier than ever.

    OneNote Web Application

    You can now create OneNote notebooks through web browsers and have other people to view, edit and collaborate anywhere. All notebooks created online will be saved to SkyDrive so you will need to have a Windows Live ID.

    OneNote Web Application is free, just like other similar live service Microsoft has delivered over many years (hotmail, messenger). To get start with OneNote Web App, go to http://office.live.com and logon with your Windows Live ID. OneNote Web Application has familiar OneNote interface so you don’t have to learn it.

    (more…)

  • Sync OneNote 2010 notebooks to SkyDrive

    Start from OneNote 2010, when you creating new notebooks, you can save notebooks to SkyDrive directly so they are available to you everywhere.

    How to synchronize OneNote and SkyDrive

    1. On your PC, open OneNote 2010.
    2. Go to the Notebook you want to enable sync, click on File > Share
    3. Choose your Notebook and then click on the Sign In button and enter your Live ID(aka MSN/Hotmail/XBox ID)
    4. Once you sign in, click on the Share Notebook button in the lower right. It will upload your notebook to your Skydrive
    5. Now notebooks will be automatically synced among different OneNote clients if they are online.

    (more…)

  • SkyDrive is Live with OneNote Sync

    SkyDrive is live with OneNote Sync, you can now go to Office.live.com and start upload your OneNote files. Office Web Apps on SkyDrive are available free for personal use.

    When you creating New Notebook in OneNote 2010, you can now save it to SkyDrive directly. To get start, you will need to have a Windows Live ID, and sign in when you are asked to. Notebooks will be automatically synced among different OneNote clients if they are online.

    (more…)

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

    (more…)