Interesting DOS commands

subst and psubst
A utility to map a subdirectory to a drive letter.
subst subst /D (Deletes the substitute drive)
If SUBST e: c:\edrive were executed, a new drive letter e: would be created, showing the contents of c:\edrive. The opposite can be achieved via the join command.

Another related command is psubst, which is supposedly able to generate permanent map. And visualsubst is a convenient GUI program.

See the rest

Debug Tomcat in Eclipse

1) Modify catalina.bat file to select the right JPDA debug protocol and port, say,
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=8000
Then, start Tomcat in the debug mode.
catalina.bat jpda start

2) Under Eclipse, select “Run->Debug Configurations…”. Click on “Remote Java Applications”, then click “New”. Type in the title and all. Save and run. Eclipse will connect to the VM that Tomcat is running under.

Output to memory instead of file using libjpeg and libpng

I need to use libjpeg and libpng to convert an image from the raw RGB format to JPEG and PNG format and then output the result to a memory buffer, and the following two links saved me lots of coding effort:

http://www.codeguru.com/forum/archive/index.php/t-378333.html

http://stackoverflow.com/questions/1821806/how-to-encode-png-to-buffer-using-libpng

Additionally, there is also a good online tutorial showing how to do in-memory data compression using zlib at
http://www.gamedev.net/reference/articles/article2279.asp

PS: just found out that the latest libjpeg (version 8 ) coming out two weeks ago added the in-memory compression method. Cheers!