Firefox Uninstall Bug (Windows)

Try the following:

  1. Install Firefox (any version)
  2. Wait for another major version and upgrade from the update facility
  3. … then you will see in Add/Remove programs two entries for Firefox. One for each version.
  4. If you try to un-install any version, both will be deleted, and firefox will be uninstalled.

#fail

PDFs and Preview on Mac OS X

It seems that adobe and apple are continuing on their war efforts on all fronts. Recently I tried to open a pdf and saw the following message:

Nice huh? To be honest, I consider acrobat reader one of the ugliest programs on Mac OS X. So, if I can help it, I will not install it.

Empty Main Pattern (republished)

I always liked to play with static initializers in Java. I remember back in the summer of 2003 i accidentally discovered the empty main pattern. Later on, a very close friend of mine, Kostantinos Saidis also found the no main pattern.

I don’t know if its bug or feature. but i sure know its fun! 🙂

Following the examples of …

Normal Class

public class Main {
	public static void main(String[] args) {
		System.out.println("Boom");
	}
}

Empty Main Class

public class Main {
	static {
		System.out.println("Boom!!");
	}

	public static void main(String[] args) {
		//do nothing
	}
}

No Main Pattern

public class Main {
	static {
		System.out.println("Boom!!");
	}
}

Next time, use the designer!

It was a sad story like that. I was trying to do a simple-enough application with Visual Studio 2008. I tried to used some custom DAO with a combo box.

It was really very simple. Combo box API in C# has two cool properties, DisplayMember and ValueMember. So it is easy to just display and object in the combo box, with a code like:

public class Foo {
public String Member { } // getter and setter
public String Value { }
}

ComboBox cb = ... //combo box init

cb.DataSource = new List(); // or any IEnumerable
cb.DisplayValue = "Member";
cb.MemberValue = "Value";

The trick is that the combo uses reflection and gets the actual properties from the textual representation of the assigned values. So far, So Good.

The problem began when i actually defined an event. To be exact, a SelectedIndexChanged event.

I added the code, accessing the actual Combo Box, and then the program started to behave abnormally. It seemed to ignore the ValueMember i already assigned and returned to me the whole object, instead of the selected property. The second time you accessed it, the combo box returned the correct value. Amazing, right?

To be honest, i was puzzled, i was sure that it was my mistake, but haven’t found a solution until a few hours later (dealt with some other stuff too, my PhD for example :-p).

The problem was at the declaration, when i assigned the DataSource, then the SelectedIndexChanged event triggers. That happened before i assigned the correct property to the combo box, and the first time it was executed, it returned the default value (which is the object), the second (and so on) the correct property.

If i originally used the designer a little bit more, instead of hacking and slashing through properties, i could have avoided the whole mess …

It was all there right?
It was all there right?