The Nerfherder

Editorials on the cross-section where politics and culture meet cyberspace

Sunday, July 31, 2016

Do the Political Party Conventions Matter? Not according to the Betting Markets...

Think what you will about the party conventions that just wrapped up, but one thing worth pointing out is that, despite the so-called boost in polling that candidates receive coming out of their convention, temporary as it may be, this boost doesn't really exist if you look at a different metric than polls - the political betting markets.

Political betting markets have often proved to be a better predictor of electoral outcomes than public opinion polls, particularly the further away the analysis is done from Election Day. So with the Republican and now Democratic conventions just completed, this is what the betting markets have had to say regarding who will win the presidential election...

Click image to enlarge

This is a 30-day snapshot with the conventions occurring during the second half of the chart. Do you notice those drastic swings for and against Hillary Clinton and Donald Trump? If not, you're not alone. There is virtually no discernible change for either candidate.

For the record, as of July 31st, the betting markets favor Hillary Clinton winning the presidency over Donald Trump by a 68 to 35 margin (these are not percentages but rather how many cents it would cost per dollar to "Buy Yes" for each candidate).

So do the conventions matter? According to the betting markets, not in the slightest.

Thursday, July 28, 2016

Basic Minecraft Programming Examples...

In the last post we reviewed how to set up Python for Minecraft. Once you have it up and running, jump right in and try these two simple scripts that not only demonstrate what Python-for-Minecraft programs look like, but are also both really useful when you're actually playing.

Example 1: Teleport to your starting location (or any location)

As most Minecrcaft newbies and veterans alike can tell you, sometimes you just want to go back to your "home base" (wherever in your world that might be) without needing to hike all the way there or even needing to figure out where it is. Wouldn't it be helpful to have an easy way to teleport there whenever you wanted?

As soon as you start a new game, click on "F3" to see lots of in-game details display on the screen. Pay particular attention to the three "Block" numbers (or XYZ numbers). Then try this...

from mcpi.minecraft import Minecraftmc = Minecraft.create()

# Replace these numbers with your three starting "Block" numbers

x = 20y = 80z = 16

mc.player.setTilePos(x, y, z)

Example 2: Instantly build a shelter

Most players have to spend their first day gathering materials to build a shelter before nightfall. But you can try this instead whenever you want to instantly build yourself a cobblestone shelter right next to your present location. You can even build it in the sky!

Step #3: Run the Spigot Server. Open the "Minecraft Tools" folder (that you extracted in Step #2), then double-click the file: "Start_Server". Without closing the Spigot window, open Minecraft and choose "Multiplayer", then "Add Server". In the server address box, type "localhost", then "Done". Double-click the server name listed and your game should start.

If you have a compatibility issue when you double-click the server name, exit back to the Minecraft launcher and create a new profile. Edit the settings for that profile by selecting an older version release (for example, 1.9.4)

You're now totally set up. In the future, when you want to write the code for your programs, use IDLE (a text editor installed when you installed Python). In order to execute your finished programs, make sure to run the Spigot server and Minecraft, and simply click "F5" within IDLE.

Thursday, July 07, 2016

Using Tableau for Political Visualizations...

If you're curious about how Data Science is being used to analyze political data, look no further than Tableau - an easy-to-use tool for converting analytics into fabulous visualizations.

Recently, Tableau held a Politics Viz Contest to showcase some of the work their users are generating. The contest winner, Robert Rouse, used data from a Pew Research Center report to visualize increasing political polarization in the U.S. over the past few decades (Click on the image to enlarge and see the details):