finding hardware depth shadow map demos

http://www.opengl.org/discussion_boards/showthread.php/166763-GLSL-Shadow-Map-code-sample
there are three shadowmap demos, but when i compile and run it under macos or windows, they are not working well.
the question is posted at gamedev:
http://www.gamedev.net/topic/654564-whats-the-common-reason-of-this-shadow-map-bug/

is there any other demo with this topic?(have source codes.)
i want to see the correct implement about this .
thanks…