Why Does It Work? Wait, what?

Preface

First, let me get this out of the way: The most frustrating thing about working on PrezPlayPro the last couple days is … I don’t know my states. I could list them all off the top of my head but if I could not pass a test where I had to label them. You know, like my kids do at school.

I need to practice that and know which are which. Seriously. As self-righteous as I get with my “nobody should be born a citizen — most people born here can’t pass the citizenship test and that just isn’t fair” I should, you know, be able to pass the citizenship test myself and know where Kansas, Nebraska, Missouri, etc. are without googling “usa map”.

Actual Post

Four months ago, I wrote that I was trying to perfect my SQL query selecting the “socialist winners” from my 2016 Presidential Election results database table. Here’s part of the screenshot from that post:

pppprogressCropped.png

Relatively recently, I created an Excel worksheet for party affiliations that included the state for each candidate/party pair and this week, I finally got around to importing that into my database.

Next step: fixing my SQL query so it used the new table!

But something weird happened.

I opened the page and saw this:

nowAll.png

I expected ZERO visual changes–I had not yet changed any code–but saw SIX states change color.

I had no theories but checked to see who won those states — they were all now going to Chris Keniston.  All states with no socialist votes stayed gray but Alyson Kennedy and Michael A. Maturen each lost three states. I looked at my code and saw his candidateID wasn’t even listed in my switch function so I added him. While doing that, I noticed  Dan R. Vacek, Jerry White, and Bradford Lyttle had a case each but none of whom won a state … I couldn’t think of a reason they’d be listed. All of this are the perils of returning to a project months later. I can’t even remember exactly what I wanted to “fix” about the final query!

doneForNowMaybe.png

I also added a stroke for the states so I could *ahem* tell the yellow ones apart.

I totally did not trust this so I looked at all the results for socialist candidates returned via SQL query.

Jill Stein won all six of these states — but, for some reason, with whatever query I used in June, those states went to Kennedy or Maturen and, yesterday, they all went to Keniston. I am completely baffled. Good thing I wasn’t in charge of the election results because this is what reality looked like in Vermont:

  • Chris Keniston     =        3
  • Alyson Kennedy  =        2
  • Jill Stein                =  6758

So, I am writing my query from scratch because it needs more than fixing.

Advertisements

About jotascript

Aiming to please. Seeking to impress.
This entry was posted in Debugging, Elections and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s