Monday, July 27, 2015
My first step was to create the database to hold games scores and betting lines which was simple enough. I have fields for the season, date, the home team and their score, the away team and their score, the betting line, and two extra fields to note when the game was in a neutral site (in which case both teams could be considered away teams) or if the NBA franchises in New York or Los Angeles were playing each other (in which case both teams could be considered home teams). Since the 2015-2016 schedule won’t be released until next month, I intended to playtest using the 2014-2015 schedule. I quickly found the entire schedule and scores on basketball-reference.com which provided a convenient CSV (comma separated values) export that I was able to massage and plug into my data table in minutes.
Having saved hours of data entry duty thanks to the power of the internet, my next job was to get the betting lines for each of the 1,230 NBA games that were played last season. This was no easy task since gamblers are a forward looking bunch and past betting recommendations and lines are not generally saved. I couldn’t find them on any of the sites I used when I was making my basketball picks during the season. Just before I was ready to search through old newspapers and microfiche at the library I stumbled upon freeplays.com which has closing betting lines for NBA games starting with the 2002 season! There was no handy download feature like basketball-reference.com so I brought up each day of the 2014-2015 NBA season, entered the betting lines on my spreadsheet, and updated the database from the spreadsheet. Entering each day’s worth of games took between one and three minutes and there is no reason to think my data entry was 100% accurate. After almost seven hours spread out over the past week I have a database of the 2014-2015 NBA season complete with betting lines.
Thanks to freeplays.com I have the possibility of entering the past 15 years of NBA schedules and betting lines but the data entry would take me around 100 hours. If I have the need to get that information in my database I’ll write a program to scrape the data from the freeplays.com website. For now one season’s worth of data should be enough to test the prediction program that I haven’t written yet.
My program from 30 years ago assigned home and road power rankings to teams using a weighted average of point differentials from the season as a whole, the point differential of the last x number of games, the season's home or road (depending on current game) point differential and the point differential of the last x number home or road games. I then compared the teams’ rankings to get my point spread and compare it to the spread in the paper. There will be some games where my rankings differ greatly from the published betting line and many more that are very close to the line. My goal is to discover a formula that causes my prediction percentage to have a positive correlation to the difference between my projections and the betting line. I needed at least one month of data to have a large enough sample to create rankings. Running against even this small amount of calculations would take hours using the computers of the 1980’s.
Last century I wanted to add variables to account for back to back games, four games in five nights, days of rest, the last game of a long road trip, and the start of a home stand. I had the data and the knowhow but not the hours these variables would have added to the tests. The computers of 2015 can easily handle all these variables and more. I spent a few hours on Sunday afternoon adding views to my database to show me point differentials for home games, road games, and the season in total as well as selected increments of past games for trending purposes. Over the next week I’ll add the activity variables (back to back games, four games in five nights, etc...). Once that’s done I’ll work on the rough sketch of an application to run tests using different weightings of these variables. The ideal application will allow me to create a script of multiple scenarios that I can run before I go to bed and check on the results in the morning. In the late 1980's running tests on a few months of data took hours using the standard personal computers of the time. The processing time convinced me to use the first formula I found that gave me a positive correlation (and results better than the magic 52.4% break even mark). In the 21st century these same tests will take minutes if not seconds. This increase in speed gives me the luxury of being able to do more testing and at the same time puts a priority on designing my testing platform to take advantage of the opportunities provided by the increase in speed.
Once I have the variables and the testing application in place the last step is to create an application that will determine the actual picks. This should be a simple offshoot of the testing program. I’m amazed at how fast this project is coming together compared to my first effort 30 years ago. At the same time I’m not too surprised. Technology has made most things easier and creating a basketball prediction program is no exception.
Friday, July 24, 2015
The Last Ship's adversary in Season 2 are the 'Immunes' and their nuclear powered submarine!
TNT’s Sunday Night post-apocalyptic summer seasons of ‘The Last Ship’ and ‘Falling Skies’ are at the halfway point of their seasons and I haven’t missed an episode. Last month I wrote about how much I like ‘The Last Ship’ and the four episodes since haven’t changed my opinion in the slightest. After taking back their ship in the two hour season premiere, the crew of the US Nathan James spent episode three searching for their families and making contact with secret government laboratories set up to produce and the cure to the deadly virus plaguing that the crew created in season one. Episode four saw the crew back at sea and battling a trained military outfit on a hospital ship. In episode five the trained military outfit was revealed to be from a nuclear powered submarine that engaged the Nathan James in a game of cat and mouse that ended with the sub wiping out all the government laboratories with their nuclear missiles. In episode six we find out the submarine commander and crew are part of the 5% of the population that is naturally immune to the virus. The ‘Immunes’ are bent on establishing a new world order run by them. Their plan does not include curing those not immune to the virus which is why they rained nuclear destruction on the government laboratories. Niels (the man who invented the virus and is an immune carrier of the disease) has thrown his lot with the Immunes, helping out by infecting camps of survivors merely by being present and weeding out the true Immunes when they don’t catch the disease and die within days. Captain Chandler has led an away team to the Florida Everglades where they have infiltrated the ‘Immunes’ and discovered one of their number is the Secretary of Housing and Urban Development and by succession the President of the United States!
The Last Ship sends out an 'away' team very reminiscent of the original Star Trek!
In my opinion ‘The Last Ship’ is the best show in television. Each episode is tightly focused on a direct mission while each mission is woven together into the upcoming final battle with the ‘Immunes’ and the nuclear powered submarine. The show has enough action and tension to keep me watching and very little of inane ‘character development’ that would drive me away. I am a believer in the saying ‘Adversity doesn’t build character – it reveals it’ and by putting the characters in adverse situations they get to show their character or lack thereof far more than scenes that do nothing but let the characters emote. The ratings for the show have held steady at three million viewers a week in season two which is down 33% from last year but still a considerable number. The special effects and large ensemble cast may make this show too expensive to renew. I’m hoping for at least another season of this engrossing show.
Some of the epic alien battles from the first four seasons of Falling Skies.
While ‘The Last Ship’ is trying to start a long run, ‘Falling Skies’ is in the planned final season of its five year alien invasion saga. This show was one of my favorites until the third season when it started to become a disjointed mess of plot lines that had to be hurriedly resolved at the end of each season. Last season was more of the same with our heroes, the militia of the 2nd Mass, losing the assistance of their alien Volm allies with a throwaway line of dialogue at the beginning of the season and ending the season with the resistance leader Tom Mason flying a suicide mission to the moon with his alien powered daughter to take out the invading Espheni power generating facility. The season ended with Tom lost in space while season five starts with Mason having a hallucination while his ship crash lands in a body of water close by to the 2nd Mass camp. The explanation for this implausible continuation is being revealed in an excruciatingly slow fashion and like other plot leaps in past episodes will likely be swept under the run and forgotten about.
A terrifying scene with genetically altered bugs!
Somehow our hardy band of alien fighters has been completely rearmed with more weaponry than they ever had at any point in the series. With Mason’s moon mission successfully knocking out the invading Espheni moon based power supply the 2nd Mass is trying to take the fight to the aliens with the help of 300 militias around the world that are communicating using Volm technology. I was expecting episodes of our heroes slowly taking back their planet but the 2nd Mass is having the same struggles for food, gasoline, and vehicles that they have had throughout the series. Instead of fighting off the Espheni mechanical weaponry (which have no power), the 2nd Mass has been fighting biologically altered creatures that resemble hornets.
While the 2nd Mass fights off the hornets, Mason is still hallucinating but has discovered his hallucinations are communications from the extra dimensional Dornian race. This has taken up about a minute of each episode. Instead of an alien battle, the focus has turned to a showdown between Mason and his arch rival Pope. Pope is the bad boy rebel of the 2nd Mass with a sketchy past but found his place with the resistance and even a love interest in Sarah, a former pill-popper. Pope and Sarah were on a scouting raid in episode 3 when Sarah got caught in an Espheni trap. Pope headed back to camp to get help but Mason was taking the truck on a raid to kill the hornet creature and refused to delay the mission to help Sarah. When Sarah was gruesomely half eaten by aliens, Pope snapped.
With aliens of all shapes and sizes to choose from the focus of the final season of Falling Skies is a kidnapping better left for a cop show like Blue Bloods!
So instead of fighting the aliens in the final season of Falling Skies, we are treated to the annual vendetta between Pope and Mason. Pope kidnapped Mason’s wife in episode four but let her go after five minutes of pontificating which included showing him shaving his head (Pope had long hair that would make a biker jealous). As soon as Pope let Mason’s wife go he kidnapped his son Hal and the preview of episode five is yet another confrontation between Pope and Mason. Even if this is the final episode in the five year vendetta I would much prefer seeing humans battle aliens and leave the good guy/bad guy confrontations to police dramas.
Pope and Mason have been feuding for four seasons and in season five are still at it. This is the problem with the show in a nutshell. There is an alien invasion, genetically altered creatures roaming the land devouring humans, members of the resistance with alien powers, and plenty of unexplored storylines. Yet the show is stuck rehashing the same conflict from four seasons ago. There are six episodes in the series – not the season – the series. After next week’s battle between Mason and Pope there will be five episodes left. I’m sure the final episode or two if the series will be as rushed as the last three season finales as the showrunners finally realize there’s only an episode or two to wrap up all the loose ends.
Falling Skies started out as a blockbuster with five million viewers a week. The viewership has slowly dwindled to fewer than 2 million viewers per episode this season. The show is ending this year and like my previous favorite show ‘Burn Notice’ has run out of steam. As disappointing as this season has been so far I’m hanging on as one of the two million viewers to see how it ends but if it wasn’t following ‘The Last Ship’ I wouldn’t make it to the end.
Monday, July 20, 2015
I didn’t expect the team to be competitive this year. It is a welcome surprise to think about the possibility of the Yankees making the playoffs for the first time in three years. The offense has been good (413 runs – 2nd in baseball) , the pitching spotty (10th in the league in ERA), and overall I was expecting the same sort of 85-90 win team that has been mired on the mediocrity treadmill the past few years. I have hopes for a postseason run because the team has the core ingredients for October success – great relief pitching and stellar top of the rotation pitching. Michael Pineda is finally free from the injuries that have plagued him since being acquired from the Mariners in 2012 and been every bit the ace Yankee GM Brian Cashman hoped for when gave up top prospect and proven steroid user Jesus Montero for him. Masahiro Tanaka hasn’t been worth his 7 year $155 million dollar contract but has been a competent and occasionally outstanding second starter. The bullpen has been generationally stellar with closer Andrew Miller unhittable and setup man Delin Betances (the first Yankee farm system product I’ve mentioned so far) looking as if he can be a generational closer himself with 79 strikeouts in 48 innings. If the Yankees can get to the playoffs and get a playoff quality starter from Ivan Nova or Nathan Eovaldi or CC Sabathia to go along with Pineda and Tanaka they could make 2015 a championship year.
The Yankee bats have been good enough to score the second most runs in baseball. The offense consists of past their prime sluggers (Carlos Beltran, Mark Teixeira, and steroid user Alex Rodriguez), above average table setters (Jacoby Ellsbury and Brett Gardner), and competent end of the order players in Brian McCann and Chase Headley to go along with good field no hit middle infielders. Every single one of the offensive players I mentioned are past the age of 30 which makes the possibility of a summer drop-off a concern but for now I’ll take leading the division in mid-July.
With a payroll of 211 MILLION DOLLARS (second only to the Dodgers $273 million) I expect the Yankees to be near the top of the league. I’m not saying the Yankees’ payroll should be enough to buy them a World Series but to spend 100 MILLION DOLLARS more on players than teams like the Royals, A’s, and Orioles and then be on the outside of the playoffs looking in while these low spending teams are participating makes no sense to me. If I owned the Yankees I’d hire the guy running the Tampa Bay Rays to run my team. The Rays consistently have the lowest payroll in baseball and consistently have a .500 or better team. They do this by having a better farm system than most other teams and it can’t just be because they get good draft picks – they’ve won 90+ games 5 of the last 8 years even though they can only keep a handful of their best players. The combination of the Rays farm system smarts with the Yankees wallet could be a dynasty for the ages.
I didn’t see any of the All-Star game but I saw the headlines about former Yankee A.J. Burnett finally making it to the All-Star team in 2015 in what is his final major league season. It was a feel good story that turned into a feel bad story when Burnett didn’t get in the game. Burnett started 6 playoff and World Series games for the Yankees 2009 to 2011 and was either quite good or really bad. Burnett won game 2 of the 2009 World Series when he gave up one run over seven innings. He followed that up in Game 5 by not giving the Yankees a chance when he gave up six runs in 2+ innings. In his game one start in the 2013 division Series for the Pirates, Burnett was torched for 7 runs in 2 innings by the Cardinals. He didn’t pitch in the rest of the five game series. I suppose I’m happy Burnett made an All-Star team but I can’t blame N.L. manager Bruce Bochy for not putting him in given his spotty record in big games. The bloated 33 man roster for the All-Star Teams means that in any given baseball game you will be seeing five all-stars and there are plenty of good pitchers besides Burnett. If the All-Star game roster was a standard 25 players Burnett likely wouldn’t even have been on the team.
One Yankee who didn’t make the All-Star team was Alex Rodriguez, who missed the entire 2014 season because he was suspended for steroid use. Rodriguez is second on the team in home runs with 19 and third in RBI with 52. Rodriguez turns 40 next week and is 89 home runs short of the steroid-aided record of 762 of Barry Bonds. Rodriguez needs 30 home runs a year over the next three years to break the tainted home run record. Logic says he can’t but logic also wouldn’t say that Rodriguez would have his best slugging percentage since he was 34 years old after a year suspension and yet he does. If A-Rod’s resurgence is the result of yet another breakthrough in performance enhancing drugs there is no reason he can’t break the tainted home run record.
The last thing I noticed about the All-Star Game was that it was in Cincinnati and all-time hits leader Pete Rose was allowed one of his infrequent associations with major league baseball. He was introduced on the field as one of Cincinnati’s franchise four players. Rose accepted a lifetime ban from baseball in 1989 after a lengthy battle with then Commissioner Bart Giamatti over whether Rose bet on baseball games as manager of the Cincinnati Reds. Rose didn’t admit to betting on baseball, claiming he couldn’t fight those charges and his income tax evasion trial at the same time. Giamatti died of a heart attack a few months after Roses’s ban and the stress caused by Rose’s public battle with him was largely credited with causing the chain smoking and overweight Giamatti's death. This led to a ruling by that players on baseball's ineligible list are not eligible to be on the Hall of Fame ballot and effectively locked Rose out of baseball's highest honor until he is reinstated by Major League Baseball.
26 years have passed since Rose’s suspension. In 2004, Rose wrote a book called ‘My Prison Without Bars’ in which he admitted he bet on baseball as a manager. Earlier this year Rose applied for reinstatement to new baseball commissioner Rob Manfred (the third commissioner since Giamatti). Last month ESPN claimed to have obtained documents proving Rose bet on baseball while he was still an active player.
I think new Commissioner Manfred would like to score a public relations coup by letting Rose become eligible for the Hall of Fame but will resist that temptation and will be reinstated posthumously if at all. Letting Rose into the Hall of Fame would make finding out every detail about his gambling a career making story for every sports journalist. The reason that only dead people are allowed on stamps, coins, and bills is to keep the honoring institutions from being embarrassed. Penn State no doubt thought honoring Joe Paterno with a statue while he was alive to enjoy it was a great idea and the Big Ten no doubt thought that naming their football championship trophy after Joe Paterno while he was alive to enjoy it was a great idea. When Paterno became embroiled in the Sandusky child abuse scandal the statue was removed from the Penn State campus and his name removed from the trophy to the great embarrassment of the Big Ten and Penn State. I can’t see Major League Baseball letting Pete Rose in their Hall of Fame until he’s passed away and not available to confirm, deny, or even say no comment to any future gambling allegations.
Friday, July 17, 2015
I don’t charge more than $5 for any of my tournaments and saw no need to collect payment in advance but I wanted to validate the people who were signing up for my tournaments as opposed to popping up a text box for anyone to put any name into. I had a signup link for my email list at the bottom of each web page that fed into an email table. I modified my email list table into a user table and changed my email sign up link to a ‘Login’ link that I placed at the top of each web page.
When the user clicks the login link they can enter their email address and password, request a new password, or sign up for a user account. I thought about adding exotic features like challenge questions for a lost password or a username instead of the email address. After some reflection I came to the conclusion that I could add them later if the need arises. One scenario that could make me take this step would be if someone starts requesting new passwords for people by guessing their email accounts. I don’t think this will happen but it only takes one bad apple to spoil the barrel.
Once a user signs up or logs in, the login link is replaced by ‘Logout’ and ‘Edit Profile’ links. The ‘Edit Profile’ brings a user to an Edit Profile web page that looks similar to the ‘Signup’ page with the addition of a ‘Family Member’ list users can add, edit, or delete. It is a simple little function but it meets my purpose for connecting players to a user.
Not every tournament I have on my website will allow signups so my next step was to add a flag to my tournament table that lets the website know whether the tournament allows user entries and an additional table that assigns sections to each tournament. Then I had a number of changes to my tournament page. When a tournament has sections I display a link that allows any viewer to see who has signed up for the tournament and what sections they have signed up for. I didn’t want to reroute users to an entirely new web page so I show the participants in a pop up box that can be discarded in one click.
The final step was to enable a tournament sign up link. I only show the link when a user that has at least one family member is logged in, the tournament allows manual user entry, and the current date is before the tournament date. That last step sounds odd but if I’m having a tournament where I don’t have internet access I don’t want people signing up for a tournament online when I have no way of knowing about it. When the user clicks the link I do some SQL (Structured Query Language) to perform a ‘cross join’ between the tournament sections and the user’s family members and I have a nice popup with a check box for every possible combination of users and sections. To test my changes I created a test tournament, signed myself as a user on four separate accounts, added family members to each account, and started signing up for tournaments. I created an email module and sent the user an email whenever they save a tournament signup and sent myself emails whenever a user signed up, changed their profile, did anything with a family member, or signed up for a tournament. Not only will I know who signs up for a tournament but I will also be the first to know if anyone adds profanity laced family member names and signs them up for tournaments. Last week I added a ‘shutoff’ switch to all the users and family member records that would allow me to block anyone I deemed abusive from signing up for tournaments.
Tournaments that allow for user signup will have a 'Sign up for the tournament' link. Click on the link and a popup box will display each family member and each section. Check the appropriate box(es) to enter the tournament.
You can see who has signed up for a tournament (and verify your entry) by clicking the 'Tournament sign up list' link.
I expected to finish these changes by the end of July and I’ve finished three weeks early. My next project is to create a 21st century version of my basketball prediction program. I expect that to be an easier project than adding a tournament signup sheet because I will only have one user – myself.
Monday, July 13, 2015
America's most prolific beagle bloggers - Baxter and Daisy have agreed to take time out of their packed schedule to once again provide expert guidance and opinion for their legion of readers in another guest blog!
Luckily on July 4th we had our 4th annual convenience store beef stick taste test. We went to all the neighborhood convenience stores and sampled their beef sticks! YUM!! I love beef sticks! YUM!! What a difference a year makes Baxter. Last year the most expensive beef sticks were at Casey’s. They were 59 cents each and two for $1.08 while everyone else charged $1 for two beef sticks. Casey’s finished last in our 2014 beef stick awards. Jiffy and Kum & Go tied for first. Kum & Go won the Daisy and Baxter beef stick award in 2013 and last fall they raised their beef stick prices to 89 cents each and three for $2. The Jiffy won the award in 2012 and this year they raised their prices to 69 cents each and two for $1.29.
I don’t know why beef sticks are so expensive, Daisy. Me neither. Hank said that because the beef sticks cost so much we couldn’t afford trophies for this year’s award winner like we gave out last year. Luckily the Daisy and Baxter convenience store award is such a prestigious honor that a trophy isn’t really necessary. We still needed to do our due diligence to pick the most worthy award winner so on July 4th we got up at 4am and had our breakfast before heading to our first destination, the Jiffy convenience store.
On the way to the Jiffy, we passed the Wells Fargo bank...
the laziest, rudest, most beagle unfriendly bank ever.
Poor Vince has to work so hard ringing up the extra money for beef sticks he can't make fresh coffee...
Jiffy – 1 1/2 paws
The new Food & Gas Mart has a thing or two to learn about providing a top notch beef stick experience...
Food & Gas Mart – 1 paw
We took our morning nap while Kathy and Hank did their Saturday shopping and then it was back to work! What a great job it is being a convenience store beef stick taste tester! YUM!! At noon we went to the Casey’s. We’ve been going to the Casey’s every weekend morning. Hank gets a 74 cent refill coffee and we get Aldi beef sticks. On the 4th we went to the Casey’s at noon and instead of Aldi beef sticks, Hank got us two Old Wisconsin beef sticks for $1.38 and since it was pretty hot he got us a cup of crushed ice with water for 15 cents. Old Wisconsin beef sticks have more water than the Jack Links brand. That makes them taste a little on the fatty side. The ones we got were very fresh and the best tasting beef sticks of the day! YUM!! I thought they were the best too. Hank was in and out of the store in seconds and the ice cold water and crushed ice was very refreshing. There’s nothing I like better on a hot day than some crushed ice to go along with my beef stick treat! YUM!! I’m giving Casey’s four paws. I’d like to give Casey’s four paws but I’m only giving them three because of the high price of their beef sticks. I did appreciate the crushed ice however! I don't like judging the beef sticks on price. Maybe we should give Hank a half paw for being such a cheapskate!
Casey's – 3 1/2 paws
After our noon walk we took our afternoon nap and at 3pm it on to the Depot for our fourth and last beef stick taste test. The Depot is a liquor store and a check cashing place and a convenience store three blocks down the street from where we live. We walk past it on our three and six o’clock afternoon walks every day. Hank and Kathy hardly ever go in there because its so busy with people buying liquor… And beer… And cigarettes… And soda, candy, or groceries. One time Kathy went in there for a lottery ticket and was there for 15 minutes. Hank went in there for beef sticks once and got stuck behind this lady having an argument with the clerk because he wouldn’t let her buy a 24 pack of Old Milwaukee with something called an EBT card. I guess everyone got liquored up early on July 4th because there wasn’t anyone in the Depot parking lot. I was so happy when Hank came out so quickly but then I saw he came out with two Slim Jims. The Depot only has prepackaged Slim Jim beef stick treats. For a dollar you get two of them. These Slim Jims were much bigger than the ones at the Food & Gas Mart but they were still pretty small. I thought the Slim Jims were OK and I liked that we didn’t have to go out of our way. I’m giving the Depot two paws. I’m giving the Depot one paw. My tastes are quite refined and I would like to have premium beef sticks for my treat. Plus it was still hot and the Depot didn’t have any crushed ice. There’s no pleasing some beagles. I prefer to think of it as a matter of basic beagle dignity but we’re getting a little off topic
Note to Depot: Premium beef sticks and crushed ice would go a long way for a better score next year...HELLO...
Well Daisy, our 2015 convenience store beef stick contest is over and the Casey’s came back from their 2014 last place finish to win the award for 2015. Yes. Congratulations to Casey’s for superior beef stick service, coffee that didn't make Hank sick, and amenities like crushed ice. I wish we lived on the south side of Marshalltown instead of the north side, Daisy. Why’s that, Baxter? Because then we would live near the Dunkin' Donuts, McDonalds, Burger King, and Hardees! And we could have a breakfast sandwich contest! We could compare bacon and egg sandwiches!! YUM!! I love bacon and egg sandwiches!! YUM!!