Re-enable Windows XP update by applying a registry patch

  • Save the following text:
    Windows Registry Editor Version 5.00
    into a text file named xp.reg
  • double click the reg file to apply the patch.

Java: string.format() align left

String.format("%-20s", "test");

Java: convert int to unsigned

int toUnsigned(short i){
    return Short.toUnsignedInt(); // i&0xffff;

long toUnsigned(int i){
    return Integer.toUnsignedLong(); // i&0xffffffffl;