Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Pro Quality. Fan Perspective.
Login-facebook
New Blog: Voodoo Five for South Florida Bulls Fans!

Community Project: Saberizing a Mac

The idea for this project came from a FanPost requesting some help getting databases and other saber-geeky tools up and running on a Mac.  While we're at it, let's add the qualification "for free".

I'm no database guru, but I do own a Mac and consider myself smarter than a seventh grader, so I'll volunteer to act as captain of this adventure, and anyone else who's a Mac user and looking to learn how to use databases is free to come along for the ride.  I suspect our cycle of learning will look something like:

  1. Someone asks a question.
  2. A bunch of people go looking for answers.
  3. They report back.
  4. We find something that works.
  5. We all implement it.
  6. We celebrate with age-appropriate beverages.
  7. We aim higher and loop back to #1.

My only official role will be to decide on the next question, and wait to announce it until we give everyone a chance to catch up.  Other than that, it's the blind leading the blind.

I will "feature" this article, meaning you can find a link to it in the Featured Stories section of the right sidebar even after it gets bumped from the front page.

First question: How do I get all the software pieces in place to work with SQL-based databases?  Colin's writeup at Statistically Speaking is a great start, although I remember striking out on a free, quality graphical interface on the Mac.  Ready, go!

 

2 recs  |  Comment 43 comments

Story-email Email Printer Print

Around SB Nation

I'm moving!

Mar 2010 from Bullets Forever - 11 comments

NetsDaily Joins SB Nation

Dec 2009 from NetsDaily - 35 comments

NetsDaily Transfer Complete

Dec 2009 from NetsDaily - 19 comments

NetsDaily Begins Off-Season Reports

Apr 2008 from NetsDaily - 4 comments

NetsDaily Expands Features Section

Apr 2008 from NetsDaily - 2 comments

Comments

Display:

Not an answer to this question

But thought I’d throw it out there for when it’s useful.

Has anyone tried Baseball on a Stick on a Mac?

by Dan Turkenkopf on Jun 2, 2009 9:10 PM EDT reply actions   0 recs

xampp

http://www.apachefriends.org/en/xampp-macosx.html

PHPMyAdmin + ANSI-standard SQL will get you any girl at a bar.

by mrjavascript on Jun 2, 2009 9:43 PM EDT reply actions   0 recs

MAMP

An alternative to XAMPP is MAMP. Personally, I haven’t used XAMPP on a Mac (have used it on Windows years ago), but I find that MAMP is as simple as dragging the application in the Applications folder and opening the controller application.

It uses MySQL and SQLlite. I’m not too sure how data is stored in this community, but these should be adequate. Postgres can also be installed (a Google search should turn up some helpful results).

How are calculations preformed? Is there any code that needs to be written? I’d be interested in doing so.

by Ryan Aghdam on Jun 2, 2009 10:31 PM EDT reply actions   0 recs

Doesn't MAMP come on a Mac already?

Something like that does.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 8:49 AM EDT up reply actions   0 recs

The building blocks do, but MAMP's easier.

You can fuss with installing the latest PHP to the built-in Apache server that starts up when you enable web sharing, and installing your own copy of MySQL.

But it’s really more trouble than it’s worth when MAMP’s a pre-built, pre-configured package of the latest MySQL, PHP, and Apache you can just drop in your Applications folder and start up whenever you need it and quit whenever you don’t.

by taber on Jun 3, 2009 8:58 AM EDT up reply actions   0 recs

Ok, does MAMP come with a GUI for MySQL?

Or do we need to add something like Sequel Pro, NaviCat MySQL Lite, or MySQL GUI Tools, all mentioned below?

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 9:20 AM EDT up reply actions   0 recs

MAMP doesn't come with a GUI

MAMP doesn’t include a GUI for MySQL management, but any of those graphical frontends will hook up to a MAMP-based MySQL server without a fuss.

Both will have to be running at the same time — the GUI depends on the server to work.

by taber on Jun 3, 2009 10:00 AM EDT up reply actions   0 recs

phpMyAdmin comes with MAMP, but some prefer a GUI client to a web application.

by Ryan Aghdam on Jun 3, 2009 10:57 AM EDT up reply actions   0 recs

Navicat

If you prefer a OSX GUI to use there’s a free version of Navicat call Navicat Lite available for non-commercial use.

http://www.navicat.com/download/download.html

by BluJay on Jun 3, 2009 1:39 PM EDT up reply actions   0 recs

From kindred in the other thread:

i give you some open-source-hippie-shit. But seriously this “R” thing looks decent…just not sure if i have the computing chops for it.

Decrease runs scored?
Maybe.

Decrease winning? Never seen that proven.
-SFTU

by hazel on Jun 3, 2009 1:12 AM EDT reply actions   0 recs

GNU R is a programming language all its own.

I use it from time to time to do stuff that Excel can’t handle, although I find myself gravitating more and more towards gretl, which is less powerful but also much easier to use for someone like me who isn’t a real computer programmer.

I don’t think either really solve the issues at stake here – whenever I use either of them I feed them data that comes out of an SQL database. The problem being looked at here is really that stage of things – MySQL should run fine on a Mac, and any MySQL code that I (or others!) publish should run regardless of the underlying OS.

Has anyone tried Navicat MySQL Lite? I’ve used the Windows version and didn’t like it as much as SQLyog, but I found it plenty servicable, and there’s a Mac version.

by cwyers on Jun 3, 2009 3:14 AM EDT up reply actions   0 recs

I've also had fairly good luck with Oracle's SQLDeveloper

And it’s a Java application, so it should run on any platform (I’ve liked it better on Windows than on Linux). They have a Mac installer here.

I also use the MySQL GUI Tools which come in a Mac version as well.

by Dan Turkenkopf on Jun 3, 2009 7:36 AM EDT up reply actions   0 recs

Oh and I am a computer programmer and I have trouble with R

The documentation is shaky at best and it assumes you know a lot about statistics and matrix math to really do anything interesting.

Baseball Hacks has a good intro to some plotting/binning in R, but I’ve found the advanced stuff quite difficult.

by Dan Turkenkopf on Jun 3, 2009 8:06 AM EDT up reply actions   0 recs

Sequel Pro's a fairly new MySQL GUI for 10.5

This frontend for MySQL (which works perfectly, of course, with a MAMP installation, which is what I use for my local MySQL server — works beautifully) used to be called CocoaMySQL, but it’s been updated and it’s called Sequel Pro now. it’s all Cocoa, fast, and pretty effective, though it’s still not as comprehensive as my favorite Windows open source solution, HeidiSQL.

by taber on Jun 3, 2009 8:22 AM EDT up reply actions   0 recs

Yeah, I want to get to R eventually, too.

Let’s get the database software ready, and a database or two imported…

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 8:48 AM EDT up reply actions   0 recs

Not Mac-specific

but phpMyAdmin is web-based, will run on anything, and does just about everything I need.

by richardhkirkando on Jun 3, 2009 9:39 AM EDT reply actions   0 recs

MAMP and phpMyAdmin set up really easy

but how do you get and manipulate Retrosheet files with it? Is it possible?

by RFK on Jun 3, 2009 1:48 PM EDT up reply actions   0 recs

Good question.

I know there’s a program that runs on PCs which takes in retrosheet files and spits out something more user-friendly. Hopefully someone more knowledgeable will chime in here.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 2:26 PM EDT up reply actions   0 recs

Longer answer:

If you follow my Retrosheet tutorial:

http://statspeak.net/2009/03/creating-a-retrosheet-database-part-i.html

You should be able to use DOSBox to run both Chadwick and the batch files I wrote to parse the Retrosheet files into CSV files. The SQL loaders I wrote should then (with a slight modification) load the CSV files. I don’t have a Mac where I can test this on, but it seems straightforward to me – you just have to pay attention to the directory structure you’re using when you mount the files on the virtual drive.

by cwyers on Jun 3, 2009 4:52 PM EDT up reply actions   0 recs

Uh, sweet.

After “we” get databases software up and running, I think the Databank database will be goal one (which shouldn’t be hard given your tutorial) and then maybe we’ll hit retrosheet. There are size issues to deal with there, right?

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 4:55 PM EDT up reply actions   0 recs

Ooh ooh

can we get Pitchf/x and Gameday too?

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 3, 2009 6:40 PM EDT up reply actions   0 recs

I'm hoping.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 7:05 PM EDT up reply actions   0 recs

What about that "Baseball on a stick" thing?

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 3, 2009 6:53 PM EDT up reply actions   0 recs

It SHOULD work.

It just should take a little additional work to get it working.

by cwyers on Jun 3, 2009 9:13 PM EDT up reply actions   0 recs

wow

I was just going to take look at the Retrosheet db… 4.59 gigs. That’s a lot of baseball.

Marlins Stadium: When It's Raining, The Roof Will Happen!

by dan 2.0 on Jun 3, 2009 9:34 PM EDT up reply actions   0 recs

I Can Host a Database

I pay for a web host that gives me database hosting where we could host a database for all to view (and possibly edit). Any interest in using it?

by Ryan Aghdam on Jun 3, 2009 10:59 AM EDT reply actions   0 recs

How would that work?

Would we all create our own queries and build them off of others’ queries? We’d have to prevent people from removing others’ queries or deleting information, right?

What if we made that databases publicly available, shared how they were set up, helped people set up their own local database, then shared, via the public sample database, all the code snippets (and queries and whatever other technical things I’m unaware of) that would do cool things people would want to do on their own computer?

Ryan, mind sending me an email? This is definitely something worth looking into.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 11:52 AM EDT up reply actions   0 recs

This is great, Sky

I’m a new Mac owner and a complete database virgin, and coupling this post with Colin’s first from Statistically Speaking, I’ve been able to start working with the Baseball Databank in fairly short order. I used MAMP and Sequel Pro; I tried Navicat but liked Sequel Pro better.

I’ll be following this closely. I’m eager to learn.

"I didn't realize his velocity was that high," said Macha, noting that radar readings aren't flashed during exhibition games.

by battlekow on Jun 3, 2009 3:24 PM EDT reply actions   0 recs

Cool, there's already a lot of information here.

I’m going to go try MAMP and SequelPro and see how I do…

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 4:36 PM EDT up reply actions   0 recs

jumping on board

I had tried this in 07 after reading Baseball Hacks, but the lack of a quality (free) GUI then left me floundering with Terminal commands.

Decided to follow battlekow’s lead and shoot for Databank using MAMP/Sequel Pro. The only issue I ran into was on running Sequel Pro, the initial connection would fail due to some socket, uh, issue. But a quick search brought up this Sequel Pro kinda-sorta FAQ, where the solution was found. Namely:

In the connection setup dialogue, tell Sequel Pro to connect to the Socket “/Applications/MAMP/tmp/mysql/mysql.sock” instead and everything works just fine.

Did that, connected fine. Followed the gist of the StatSpeak post and was running simple queries in short order.

Marlins Stadium: When It's Raining, The Roof Will Happen!

by dan 2.0 on Jun 3, 2009 6:01 PM EDT reply actions   0 recs

Yeppers!

I downloaded MAMP and downloaded Sequel Pro. Dragged them both into Applications. Opened them both. On the web page MAMP automatically opened up, there were login details (user, password, port, host) including the /Applications/MAMP/tmp/mysql/mysql.sock socket link. I typed those all into the Sequel Pro login screen and it connected. Next step, a database, but I’m going to wait just a bit to move on to give others a chance to try this themselves and ask questions.

Anyone know of any limitations of Sequel Pro? What are the chances we regret using this down the road. It sure does look nice and keeps the spirit of doing things on a Mac alive, at least visually…

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 6:08 PM EDT up reply actions   0 recs

my initial observation is

that Sequel Pro does work fine IF you know SQL syntax/language/commands/whatever (unless I’m missing something).

On the other hand, phpMyAdmin has a Query tab that helps you build the proper command. Of course, you need to learn how to use THAT.

by RFK on Jun 3, 2009 7:27 PM EDT up reply actions   0 recs

Is it like Access' tool? That's pretty handy.

I could see us getting into some SQL challenges and sharing results for useful queries that work.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 11:18 PM EDT up reply actions   0 recs

I've never used Access

but I searched around and some site said the phpMyAdmin Query tab was a "MSAccess-like query editor (Query-By-Example) which allows users to compose an SQL query using several GUI elements", so, yeah, probably.

(Sorry for having to double-post this comment.)

by RFK on Jun 4, 2009 1:30 AM EDT up reply actions   0 recs

FYI, I have a post scheduled for tonight that runs down which software to install and how...

… plus sets the next bar at installing the Baseball Databank database and running some of Colin’s introductory queries (links included).

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 4, 2009 4:41 PM EDT reply actions   0 recs

If you've accomplished goal one, yes. ; )

I’m never going to stop you from celebrating with age-appropriate beverages by the way.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 4, 2009 6:08 PM EDT up reply actions   0 recs

Comments For This Post Are Closed


User Tools

We use numbers and stuff.
Community Guidelines
Why be a member?
Start posting on Beyond the Box Score »

Join SB Nation and dive into communities focused on all your favorite teams.

Connect_with_facebook

Cbs_fantasy_baseball_promo

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Picture-2_small
Advanced Graphing Techniques Part 4 - Cluster Analysis in R

Recent FanPosts

Small
SB Nation Survey + Chance to donate $500 to a charity of this community's choice
Small
Spring Training Statistics?
Patrick_willis_small
WAR Fantasy draft
Small
Is It No Longer Sonny In Tampa?
Limes_125_small
Help With 32 Questions Contest
Otto_-_image_adjusted_small
Good reasons for getting past the divided leagues era
Small
Nathan's Replacement
Rays_small
Chasing the Grail, Part Two
Rays_small
Chasing Sabermetric’s Holy Grail or, Another Stab at Estimating Catcher Defense

+ New FanPost All FanPosts >

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recent FanShots

Optimizing the Phillies and Yankees Lineups
Join BtB's Last Minute March Madness Pool
Dave Allen did this with home runs. I thought this might look cool for certain pitchers who had pinpoint command.
Irish Ballplayers -- Seems appropriate for today
Simpson's Paradox, Bert vs. Jack, and more sweet B-Ref splits

I've played fantasy baseball for many years. (My first team's rotation featured rookies Jason Bere and Aaron Sele.  Jay Buhner and Mo Vaughn anchored my lineup.) But I haven't played it well since 2003 or 2004.  My excuse?  Kids.

No, it's not that I fill my rosters with unproven youngsters.  It's that my wife and I have too many.  Too many to allow me the time necessary to have success in a competitive fantasy baseball league.

I've thought about hanging up my fantasy spikes but I really like playing it -not to win necessarily- but really just to keep an eye on good and great players from around baseball.  Players  like Adrian Gonzalez or Josh Johnson who of course come up on the each team's schedule sporadically throughout the summer but then seemingly disappear.  I like knowing about those guys and I like being able to talk to other baseball fans about those guys.  So I play fantasy baseball.  And I'm gonna continue to play.

...As long as at least two or three of you folks wanna join the rest of us in my new league: S(a.N.D)B.O.K.X. Fantasy Baseball.

The SAND is the tautologically redundant part of the acronym: Simple (and Not Difficult)

The BOKX explains just how simple (and not difficult) this league's scoring system will be: Based Only on Ks (strikeouts) and Xs (extra base hits).

* * * This league's scoring system has two only statistics: strikeouts and extra-base hits.* * *

Hopefully, this keeps things simple (and not difficult) and will thus require only a few minutes each week to seek out good hitters and good pitchers to replace not-quite-as-good pitchers and not-quite-as-good hitters.  (And hopefully, I'll have Ryan Howard on my team.)

We'll probably use only players from the National League and  unless things change for some reason, it'll be a points league. It's gonna be on Yahoo! so it'll be free and unless things change for some reason, we'll just be playing for bragging rights (and something to do).

I've had some help from Red Reporter's sabermetric higher-ups and I think I know how to weight things so that the NL's good, better and best strikeout pitchers are going to be worth roughly what the NL's good, better and best sluggers will be worth on draft day.  But I've never seen or heard of a league like this so I don't know quite what to expect and if anybody can think of any reason that this format might go beyond just being quirky and we'll like end up ripping a hole in the space/time continuum, help us out, eh?

So, if you wanna play and/or if you have any questions, let me know below.

We had the draft set for Wednesday, March 31st at 8:30pm EST.  But I'm almost certain that we're going to change that date. I think we'll need to settle on a date and a time and I think we'll need to do it sooner rather than later so as soon as we can get our ninth and tenth owners we'll restart that conversation.

I'm gonna go ahead and post an email address so that if there are any lurkers who wanna play they don't necessarily have to create an SBNation account in order to do so.  Just let me know what you're thinking: SANDBOKX.at.Gmail
Why Nathan's loss won't kill the Twins - ESPN TMI Blog
The Book -- Predicting the HR leader board
Spring Training Pitch FX Data
The All-CHONE Team

+ New FanShot All FanShots >

BtB on Twitter

Main Feed: @BtBScore

Jeff: @jeffwzimmerman
Steve: @steve_sommer
Sky: @BtB_Sky
Dan: @dturkenk
Harry: @harrypav
Jinaz: @jinazreds
Jack: @jh_moore
Erik: @Erik_Manning
Tommy R: @trancel
Justin: @justinbopp

Subscribe to BtB via Email

Enter your email address:

Delivered by FeedBurner

BtB Goes Social

SBNation.com Recent Stories

New York Mets starting pitchers Mike Pelfrey, left, Johan Santana, center, and Oliver Perez watch as teammates take part in drills during spring training baseball Saturday, Feb. 27, 2010, in Port St. Lucie, Fla. (AP Photo/Jeff Roberson)

SB Nation's 2010 MLB Previews: New York Mets, The High Cost Of Low Expectations

Washington Nationals pitcher Stephen Strasburg throws during the second inning of  a spring training baseball game against the Detroit Tigers Tuesday, March 9, 2010 in Viera, Fla. (AP Photo/Charlie Riedel)

Nationals Send Stephen Strasburg To Double-A Despite Impressive Spring

Seattle Mariners pitcher Cliff Lee speaks during a baseball news conference at Safeco Field in Seattle on Friday, Jan. 22, 2010. Lee was acquired by the Mariners in a trade with the Philadelphia Phillies last December. (AP Photo/John Froschauer) link

Cliff Lee Out With Right Abdominal Strain

More from SBNation.com >


Managers

Wbc_029_small Jeff Sullivan

Editors

Rawlings_baseball_bigger_small Dan Turkenkopf

Limes_125_small Sky Kalkman

770insig_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Paige_small Satchel Price

Authors

Jinaz-reds-avatar_small JinAZ

Face_small Harry Pavlidis

Newavatar_small Matt Klaassen

1753738656_110919ebe9_o_small vivaelpujols

Ozzie_small erik

Big_pun--300x300_small Tommy Rancel

Adam_small adarowski

Redcap_small SFiercex4

St_louis_cardinals_ce1141_003263_small stevesommer05

Julio_teheran_2_small PWHjort

Cclogo_small Daniel Moroz