I wonder now why transformers are used on just about everything if resistors can be more efficient.
Loads of reasons, the most important being the fact that if no current flows through a resistor, no voltage gets dropped accross it. So you get the full input voltage appearing at the output. The voltage drop accross a resistor is proportional to the current flowing it-
volt drop (volts)= current flow (amps) x resistance (ohms).
No current flow = no volt drop. Reduced current flow = reduced volt drop = more volts in to your equipment = fried equipment
Transformers give a fairly constant output over the range of loading from 0 to full, though they do drop in voltage as the current increases due to the resistance of the internal windings- an inherited characteristic that can`t really be avoided. Some are better than others, depends on the build quality and how much you want to pay. And they are bulky and small ones are quite innefficient
Other power supply ccts do exist without step-down transformers. The thing inside your PC most likely is a switch-mode type. I don`t really know how they work, and they
do have a small transformer or 2 inside (I looked!), probably for mains isolation or other reasons, but the reduction in voltage is achieved by different means and they usually have a very constant output over a range of loads. They`re also quite efficient but oddly enough transformers can be the most efficient means of stepping down voltage, provided they run at the rated load. A big 50w transformer running a teeny led would be very innefficient due to losses within the transformer. A 50w transformer running a 50w load would be many times more efficient though it still does have losses. The small battery charger plug for you cell-phone may probably be a tiny switch-mode power supply.
Now as to building one for running a LED nightlight, it`s probably not practical and I wouldn`t know where to point you to find the details. The capacitor setup is probably the best because of its simplicity and is what I would choose. Might even try that one myself.
php_44- what do the "C" and "F" values in the calculation 1/(2*pi*C*F) stand for, I`m not 100% sure.