Sunday, September 14th, 2008

Amanda’s Marathon Training Video

Amanda and I are running the Chicago Marathon this year. We’re hoping our friends will want to come watch us run on Sunday, October 12!

We are running as part of a fundraising group that supports the Chicago Children’s Memorial Hospital. So, Amanda made a fun video showing her unique Rocky Balboa training methods.

Anyway, hope you enjoy the video. If you like it and want to sponsor us, head to Amanda’s donation site and make a pledge to support her. Or, you can pledge to support me here.

Watch below, or check it out in HD on YouTube.

/life   〆   permanent link

Monday, September 8th, 2008

Git-SVN Cheat Sheet

Set good “don’t mess with my line endings” option before first checkout:

git config --global core.autocrlf false

Do this one time to suck in the repo w/history from SVN:

git svn clone svn://myrepo.com/project/

Do this loop over and over until your code ready to push back to SVN. The cool thing about this is that the adds and commits can be done off the network! Don’t forget to merge and re-test your changes after the rebase:

git add .
git commit -m "Added some awesome stuff"
git svn rebase

Push all local changes back to the SVN repo, which will now have all the local commits you did when you were on the airplane:

git svn dcommit

Also, here are a few links that inspired this post:

/developer   〆   permanent link

Monday, June 30th, 2008

Announcing Haiku Of the Day (HOD)

I helped put together a simple website and RSS feed of Haiku published by Bronze Man Books. Read the announcement or check out today’s haiku of the day!

/web   〆   permanent link

Saturday, May 10th, 2008

Run Your Software on Your GPU

Check out GPULib from Tech-X Corp. It gives you the ability to run mathematical functions on your GPU card (certain NVIDIA models only, as the moment). Includes a blog and bindings for Python (pystream) and MATLAB.

/developer   〆   permanent link

Tuesday, May 6th, 2008

Idiomatic Python, the Cheese Shop, PyEuclid

Today is becoming python link day, so here are a few more:

  • Idiomatic Python has some great tips on how to use python as it was intended.
  • The Python Package Index is a good place to look for code someone has already written that might solve the problem you’re thinking about, and probably in a much cleaner way than you were thinking. This used to be known as the Cheese Shop.
  • pyeuclid is a nice 2D/3D vector, matrix, and quaternion math library (that needs better docstrings and a ray-sphereoid intersection).

/developer   〆   permanent link

Tuesday, May 6th, 2008

Numpy for MATLAB Users

Great reference for those of us recovering from a MATLAB addiction, like this guy, who recently moved his scientific workflow to Python.

/developer   〆   permanent link

Thursday, May 1st, 2008

Python-by-example

Straight-forward Python reference the explains the standard library rather completely and cleanly just by showing a simple example for each module and function. Very nice for a quick lookup of something you don’t quite remember.

/developer   〆   permanent link

Monday, April 28th, 2008

Universal Sole 10

Amanda, Shayna, Mark, and I ran the 10-mile Universal Sole race in Lincoln Park yesterday. Here’s an excerpt with our times (full results):

O'All No. Name   Div/Tot  Rank 5 Mile  Pace  Finish    Pace 
===== === ====== ======== ==== ======= ===== ========= =====
  788 369 MARK   103/120   960   49:11  9:51 1:33:00.4  9:19
  883 155 ALAN    57/66    961   49:12  9:51 1:35:53.2  9:36
 1148 370 SHAYNA 119/130  1181 1:00:52 12:11 1:56:42.8 11:41
 1149 156 AMANDA 120/130  1182 1:00:53 12:11 1:56:44.4 11:41

/life   〆   permanent link

Thursday, February 21st, 2008

Installing IPython, SciPy, and Matplotlib into Apple’s Python on upgraded Leopard

Start by reading this reference and some tips at MacResearch.

Because it obscures the nice Leopard python that includes Numpy and Dtrace, remove your old Python completely.

sudo rm -rf /Library/Frameworks/Python.framework/

Check that NumPy is already installed and working.

python
import numpy
numpy.test(1,10)

Install latest IPython, version 0.8.2. Note that I always alais untar='tar xvzf' in my bash setup.

wget http://ipython.scipy.org/dist/ipython-0.8.2.tar.gz
untar ipython-0.8.2.tar.gz
cd ipython-0.8.2
sudo python setup.py install

Install a fortran compiler binary because it is needed to compile/install Scipy. I get the PPC version of gfortran. You can also find the Intel version at HPC Mac OS X.

wget http://internap.dl.sourceforge.net/sourceforge/hpc/\
gfortran-ppc-leopard-bin.tar.gz
sudo tar -xvf gfortran-ppc-leopard-bin.tar.gz -C /

Edit a disttools file in Apple’s NumPy distribution so it is more lenient in allowing the use of the above gfortran compiler when building SciPy. Inspired by this note.

cd /System/Library/Frameworks/Python.framework/Versions/2.5/\
Extras/lib/python/numpy/distutils/fcompiler
sudo cp -p gnu.py gnu.py.bak

And edit the following lines as follows (I use mate gnu.py to edit in TextMate).

- version_match = simple_version_match(start=r'GNU Fortran (?!95)')
+ version_match = simple_version_match(start=r'GNU Fortran')
- version_match = simple_version_match(start='GNU Fortran 95')
+ version_match = simple_version_match(start='GNU Fortran')

Build and install SciPy 0.6.0. Source available here.

wget http://internap.dl.sourceforge.net/sourceforge/scipy/\
scipy-0.6.0.tar.gz
untar scipy-0.6.0.tar.gz
cd scipy-0.6.0
sudo python setup.py install

This installs SciPy here: /Library/Python/2.5/site-packages/scipy, which isn’t seen by Python at first. I added the following to my .profile.

export PYTHONPATH="/Library/Python/2.5/site-packages"

Test it after closing your terminal and re-opening. I actually have 2 failures and 3 errors, but they are things I don’t care about at the moment.

python
import scipy
scipy.test(1,10)

Install matplotlib binary.

wget http://internap.dl.sourceforge.net/sourceforge/matplotlib/\
matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg
sudo easy_install -N matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg

Test it out and be happy that you’re done!

ipython -pylab
plot([1,2,3])

/mac   〆   permanent link

Saturday, December 15th, 2007

Rocky Fetching, Fighting the Roomba

Our boy continues to be quite the fun addition to the family. He can run around playing fetch all day. He also likes to fight with Little Buddy (a.k.a. our Roomba). I think we should teach him to ride it around.

/doggy   〆   permanent link

Tuesday, November 6th, 2007

Markdown in Python

A clean, fast Markdown implementation in python.

/web   〆   permanent link

Monday, October 22nd, 2007

Meet Rocky Brooks

We love our little 4-month-old Chihuahua we adopted on 20-Oct-2007. He also loves to play with his inverted self in the mirror …

/doggy   〆   permanent link

Wednesday, October 17th, 2007

Clean up your Contextual Menus

Thanks to this TidBITS article, I was tipped off to find this Mac OS X Hint about how you can rebuild the Launch Services database that determines which applications show up in your “Open With” contextual menu. My Open With had a huge amount of cruft accumulated over time with Classic apps, apps on my backup hard drive, and an annoying number of image droplets in the Photoshop/Samples/Droplets folder.

So I rebuilt my Launch Services database to make my Open With much cleaner and faster. Here’s how I did it.

  1. Eject my backup hard drive so that the database doesn’t include duplicate copies of all my applications.

  2. Archive the Photoshop/Samples/Droplets/ folder (right click, Create Archive, then delete the folder).

  3. Add the following line to my ~\.profile so typing the lsregister command is easier. (alias ... should all be on one line)

    # make launch services register easy to find
    alias lsregister='/System/Library/Frameworks/
        ApplicationServices.framework/Frameworks/
        LaunchServices.framework/Support/lsregister'
    
  4. Save a description of the old database (out of curiosity, not necessary).

    lsregister -dump | less > lsregDumpOld.txt
    
  5. Rebuild the database. (all on one line)

    lsregister -kill -r -f -domain system -domain system
        -domain user "/Applications"
    
  6. Save a description of the new database (again just curious).

    lsregister -dump | less > lsregDumpNew2.txt
    

The new database is now about 1 MB, down from the original 6 MB. There sure was a lot of junk in there!

/mac   〆   permanent link

Tuesday, October 16th, 2007

Steve vs. Alan on Hearing High Stuff

I can hear up to 17.1kHz. Steve can only hear up to 14.7kHz. So I win this round. Although maybe that means he can save more disc space and compress his MP3s a little more?

If you want to perform your own test, you can use Python on Windows as follows:

from winsound import Beep
Beep(14000, 1000)

14000 is the frequency 14kHz and 1000 is beep duration 1000ms (1 second). Crank up the frequency until you can’t hear it.

Update: alternate MATLAB one-liner for doing the same:

f=15000;fs=44100;sound(sin(f*2*pi*[0:fs-1]/fs),fs)

Update 2: Paul says he can hear up to 16.9kHz well but also claims to faintly hear 18-20kHz. I think that means he wins, because I cannot hear above 17.1kHz at all. He said he used headphones whereas I used crappy laptop speakers, so I consider that cheating a little.

Update 3: So apparently, the results are very dependent on the speakers being used. I tested Amanda at home using the Bose speakers and she can hear up to 17.5kHz. Funny thing: with these speakers, I can hear up to about 18.4kHz. Not sure what to make of that except that I’m winning again.

/life   〆   permanent link

Monday, October 15th, 2007

Punched before Eating

Maybe the funniest SNL Digital Short yet.

/web   〆   permanent link

Monday, October 15th, 2007

Hidden Dictionary on The New York Times

Woah, I just randomly double-clicked a word while reading an article nytimes.com and it popped up a definition/theauraus with information on that word. Seems to work while reading articles, but not on the front page.

It is actually more than just a dictionary. For example, go read about Led Zeppelin finally doing digital downloads and when you click Zeppelin, it gives a short bio on the band. Says it’s powered by Answers.com.

/web   〆   permanent link

Saturday, October 13th, 2007

iPhone Unleashed

Hack the iPhone is the best site that collects iPhone hacks, how-to’s, and downloads. Installer.app is a package manager that lets you install, update, and uninstall a great variety of 3rd party iPhone software. Awesome. Finally, iFuntastic lets you change your icons, backgrounds, and install apps.

Update: The iPhone Dev Wiki gives the most updated info on current hacking status, including a list of working native apps.

Also, iPhone Alley has some great news and guides.

Also also, iPhonegoboom has good warnings.

/mac   〆   permanent link

Saturday, October 13th, 2007

effbot

Great Python articles, books and downloads. Visit and enjoy. I especially enjoyed this optimization of a log file parser.

Some other interesting articles:

/developer   〆   permanent link

Friday, October 12th, 2007

Humanized

I’m starting to really like the Humanized weblog. A few interesting articles:

/web   〆   permanent link

Thursday, October 11th, 2007

Twitter?

Adam Engst of TidBITS has me convinced to try Twitter.

/web   〆   permanent link

Thursday, October 11th, 2007

SVN Version in Your Source

Suppose you are using Subversion to manage your code and find that you’d like to include revision information within a file. You might read this and think it won’t work, but do not be dismayed. You really wanted to look at Keyword Substitution in the Subversion book.

There you will find that enabling substution on a file is rather easy. Say you have some code in Spam.py and you’re running TortiseSVN. Then, the basic process is:

  1. Rt click file -> Properties -> Subversion tab -> Properties.
  2. Add a property svn:keywords with value Date Revision Author HeadURL Id
  3. Put a keyword in the file where you want it to expand the thing — I put $Id$ in the docstring of Spam.py. Id is a summary which, after checking in, expanded to "$Id: Spam.py 513 2007-10-10 23:10:30Z username $".

/developer   〆   permanent link