Setting the Default Version of Java in Windows
You’re a java programmer on a Windows development environment. You fire up the command prompt and run “java -version”. It’s some JRE and its not even the version you want! Eclipse is throwing a fit. There’s no good way to figure out what path the “java.exe” you are executing lives in.
The most surefire way to solve this problem is take the java bin path (ex: C:\program files\Java\jdk1.6.0_07\bin) you want and prepend it to your System level PATH environment variable, as highlighted below. This will ensure that you are executing the java.exe from the expected java installation every time.


JavaScript Documentation
It can be tough to find a decent JavaScript reference. This one is my favorite:
JavaScript Language Reference: https://developer.mozilla.org/en/JavaScript/Reference
Other great javascript links:
JQuery Reference: http://docs.jquery.com/Main_Page
Closure Compiler: http://code.google.com/closure/compiler/
Vnc4server on Ubuntu 10.04
After several hours wasted trying to setup an automated vnc server on Ubuntu 10.04 I’ve finally got it working. Here’s how:
-install vnc4server via package manager. ”sudo apt-get install vnc4server” should also work
execute “vnc4server” as my local user. This prompts me to set a password and ~/.vnc directory for the first time.
modify ~/.vnc/xstartup to start gnome, and not startup x-window-manager. My xstartup file now looks like this:
#!/bin/sh# Uncomment the following two lines for normal desktop:# unset SESSION_MANAGER# exec /etc/X11/xinit/xinitrc[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresourcesxsetroot -solid greyvncconfig -iconic &x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &#x-window-manager &gnome-session &#!/bin/sh
# Uncomment the following two lines for normal desktop:# unset SESSION_MANAGER# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresourcesxsetroot -solid greyvncconfig -iconic &x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &#x-window-manager &gnome-session &
Next, I created a /etc/init.d/vnc4server file. It look like this:
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: networking
# Default-Start: S
# Default-Stop: 0 6
### END INIT INFOPATH=”$PATH:/usr/X11R6/bin/”
# The Username:Group that will run VNC
export USER=”chris” #<– my local user# The display that VNC will use
DISPLAY=”1″# Color depth (between 8 and 32)
DEPTH=”16″# The Desktop geometry to use.
#GEOMETRY=”<WIDTH>x<HEIGHT>”
#GEOMETRY=”800×600″
GEOMETRY=”1024×768″
#GEOMETRY=”1280×1024″# The name that the VNC Desktop will have.
NAME=”filebox-vnc-server”OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”
. /lib/lsb/init-functionscase “$1″ in
start)
log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vnc4server ${OPTIONS}”
;;stop)
log_action_begin_msg “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vnc4server -kill :${DISPLAY}”
;;restart)
$0 stop
$0 start
;;esac
exit 0
Finally, I installed and ran “sysv-rc-conf” to make the vnc4server process start when the machine boots (runlevel 2,3,4,5)
after rebooting the machine you should be able to access it via vnc. Try it locally with a vnc viewer by using host: localhost:1
JPA Annotation Cheatsheet
Whenever I need need help configuring JPA annotations I turn to google, and I always find it difficult to find a good cheatsheet.
Well here is my favorite JPA annotation cheatsheet. Even though it says Oracle and Toplink it applies to any Spring/JPA/Hibernate technology stack:
http://www.oracle.com/technetwork/middleware/ias/toplink-jpa-annotations-096251.html
Oh yeah, and here’s my tip on using cascades: Never use CascadeType.ALL! Use MERGE, PERSIST, and maybe REMOVE if you want to cascade your deletes. CascadeType.ALL will result in poor performance and unintended consequences.
Configuring Jetty, Maven, and Eclipse together with Hot Swap
This tutorial will show you how to setup Jetty in embedded mode, and using Eclipse, attach a debugger to enable True Hot Deployment of code onto your Jetty server.
Click to continue reading “Configuring Jetty, Maven, and Eclipse together with Hot Swap”
And… We’re Back
I blame wp-supercache. I knew something was funny when the twitter posts on the front page were from many many moths ago. I figured its like your web browser – just delete the cache and you’ll be all set. Well when I deleted wp-supercache’s cache, my site went down, and it took me a couple of days to bring it back up
The fix?
1 -Disable plugins via the database:
2 – Modify .htaccess to comment out or remove the section relating to wp-supercache.
wp-supercache has always caused some oddities. I will no longer be using it.
Tutorial: Palm Pre SDK
The Palm Pre SDK, named Mojo, is not supposed to be available to the general public of developers for a few months. Apparently it was leaked on the internets last night. I was able to get a Hello World program running on the emulator. Here is how I did it.
Environment:
Windows XP
Java JDK 1.6.0_11 (any 1.6 probably works)
Any modern CPU should work. Mine is 32 bit – not sure about 64 bit.
The emulator takes ~300MB of memory so you’ll probably want at least 1GB.I’ve got 2GB
1 – Download and install VirtualBox
(http://www.virtualbox.org/wiki/Downloads). I am using version 2.2.4
2 – Download and install the SDK.
Palm has the SDK available for free download. I think registration is required.
link: http://developer.palm.com/index.php?option=com_content&view=article&layout=page&id=1788
3 – Start the Emulator.
When the SDK finishes installing you should see a “Palm Emulator” icon on your desktop. Open it.
The emulator should start up and it should look like this:
Linux kernel starting

Click to continue reading “Tutorial: Palm Pre SDK”
ATVs are Awesome!
Need Personal Health Insurance?
Hardwood Floors

Dayna and I ripped up the carpet in our living room and dining room and installed hardwood there instead. Pictures Here



