Friday, August 30, 2013

Draft this Weekend

So my Fantasy Football draft is this weekend. I have taken part in a few mock drafts and keep coming up with the same issue. After the first couple of rounds you are siting there staring at the screen wondering what player to take.


Fortunately there is not a lack of analisys. Seems like everyone has an opinion, a ranking, a projected stat calculation, etc. However flipping from site to site becomes pretty tedious.


I am in a hurry now to throw together a tool I call draft view. I am scraping the web sites for analysis and throwing them into a database. From there I can type in a player or a list of players and get all the information on a single screen.


I am not predicting a victory for my team, but at least I will not be scurrying around as much during the draft trying to figure out if I should take Hillman or Joique Bell.



Early Screen shot of the app:


image


Update 8/30 @ 3:55PM


Sources of info


  • ESPN Average Draft Position Chart

  • Cheat Sheet from this one site (wink)

  • ESPN FF Projected Rankings

  • ESPN Point Projections

  • Point Projections from this one site (wink)

Wednesday, August 28, 2013

First FitBit Numbers

So I have been wearing the FitBit for over a year now. I thought I would start looking at the numbers. I haven’t made time to really look at the numbers but I did come up with the Top 10 Step Count days and the Top 11 best days of sleep. I used 11 because I found out that one day I forgot to stop the counter when I woke up. FitBit thought I slept for 12 hours that day…yeah right!



Thursday, August 8, 2013

PowherShell Mass download with Credential

I needed a PowerShell script to download several images from my web server. The images were in a password protected area of my web site. At first I was receiving 401 errors due to lack of authentication. So I just had to add the Get-Credential module under the System.Net.WebClient. This prompted me for a password and boom the download worked as planned.


The $i is used to denote the number in the loop. As you can see my pictures had an interesting naming format since I just exported these out of picasa as JPG. The pics were originally shot as RAW files from my Nikon


$storageDir = "C:dl"
$webclient = New-Object System.Net.WebClient
$webclient.Credentials =Get-Credential
$i = 6900
do {
$url = "http://your your.com/dsc_$i.nef.jpg"
$file = "$storageDir$i.jpg"
$webclient.DownloadFile($url,$file)
$i++
}
while ($i -le 7548)

Monday, July 29, 2013

Cardinals vs Braves since 1990

Few of my friends like to trash talk Cardinals vs Braves. Here is how the teams compare since 1990. I chose 1990 because that is around the time I started to care about MLB and its my blog, not yours.


I did run some numbers for the entire history of the two teams. Cardinals own the overall games won total by an impressive 411 games. However remember that at one point in the history of the Braves, they were called the Boston Beaneaters. Not sure how you expect to field a good team with a name like that. Cardinals also lead the overall head to head record 1060-957 (.526).


However since 1990:


  • Braves lead in overall wins by 154 games

  • Cardinals have been in the playoffs 10 times

  • Braves have been in the playoffs 16 times

  • Cardinals have been to 3 World Series and have a record of 2-1

  • Braves have been to 5 world Series and have a record of 1-4

  • Braves lead the head-to-head record 115-85

Click Image for a larger version.


image


So one could easily say in recent history that Braves have been better than the Cardinals. Remember though you can make the numbers say exactly what you want (and I do not like the Cardinals).


I can almost hear the Cardinal tears being cried how this is not fair, or claiming how high their attendance numbers have been, or total World Series counts or something.


The Cardinals have had a long storied history of excellence and the Braves have had an extended run of excellence over the past two decades. Hey as a Royals fan, I really have nothing to say. We had some glory years in the 80s. Fans of the Cardinals and Braves have it good. 


I guess as a Royals fan we do have one thing to say: “Safe” -Don Denkinger Game 6 10/26/1985.



Wednesday, July 10, 2013

Friday, June 14, 2013

PowerShell Mass Download

Here is an example of a PowerShell script to mass download files from a web site. This is a very simple example and would probably need to be changed based on your need. The files I wanted to grab were named 1000.jpg.  A four digit number jpg.


$storageDir = "C:somefolder"
$webclient = New-Object System.Net.WebClient
$i = 1050
do {
$url = "https://yourwebsite.com/path_to_the_files/$i.jpg"
$file = "$storageDir$i.jpg"
$webclient.DownloadFile($url,$file)
$i++

while ($i -le 2000)

Good luck

Friday, May 31, 2013

Chiefs 2012 Review - First Down Play Calling

Last year was a tough year to be a Chiefs fan. Cautiously optimistic and hoping for the best this year. Here are some numbers from the 2012 debacle.


First Down Play calling


The cheifs had a total of 436 First Downs, 22nd in the league. That stat doesn’t mean a whole lot. Two possible explanations for first down counts are You stink, or you have a lot of big plays on offense. The Chiefs called a pass play 36% of the time on First Down compared to 64% rush play calls. League average pass play call on first down is 46% vs 54% for rushing play calls.




Here is the pass vs rush play calls on first down by quarter for the Chiefs and the entire NFL





1st quarter shows heavy run for the Chiefs. Trying to establish the run early at 73% of the plays run plays. Well above the 58% league percentage. The rush play call on 1st down is lopsided in every quarter for the Chiefs except the 4th quarter. At this point in the game the Chiefs have to start passing since they were typically losing.


The sample size is too small to predict the play on 1st down, but it will be interesting to see 2013 stats with a new quarterback and new head coach.



Wednesday, May 29, 2013

Chats with Byrne

Few months back I did a word cloud analysis on IM conversations with the one and only Byrne. Word Clouds are amazingly easy using R and R-Studio. 


R: http://www.r-project.org/
R-Studio: http://www.rstudio.com/


Below is the cloud.Some notes


  • The numbers are time stamps

  • Byrne and are are in-decisive with words like probably, maybe, pretty, etc.

  • We overuse the word cool

  • Lunch is an important topic.

Friday, May 17, 2013

When is the best chance to see a HR

Between 1952 and 2012 when is the best chance to see a HR? It happens to be on a 0-0 count in the 4th inning. Historically, 53.07% of all HR balls happen on an 0-0 count.


That number, to me, is surprisingly high. 


image




The 4th inning holds a slight edge on most HRs in an inning with 12.623% of all HRs. In my opinion a couple explanations could be the pitcher is getting tired as the game progresses and/or the batter is having  more success in second/third at bats against the pitcher. Again the margin is slight. Interesting note is that the 9th inning is relatively low related to the other innings at 7.89%. Perhaps explained by the dominance of closing pitchers. However when a closer gives up a jack we seem to remember it since typically the situations are high leverage situations with the game on the line.


image



The inning with the least chance to see a HR is the 25th inning with a .0005% chance. Of course if you make it to the 25th inning to see a HR you should get some kind of prize like a free ticket to a game or a free dozen donuts or something.



Looking at 3 recent HR sluggers you can see their success on the 0-0 count. The 0-2 count is incredible. Pitchers have the upper hand on 0-2 as far as the long ball is concerned.


Perhaps the batter switches plate approach to contact, but truly an amazing drop off in HR balls on 0-2. The HR numbers fall dramatically at 0-2 count. Of course 3-0 count is the lowest HR % count since typically you take that pitch.


image