d(e(g),e(h))?"horizontal":"vertical",b.using.call(this,a,m)}),i.offset(a.extend(A,{using:h}))})},a.ui.position={fit:{left:function(a,b){var j,c=b.within,e=c.isWindow?c.scrollLeft:c.offset.left,f=c.width,g=a.left-b.collisionPosition.marginLeft,h=e-g,i=g+b.collisionWidth-f-e;b.collisionWidth>f?h>0&&0>=i?(j=a.left+h+b.collisionWidth-f-e,a.left+=h-j):a.left=i>0&&0>=h?e:h>i?e+f-b.collisionWidth:e:h>0?a.left+=h:i>0?a.left-=i:a.left=d(a.left-g,a.left)},top:function(a,b){var j,c=b.within,e=c.isWindow?c.scrollTop:c.offset.top,f=b.within.height,g=a.top-b.collisionPosition.marginTop,h=e-g,i=g+b.collisionHeight-f-e;b.collisionHeight>f?h>0&&0>=i?(j=a.top+h+b.collisionHeight-f-e,a.top+=h-j):a.top=i>0&&0>=h?e:h>i?e+f-b.collisionHeight:e:h>0?a.top+=h:i>0?a.top-=i:a.top=d(a.top-g,a.top)}},flip:{left:function(a,b){var n,o,c=b.within,d=c.offset.left+c.scrollLeft,f=c.width,g=c.isWindow?c.scrollLeft:c.offset.left,h=a.left-b.collisionPosition.marginLeft,i=h-g,j=h+b.collisionWidth-f-g,k="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,l="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,m=-2*b.offset[0];0>i?(n=a.left+k+l+m+b.collisionWidth-f-d,(0>n||n One time, in college, I managed to play in a pickup basketball game against the Harlem Globetrotters. My stat line was not very impressive: four steals (against me), three blocks (against me), and two hoops (that we quickly bought at a sports shop once the Globetrotters unexpectedly accepted our challenge). In that game, I had the honor of playing against a 7-foot-7 fellow nicknamed “Tiny.” The human giant, in turn, had played with a Globetrotter named “Moose,” who went to North Korea with Dennis Rodman, who was on the 1999 Dallas Mavericks with Bruno Sundov, who played on the 2003 Cleveland Cavaliers with LeBron James. Yes, thanks to my pickup nonstardom, I'm now only four degrees of separation from LeBron James. (Unfortunately, using the same logic, I'm three degrees away from Kim Jong-un.) All this self-centered small-worlding got me thinking about connectedness and the world of sports. If someone who has never set foot on (or even near) an NBA court is within four steps of the greatest basketball player of our generation, how connected is the rest of the league? What about the players who played in the NBA decades ago? Or those who have played professional sports in another league? To answer this question, I built a tool to find the shortest possible connections between 50,000-plus professional baseball, basketball, football, and hockey players. (Special thanks to the amazing Sports-Reference family of sites for the thorough databases for each sport.) Two athletes are considered “connected” if they played for the same team during the same season, although due to trades and injuries it’s possible that certain “connected” athletes never shared a field of play. You can play around with the widget at the top of the page to figure out the shortest path between (almost) every pair of North American pro athletes. These athletes include: more than 4,000 basketball players, including those who played on all NBA, BAA, and ABA teams, dating back to the 1940s; more than 23,000 football players dating back to classic NFL teams of the 1920s, such as the Frankford Yellow Jackets; just under 18,000 baseball players, from the 1870s to the present day; and more than 7,000 hockey players, from the WHA and NHL, dating back to the late 1910s. While each game has a different historical time span, the number of “degrees” needed to cover the four major pro sports is still remarkably similar. It takes at most nine steps to connect any two men who’ve ever played professional baseball via common teammates, 10 to connect any two football players, nine for basketball, and eight for hockey. Focusing on the present era, it takes just three steps to connect any current NBA, MLB, NFL, or NHL player to any other current player in the same league. In baseball, you can use one of these three-step chains to link two of the season's best rookies. Gerrit Cole played on the 2013 Pittsburgh Pirates with ... Within each league, some players—journeymen athletes who’ve played on many teams with many different teammates—can be linked to other athletes even more readily. Kicker Billy Cundiff, who’s played for six different NFL franchises over 12 seasons, is an average of just 1.9 degrees from all other current players, earning him the title “Kevin Bacon of the NFL”—the player with the shortest average distance to his pro football contemporaries. What’s even more remarkable is that it’s possible to connect players who didn’t even play the same sport. Cross-sport athletes like Deion Sanders and Bo Jackson are exceedingly rare, and some combinations of sports are hardly seen at all. Of these 18 athletes, all but one—Bud Grant—played baseball as one of his two pro careers, proving either that the stars of the diamond are athletic enough to master other sports or that anyone athletic enough to play basketball or football can also handle baseball. Hockey is the opposite, as there has never been a pro hockey player who also played top-level basketball, football, or baseball. As a result, hockey is a closed system. But once you get off the ice, it’s possible to link every pro baseball, basketball, and football star. Adding multisport athletes adds some surprising twists to the network. It turns out that sometimes the fastest way to link players from two different sports is to go through a third sport. You can link up Tom Brady and Kevin Garnett, for instance, by going from the NFL to MLB before coming back to the NBA: Tom Brady played on the 2000 New England Patriots with … Voila—two legends of Boston sports, just six degrees apart. Thanks to this handful of multisport athletes, no more than 12 degrees is ever needed to make one of the more than 2 billion possible connections between any two athletes from baseball, football, or basketball. An example of one of those 12-step chains: Ben Dvorak played on the 1921 Minneapolis Marines with ... “Twelve Degrees of Separation” is not quite as catchy as six, but it's still impressive that any two athletes who played for any of 6,000 teams over 140 years can be covered in just a dozen steps. If you buy my original logic that I'm only four degrees away from LeBron, and we know that LeBron is no more than 12 degrees from any other player in the history of baseball, basketball, or football, does that make me at most 16 degrees from any pro? Possibly, although considering I haven't seen daylight since I started coding this project, it’s probably more accurate to say I’m living a life as far away as humanly possible from that of a professional athlete.
},value:function(a){return a===b?this.options.value:(this.options.value=this._constrainedValue(a),this._refreshValue(),void 0)},_constrainedValue:function(a){return a===b&&(a=this.options.value),this.indeterminate=a===!1,"number"!=typeof a&&(a=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,a))},_setOptions:function(a){var b=a.value;delete a.value,this._super(a),this.options.value=this._constrainedValue(b),this._refreshValue()},_setOption:function(a,b){"max"===a&&(b=Math.max(this.min,b)),this._super(a,b)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var b=this.options.value,c=this._percentage();this.valueDiv.toggle(this.indeterminate||b>this.min).toggleClass("ui-corner-right",b===this.options.max).width(c.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=a("").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":b}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==b&&(this.oldValue=b,this._trigger("change")),b===this.options.max&&this._trigger("complete")}})}(jQuery),function(a){var c=5;a.widget("ui.slider",a.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var b,c,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="",g=[];for(c=d.values&&d.values.length||1,e.length>c&&(e.slice(c).remove(),e=e.slice(0,c)),b=e.length;c>b;b++)g.push(f);this.handles=e.add(a(g.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(b){a(this).data("ui-slider-handle-index",b)})},_createRange:function(){var b=this.options,c="";b.range?(b.range===!0&&(b.values?b.values.length&&2!==b.values.length?b.values=[b.values[0],b.values[0]]:a.isArray(b.values)&&(b.values=b.values.slice(0)):b.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=a("").appendTo(this.element),c="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(c+("min"===b.range||"max"===b.range?" ui-slider-range-"+b.range:""))):this.range=a([])},_setupEvents:function(){var a=this.handles.add(this.range).filter("a");this._off(a),this._on(a,this._handleEvents),this._hoverable(a),this._focusable(a)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(b){var c,d,e,f,g,h,i,j,k=this,l=this.options;return l.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),c={x:b.pageX,y:b.pageY},d=this._normValueFromMouse(c),e=this._valueMax()-this._valueMin()+1,this.handles.each(function(b){var c=Math.abs(d-k.values(b));(e>c||e===c&&(b===k._lastChangedValue||k.values(b)===l.min))&&(e=c,f=a(this),g=b)}),h=this._start(b,g),h===!1?!1:(this._mouseSliding=!0,this._handleIndex=g,f.addClass("ui-state-active").focus(),i=f.offset(),j=!a(b.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=j?{left:0,top:0}:{left:b.pageX-i.left-f.width()/2,top:b.pageY-i.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,g,d),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return"horizontal"===this.orientation?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),0>d&&(d=0),"vertical"===this.orientation&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),2===this.options.values.length&&this.options.range===!0&&(0===b&&c>d||1===b&&d>c)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._lastChangedValue=b,this._trigger("change",a,c)}},value:function(a){return arguments.length?(this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)return this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b),void 0;if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();for(d=this.options.values,e=arguments[0],f=0;f
}var f,g,h,i=a.extend({},this.options.position);if(e){if(f=this._find(d),f.length)return f.find(".ui-tooltip-content").html(e),void 0;d.is("[title]")&&(b&&"mouseover"===b.type?d.attr("title",""):d.removeAttr("title")),f=this._tooltip(d),c(d,f.attr("id")),f.find(".ui-tooltip-content").html(e),this.options.track&&b&&/^mouse/.test(b.type)?(this._on(this.document,{mousemove:j}),j(b)):f.position(a.extend({of:d},this.options.position)),f.hide(),this._show(f,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){f.is(":visible")&&(j(i.of),clearInterval(h))},a.fx.interval)),this._trigger("open",b,{tooltip:f}),g={keyup:function(b){if(b.keyCode===a.ui.keyCode.ESCAPE){var c=a.Event(b);c.currentTarget=d[0],this.close(c,!0)}},remove:function(){this._removeTooltip(f)}},b&&"mouseover"!==b.type||(g.mouseleave="close"),b&&"focusin"!==b.type||(g.focusout="close"),this._on(!0,d,g)}},close:function(b){var c=this,e=a(b?b.currentTarget:this.element),f=this._find(e);this.closing||(clearInterval(this.delayedShow),e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title")),d(e),f.stop(!0),this._hide(f,this.options.hide,function(){c._removeTooltip(a(this))}),e.removeData("ui-tooltip-open"),this._off(e,"mouseleave focusout keyup"),e[0]!==this.element[0]&&this._off(e,"remove"),this._off(this.document,"mousemove"),b&&"mouseleave"===b.type&&a.each(this.parents,function(b,d){a(d.element).attr("title",d.title),delete c.parents[b]}),this.closing=!0,this._trigger("close",b,{tooltip:f}),this.closing=!1)},_tooltip:function(c){var d="ui-tooltip-"+b++,e=a("").attr({id:d,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return a("").addClass("ui-tooltip-content").appendTo(e),e.appendTo(this.document[0].body),this.tooltips[d]=c,e},_find:function(b){var c=b.data("ui-tooltip-id");return c?a("#"+c):a()},_removeTooltip:function(a){a.remove(),delete this.tooltips[a.attr("id")]},_destroy:function(){var b=this;a.each(this.tooltips,function(c,d){var e=a.Event("blur");e.target=e.currentTarget=d[0],b.close(e,!0),a("#"+c).remove(),d.data("ui-tooltip-title")&&(d.attr("title",d.data("ui-tooltip-title")),d.removeData("ui-tooltip-title"))})}})}(jQuery); $(function() {
var url_parameters = function () {
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i
return SERVER_PATH;
}
else{
return SERVER_PATH_2;
}
}());
this.addEventListeners();
if(url_parameters['p1']!==undefined){
if(url_parameters['p2']!==undefined){
this.loadData(decodeURI(url_parameters['p1'].replace(/_/g,' ')),decodeURI(url_parameters['p2']).replace(/_/g,' '));
}
}
}
Interactive.prototype = {
addEventListeners: function() {
var self = this;
$('.input_text')
.each(function() {
$(this).data('initialval', $(this).val());
});
$('.input_text')
.autocomplete({
delay: 1000,
minLength: 1,
source: function(request, response) {
var url = self.selected_server_path + 'c2.php';
console.log(url);
$.ajax({
url: url,
dataType: "jsonp",
data: {
term: request.term
},
success: function(data) {
response($.map(data, function(item) {
return {
label: item.label,
value: item.label
};
}));
}
});
}
})
.focus(function() {
if (!$(this).hasClass('focused')) {
$(this).val('');
}
$(this).addClass('focused');
})
.blur(function() {
if ($(this).val() === '') {
$(this).removeClass('focused');
$(this).val($(this).data('initialval'));
}
});
$('.btn_submit')
.click(function() {
if($('#input_p1').hasClass('focused')&&$('#input_p2').hasClass('focused')){
self.loadData($('#input_p1').val(),$('#input_p2').val());
}
});
},
addShareListeners:function(p1,p2){
var degrees = $('.degrees_count_readout').html();
$('.int_btn_facebook')
.click(function(){
Sharing.facebookShare({p1:p1,p2:p2,degrees:degrees});
});
$('.int_btn_twitter')
.click(function(){
Sharing.twitterShare({p1:p1,p2:p2,degrees:degrees});
});
},
loadData:function(p1,p2){
var self = this;
$('#int_loading').show();
$('.connection_here').empty();
$.ajax({
dataType: 'jsonp',
url: this.selected_server_path + 'SD.php',
data: {
'P1': p1,
'P2': p2,
},
success: function(response) {
$('#int_loading').hide();
$('.connection_here').html(response.html);
self.addShareListeners(p1,p2);
},
error: function(error){
$('#int_loading').hide();
$('.connection_here').html("We're sorry, the server can't be reached at this time. Please try again later.");
},
complete: function(){
$('.input_text').each(function(){
$(this)
.removeClass('focused')
.val($(this).data('initialval'));
});
}
});
}
};
var my_interactive = new Interactive();
var Sharing = {
FACEBOOK_SHARE_IMG_SRC: 'http://www.slate.com/content/dam/slate/articles/sports/slate_labs/2013/10/131014_LAB_KevinGarnett.jpg',
getShareText: function(conf, twitter) {
conf.degrees = parseInt(conf.degrees,10);
return 'There '+(conf.degrees===1?'is':'are')+' ' + conf.degrees +' '+(conf.degrees===1?'degree':'degrees')+' of separation between ' + conf.p1 + ' and ' + conf.p2;
},
twitterShare: function(conf) {
var url = Sharing.getURLsansParameters() + '?p1=' + conf.p1.replace(/ /g,'_') + '%26p2=' + conf.p2.replace(/ /g,'_');
var share_text = Sharing.getShareText(conf, true);
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left;
var url2 = 'http://twitter.com/intent/tweet?' + '&text=' + share_text + '&url=' + url;
window.open(url2, 'twitter', opts);
},
facebookShare: function(conf) {
var url = Sharing.getURLsansParameters() + '?p1=' + conf.p1 + '&p2=' + conf.p2;
var share_text = Sharing.getShareText(conf);
var obj = {
method: 'feed',
link: url,
picture: Sharing.FACEBOOK_SHARE_IMG_SRC,
name: share_text,
caption: 'Slate.com',
description: "How many degrees of separation are between your favorite athletes?"
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
},
getURLsansParameters: function() {
return 'http://' + location.host + location.pathname;
}
};
}); }());
//]]>
Jonathan Sanchez who played on the 2009 San Francisco Giants with ...
Juan Uribe who played on the 2013 Los Angeles Dodgers with ...
Yasiel Puig
Chad Eaton, who played on the 2004 Dallas Cowboys with …
Drew Henson, who played on the 2002 New York Yankees with …
Raul Mondesi, who played on the 2002 Toronto Blue Jays with …
Mark Hendrickson, who played on the 1998-99 New Jersey Nets with...
Mark Davis, who played on the 1995-96 Minnesota Timberwolves with …
Kevin Garnett
Rube Ursella, who played on the 1929 Minneapolis Red Jackets with ...
Bob Lundell, who played on the 1930 Staten Island Stapletons with ...
Ken Strong, who played on the 1947 New York Giants with ...
Frank Reagan, who played on the 1951 Philadelphia Eagles with ...
Bud Grant, who played on the 1949-50 Minneapolis Lakers with ...
Slater Martin, who played on the 1956-57 New York Knicks with ...
Richie Guerin, who played on the 1968-69 Atlanta Hawks with ...
Lou Hudson, who played on the 1977-78 Los Angeles Lakers with ...
James Edwards, who played on the 1992-93 Los Angeles Lakers with ...
Elden Campbell, who played on the 2004-05 Detroit Pistons with ...
Carlos Delfino, who played on the 2012-13 Houston Rockets with ...
Terrence Jones
Related Topics: us open tennis indicted
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.