Getting Rails, Sphinx, MySQL working on Snow Leopard

Had to switch to the 64-bit version of MySQL. Then I needed to re-install the MySQL gem as follows:
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
For Sphinx, I had to compile with the following commands:
LDFLAGS="-arch x86_64" ./configure --prefix=/usr/local --with-mysql=/usr/local/mysql
make
sudo make install
Check out this website for more info.

Update: Use the 32-bit version of MySQL if you’re still on Leopard. Apparently the Ruby interpreter is 32-bit on Leopard and 64-bit on Snow Leopard. Grr.

Overlapping pie chart labels in Stata

I’m generating a large number of graphs with loops in a Do file. In some of my pie charts, the slice labels (percentages) overlap. I was looking for an easy way to either alternate the gap on the labels or to not display labels for slices less than a certain value. If I were just generating a few pie charts by hand, this wouldn’t be an issue: I would manually set which labels should appear. However, because I am doing this on a large scale, I need my Do file to either intelligently not display labels or alternate the gap. Easy fix for this one. Split the label commands up for each slice, some with gaps of 5. Extra ones are ignored.

graph pie varname, plabel(1 percent, format(%3.1f) color(white) size(medsmall)) plabel(2 percent, format(%3.1f) color(white) size(medsmall)) plabel(3 percent, format(%3.1f) color(white) size(medsmall) gap(5))