This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name | value | |
---|---|---|
Locke | 4 | |
Reyes | 8 | |
Ford | 15 | |
Jarrah | 16 | |
Shephard | 23 | |
Kwon | 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************ | |
* An implementation of Zeller's Congruence - presuming MM/DD/YYYY input | |
* more information here: | |
* http://en.wikipedia.org/wiki/Zeller's_congruence | |
* | |
* TL;DR notes: | |
* - january and february are treated as months 13 & 14 of the previous year | |
* - resulting day number begins on saturday (0 = "Sat", 1 = "Sun", ... , 6 = "Fri") | |
* - actual formula listed below | |
* ********************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adds st nd rd th to number | |
// returns suffix-appended string or FALSE | |
function ordinal_suffix (num) { | |
var val=parseInt(num); | |
if ( isNaN(val) ) return false; | |
var mod_ten = Math.abs(val) % 10; | |
var mod_hun = Math.abs(val) % 100; | |
if ( (mod_ten == 1) && (mod_hun != 11) ) return val + "st"; | |
else if ( (mod_ten == 2) && (mod_hun != 12) ) return val + "nd"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- function to calculate multi-year wOBA for Retrosheet | |
-- This snippet supposes you have the Fangraphs GUTS table located with-in retrosheet. | |
-- Currently calculates career wOBA. Just add a year parameter and it works for single season calculations. | |
-- Also good for vs. Pitcher matchups and date ranges | |
DELIMITER // | |
CREATE FUNCTION wOBA(batter VARCHAR(8)) | |
RETURNS DECIMAL(10,3) | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- function to calculate multi-year FIP for Retrosheet | |
-- This snippet supposes you have the Fangraphs GUTS table located with-in retrosheet. | |
-- Currently calculates career FIP. Just add a year parameter and it works for single season calculations. | |
DELIMITER // | |
CREATE FUNCTION FIP(pitcher VARCHAR(8)) | |
RETURNS DECIMAL(10,2) | |
BEGIN | |
DECLARE FIP DECIMAL(10,2); |