Category: Development

  • Find Dead Code

    Dead code means block of code that is not reachable in application. They can cause noisy in code debugging and confuse developers. Sometimes I might spend a few hours to figure out why a breakpoint never hit. Most of code defect is result of old function no longer used and referenced. Remove them will prevent…

  • List of dev and test tools for IE8

    From http://www.microsoft.com/windows/internet-explorer/readiness/testing-tools.aspx Here is a list of convenient development and test tools to help test and modify applications to run on Internet Explorer 8: Debugging websites Debugging User Agent String Changes This program produces a report on Internet Explorer’s current User Agent String, along with scripts to simulate User-Agent Strings for other Internet Explorer versions…

  • Delete blank lines from text file

    This note is for a few quick ways to delete all blank lines from a text file. sed ‘/^$/d’ file > file_new grep -v "^$" file > file_new (This is for Notepad++ users) Select all text (shortcut Ctrl+A) and then click Menu TextFX -> TextFX Edit -> Delete Blank Lines

  • Visual Studio plug-in: GhostDoc

    Are your tired of documenting you code using C# /// XmlDoc syntax for each and every method? It is time for you to meet SubMain’s GhostDoc. SubMain’s GhostDoc is a Visual Studio plug-in the was design just for you. It will parse your method/property/parameters names and will create a great documentation just for you with…

  • Install Local WordPress Environment on Windows

    WordPress is one of most popular blog applications. This application is very easy to use however setup a local environment for theme or plugin development on windows system is not that easy for bloggers. In this post, I will walk thru you how to setup local WordPress environment using Microsoft Web Platform Installer 2.0 with…

  • C# reading from and write to text file

    CSharp sample for reading from a text file and writing to a text file. //Reading from a text file       System.IO.StreamReader srFile = new System.IO.StreamReader(@"c:foo.txt"); string str = srFile.ReadToEnd(); srFile.Close();   //Writing to a text file string lines = "foobar"; System.IO.StreamWriter swFile = new System.IO.StreamWriter(@"c:bar.txt"); swFile.WriteLine(lines); swFile.Close();

  • Uncompress MSI File

    Sometimes I need to unzip MSI file to view its content without actual installing it. I used to use a 3rd party tool named 7zip to extract MSI. Today I discover there is much easier way to do this with windows build in tool msiexec.exe The use msiexec to uncompress MSI file, you need to…

  • Batch Script Tips

    Getting the current working directory cd /d %~dp0 Comment: %0 is the name of the batch file. ~dp gives you the drive and path.

  • Synchronizing two batch files

    This useful command lets you wait for signals from other command windows or even across the network. waitfor.exe is in windowssystem32 directory. The simple case for the tool is in one command window you do a “waitfor foobar” and it’ll block until in another window you do a “waitfor /SI foobar”.

  • Disable standby/sleep

    powercfg.exe is a windows built in tool to config power management. powercfg.exe is a command line utility, it’s easy to integrate powercfg.exe into scripts. Turn hibernation off powercfg -hibernate OFF Set the power configuration to High Performance powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c Set the absentia power scheme (the scheme used when no one is logged in) powercfg.exe…