Arrowhead Antipattern
Controls Enable Disable Refactoring
How many times we have written such code to enable/disable controls, based on some conditions:
{
buttonFindNext.Enabled = false;
buttonReplace.Enabled = false;
buttonReplaceAll.Enabled = false;
}
else
{
buttonFindNext.Enabled = true;
if (string.IsNullOrEmpty(textBoxReplace.Text))
{
buttonReplace.Enabled = false;
buttonReplaceAll.Enabled = false;
}
else
{
buttonReplace.Enabled = true;
buttonReplaceAll.Enabled = true;
}
}
The power of refactoring?
Check out this piece of code taken from CodeProject.
if (mShowShadow == false)
son = false;
else
{
if (DropShadowSupported() == false)
son = false;
else
{
son = true;
}
}
if (son)
{
parameters.ClassStyle += CS_DROPSHADOW;
}
The code doesn't made any sense to me, so I refactored and guess what the outcome:
Free and Best System Utilities and Diagnostic Software
Kaspersky fails with 0 marks
I was a ardent proponent of Kaspersky until today, when I tested it with some cracks downloaded from internet (not for piracy, but for validating those cracks against my products). Though the sample size was too small (just 2 files) but from the reviews I had read about Kaspersky and its amazing price 10$ (India), I was a huge admirer of this software.
XDocument can't load a simple xml with version 1.1
using System.Xml.Linq;
class Test
{
static void Main(string[] args)
{
string xml = "<?xml version=\"1.1\" ?><root><sub /></root>";
XDocument doc = XDocument.Parse(xml);
Console.WriteLine(doc);
}
}
Unhandled Exception: System.Xml.XmlException: Version number '1.1' is invalid. Line 1, position 16. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
Difference between 'ɡ' and 'g' characters?
Indian Stock Market

Interview with Mr. JH
Some, rather most organizations reject his CV today because he has changed jobs frequently (10 in 14 years). My friend, the job hopper™ (referred here as Mr. JH), does not mind it. well he does not need to mind it at all. Having worked full-time with 10 employer companies in just 14 years gives Mr. JH the relaxing edge that most of the company loyal™ employees are struggling for today. Today, Mr. JH too is laid off like some other 14-15 year experienced guys, the difference being the latter have just worked in 2-3 organizations in the same number of years.