Resonant tunneling through a quantum dot weakly coupled to quantum wires or quantum Hall edge states