Sigurbjörn Lárusson's blog

Musings of a network engineer

Gear ratio calculator

Made a little Gear Ratio calculator that you can find at The Bikecalculator page

It requires 5 things to calculate things for you (all of which you can leave at default if you want)

  • Tire Size, pick your ISO or common name tire size from the list, if your size is missing, drop me an email
  • Lower desired cadence, this is the lower mark of your desired cadence, if you're a hobby cyclist this is probably 60 RPM or so, if you're quite fit it's probably closer to 70
  • Higher desired cadence, this is the higher mark of your desired cadence, if you're a hobby cyclist this is probably 80 RPM or so, if you're quite fit it's probably closer to 90
  • Front crankset teeth, list the number of teeth in your front crankset here, separated by a comma, if there is only one, just enter one value (and no comma)
  • Rear cassette teeth, list the number of teeth in all your rear sprockets here, separated by a comma, if there is only one, just enter one value (and no comma)

It will then calculate the following information

  • Gear inches for every front/rear combination of gears, a gear inch is the diameter (in inches) of the drive wheel of a Penny-farthing bicycle with the same gearing. These values range from low (20ish) to high (120ish), where low means it's slower (and easier to peddle) and high means it's faster (and harder to peddle)
  • Metres of development, how many meters the bike will progress given one turn of the crank
  • Cadence required to reach Kilometers/hour, the number of times you have to spin the crank per minute to reach the desired speed in Kilometers an hour for each gear available
    • The page will take your desired cadence values and calculate a medium cadence value which is between your lower and higher value (if your lower is 60 and your higher is 80, then this medium value is 70)
    • It will also calculate the difference between your lower and higher value and divide it by two to find the medium cadence range (if your lower is 60 and your higher is 80, then this medium cadence range is 10).
    • It will then calculate a lowest cadence by deducting half your cadence range from your lower value (lower is 60, higher is 80, lowest is then 50)
    • And additionally a highest cadence by adding half your cadence range to the higher value (lower is 60, higher is 80, highest is then 90).
    • Cadence values that fall between the lowest and your lower cadence value will be coloured blue
    • Cadence values that fall between your lower cadence value and the medium cadence value will be coloured green
    • Cadence values that fall between the medium cadence value and your higher cadence value will be coloured yellow
    • Cadence values that fall between your higher cadence values and the highest cadence value will be coloured red
  • Kilometers/hour at Cadence, this is how many Kilometers an hour you can reach at a given cadence for each gear available. Color coding is the same as in the Cadence to reach Kilometers/hour table
  • Various figures shows your lowest possible gear (and ratio) and the lowest speed, as well as your highest possible gear (and ratio) and the highest speed. Speeds are based on your lower and higher cadence values. It will also tell you how many unique gear ratios are found within the gears on your bike

Suggestions for improvement in email please, and enjoy.

Shake up the NBA playoffs

Basketball
It's early January, and I've been thinking about how the NBA post-season system is broken. This is certainly not the first time I've thought about this, but it seems to be happening earlier in the year every season.

The three main reasons why I think the current system is broken are the following

  • There is a discrepancy in the quality of teams in the Eastern and Western conference, this makes it easier for the teams in the East to make the Playoffs
  • Teams in each conference play a majority of their games (52 out of 82 games, or 63.5%) against teams in their own conference, making that discrepancy bigger
  • Owing to the fact that the teams play more games against their own conference, teams play an unequal amount of games between themselves, teams in the same division meet 4 times, teams in the same conference but not in the same division meet 3 or 4 times, and teams in separate conferences meet 2 times.
There have been a number of suggestions on how to solve this, each viewpoint has some merit and I'm going to go over the most common suggestions and then wrap up with a discussion on how I would most like to see it.

Wait it out

Every year we hear that the Eastern conference is bound to get stronger than it was last year. In this article from BBall Breakdown they go over the history since the current Eastern/Western conference and Divisional Split and compare the win/loss records of teams in the conferences since those changes were made.

In this millennium, the Eastern Conference has had a better record once, in the 2008-2009 season. This is not to say that there haven't been strong teams in the Eastern conference during that time (including the Pistons, Shaq/Wade Heat, Big-3 Heat, and the Big-3 Celtics), although from the 2000-2001 season and up until now, the West has claimed 10 titles against 5 titles to the East teams. Out of the 10 West victories, there are 2 sweeps (4-0) and 3 gentleman's sweeps (4-1).

There is little to support the argument that this will go away on its own, in fact since the 2000-2001 season, the winning percentage of Eastern teams is 42.1% and last season it was only 36.9%. Again, this is not to say that there aren't strong teams in the Eastern Conference, the top 3-4 teams in the East have traditionally been strong, the fact that a few select teams in the East have a winning percentage against teams from the Western Conference doesn't really change the overall balance of the rest of the conference.

I've compiled the current (as of January 9th) 2014-2015 standings against conferences and calculated the current standings against the conferences for each team in this table

Eastern Conference
TeamWinsLossesWin PctConf WinsConf LossesOther WinsOther LossesWin Pct against EastWin Pct against West
Atlanta27877,1% 17 6 10 2 73,9%83,3%
Chicago251169,4% 16 5 9 6 76,2%60,0%
Toronto241168,6% 15 6 9 5 71,4%64,3%
Washington241168,6% 16 6 8 5 72,7%61,5%
Cleveland191752,8% 15 9 4 8 62,5%33,3%
Milwaukee191851,4% 13 11 6 7 54,2%46,2%
Brooklyn161945,7% 11 13 5 6 45,8%45,5%
Miami152141,7% 11 12 4 9 47,8%30,8%
Indiana142337,8% 8 10 6 13 44,4%31,6%
Charlotte142436,8% 10 11 4 13 47,6%23,5%
Boston122136,4% 9 13 3 8 40,9%27,3%
Detroit122334,3% 6 11 6 12 35,3%33,3%
Orlando132534,2% 9 18 4 7 33,3%36,4%
Philadelphia52914,7% 4 14 1 15 22,2%6,3%
New York53412,8% 4 19 1 15 17,4%6,3%
Western Conference
TeamWinsLossesWin PctConf WinsConf LossesOther WinsOther LossesWin Pct against EastWin Pct against West
Golden State28584,8% 17 5 11 - 100,0%77,3%
Portland28877,8% 12 6 16 2 88,9%66,7%
Memphis251071,4% 16 5 9 5 64,3%76,2%
Dallas261170,3% 10 7 16 4 80,0%58,8%
Houston251169,4% 15 8 10 3 76,9%65,2%
LA Clippers241266,7% 13 6 11 6 64,7%68,4%
San Antonio211558,3% 12 13 9 2 81,8%48,0%
Phoenix221657,9% 10 10 12 6 66,7%50,0%
New Orleans171848,6% 13 11 4 7 36,4%54,2%
Oklahoma City171947,2% 9 14 8 5 61,5%39,1%
Denver162044,4% 9 11 7 9 43,8%45,0%
Sacramento152042,9% 12 13 3 7 30,0%48,0%
Utah132336,1% 6 12 7 11 38,9%33,3%
L.A. Lakers112530,6% 6 21 5 4 55,6%22,2%
Minnesota52914,7% 2 20 3 9 25,0%9,1%

The data clearly shows the difference between the conferences. 4 teams out of 16 in the East have a winning percentage against the West, half of them have a 33.3% or poorer record against teams in the Western Conference. 7 teams in the Eastern Conference have a below 40% total winning percentage, despite playing the majority of their games against their weaker Eastern Conference rivals.

In comparison, 10 teams in the West have a winning percentage against the East and only 2 of them have a 33.3% or poorer record against the Eastern Conference teams, and only 3 teams have a poorer than 40% total winning percentage, despite playing the majority of their games against the stronger Western Conference.

Statistically, this should eventually balance out, how long that would take however is anyone's guess, there's nothing in the data to suggest this is changing. We've heard talk recently that the top teams in the East are doing much better against the West. That does not seem to be the case, while the overall winning percentage in the East is 42.6% now, better than last year, the winning percentage against the Western Conference is at 36.8% which remains very poor.

Swap teams to balance the talent pool

Mark Cuban (and undoubtedly many others) have given some thought to moving teams from the Western conference into the Eastern conference and vice-versa in an attempt to balance the talent pools of the respective conferences.

In his suggestion, as reported on SI.com, he suggests moving the Texas teams (Spurs, Mavericks and Rockets) as well as the Pelicans from the Western conference out East, and moving the Bulls, Pacers, Bucks and Pistons to the Western conference instead.

Although this idea has merit at this point in time, there is no guarantee that those 4 teams will remain weak or strong for any amount of time, so even though this is undoubtedly a short-term fix (which would benefit the Dallas Mavericks which Cuban owns) there is no guarantee that this would fix things in the long term.

Top 16 teams make the Playoffs

This idea has merit although you'd have to somehow make up for the uneven number of games played between each team. I see three potential ways to solve that.

Calculate a power ratio for each team, and use that to seed them

If you want to keep the current scheduling and number of games, you'd have to come up with something other than the total Wins and Losses, since that is obviously biased in favour of the Eastern Conference teams currently. The simplest way of doing this is to simply add a correction factor. The way things are currently, the correction factor would lower the affect of a win against the Eastern Conference (making a win against the Eastern Conference worth less than 1 win) while a win against a Western Conference opponent would be worth 1 win exactly. If the balance of power was reversed, the factor would be applied to wins against the Western Conference. As I see it, there are at least 3 (and possibly many more, some far more complicated) ways to calculate the factor

  • A calculation of total win percentages in the conferences, (currently would be 42.6/51.3, giving a factor of .830)
  • A calculation of inter conference win percentages (currently would be 36.8/57.1, giving a factor of .644)
  • A calculation of inter conference win percentages and total win percentages (currently would be (42.6+36.8)/(51.3+57.1), giving a factor of .732)
None of them are completely fair (and never would be), I believe the last option might be the most reasonable. That would mean that each victory against the East is only worth .732 wins, if the Playoff cut would be made today. I've calculated the top 20 teams in the NBA based on a factor of .732 and they are listed in the table below
Top 20 overall teams based on a factored win percentage
TeamFactored Wins
Golden State (1)25.05
Portland (2)23.71
Memphis (3)22.59
Atlanta (4)22.44
Houston (5)22.32
Dallas (6)21.71
LA Clippers (7)21.05
Chicago (8)20.71
Toronto (9)19.98
Washington (10)19.71
Phoenix (11)18.78
San Antonio (12)18.59
New Orleans (13)15.93
Milwaukee (14)15.52
Cleveland (15)14.98
Oklahoma City (16)14.86
Sacramento14.20
Denver14.12
Brooklyn13.05
Miami12.05

This list reads far more like a power ranking list, and probably isn't far off base. Changing the factor to .830 (the first calculation option) doesn't change the 16 teams, but does move the top East teams slightly up. Putting these 16 teams into the Playoffs (with the top 8 having home court advantage, just like the current system) would certainly make for some very interesting Playoff series.

Have the teams play an equal amount of games between them

The other way is to make the teams play an equal amount of games between each other, which would mean that a win was just a win. As I see it, seeing as there are 29 teams, and 82/29 is not an even number, there are two ways to do this

  • Have each team meet 3 times (3*29 games or 87 games) which is an increase of 5 games to the currently very long 82 game season. This would mean an unequal amount of home and away games, although you could alternate this every other year (and likewise the matches, if you had two home games and a road game against team X in one year, you would have two road games and a home game next year to balance it out)
  • Have each team meet 2 times, (2*29 games or 58 games), one home and one way, which is what the proponents of shortening the season are generally rooting for

I'm not against either proposal, although changing the number of games, would put a dent in comparing statistics between seasons with an unequal number of games played, probably more true if you were to shorten it to 58 games. If you shorten the season, by a whopping 24 games, you are skewing per game numbers (players get more rest, are able to play more minutes per game, upping their statistics, but less games are played so the total is lower). Perhaps it would finally put a rest to comparing players from different eras, but I doubt it.

Best 4 make the Playoffs, best 12 compete for 8 spots

The proposal I'm advocating is a mix of the best 16 and the current well known system with a wild card addition. In this proposal, the top 4 teams in the West and East would always make the Playoffs (and therefore all the division winners since a division winner is always ranked among the top 4 regardless of win percentage), 2 teams outside of the top 4 teams in the East and West would also have a reserved spot, regardless of conference. The remaining 6 spots would go to the victors in 6 best-of-3 series amongst the top 12 remaining teams (regardless of conference).

If this cut were made today, the following teams would move forward

10 safe teams
TeamWinsLossesWhy they're in
Golden State285Top 4 in Western conference
Atlanta288Top 4 in Eastern conference
Portland288Top 4 in Western conference
Memphis2510Top 4 in Western conference
Dallas2611Top 4 in Western conference
Chicago2511Top 4 in Eastern conference
Toronto2411Top 4 in Eastern conference
Washington2411Top 4 in Eastern conference
Houston2511Top 2 outside of the Top 4 East/West teams
L.A. Clippers2412Top 2 outside of the Top 4 East/West teams

The wild card best-of-3 series would be between the following 12 teams, (based on their Rank after the first 10 safe teams have been found)

Team 1 (Rank)Team 2 (Rank)
San Antonio (1)Charlotte (12)
Phoenix (2)Indiana (11)
Cleveland (3)Miami (10)
Milwaukee (4)Sacramento (9)
New Orleans (5)Denver (8)
Oklahoma City (6)Brooklyn (7)

The winning teams would advance to take one of the 6 remaining spots. Once all teams would have been established, they would get home court advantage and play each other based on their win percentage and face each other in 8 best-of-5 series. The top team would play the team with the 16th best record and so on. The remaining 8 teams from these 8 best-of-5 series would then move on to best-of-7 series, then we'd have 4 teams compete in a best-of-7, and finally the Finals in a best-of-7. The Finals could happen between two teams that would both be from the same conference (which seems reasonable and fair if the two strongest teams are in the West or in the East).

The pros as I see it

  • More teams make the Playoffs (22 out of the 30 teams, only the bottom 8 teams don't go in), possibly giving less incentive to tank
  • Top 4 teams from each conference and the best 2 of the rest get a sure spot, and get a break during the wild card round, giving them time to rest their players
  • Changing the second (first after wild card) round into a best-of-5 lessens the boredom of lopsided matches between very strong and very weak teams, giving way to the 3-0 sweep, it also makes the first and second round not much longer than the current first round
  • The top team is going against the 16th best team so it's very unlikely that a good team is wiped out in the first round, it's also very unlikely that it happen in the second round keeping the best teams in the Playoffs
  • Once the third round is reached the best 8 teams should remain and should make for exciting 7 game series
  • The best two teams will meet in the Finals

There are undoubtedly many flaws with this proposal (we still have an unbalanced schedule so the East teams play more games against other East teams and vice-versa, we also still have the divisional system in place and we'd have to do away with the Western and Eastern conference champions, at least in the manner in which it is done today) and probably many others, agree or disagree, or write about it somewhere, let me know

Drafting for need

During the (seemingly endless) amount of time passing between games in the NBA Playoffs this year I've had too much time to think about the draft.

At one point I started wondering why teams approach drafting any different from a normal hiring process of any company for a long term job. Seemingly there are many similarities:
  • You'd want to hire smart and confident people
  • You'd want to hire people whose personality complements the team that he/she is being hired into
  • You'd want to hire people whose skill set complements the team that he/she is being hired into (and pay more) or who's shown an ability to learn skills so that he can be trained to pickup the skills required (and pay less)
Seemingly there are also principles that are applied to drafting that don't seem to fit a normal hiring procedure, such as
  • Hiring someone you don't need because he was the best candidate that applied
  • Hiring someone who doesn't fit into your environment because he was the best candidate that applied

So why is that, why would you depart from seemingly sane methods of hiring people? One of the reasons is because a draft pick is considered an 'asset', so you want to get the maximum return on your money.

The problem with the asset thinking is that people aren't things, you need to develop them and nurture them, and to do that, you have to have a fit for them and you have to let them play, preferably even win games or see how they could at some later stage win games, otherwise your 'asset' will probably lose value. Some teams have a better record with the draft than others, and it often seems that the teams who are fairly constant basement dwellers (Knicks and Timberwolves spring to mind), have the least success.

While I was pondering this (in multiple Tweets instead of just writing this article) @Nelush asked me the following question:

"would be interested to see how a list of teams ranked by draft performance measured up to a list ranked by player retention too".

This is not an easy question to answer, how do we rank teams by draft performance? For that I'm cheating and using work done by Roland Beech on grading every team on their draft picks made between 1989 (first draft that was in the current two round format that we all know) and up to 2008. For detailed analysis of his methodology and results you can read his article, but he used data from Basketball Reference to form a rating for each player drafted which is put together as:

Rating = points/game + rebounds/game + assists/game

He then divides players into 6 categories

  • Stars (Rating of 20+)
  • Solid players (Rating of 15-19.9)
  • Role players (Rating of 10-14.9)
  • Deep Bench (Rating of 5-9.9)
  • Complete Bust (Rating < 5)
  • DNP (never played a single minute)
You can then, using the same ratings, compare each pick to the average rating for that pick, to figure out if the team did well (their pick was better than the average pick), on par (their pick was pretty much at the average) or poorly (their pick was worse than the average pick).

Then there's the question of retention, that data isn't easy to come by nor is it simple to calculate. For the sake of simplicity however, I made a script that dumps the Basketball Reference roster data for each team for each year in question and 3 simple scripts that parse the information to enable me to count for how many years each player was on the roster.

Then I calculate three values for the retention

  • The average number of years a player is retained (which is simply the total number of years the players were retained, divided by the number of players who were on the roster during these years)
  • The median (middle) number of retention years, technically this isn't a median since I remove all duplicate values (i.e. if 30 players have been retained for 1 year, the number 1 only appears once in the median list), but it's pretty close to being the median number of years the team retains players
  • The maximum years the team has kept a player.

This isn't perfect for a number of reasons

  • I have no drafting data after the 2008-2009 season, since that's all that is included in the 82games article. Working out the drafting success data is a lot of work but it could be done
  • Not all teams existed for all seasons, Toronto Raptors (1995 is first season), Vancouver Grizzlies (1995 is first season), New Orleans Pelicans (2002 is first season), for those teams they'll suffer from a smaller sample size, making their data less comparable then the rest
  • Some teams have been renamed, I've used the newer names in my data table, the older names are referenced in the 82games article obviously
  • I combined the values for the Charlotte Hornets and Charlotte Bobcats since those records now belong to the Charlotte Hornets
  • The method for calculating the retention (player might only have played one game for the team in any given season for example) and the draft success is not perfect, this is more for fun than intended to be an exact science

The following table uses the RTG (Rating above average for draft picks by the team, referenced from Roland Beech's 82games.com article on Best/Worst drafting teams and the retention value I calculated from Basketball Reference as explained above)

Draft success vs retention
Team RTG Average retention years Median retention years Max retention years
Milwaukee Bucks 1.8 1.95 4 8
Phoenix Suns 1.5 2.02 4 9
LA Lakers 1.5 2.23 4 9
San Antonio Spurs 1.2 2.03 3 8
Cleveland Cavaliers 1.1 2.11 4 10
Golden State Warriors 1.0 1.89 4 9
Boston Celtics 0.8 2.00 4 10
Sacramento Kings 0.7 2.02 4 8
Memphis Grizzlies / Vancouver Grizzlies 0.6 1.80 4 7
Utah Jazz 0.4 2.44 5 15
Miami Heat 0.3 1.93 4 11
Washington Wizards / Bullets 0.2 2.09 4 8
Charlotte Hornets/Bobcats -0.7 1.79 2 4
Oklahoma City Thunder / Seattle Supersonics -0.1 2.25 5 13
Detroit Pistons -0.1 2.10 2 6
Philadelphia 76ers -0.1 1.80 4 11
Indiana Pacers -0.2 2.62 3 9
Chicago Bulls -0.3 2.18 5 11
Orlando Magic -0.3 2.11 5 10
Dallas Mavericks -0.3 2.04 5 10
Houston Rockets -0.4 2.09 5 13
New Orleans Pelicans/Hornets -0.6 1.49 2 3
Brooklyn / New Jersey Nets -0.6 1.94 4 7
Portland Trailblazers -0.7 2.20 4 8
Minnesota Timberwolves -0.8 2.06 5 12
Toronto Raptors -1.1 1.77 4 7
Denver Nuggets -1.2 1.89 4 7
LA Clippers -1.4 1.94 4 8
Atlanta Hawks -1.5 1.91 4 9
New York Knicks -1.5 2.45 6 12

So what can we gather from this data? Not a whole lot, there doesn't seem to be any direct tie between player retention rates and their draft success using this (admittedly very crude) way of calculating this. Maybe I'll revisit this at a later stage to see if I can gather some correlation, in the meantime, this was at least a fun way to spend an evening doing something basketball related.

If you are interested in how I gathered this data, these are the scripts used to gather the data from Basketball Reference and to calculate these values

Retention-Calculator.sh

This is a shell script which uses w3m (text based web browser) to fetch the data from Basketball Reference, it then uses two perl scripts to work with the data delivering a textual output in the end for each team


#!/bin/bash

YEARS="1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009"
TEAMS="TOR BOS BRK PHI NYK POR OKC UTA DEN MIN CLE CHI MIL IND DET GSW LAC PHO SAC LAL ATL WAS MIA CHO ORL HOU MEM SAS DAL NOP"

# For each team
for team in $TEAMS; do
        echo -n "Processing $team: "
        # Check if we already grabbed the stats for this team, if so we won't grab them again
        if [ ! -f $team.txt ]; then
                # Create an empty text file called $team.txt
                echo >$team.txt
                # And for every year that we're parsing
                for year in $YEARS; do
                        # Dump the team information page from BB reference, take out the Roster information and use a small perl script to grab just the player names from that roster
                        # then add that information to the $team.txt file that we created earlier
                        w3m -cols 256 -dump http://www.basketball-reference.com/teams/$team/$year.html#roster | grep -A 20 ^Roster$ | parse-roster.pl >>$team.txt
                        # Wait for 3 seconds so as to not bombard the BB ref server
                        sleep 3
                        # Print a status message for each year we process
                        echo -n " $year "
                done
        fi
        # The $team.txt file now includes all players that were on the roster for that team from 1989 to 2008, with one line for each year they were there
        # We'll pipe that into another perl script which will do 3 things
        # 1.)  Count the total number of unique players
        # 2.)  Count for how many years each unique player was with the team
        # 3.)  Print out a retention data value for the team
        # The retention value is a simple average, we already have a count of how many years each player spent with the team, we simply add them all together and then divide it by the total number of players that have played on these rosters, that way we get an average number of seasons that a player was retained
        RETVALUE=`cat $team.txt | retention-counter.pl`
        # Finish the status line
        echo
        # Print out the retention value for each team
        echo "For team: $team the average number a player was retained is $RETVALUE"
done

parse-roster.pl

This a script that takes the dumped roster data (in textual format) and gathers just the player names from it and dumps it out to the screen


#!/usr/bin/perl

# Player number
my $playernumber = 0;
# Player name
my $player;

# While we have data coming in (the HTML dump of the webpage)
while() {
        # Seperate the player part from the rest of the line, the player part is the part before the PG/SG/SF/PF/C distinction
        $_ =~ /(^\s?[0-9]{1,2}\s+)(.*)(\s[P|S]{0,1}[C,G,F]{1}\s)(.*)/igs;
        $playernumber = $1;
        $player = $2;
        # If the player number is indeed a number (which means that this line includes a player, and isn't a header or footer of some sort)
        if($playernumber =~ /.*[0-9]{1,2}.*/) {
                print "$player\n";
        }
}

retention-counter.pl

This a perl script that goes through the player file (which is just a file containing player names, one line for each year that player has played for the team) and prints out the average number of years players have been retained by the team, the median (middle) number of years and the maximum number of years


#!/usr/bin/perl

# A hash containing the players for each team
my %players;
# A hash containing the number of years a player has played (used for calculating the median)
my %playeryears;
# The total years the players have played
my $totalyears = 0;
# The total number of players is simply the number of keys (which are the players) in the hash
my $totalplayers = 0;
# An array to hold the years retained by each player
my @years;
# An array to hold the number of times we've looped
my $loops = 0;
# A value to hold the median number of years players have been retained
my $median = 0;
# A variable to hold the max years a player has been retained
my $max = 0;

# While we have textual input
while() {
	# Remove the newline from the end of the line
	chomp;
	# Remove any additional whitespace from the end of the line
	$_ =~ s/\s+$//;
	# Take each line, put it into a hash, with a key of the player name
	# Check if it exists first
	if(exists($players{$_})) {
		# If this key already exists, we've already counted the player once, so we'll increment the value (the count of how many years the player has played for the team) by 1
		$players{$_}++;
	} else {
		# Otherwise we'll create a new key with this players name, and put his count as 1 since this is the first time we've seen this player in the data
		$players{$_} = 1;
	}
}

# Set the total years to the number of keys in the hash (the number of different players)
$totalplayers = keys %players;

# Then we loop for each player in the hash
foreach my $player (keys %players) {
	$hashvalue = $players{$player};
	# Add to the total years
	$totalyears += $hashvalue;
	# Add the years for this player to the years array as well
	$playeryears{$hashvalue} = 1;
}

# Make an array called years, from the keys of the playeryears hash...
foreach my $yearkey (keys %playeryears) {
	$years[$loop++] = $yearkey;
}

# Now we know the total years the players on the roster have been on the roster and we know the number of players that were on the roster
# The average is simply the total years divided by the number of players
my $retention_average = $totalyears/$totalplayers;

# We can also find the median value, we have the years for each and every player in the @years array which we'll now sort numerically so that the lowest number
# of retained years is at the bottom of the array while the highest is at the top
my @sortedyears = sort {$a <=> $b} @years;
# Let's see how many seats are in the years array (we'll add one since the counter starts at 0)
my $arrayyears = $#sortedyears + 1;
# If it's an odd number, the median is simply the middle seat in the array
# If it's an even number, then there are two middle numbers so we need to add them together and divide them by two to find one median number
# Let's do the modulus of the array seats by 2 to find the remainder, if there is a remainder then the value is odd
if($arrayyears % 2 > 0) {
	# And let's place the median value as the value in the middle of the array
	$median = $sortedyears[int($arrayyears/2)];
} else {
	# Otherwise there's an even number of seats
	# The median is then the number in the seat right before the middle of the array, plus the number in the middle, divided by 2
	$median = ($sortedyears[((int($arrayyears)/2)-1)] + $sortedyears[int($arrayyears/2)])/2;
}

# Then we'll take the maximum, which is the highest number of years a player has been retained, that is simply the last member of the sorted array
$max = $sortedyears[$#sortedyears];

# And we print these three values
printf("%.2f %d %d\n",$retention_average,$median,$max);

First child and some new entries on Soundcloud

Not a lot of updates recently, busy with work and then I had my first child on March 5th so I've been a little busy...

Here's a picture of the young lad
In other news I've uploaded 3 new files on Soundcloud

They are in (in no particular order)
  • Podcast-Intro - A short (40 second) piece I wrote as an Intro for a Podcast by request. They didn't want to use it so it's up for grabs (usual CC license)
  • C-Lydian-Backing - Ambient and Atmospheric backing track written in C-Lydian, 16 bar Verse, 16 bar Chorus in a V-C-V-C-C form
  • A-Harmonic-Minor-Backing - Easy going track with a heavy beat in A-Harmonic Minor, just a Verse, repeated a few times, drums kick in after one repeat

Cisco Live 2015

Are you going to Cisco Live! in Milan 2015? This blog entry is aimed at the crowd that is going to visit Milan this winter for Cisco Live 2015 Europe in January, although some things would apply to anyone going to Cisco Live no matter where it is being held.

Trains, planes and automobiles

Trains

Milan central station (Milano Centrale) is home to around 600 trains per day according to their website and is the second largest Italian train hub.

Trains arrive daily from many cities in Europe including Bern, Lugano, Geneve, Zurich, Paris, Wien, Barcelona and Munich. In addition to Centrale the Milano Cadorna and Milano Porta Garibaldi stations are big hubs for train traffic and many off the regional trains operated by Trenord arrive there.

You can easily get between Centrale, Garibaldi and Cadorna using the green line of the subway (M2) which stops at all 3 locations.

Centrale train station in January 2014

Planes

Milan has three airports.

Malpensa

The biggest one, Malpensa (MXP) is also the biggest in northern Italy and is well connected to the city by the Malpensa Express. You can buy tickets directly from the Malpensa Express homepage. One way tickets are 12€ while return tickets (which have to be used within 30 days) are 18€.

The Malpensa Express is a typical airport train, has place for your luggage and is fairly comfortable, it's probably the quickest and easiest way for you to get from Malpensa to the city and is pretty much the same price as taking a coach. The Malpensa Express departs every 30 minutes to Cadorna (non-stop, takes about 30 minutes) and every hour to Garibaldi (about 40 minutes travel time) and Centrale (about 50 minutes travel time) with 6 stops before arriving at Garibaldi (7 before Centrale, Garibaldi being the pen-ultimate stop).

It is possible to get to Centrale by changing trains twice, take a train to Nord Bovisa and change there to Milano Rogoredo and from Milano Rogoredo to Centrale, this will take you about an hour and 20 minutes. It is also possible to get to Garibaldi by taking the train to Busto Arsizio and changing there to Milano Porta Garibaldi Passante, that will take you about an hour and 10 minutes. In both cases little if any time is saved and you're better off waiting for the next train that goes directly to Garibaldi or Centrale without having to change trains.

You can also take a taxi to the city from Malpensa, that will take about 50 minutes on average obviously depending on traffic. There is a limit of 4 people per taxi. It's a good idea to make sure the Taxi has a sticker that says "Taxi autorizzato per il servizio aeroportuale lombardo", that means that the taxi is authorized for the airport service and that you will pay a fixed fee for the transport. Ask the driver anyway before you depart how much it will be, a fairly common rate is 70-80€ for the journey.

The cheapest option if you're on a very restrained budget is to take a coach (The Malpensa Shuttle is one option), that will set you back 10€ one way, about 16€ for return tickets. You can buy tickets online in advance.

Linate

Linate is a smaller, more regional airport which is located about 8 km from Milan to the east. Some BA flights as well as Air Italia and others operate from Linate.

Linate isn't directly connected by rail but you can take the Urban Line 73 or X73 bus (73 has more stops, X73 is an express bus that only stops 3 times), 73 departs every 10 minutes, X73 every 20 minutes. The last stop for both is San Babila M1 which is on the red line of the subway (Line 1). From there you can take the subway. The cost of the bus is 1.50€.

ATM also operates a coach from Linate to Centrale station which departs every 30 minutes, it is 5€ one-way, 9€ for a return ticket and is a far more comfortable option than the bus (unless you're travelling very light).

A taxi from Linate to Milan is likely to be somewhere in the range of 30-40€ depending on traffic and where you are going within the city. Ask before you get in how much it will be to go where you want to go. I paid around 30€ from Milano Centrale to Linate on a Saturday with little traffic.

Linate airport also has a nice page with options on how to get in and out of the airport that you can find here

Orio al Serio

The last (perhaps not the least) airport is Orio al Serio, located in Bergamo. Orio al Serio is mainly used by the low cost airlines.

There are a multitude of shuttles that will take you from Orio to Centrale, a list of which can be found on the airports homepage. Orioshuttle departs every 25 minutes and will take you to Centrale for 4€, 8€ round-trip and you can buy your tickets online. The trip will take about 50 minutes depending on traffic and there are no stops. This is probably the easiest way to get in and out.

By train you can take a Trenord train from Garibaldi station or Lambrate station to Bergamo (which will set you back around 5€, 10€ return) and then take the ATB bus from Bergamo station to the airport. Train trip will take you over an hour from Garibaldi, but there is a train that departs at 19 minutes past the whole hour from Lambrate that only takes about 40 minutes. The bus will take you an additional 10 minutes

You could also take a taxi, ask before getting in how much it is to get where you want, I'd estimate somewhere from 75-100€, I'd rather spend that money on a more expensive flight or use the massively cheaper shuttle

Automobiles

Milan is well situated for arriving by car. From East and West it is connected by the A4 highway to Turin and Venice and from the North and South by the A1 highway to Rome and Naples. Furthermore it is serviced by the A7 from Genova and the A8-A9 which connects to Switzerland.

Some parts in the city centre are traffic restricted although you will find multiple car parks. Check that your desired Hotel or Apartment has parking available and how much it is before committing to arriving by car since parking can end up being very expensive.

If you're planning on renting a car in another country to get there make sure you're allowed to drive it over the border and any changes in insurance if you do so. It might still be beneficial for you to make your way around Milano by using the subway rather than the car while you are there (subway isn't competing with traffic), obviously depending on where you intend to stay.

Milano Congressi where the event is held in 2015 (and presumably 2016) has ample parking but check before you arrive whether there is cost involved in parking there and whether the car park is open to attendees.

Metro system

The metro system in Milan like in most larger cities in Europe is fairly solid. It is run by Azienda Transporti Milanesi (ATM) and covers the city using 5 subway lines, 16 tram lines and a multitude of bus lines. If you are staying within Urban Milan and travelling within Urban Milan the Urban ticket is all you need.

Tickets

Which Urban ticket option is best for you depends a little on how much travelling you will be doing and where you will be travelling.

Extra-Urban?

If you need to travel outside the urban Milan area you will need to purchase an extra-urban ticket for that journey, more information about that on the ATM webpage

Urban

If you are staying within Urban Milan and travelling within Urban Milan the Urban ticket is all you need. Then it's just a matter of which ticket you should get. You have some options.

If you anticipate just going from the hotel to the conference and back to the hotel every day, the cheapest pass is the Weekly 2x6 pass which is 10.00€ and allows you two 90 minutes trips every day for up to 6 days a week. You could then buy a single-ticket for any extra trips which is 1.50€ (or a pack of 10 single trips slightly cheaper at 13.80€).

If you are like me and tend to go out again in the evenings to do more networking with other people, shopping or sightseeing, I found the cheapest Urban ticket solution to be one or two day tickets which are valid for as many journeys as you want, for 24 or 48 hours from the time you first use it (run it through the machine at the station).

If you go to the technical seminars (and therefore arrive on Sunday and leave again on Friday) it's probably best to buy 3x2-day tickets (you can buy them all at once using any of the ticket machines in the metro stations, using a credit card, or cash). If you arrive on Monday and leave on Friday you could get 2x2-day tickets and 1x1-day ticket.

The price for the 2-day ticket is 8.25€ and the 1-day ticket is 4.50€ (so 5 days is 21€, 6 days is 24.75€). Note that the 6 days end up being very similarly priced to buying a 2x6 and then 10 single trips which would be 23.80€ but it's just a little more convenient to not have to have a bunch of single-tickets with you.

Take note that if you're travelling with something other than hand luggage on the ATM network, the ATM home page says that you need a luggage ticket (or you can use a metro single ticket if you have one), which costs the same as a standard single ticket or 1.50€. You need to stamp that ticket, as well as your travel ticket before you get on-board and like the usual single ticket it is valid for 90 minutes. Having said that, I've never seen any enforcement of this rule nor seen anyone being asked to show that he has a luggage ticket, but if you want to go strictly by the book you should be aware of it.

Picture of the Duomo, go to the Duomo station on the green and yellow lines

Links

Accommodations

The Cisco Hotels

There are obviously many places where you can stay in Milan, ranging from hostels with shared bathrooms in the hallway to 5 star hotels. The easiest option for you might be to follow the official Cisco list of hotels that Cisco has gathered for you. They have also calculated transit times from these hotels to the venue. There tends to be a reasonable amount of hotels on offer in varying price categories, these are however obviously not the only hotels on offer.

Other hotel options

If you are feeling more adventurous you can use sites such as Trip Advisor which has good (honest) reviews and a list of prices from many hotel sites or browse the hotel sites directly, some examples of which are booking.com, hotels.com and expedia.com to look for Hotels that meet your criteria. Do read the reviews and find out what people liked and disliked. What some people disliked might not matter at all to you and vice versa. My main criteria for Hotels during the stay is:

  • Quiet during the night, because the hotel does not need to be quiet during the day when you're away at the conference anyway you can safely pick a hotel that is undergoing renovation or repair during your stay, which can sometimes save you some money, do check the reviews and see if guests said it was quiet during the night.
  • Has good breakfast, there tends to be not a lot to eat at the conference except for lunch so I make it a rule to eat a good breakfast before I depart in the morning, a good breakfast is therefore high on my list of things I need.
  • Bathroom and shower in the room, staying a whole week somewhere where you're sharing a bathroom or a shower is out of the question for me, if you think you can live with that for a full week there are cheaper options that open up for you, otherwise you're pretty much limited to 3 star hotels.
  • WiFi that works, many hotels offer WiFi (sometimes even free), it isn't always good however, browse the reviews for the WiFi, check if it's free, check how much it is if it isn't free (you might have to send an email to the hotel or even call them to check), it can sometimes be very expensive, even ludicrously so.

Where in the city should you stay

Where to stay depends a little on your preferences. I've been to Cisco Live! (and Networkers) in 3 different cities over a span of 9 years and I've tried pretty much all of these options. There are pros and cons to each one of them, read them and figure out where you fit.
  • Stay close to the conference centre:
    • Pros
      • Shorter transit in the morning, might even be within walking distance so you don't have to leave as early and might save some money on trains
      • You can go to the hotel at lunch time or during longer breaks to relax, work, or even use the facilities
    • Cons
      • The conference centre area isn't necessarily in a good place to see anything else, you might have to travel a bit to see the sites. This was particularly the case in London but isn't too bad in Milan, you are not in a suburb blocked off from civilization and while you're not strictly downtown getting there by train is not a big deal and is only a few stops away.
      • The choice of reasonably priced options might not be that great, particularly if many people want to stay near the conference centre, check hotels in other areas and if you can find a hotel within a reasonable metro distance don't overpay for a 10 minute saving in the morning, get a better hotel.
  • Stay downtown:
    • Pros
      • Choice of restaurants, shops and things to do when you're not at the conference that are within walking distance
      • Usually a short walk to the next Metro station, if you have many equal hotels pick the one that is closest to the Metro
    • Cons
      • Can be expensive, when you don't have a car it's very nice to be downtown so these hotels tend to be a little on the steep side
      • Can be noisy, pay attention to what the hotels guests said about noise levels, sometimes hotels face busy streets or are opposite to the police station
  • Pick your location based on the Metro, stay within 3-6 hops of the conference and 3-6 hops to the city centre.
    • Pros
      • Relatively quick transit in the morning, perhaps 5-15 minutes depending on how close you are
      • Relatively quick transit if you want to go downtown to hit the bars, see the sites or shop.
    • Cons
      • Might not be the greatest neighbourhood to be in, read some information about the area and check the hotel reviews to see if it is relatively safe. In Milan the best place for this criteria is around Cadorna station (Parco Sempione) which is a pretty nice neighbourhood.
      • Possibly expensive, it's always a little more expensive to be well connected
  • Pick your location based on where you can get the cheaper hotels a bit away
    • Pros
      • If you're on a tight budget this might be the only way to persuade your employer to take the plunge or if you're paying the whole cost yourself this might be what you can afford.
      • You'll probably end up in the suburbs in a more quiet area
    • Cons
      • You'll spend more time on public transit than you might necessarily like
      • Usually not a great range of restaurants or shops in the area which might mean even more transit


Whatever option you pick you can always change your mind next year. Last year (2014) I stayed close to the Milano Centrale station at the Una Hotel Century (see video above). That hotel was part of the official Cisco Hotel list last year and was in the process of renovating. It was quite cheap (partly because it was renovating) at around 120€ a night and was very nice as you can see from the video.

This year I've picked a hotel in Antica Locanda Leonardo that is about 700 meters from the Cadorna station. Cadorna happens to be a 30 minute transit from Malpensa (via Malpensa Express non-stop) and is 4 stops away from the conference centre and 4 stops from Centrale. It is serviced by the red metro line (M1) and the green metro line (M2) and the Hotel is within walking distance to the painting of the last supper.

Whatever you do I recommend you start booking your hotel as early as possible, as you get closer to the conference the prices tend to hike up fast, particularly for the best locations, you can save quite a bit of money by booking early. Even if you are not sure that you'll get to go, you can in most cases book well in advance and not need to pay anything to cancel at a later date.

Plan your sessions

If you're taking tech-seminars (which are on Monday, in the form of 1x8 hours, 2x4 hours or 1x4 hours) you'll need to pick those when you register. To schedule the rest of your time you need to do so when the schedule builder becomes available (usually early November). So what sessions should you take?

  • Don't be afraid to take a breakout in the same subject area as you picked your technical-seminar, if it makes sense there is nothing wrong with that.
  • Pick a theme for your breakouts, with a ton of sessions available in many different categories it is fairly smart to pick a theme for your sessions. If more than one person is going, picking a theme for each one will make you able to get a lot of knowledge about a few subjects which in the long run generally tends to work out better than being all over the place. This is one of the reasons why sending more than one person from your company is a good idea.
  • Take advantage of meet-the-engineer, these are quality people that you won't get many opportunities to meet face-to-face. If you have difficult TAC cases, have implementation questions for a particular platform (or need a how do I do this on this platform) or even if you just want to discuss the idiosyncrasies of a particular platform.
  • A lot of Cisco people come to Cisco Live! Your Cisco account manager might be able to schedule some meetings for you with some higher ups if you need to discuss a particular case or a large project with someone in the know.
  • If you need hands on in a particular subject take advantage of all the available labs.
  • If you are on your path to certification you might want to take advantage of your free certification exam while you are at the conference.

Getting to the conference

Getting to the conference by train is by far the best option you have, unless you are within walking distance. Subway map with the main players
And here again is the map of the Metro system with all the lines in PDF.

The Metro station serving the conference centre is Amendola which is on the west bound red line (M1) of the Metro. The train that goes there is named after the last stop (as are they all), the last stop being RHO Fiera Milano. Take care that there are two trains westbound on the red line, the other one is marked Bisceglie and does not go to the conference centre since the lines split up after Pagano, one going north west while the other goes south west. Travelling from Cadorna station to Amendola will take roughly 10 minutes.

If you are travelling to the conference centre from the green line (M2) you'll need to take the green line to Cadorna. If you are travelling with the yellow line (M3) you'll need to change trains at Duomo. If you're coming from Centrale you can take both the Green and the Yellow line, I recommend the Green line, it is faster.

You can take a Taxi (at a price, Taxis in Milan tend to be a little on the expensive side) but more comfortable and you're guaranteed a seat. Don't bet on the Taxi being faster though, it has traffic to compete with. If you have your own car you could also drive to MiCo although you should make sure you can park there before doing so as mentioned previously.

Arrival and the first day

Those of you who have signed up for technical seminars should arrive no later than midday Sunday to have time to register before registration closes, if you want an extra day in Milan you can also arrive on Sunday and spend your Monday walking around Milan, otherwise you should arrive no later than midday Monday, again to finish registration before registration closes.

Practice run

It is beneficial to do a trial run of the route (hopefully selected with the dijkstra algorithm) you're going to be travelling to the conference, particularly if you're going to be using the Metro. You can roughly time your trip and figure out which way you have to go into the station to get to the track you want. There are often multiple entrances (and exists), particularly to the larger Metro stations, pick the one that gets you to the right track in the shortest amount of time, this will matter more when there is more traffic in the morning.

If you need to change trains you should also figure out what the best route from your current track to the track you need to go to is. It's also far better to go in the wrong direction on the trial run than it is to do it on your first day.

Early registration and the App

Registration opens on Sunday at 15:00 and is open until 20:00 for those who arrive on Sunday for the main conference or those who have technical seminars on Monday morning. If you arrive at a reasonable hour on Sunday you can use your practice run to go and register, that will save you from having to do so on your first day. Similarly if you arrive on Monday for the Tuesday start, registration is open from 08:00 till 19:00 and it's good to finish up the registration before the first day.

When you register you'll get your computer bag (and whatever goodies are in it) as well as your badge which you're required to wear at all times during the conference, the bag you don't need to bring with you but it's usually a nice bag so you might do it anyway. To register you'll have to log into the registration computer with your ciscolive.com username and password (that you used to register) so you'll need to bring that with you or memorize it.

Register early to avoid the lines

The Cisco Events app is now available from the Play Store and the App store. The app has the full event schedule, all speakers and exhibitors, the venue map and integration with social networking.

Learn your way around

You should also study the floor plan of the conference centre, maps are available here and there is also an iPad app available. Find the room where you first session is and figure out how to get there. You'll have a little more perspective after you at least go there for the registration.

It is remarkably easy to get lost in any conference centre and the MiCo is particularly confusing. Cisco does a decent job of making information signs for you and there are lots of people there to help you, don't be afraid to stop and ask rather than spending 20 minutes aimlessly walking around! It is particularly confusing to get from the North Wing to the South Wing because it isn't always possible to do so within the same floor (might need to go up or down a floor).

Sleep

This might seem like childish advice but you're going to need to sleep while you're there. A full day of technical-seminars or breakouts will make your brain mush by the week-end and you need to sleep to rejuvenate. Go to bed early and get a good nights sleep for the first day as well as all the other days that follow.

Dressing for success

There is not much of a dress code, wear what makes you comfortable. Do remember to wear comfortable shoes, there is quite a bit of walking involved. Some people arrive in one set of shoes and change to flip flops, Birkenstocks or whatnot when they arrive at the conference. Sandals or flip flops while travelling to the conference centre might not be the best idea though, in late January it tends to be both cold and damp in Milan.

The AC at the conference varies, sometimes (particularly during the first day) it can get very warm while they figure out how much of it is needed (or wait for AC units to come in). At other times you're rubbing your hands together for warmth. Don't sit right in front of the AC unit if there is one in the room and it's not a bad idea to bring a sweater that you can take off so you can adjust to the room temps.

First day

If you follow my advice and get registered the day before and do a trial run of your route you'll know pretty well when you should leave for your first day. If your session starts at 9, don't plan on being there at exactly 9, be there no later than 8:40, it will take you time to get to the correct room and you'll need to be there before the session starts to have your badge scanned and get a decent seat. This applies for all the days and all sessions in general, get there in plenty of time.

Lunch

Lunch is served in designated areas for those with a full conference pass. The lunch tends to be OK (certainly better in Milan than it was in London) but you also have the option of going out for Lunch to any of the places nearby. Gogobot has a list of places nearby along with reviews.

Rest of the conference

Hopefully you'll have a ton of fun in your tech-seminars, breakouts, labs and whatever else you attend. Here are couple of other things I think you should consider doing:

  • Go to the opening party at the World of Solutions. The World of Solutions is where Cisco and others show off their products for you. There is food, drink, and products to see and try out. There is quite a bit of pushing to try to sell you something (or scan your badge) but there are plenty of smart products on display, some of which might interest you. The World of Solutions opening party which is at the end of Tuesday is a good time to browse and see what interests you.
  • Go to the Keynotes, the subjects vary from borderline boring to very interesting but you can't miss it.
  • If you go to the conference lunch, pick a random table and meet other people. There are great conversations to be had with people of different nationalities that are dealing with the same issues you are.
  • Go to the Customer appreciation event on Thursday night, meet your peers, sample the food and drink, enjoy the entertainment and even dance. Most of all have fun! Having said that, there is always the dude that doesn't show up for his Friday sessions because he had a little bit too much fun at the party, don't be that guy.

Picture from the Customer Appreciation Event in 2014

Going home

Some people take Friday off and go home on Friday morning, I tend to think that's a bit of a waste because you can squeeze two breakouts on Friday, if you take advantage of that the conference end is at 13:30 on Friday, at which point you'll turn in your badge, grab your lunch bag which Cisco graciously provides you with (sandwich and chips or something to that order) and head back to the Hotel to get your bag which your friendly concierge will store for you while you're at the conference after having checked out Friday morning.

It's reasonable to take a flight back home at around 17:00 if you are leaving by plane, that should give you a little time to get back to the Hotel, grab your bag and get to the airport. You can perhaps get away with leaving a little bit earlier if you are pre-checked in and you know how long it will take you to get to the airport, I don't like to be very stressed so I like to have more time rather than less.

If you're travelling by train the same applies except you don't need to arrive as early, leave some time though so you don't miss your train.

The end

Thank you for taking the time to read this, I hope you enjoyed it and that you learned something and I wish you an excellent time at Cisco Live! Perhaps I'll see you there!