Prez Play Pro Progress

Thus far, if I spend this much time fixing stuff, it’s really frustrating because I’m not learning anything, I’m just trying to figure out what’s broken and why — but it wasn’t my own mistake or lack of knowledge.

This time, however, it is TOTALLY my lack of knowledge so each time I hid a bump, I learn something. Each problem I solve — I learn how and why what I did wasn’t working and how to do it correctly!

A lot of my work super-recently has been learning and using Javascript‘s map, reduce, and filter methods. I was depending on SQL queries (my database being MySQL, if you’re curious … though I was using MariaDB before changing hosting plans) to get the exact results and data visualization I wanted but, for multiple reasons, I’d prefer getting all the results from my database and manipulate the data client-side with Javascript.

Much of what follows is actually from an email I just sent to the American Nazi Party replying to an answer they sent to a question I asked a couple weeks ago. Say what you want about nazis, whenever I’ve asked a question, they’ve sent a polite and meaningful answer. Not all candidates/parties are responsive, let alone courteous. Anyway, I was explaining why I asked my questions and what I was doing.

So, here are my latest screenshots along with what is still in progress, etc.

If only what I consider “right” candidates run — excluding Trump because, of course, he’d win every state, then Gary Johnson wins every state. If we exclude him as well, Darrell Castle (usually Constitution Party) wins all states in which he runs except Arkansas where Jim Hedges wins. The gray states have no conservative/right candidates.

Screen Shot 2018-11-17 at 10.17.24 AM.png

Whatever happened to the Natural Law Party and Reform Party? Maybe the former are all write-in candidates (Darn it! I need to get write-in data!). I know the Reform Party was only on a couple state ballots in the 2012 election — not only that but with two different candidates. I read somewhere at least one state Reform Party nominated a different candidate because, despite how conservative Andre Barnett was (and still is, I assume), they didn’t like that he was (and still is, I suppose) black.

If only “left” or even just socialist candidates run, Jill Stein wins every state except Nevada, South Dakota, and Oklahoma (off the top of my head I think it’s simply because no “left” candidates besides Clinton were on the ballot there). If we only include socialists except Jill Stein, these are the results:

Screen Shot 2018-11-17 at 10.24.07 AM.png

Michael Maturen looks like he wins the most states (I don’t have electoral college votes in the code yet) and there are five tied in second place for number of states. Again, gray means there are either no socialist candidates in those states (except Stein) or, if there are — I need to clean up my data to make sure — there are candidates but none received any votes (which I find difficult to believe).

Once I get these all working, I’ll start adding previous elections and, hopefully, the next one won’t take two years to put together (in my own defense, most of that two years was the learning curve).

Advertisements

PrezPlayPro Progress

I’ve made so much progress since I last revised my schema in Nov 2017. Most of that progress has been in the last week — two weeks at the very most. The Mobile Web Specialist nanodegree program I’m in as a Google Udacity Scholar via a Grow With Google scholarship has made my skillset and confidence go all supernova.

See also: I have a dream come true (2012 results made manually in Photoshop)

Here is what I’m up to:

pppProgress.png
Gray states are those with no socialist candidates (or there were socialist candidates but they received zero votes).

This query fetches only socialist candidates (excluding Hillary Clinton in one state where she’s actually on the ballot as a socialist — she’s not included because then she’d win all the states … until I fix my query by, hopefully, finally completing the affiliations table below) to see who among would “win” among the socialist candidates.

Here’s the new schema … I still haven’t added a stateAbbr column to the affiliations2016 table which, I think, is the reason for a problem I’m having with my first major query.

schema_061918.png

I need some buttons to change what results are fetched and displayed including but not limited to:

  • Results if all the “left-ish” third parties voted for a single candidate — would that candidate have beaten Trump?
  • If all the right-ish votes went to Trump, would he have have won the popular vote?