Thursday, February 7, 2013

What is Reponsive UI?

Website is able to changes layout by device type.


http://www.neevtech.com/blog/2012/05/01/responsive-ui-using-css-media-query/#

Wednesday, February 6, 2013

How to fix "Hexadecimal value 0x is an invalid character"?

Because xml includes invalid character.
Add an filter following for xml content

/// 
/// Remove illegal XML characters from a string.
/// 
public string SanitizeXmlString(string xml)
{
 if (xml == null)
 {
  throw new ArgumentNullException("xml");
 }
 
 StringBuilder buffer = new StringBuilder(xml.Length);
 
 foreach (char c in xml)
 {
  if (IsLegalXmlChar(c))
  {
   buffer.Append(c);
  }
 }
  
 return buffer.ToString();
}

/// 
/// Whether a given character is allowed by XML 1.0.
/// 
public bool IsLegalXmlChar(int character)
{
 return
 (
   character == 0x9 /* == '\t' == 9   */          ||
   character == 0xA /* == '\n' == 10  */          ||
   character == 0xD /* == '\r' == 13  */          ||
  (character >= 0x20    && character <= 0xD7FF  ) ||
  (character >= 0xE000  && character <= 0xFFFD  ) ||
  (character >= 0x10000 && character <= 0x10FFFF)
 );
}



http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/

Tuesday, February 5, 2013

How to fix "The type or namespace name could not be found (are you missing a using directive or an assembly reference?)"

First of all, check if this assembly you already added into your project.

If yes, but still get this problem:
Go to Project Properties -> Application -> Target framework
Change this value to .NET Framework 4.0 from .NET Framework 4.0 Client Profile

Monday, February 4, 2013

Friday, February 1, 2013

The clearest way to express polymorphism


http://stackoverflow.com/questions/154577/polymorphism-vs-overriding-vs-overloading/154939#154939
public abstract class Human
{
   ...
   public abstract void goPee();
}

public class Male extends Human
{
...
public void goPee()
{
System.out.println("Stand Up");
}
}

public class Female extends Human
{
...
public void goPee()
{
System.out.println("Sit Down");
}
}
//Now we can tell an entire room full of Humans to go pee.

public static void main(String args)
{
ArrayList group = new ArrayList();
group.add(new Male());
group.add(new Female());
// ... add more...

// tell the class to take a pee break
for( Human person : group) person.goPee();
}