Sunday, May 09, 2010

JavaDB Many-To-Many SQL Syntax

create table schema.table name(
column_id column_type (column_parameter(s)) references schema.primary_table_name (primary_table_column)
primary key (column_id, column_id)

foreign keys must be the same type and size as their primary key counterparts.

Sunday, March 14, 2010

The Newest Driver is not Necessarily the BEST Driver

Just upgraded my computer to Windows 7 and my headphones stopped working. After downloading five different drivers, I backed into the solution.

Find your device manufacturer. If you are like most people in the world, you bought your computer as a complete system. Any manufacturer worth a dang will have the specs for your hardware on their website. Look up your particular model and get the manufacturer name for the component you need to work on.

Find the correct driver. Once you've found the component manufacturer, next step is to find the correct drivers. This does not always translate as the NEWEST driver available. For instance, Windows has a tendency to use a generic driver if the most recent driver for the component is older than the generic driver. This will pooch your component. If your computer manufacturer does not have a way to get drivers, the component manufacturer's website is just a google away. You are looking for the newest available driver for the specific component. For instance, I have an IntelGMA945 motherboard with integrated audio. I searched for drivers for that particular motherboard and got one dated 11/07. The windows generic driver was dated 9/10. In this case, I needed to use the older driver. And it worked.

Mostly this post is for when I inevitably forget, but if you got some use out of it, you're welcome.

Wednesday, January 13, 2010

Java Tree Recursion

This is the basic recursion algorithm for a tree in Java.

public Object recurse(Object obj){

Object result = obj;
boolean found = result == baseCase ||
result == baseCase2

if (found)
return result;
else {
ObjectList list = getObjectChildren(result);

for (Object child : list){
result = recurse(child);

found = result == baseCase ||
result == baseCase2;


return result;