21 May 2015

Battery drainage issue on Android

WiFi is always on:

22 October 2010

Problem in KeyBinding constructor in WPF

Basically Implementation#01 and Implementation#02 should be same. But Implementation sometimes gets exception if modifiers = ModifierKeys.None.


//Implementation # 01:
KeyBinding k = new KeyBinding(command, key, modifiers);

//Implementation # 02:
KeyBinding keyBinding = new KeyBinding();
keyBinding.Command = command;
keyBinding.Key = key;
keyBinding.Modifiers = modifiers;


So, use the 2nd way of implementation if required.

07 July 2010

Code : Strip HTML (Remove HTML Tags)

string StripHTML(string htmlString)
{

    //This pattern Matches everything found inside html tags;
    //(.|\n) - > Look for any character or a new line
    // *?  -> 0 or more occurences, and make a non-greedy search meaning
    //That the match will stop at the 1st available '>' it sees, and not at the last one
    //(if it stopped at the last one we could have overlooked
    //nested HTML tags inside a bigger HTML tag..)
   
    string pattern = @"<(.|\n)*?>";
    return Regex.Replace(htmlString, pattern, string.Empty);
   
}

Beginner's Unit Testing in C# using NUnit

C# .NET 2.0 Test Driven Development


The above website is helpful for a beginner though some steps could have been clearer.

 

© 2007 t!ps n tr!cks



Template unik dari rohman


---[[ Skip to top ]]---