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
#!/usr/bin/perl | |
print "retroID,lastName,firstName,bats,throws,team,pos\n"; | |
opendir RSDIR, "." or die "can't open directory .: $!\n"; | |
while (readdir RSDIR) { | |
if ( $_ =~ /(\d\d\d\d)eve$/ ) { | |
opendir YRDIR, $_ or die "can't open directory .: $!\n"; | |
chdir($_) or die "can't change to directory .: $!\n"; | |
while (readdir YRDIR) { |
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
#!/usr/bin/perl | |
use Archive::Extract; | |
$outfile = '"C:\Users\John\Desktop\Baseball Hacks\retrosheet\pbp.csv"'; | |
print `type all_hdr.txt > $outfile`; | |
opendir RSDIR, "." or die "can't open directory .: $!\n"; | |
while (readdir RSDIR) { | |
if ( $_ =~ /(\d\d\d\deve)\.zip$/ ) { | |
print "Unzipping $_\n"; |
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
'create a basic class given an array of property names | |
Public Sub CreateClass() | |
Dim cols | |
cols = Split("LETTER-NBR,INST,APPL,BRCH-ACCT,LST-PROM-DT,LST-PROM-AMT,PRIMARY-NAME,SECONDARY-NAME,ADDR-LINE-1,ADDR-LINE-2,CITY-STATE,TAX-ID-NBR,PROMS-BRKN,LEGAL-STATUS,AGENT-NBR,ACCT-TYPE,COLLAT-DESC,DUE-DATE,DUE-AMT,GRACE-DAYS,LST-PMT-DT,LST-PMT-AMT,CURR-BAL,REG-PMT-AMT,EMP-ID,ORIG-AMT,DT-1,DT-2,DT-3,DT-4,AMT-1,AMT-2,AMT-3,AMT-4,NBR-1,NBR-2,NBR-3,NBR-4,SAF-1,SAF-2,SAF-3,SAF-4,LAF-1,LAF-2,LAF-3,LAF-4,LAF-5,PHONE-NBR,LC-DUE,DEF-LC", ",") | |
Dim outfile As New System.IO.StreamWriter("c:\documents and settings\jkatricak\desktop\letterclass.txt") | |
For Each col In cols | |
col = Replace(col, "-", "_") | |
outfile.WriteLine(vbTab & "Private _" & col & " As String = " & Chr(34) & Chr(34)) |
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
CLS | |
@ECHO OFF | |
ECHO Backing up SQL databases to file. | |
"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\osql.exe" -E -S SERVERNAME -i "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\SQL Backup Files\backup.sql" | |
ECHO Done. |
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
#!/usr/bin/perl | |
foreach $argnum (0 .. $#ARGV) { | |
$tmp = $ARGV[$argnum]; | |
$ARGV[$argnum] =~ s/\.mp3/\.wav/g; | |
print "$tmp\n"; | |
system("lame --decode \"$tmp\" \"$ARGV[$argnum]\""); | |
} |
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
'Convert .ddb files to .bdb for camera backup software | |
'Note: this script must be in the same directory | |
'(normally _DDB_) as the files you want to convert. | |
Set WshShell = WScript.CreateObject("WScript.Shell") | |
Set objFS = CreateObject("Scripting.FileSystemObject") | |
strCurrentFolder=WshShell.CurrentDirectory | |
Dim fso, f, f1, fc, s | |
Dim i | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set f = fso.GetFolder(strCurrentFolder) |
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
#!/usr/bin/perl | |
use Algorithm::Permute; | |
# put players and their obp/slgs here | |
my @pname = ('John','Eddie','Scott','Todd','Mario','Beth','Maggie','Erin','Amanda'); | |
my @pobp = (.677,.590,.563,.556,.364,.500,.300,.333,.273); | |
my @pslg = (.900,.921,.552,.722,.364,.370,.300,.200,.200); | |
# formulae from http://www.beyondtheboxscore.com/story/2006/2/12/133645/296 | |
my @obpx = (2.997,2.255,2.141,1.670,2.254,1.346,1.528,1.188,2.550); | |
my @slgx = (.931,1.263,.933,1.504,1.146,1.237,1.164,.825,.539); |
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
#!/usr/bin/perl | |
foreach $argnum (0 .. $#ARGV) { | |
$tmp = $ARGV[$argnum]; | |
$ARGV[$argnum] =~ tr/A-Z/a-z/; | |
$ARGV[$argnum] =~ s/\(//g; | |
$ARGV[$argnum] =~ s/\)//g; | |
$ARGV[$argnum] =~ s/\'//g; | |
print "$tmp\n"; | |
system("mv \"$tmp\" \"$ARGV[$argnum]\""); | |
} |
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
'TODO: | |
'check/prompt number of rows/columns | |
'prompt for border width | |
'differentiate bold and not (plus other formatting?) | |
'output to ... | |
Sub CreateHTMLTable() | |
Dim strTable As String | |
Dim i As Long, j As Integer | |
Dim lngRows As Long, intCols As Integer |