Thursday, June 28, 2012

Thought of the Day Thoughts

I used to post daily "Thought of the Day" back when AIM was still popular. I would then archive them so I could read them later and chuckle. I've since lost them all and with AIM not as popular, I've have stopped posting. But recently I've decided to try and get back in it on my gchat status and to archive them, I'll save them here in the form of posts. So hopefully this is the first in a series of them. Thought of the Day: Courtesy of Cheryl, actually the girl in the article actually reminds me of Cheryl. The article really makes you think though. How often does jog by groping really occur? Is this a real problem? Or is this just one of those crazy Canadian things? Something to think aboot.

Wednesday, June 13, 2012

Random Stuff With Tomcat and Applets

Lately I've just been blogging about random things that I learned or use that I think others would find helpful. I'll try and have more insightful things up later, but for today, here's more random crap I used today!

Tomcat Server

Use more debuggery.  Should be easy with Tomcat7 right?  Shocker, it is.
1.  cd $CATALINA_HOME #that's the tomcat home
2.  vi bin/
On the first line (after their comments) just drop in

export JPDA_ADDRESS=8787
export JPDA_TRANSPORT=dt_socket

Now at the bottom, comment out

#exec "$PRGDIR"/"$EXECUTABLE" start "$@"
and add in 
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

Terrific, are we done?  Yes.

Linux Distro

I was also using a random linux server today and couldn't figure out what distro it was.  A quick:
cat /etc/issue 
solved that one real quick for me.
Red Hat Enterprise Linux Server

Applet JVM Args

Gah, applets.  Can't believe I'm working with them.  How the hell do you pass jvm args into these damn things??  Turns out you have to set a system env variable

_JPI_VM_OPTIONS='-Xdebug -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=y'

You gotta restart your browser though.  But now, when my applet runs, it'll sit and wait for me to connect my debugger to it (b/c of the suspend=y).

*I hope you never ever have to do applet development and never have to use this

Wednesday, June 6, 2012

How I Imported Ant project into Eclipse

I haven't used Ant in a while and forgot how to 'mvn eclipse:eclipse' it as it were to create an Eclipse project from my build.xml.  The following steps is what I did:

1.  Go to File -> New  ->  Project
2.  Select "Java Project from Existing Ant Bundle"
3.  Right click project  ->  properties
 a.  Java Build Path
  1)  Source tab
   a)  Unclick 'Allow output folders for source folders'
   b)  Default output folder: Specify the same folder that you specified in your build.xml
  2)  Libraries
   a)  Add External JARS and select jars used in your ant file.
   b)  Add Library  ->  JRE System Library.  Select JDK home.
    *Make sure you have the JDK installed.  If not, click Alternate JRE.  Then click Installed JREs and find your JDK home.  Then use that

* I had to delete the .class files created automatically on import, before I had a shot at changing the settings above.