Month: May 2010

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

    (more…)

  • 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. (more…)

  • 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

  • Exceed Office 2010 Trial Period

    Office 2010 can be run for 30 days for free before needing to be active, or you will start seeing activation notification dialog. If you want to exceed the 30 days free trial during evaluation, you will need to rearm your Office 2010.

    To rearm Office 2010, type in the following from an elevated command prompt:

    “C:Program FilesCommon FilesMicrosoft sharedOfficeSoftwareProtectionPlatformOSPPREARM.EXE”

    (more…)

  • Office 2010 Upgrade, 32 or 64 bit?

    Office 2010 is the first release of Office that contains 64 bit edition. It’s recommended to install the 32 bit version Office 2010 due to compatibility issues however if you still want to try 64 bit version keep these in mind.

    • 32 bit version works on both 32 bit and 64 bit windows operation systems. But 64 bit version Office 2010 must be installed on 64 bit windows operation systems.
    • You can’t upgrade from 32 bit Office 2007 to 64 bit Office 2010 directly, you have to uninstall existing 32 bit Office products prior to install 64 bit Office 2010. (It’s okay to upgrade Office 2007 to 32 bit Office 2010 on either 32 bit or 64 bit operation systems)
    • You can’t run 64bit and 32bit office products side by side. For example, you can’t have side by side installation of 32 bit OneNote 2010 and 64 bit Outlook 2010
    • Some of 32bit Office Add-Ins might not work on 64 bit Office 2010.
  • Error 1731 During Office 2010 Installation

    When you upgrade Office 2010 from BETA to RTM, you might get Error 1731 the source installation package for the product Microsoft Office Office 64-bit Components 2010 is out of sync with the client package as shown in this screenshot.

    image

    (more…)

  • WordPress 3.0 Beta 2 Released

    WordPress team has announced WordPress 3.0 beta 2 is shipped. It seems that release candidate will be coming very soon.

    Things to test in 3.0 beta 2

    • Revised menu user interface
    • Changes to the WordPress exporter and importer to make it more flexible

    WordPress 3.0 changes

    Check out my previous post WordPress 3.0 Features. I will keep updating there.

    Note: it’s recommended not try beta version WordPress on production site.

  • Exceed Windows Server 2008 R2 Trial Period

    Windows Server 2008 R2 does not ask for a CD key in setup, and it can be run for 30 days for free before needing to be active. You can continue to use it after 30 days trial but the system will reboot every 2 hours and run with reduced functionalities.

    If you want to evaluate or run testing on a server with Windows Server 2008 R2 installed. The following procedures will walk you through the steps to extend your grace period.

    Re-arm windows

    Type in the following from an elevated command prompt:

    slmgr.vbs –rearm

    This will reset the activation expiration and the machine is good for another 30 days. You can do this up to 3 times and get 120 days free trial in total.

    (more…)

  • Remove Earlier Version of Windows boot option

    After I upgrade from Windows XP to Windows 7, I see two options at boot up, one is to logon to Earlier Version of Windows, the other is Windows 7. The default option is boot into Windows 7.

    There is a workaround to remove the Earlier Version of Windows option from the boot up screen so that it will boot straight into Windows 7 instead of asking users to choose which OS or waiting for 30 seconds and boot into Windows 7.

    (more…)

  • 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" />

    (more…)