Re: Canon 10d or Nikon d40
Take the D40. The specs of the 10D look better on paper (nicer body, more autofocus points) but the image processor is really old, there were problems with the autofocus and it's been out of production for more than 5 years so you'd probably get a refurbished one.
Re: Canon 10d or Nikon d40
I agree with Franglais. The D40 is a nice little camera, that's what I use, and I'm very happy with the results. I think the D40 is technically discontinued now, but there are lots of companies that still have it in stock, and probably have good deals. If you can afford the extra $200, consider picking up the Nikkor 35mm 1.8 AFS lens, since you said you may want to do some portrait work. It's a great lens, it works well in low light, and it works well for portraits. Be sure to post your decision and your opinion, once you choose!