Charles Rand Barnett / Dot Trombone LLC

Musician & Software Developer


Welcome to the dottrombone.com site!

Site Map

I started programming around the time the first Apple II came out. We had an IBM PCjr. Others in the neighborhood had the Commodore 64's. They all ran Basic. I got heavily involved in music during my high school years and went on to doing that for 7 years in the US Navy. While I was in the Navy, I got into computers again during the Windows 95 years. I had a 486 DX2 50MGhz computer with a Math Co-processor!

I got out of the Navy in 2000 and did my best to make it as a musician. It didn't pan out. I'm just wasn't social enough to make that happen. My Dirty Pot recording was about the best I did. It got to the point that I could just not gamble on music anymore and that was when I got into programming as a career. I studied the math of collision detection as a way to become a programmmer. That certainly wasn't the easiest way to get into professional programming, but it did lay a solid foundation of computer programming skills.

Here is an example of the computer and math work I do. This is the math behind the menu on this website:

var slantLength = 15;// the horizontal length of the slanted line

// xO stands for x origin, the bottom left of each diagonal line
// xmn stands for x mouse now

var xmn = menuLastMouseX;
var angle = Math.atan((canvas.height + 2) / slantLength);
var sideA = canvas.height - menuLastMouseY;
var sideC = (1 / Math.sin(angle)) * sideA;
var sideB = Math.cos(angle) * sideC;			

var xOffset = sideB;

if(xmn - xOffset > xO && xmn - xOffset < xO + textWidth + textTrailingWidth)
{
	ctx.fillStyle = "yellow";
}
else
{
	ctx.fillStyle = "white";
}

But as is often the case, we don't need fancy trig to do this. We can simply use ratios!

var slantLength = 15;// the horizontal length of the slanted line

// xO stands for x origin, the bottom left of each diagonal line
// xmn stands for x mouse now

var xmn = menuLastMouseX;

// a/b = c/d
var a = canvas.height + 2;
var b = slantLength;
var c = canvas.height - menuLastMouseY;

// now cross multiply and divide to get d
var d = (c * b) / a;

if(xmn > xO && d < xmn - xO && d > xmn - (xO + textWidth + textTrailingWidth))
{
	ctx.fillStyle = "yellow";
}
else
{
	ctx.fillStyle = "white";
}



This is one of the cleanest MySQL join queries I've written. I did this in the summer of 2020 for my curry business:


$allMenuItemIngredients = queryResult("

SELECT menu_items.id as menu_item_id, menu_items.name as name, ingredients.name as ingredient, ingredients.measurement as measurement, ingredients.measurement_per_cup as measurement_per_cup, menu_item_ingredients.quantity as quantity

FROM menu_items

LEFT JOIN menu_item_ingredients ON menu_items.id = menu_item_ingredients.menu_item_id

LEFT JOIN ingredients ON menu_item_ingredients.ingredient_id = ingredients.id

GROUP BY menu_item_ingredients.id

ORDER BY menu_items.name");

foreach($allMenuItemIngredients as $k=>$v)
{
	echo $k . ' = ' . $v . '<br />';
}