Wednesday, November 8, 2017

Car Stereo Install Part 1

I bought a 1994 Mitsubishi Might Max pickup truck a year ago.

I got it so that I could teach a couple of kids to drive on an (increasingly rare) stick shift vehicle, so my requirements list was pretty small.

This was a year ago, October 2016.

Among other problems, the truck had a mass of dangling wires where the radio should have been.

My friend Jeff commented that he got a radio for $30, and instead of being proud of my cheapskatery, I found myself feeling embarrassed that I hadn't bothered to check.

I decided to install a stereo in the pickup. This $20 bluetooth radio from Walmart

I pulled on the wires, looked at the ragged hole the previous owner left when they removed whatever was there. And I shorted out the instrument panel as I started looking at the wires. I drove the truck with no visible speedometer after dark for several days. I was left feeling a lot less confident in my abilities.

Then I drove home to Richland Washington for a couple of weeks to visit with wife and children, leaving the

When I returned I determined I would man up and get the radio installed. And discovered that My parents don't have any of the tools for this job.

Undaunted, I bought a soldering iron, heat gun, heat shrink tubing, wire stripper and a multimeter. (At this point I'm not sure, but it might have been cheaper to pay someone to install it, but I get to keep the tools, so still a good deal, right?)

I found a wire color diagram online, but EVERY SINGLE wire color was wrong, I assumed I would have to probe them all with the multimeter. I found persistent 12V. I found the "accessory +12V", I eventually figured out the ground, dimmer and illumination wires, which sadly had no matching wire on the radio I bought. I watched a video on Youtube about tinning your Soldering Iron (I really suck at soldering. I guess I've never really learned how it is done).

After soldering and heat shrinking the power wires, I replaced 3 burned out fuses. It was time (late really) to leave for work. I made a real effort to put away all my tools and supplies, making me late (since I was pushing my time). As I was doing this I thought "I should always put everything away when I have to stop in the middle of a project. How many times have I left things out and then returned to the project much later than intended, only to find that the things I left out have been damaged or lost because I left them out?"

When I pulled in to the parking structure at work,  found that the instrument panel lit up again! This was much appreciated.

A day (and several hours of soldering later) the radio worked, but only out of one speaker (the right speaker has a broken wire, I have no idea what the deal is with the internal speakers if they are even still in the dash).

But I did it myself. I learned something. And I made my little truck a little better.




Friday, September 29, 2017

Missing mens wedding ring "My love, for eternity, Amie"

A few weeks ago, I misplaced my wedding ring. I've looked everywhere I could think of and asked at the gym, at work, and anywhere I could think I might have been dumb enough to take it off, but to no avail. On the slim chance that someone might find it and search, I'm posting here. It is a plain rounded band with an inscription inside, which says "My love, for eternity, Amie"

I really didn't want to publicly out myself for being such a fool, but after nearly a month of being gone, it seems like being found by a stranger is as likely an outcome as any other, and after almost 18 years of marriage to my sweetheart, that ring represents the most precious things in my life. I hate to replace it.

Thursday, April 13, 2017

Splitting a single monster git commit

Sometimes for whatever reason, you are working on a change or a new feature, and
one thing leads to another, you find a bug and fix it here, you need some new structure
there, you need to change the return value or the parameters for another existing feature,
you change something, only to find out you didn't need it, etc, etc.

This goes on along as you hack out the details, and finally, the shiny new thing is complete.
You commit it. but when you sit back and look at your new feature, or worse, when your team
gathers around the table for code review, they note that it includes a huge amount of stuff which
isn't part of the feature.

"How are we supposed to even review this? Fix it! Split up the commit."

This post is a guide to how I prefer to split a commit.

  1. create a new branch to keep the old branch around until we're sure the new one is good
    git branch original_monster_commit
  2. If your commit is the most recent one, skip to step 4
  3. OR if it is not the most recent commit: do an interactive rebase on a commit before the monster, and mark the monster commit with "e" for edit 
    1. git rebase -i some_commit
  4.  do a soft reset to the previous version (This is technically a dangerous thing to do, but remember, we're safe because we created that branch in step 1)
    1. git reset HEAD~1
  5. Form a strategy:
    1. Look at the changes with git diff.
    2. Ask youself:
      1. What changes go together?
      2. What changes are dependent on other changes
      3. What changes might require temporary changes to stand alone?
      4. Are there a class of cleanups or whitespace changes that should be bundled
  6. Repeatedly Add and commit your changesets
    1. git add -p
    2. git add <new_filename_if_applicable>
    3. git commit
    4. git stash 
    5. make sure your tests pass, compile succeeds, etc
    6. git stash pop
  7. finish the rebase (if this was not the most recent commit)
    1. git rebase --continue
  8. When there are no uncommitted changes, check it against the saved branch (You did create an extra branch in step 1, didn't you? DIDN'T YOU?!!!!)
    1. git diff original_monster_commit
  9. If they are the same, you're done!