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;

Sunday, July 27, 2008

Catholicism and Islam: Two Insane Peas in a Violent Pod

Note: This post is a year and a half out of date. Found the draft when I was working on another post. Figured I might as well post it.

Remember a while ago, fundamentalist Muslims got all up in arms over an irreverent depiction of that Muhammad dude? The news was filled with crazy fuckers who were rioting and burning effigies in the streets. Not to mention all of the calls for the guy to be fired/arrested/beheaded/anally raped and so on and so on. People over here were calling the reaction barbaric and couldn't believe how violent Islam was.

Fast forward to a few weeks ago. Some kid in Florida goes to mass and procures a communion wafer. The short version, the kid got assaulted by some of the Catholics in the church and faked eating the wafer just to get them to stop pawing at him. (Am I the only one that pictures a scene from some zombie flick?)

So what do all these fundamentalist Catholics, who likely condemned the whole Islam spectacle, do? They go batshit insane with rage. Bill Donahue, leader of the Catholic League, fell down in a fit of apoplexy over how this kid kidnapped the cracker. Whatever branch of the Catholic Mafia is based out of this kid's university have caused him all kinds of trouble, including death threats, trying to get him kicked out of the school over a hate crime (don't get me started on how that's an affront to actual hate crime victims,) and arrested. Even the kid's friend, who asked him to get the cracker, has been blocked from registering for classes.

Time for the standard disclaimer: If you are a Catholic who does not view this student as an agent of Lucifer and think the whole thing is blown way out of proportion, I'm not talking about you.

Sunday, July 13, 2008

Another Missed Opportunity

So a church in Oklahoma City, Oklahoma decided to have a youth rally.

No big deal.

To draw kids, they wanted to give away a semiautomatic assault rifle.


You'd think a fishing pole would have been a much more symbolically relevant prize. Hell, for $800.00, they could have gotten a few top notch poles.

Tuesday, July 08, 2008

Ruby on Rails Errata

@pull_list = Pull.find(:all, :include => [:book, :customer],
:conditions => ["customer_id = ?", params[:id]])

When using a condition in RoR that relies on a passed in value from a link_to function, remember to use params formal parameter name to use it.

That is all.

Tuesday, April 15, 2008

Expelled: Integrity, Honesty and Competency Not Allowed

Have you heard about that movie called Expelled? (I COULD link to the actual movie site but I don't want to contribute to their page rank.)

Anyway, the stated premise of the movie is that there are some people whining about not getting tenure because they believe in creationism and not because they just aren't smart enough to earn their spot.

Of course, if you look at the reviews you'll discover the unstated premise: If you don't accept Jesus Christ as your Lord and Savior and accept the biblical account of how the world started you are morally equivalent to Hitler and Stalin, biding your time until the time is right to usher the poor, oppressed christians into ovens and gas chambers.

I was going to summarize all of the nonsense that has been swirling in the bowl with this turd of a movie but other folks have done a far better job than me. The short version is that from the moment this movie was conceived it has been an exercise in dishonesty, lack of integrity, and apparent incompetence. Take a look at Expelled Exposed or Pharyngula, the blog of PZ Myers.

From what I've heard of this movie, it only really plays to the pre-converted. The only positive response is coming from the folks that gnash their teeth over evolution and how it is destroying the moral fabric of society. I suppose there are enough of these people out there for the producers to make some of their money back. It worked for Mel Gibson and his snuff flick after all.