08 March 2009

How To Blow a Couple of Hours with the iLife Suite

Step 1: Pick a Song

I've always been a huge fan of Paul Simon and The Only Living Boy In New York is a personal favorite.

Step 2: Record The First Pass

The first thing I recorded was the final video clip and a one-take pass at the song to give me some structure to begin layering on top of. To get this first track I set up Garage Band to record using a microphone which was set up (off-screen) about 2 feet from me. At the same time I used Photo Booth to capture the video from the iMacs web cam. In the video I'm wearing headphones so that I can hear the click track.

Step 3: Overdub, Overdub, Overdub

At this point I had the one track to work with and began to lay additional guitar and vocal tracks over it, recording directly into the iMac using an M-Audio USB interface.

Step 4: Export the Final Mix and Sync the Video

After exporting the final mix from Garage Band into a high quality AAC file, I imported both the original video clip from Photo Booth and the audio track into iMovie HD. Once the import was complete, all that was left to do was to extract and remove the clip's original audio track, sync up the new audio and export to an H.264 Quicktime movie. I ended up forgetting to flip the source video so the final clip is still a "mirror image" due to the way Photo Booth captures video.

That's It?

I'm consistantly amazed at the quality of the iLife applications. I'm in no way an expert at Garage Band and this was literally the first time I've ever opened iMovie HD. Still, given a couple of hours and a low end Apple it's almost absurdly easy to complete a project like this. As a teenager I'd spend days recording and bouncing tracks on a 4-track cassette recorder, work that would literally take a fraction of the time on an out of the box iMac.

The "Final" Product

06 March 2009

Virtualenv Helper for Windows

If you're a fan of Ian Bicking's virtualenv library, and you should be, you've probably heard of Doug Hellmann's virtualenvwrapper bash script. Unfortunately for me I have to develop on Windows at work so this does me little good without a Bash shell (it may work under Cygwin, I haven't tried). Thankfully, Python runs everywhere and I was able to hack together a simple virtualenv management script for windows that handles most of my needs.

The script assumes you will store your virtual environments in the directory "C:\virtualenvs" (you can edit this in the script by changing DEFAULT_DIR_PATH), and supports listing, creating, removing and switching virtual environments from cmd.exe. To install, simply save the code below as env.py in your Python scripts folder, typically something like "C:\Python25\Scripts". You can then get a summary of the command line options by typeing "env.py -h" at a command prompt.

Here's the script:


import os
import shutil
from optparse import OptionParser

# default path to store virtualenv directories
# can be modified on a case by case basis with the -d option
DEFAULT_DIR_PATH = "C:\\virtualenvs\\"


def main():
    usage = "usage: %prog [options] arg"
    parser = OptionParser(usage)
    parser.add_option("-r", "--remove", action="store_true", dest="remove",
                      help="delete the virualenv")
    parser.add_option("-c", "--create", action="store_true", dest="create",
                      help="create the virtualenv if it does not already exist")
    parser.add_option("-l", "--list", action="store_true", dest="list",
                      help="list all current virtualenvs in directory")
    parser.add_option("-d", "--directory", dest="directory",
                      help="path to the directory containing the virtualenv")
                      
    (options, args) = parser.parse_args()
    
    dir_path = options.directory
    if dir_path is None:
        dir_path = DEFAULT_DIR_PATH
    
    # create the virtualenv directory if it does not exist
    if not os.path.isdir(dir_path):
        os.makedirs(dir_path)
        
    # list virtualenvs and exit
    if options.list:
        for item in os.listdir(dir_path):
            if os.path.isdir(os.path.join(dir_path, item)):
                print item
        return        

    # if we are not listing all envs we need a env name
    if len(args) != 1:
        parser.error("you must supply a virtualenv name")
    
    # store our paths
    env_name = args[0]
    env_path = os.path.join(dir_path, env_name)
    
    # does this env already exist?
    env_exists = os.path.isdir(env_path)
    
    # can't create and remove
    if options.create and options.remove:
        parser.error('iptions -c and -r are mutually exclusive')
    
    # prompt for confirmation and then delete the virtual env
    if options.remove and env_exists:
        resp = raw_input('remove directory "%s"? Y/n: ' % env_path)
        if resp == 'Y':
            print 'removing directory "%s"' % env_path
            shutil.rmtree(env_path)
        return
          
    # if the env does not exists we either create it (-c) or throw an error
    if not env_exists:
        if options.create:
            print os.system('virtualenv.exe %s' % env_path)
        else:
            parser.error('virtualenv does not exists. use the -c option to create it.')
            
    # activate the virtualenv
    script_path = os.path.join(env_path, 'scripts', 'activate.bat')
    os.system('cmd.exe /K "%s"' % script_path)
        

if __name__ == '__main__':
    main()

Here are some usage examples:


# List all environments
> env.py -l

# Switch to a new environment
> env.py myenviron

# Switch to a new environment and
# create it if it doesn't already exist
> env.py -c myenviron

# Remove an environment
> env.py -r myenviron

A couple notes:

  1. I've only tested this script on Windows XP with Python 2.5. It works for me. Use it at your own risk and all that.
  2. If you're developing with the Django development server DO NOT exit it using CTRL-BREAK as instructed. This will bork your command process and you'll have to close it out and open a new window. Use CTRL-C instead.

Update:

I've posted this script to Bitbucket where you can check out the latest changes and report any issues you find.

04 March 2009

Seriously, Get Dropbox.

If you don't already have a free Dropbox account (I wrote about it here) you don't know what you're missing and you should sign up using this link so that we both get extra free space. Dropbox is good. Extra free space is even better (more good).

20 February 2009

Quite a Year

Overall, 1999 is still my favorite movie year. I saw more than 50 movies in the theater that year, including EWS [Eyes Wide Shut], Rushmore, Princess Mononoke, Election, Run Lola Run, Being John Malkovich, Iron Giant, The Matrix, Magnolia, American Beauty, Toy Story 2, and Three Kings. Quite a year.

- Jason Kottke

Quite a year indeed.

08 November 2008

Setting Up A Django Development Virtual Environment on OS X

This is a simple script I currently use to set up a Python virtualenv for Django development. It just sets up a new virtualenv and checks out the latest revision of Django from their web site. Maybe someone else will find it useful. Improvements are definitely welcome!

#! /bin/bash
virtualenv env
svn co http://code.djangoproject.com/svn/django/trunk/django env/lib/python2.5/site-packages/django
cp env/lib/python2.5/site-packages/django/bin/django-admin.py django-admin.py

I save the script in /usr/local/bin as "djangovirtualenv.sh" and whenever I want to setup a new environment I do this:

justin$ cd ~/projects
justin$ mkdir NewProject
justin$ cd NewProject
justin$ djangovirtualenv.sh
justin$ source env/bin/activate
justin$ python djangoadmin.py startproject newproject

You can get virtualenv from PyPi

02 October 2008

Why Apple Might Close the iTunes Store

Vice president for iTunes, Eddy Cue:

Apple has repeatedly made clear that it is in this business to make money, and would most likely not continue to operate iTS if it were no longer possible to do so profitably

While the consensus on the web seems to be that this would never happen, I think a strong case could be made for Apple exiting the music sales business - if it did become unprofitable - and turning the iTunes store into a distribution platform for a current rival such as Amazon. Such an arrangement would allow Apple to keep the iTunes/iPod integration and lose the continued hassle of RIAA negotiations and DRM enforcement.

Via BBC News.

26 September 2008

"Mission Accomplished"

I read about this earlier but now it seems it's been confirmed. John McCain truly is a maverick if he can win a debate he wasn't planning on attending before it even occurs. Brilliant.

World, Stop for a Moment

Even Huckabee's calling McCain out on this bullshit political maneuver:

You can't just say, 'World, stop for a moment. I'm going to cancel everything,'

- Mike Huckabee on John McCains attempt to postpone the debate

22 September 2008

The Way Out Is Through

There is no more MTV, radio has lost it's reach and the major record labels are losing their relevance. Still, I never thought I would be getting direct marketing emails from Trent Reznor.

Message from Trent:

Hello everyone.

I'd like to thank everyone for a very successful year so far in the world of Nine Inch Nails. I'm enjoying my couple of weeks off between legs of our Lights In The Sky tour and got to thinking... "wouldn't it be fun to send out a survey to everyone that's shown interest in NIN?" Well, that's not exactly how it went, but regardless - here it is. As we've moved from the familiar world of record labels and BS into the unknown world of doing everything yourself, we've realized it would benefit us and our ability to interact with you if we knew more about what you want, what you like, what you look like naked, etc. I know it's a pain in the ass but we'd truly appreciate it if you'd take a minute and help us out. As an incentive, everyone who completes the survey will be able to download a video of live performance from this most recent tour (and I know what's going through your little minds right now: "I'll just grab this off a torrent site and not have to fill out the survey!!!" and guess what? You will be able to do just that and BEAT THE SYSTEM!!!! NIN=pwn3d!!!)
BUT
What if we were to select some of those that DO complete the survey and provide them with something really cool? I'm not saying we'll ever get around to it, but if we did maybe something like signed stuff, flying someone to a show somewhere in the world, a magic amulet that makes you invisible, a date with Jeordie White (condoms supplied of course), you know - something cool. See, you'd miss that opportunity AND be a cheater. Do the right thing - help us out. You'll feel better.

Thank you and I've had too much caffeine this morning,
Trent

I can't imagine I'm the only one waiting to see what he does next.

Update: I took the survey and I am now eagerly awaiting my date with Jeordie White.

20 September 2008

Nanorganization

I currently sync two playlists to my iPod. A "smart" playlist and a manual playlist named iPod Smart and iPod Manual respectively. The "smart" playlist is configured to select 115 songs ordered by date from my library where a: the rating is greater than two and b: the play count is less than two. The other serves as a way sync up a few current favorites or even a pod cast.

As the idea of an iPod large enough to hold your entire library goes the way of the virtually ignored "classic", I think apple would do well to make some improvements in the tools it provides for managing and syncing it's iPod devices. What are your tricks?

Update: as I was syncing my iPod this morning I realized you could limit a "smart" playlist by total bytes (in GB and MB). This is a far more reliable method for someone like me trying to use every bit on a small drive. I'm not sure if this is a new feature in iTunes 8 or if I just never noticed before.

17 September 2008

Bandcamp

Great ideas are often based not on doing something new, but doing something the way most people didn't even realize it should be done. Bandcamp, the newly launched digital music publishing platform, looks like it may just fall into this category. As a musician, as well as a developer, I'm terribly excited about it's possibilities.

If you're at all interested in independent music or web application development, do yourself a favor and read the interview with Bandcamp founder Ethan Diamond at Waxy.org.

02 September 2008

Chrome Notes

Vassup!

  • Install and import process is painless and idiot proof
  • When you open a link in a new tab it opens next to the parent tab not at the end of the list
  • Built in site specific browser (SSB) functionality
  • Incremental but significant improvements to existing ideas such as the "omnibar" and the new tab page
  • WebKit
  • Minimal interface
  • History and bookmarks, all searchable and seamlessly integrated
  • It's really, really fast

Ich Don't Think So!

  • No Mac/Linux version, yet
  • The window "chrome" is very, very blue

Google Chrome

11 August 2008

CSS Variables

Alex Russell takes the W3C to task for this essay on CSS variables:

CSS authors who maintain the world’s most popular landing pages are contending with thousands of lines of CSS per page and hundreds of rules. This is orders of magnitude more complexity than the initially presented numbers, hopefully dispelling any notion that we could rely on those numbers as the basis for asserting anything but that those in the employ of the W3C and the volunteers which join them are not typical content authors and do not attempt the feats of CSS which are meerly [sic] work-a-day constructions for commercially successful websites.

There have been days in my career when I would probably have strangled the life from the author of this essay with my bare hands if it meant I could define variables in CSS.

31 July 2008

Origin Story

Every superhero needs an origin story.

Occasionally people ask me about the origins of my nickname BDFL (Benevolent Dictator For Life). At some point, Wikipedia claimed it was from a Monty Python skit, which is patently false, although it has sometimes been called a Pythonesque title. I recently trawled through an old mailbox of mine, and found a message from 1995 that pinpoints the origin exactly. I'm including the entire message here, to end any doubts that the term originated in the Python community.

I now find myself contemplating the existence of a Bizarro GvR.

30 July 2008

So What's "Cuil" Supposed to Mean Again?

Macworld:

Maybe Cuil’s founders tried to find an Irish dictionary using their site and couldn’t. Searching on Cuil.com for “Irish English dictionary” fails to turn up a link to such a dictionary in at least the first six pages of results.

Ouch.

26 July 2008

Dropbox is Better

I finally got an invite to the Dropbox beta program and having been trying it out for a few days now. It's minimal but it's lightweight and the web interface is clean and easy to use. It works quickly and quietly in the background and that's possibly the best compliment I can give any backup solution. It doesn't however, support all the features that MS Live Mesh provides.

Using Live Mesh, you can remote access any windows desktops in your cloud from any other device, including any Active X capable browser. Of course this leaves out Firefox, Safari and Opera. File access is supported for those browsers however, so they got that going for them. You can also add any folder on your Windows desktop to your "mesh" whereas you have to move files and folders to your Dropbox to have them sync.

Both of these services provide file backup and sync from multiple devices (desktops, laptops, Live Mesh promises mobile support). A file, once added to your "mesh" or your Dropbox, is immediately copied to the service's online system, and from there propagates down to each of your other devices. With Dropbox, and I'm imagining Mesh works similarly, if a file is modified only those modified bytes are transmitted. This reduces the amount of time and bandwidth the service needs to keep things in sync.

For right now, if you're on Mac or if you don't need the ability to remotely access your other devices I heartily recommend Dropbox. Live Mesh just feels bloated and clunkly in comparison.

25 July 2008

Force Gmail to Connect Using HTTPS

From the Official Gmail Blog:

We've added an option to Settings to always use https. If you don't regularly log in via unencrypted wireless connections at coffee shops or airports or college dorms, then you might not need this additional layer of security. But if you want to always use https, then this setting makes it super easy. Whenever you forget to type https://mail.google.com, we'll add the https for you. If you already have the https URL bookmarked, using this setting will ensure you access your account via https even when you don't use your bookmark. Any http link to Gmail (for example, the one at the top of Google.com) will be automatically redirected to https."

Home Economics

Jamie Lee Curtis:

"I am glad that I was given these skills as part of a basic, public school education. I want that for all children. So that whether they end up a political leader, scientist, teacher, artist or homemaker they all are given the best education possible so that they can develop their God given talents and abilities and flourish and thrive as adults."

I love to cook and I believe that sharing good food is an absolutely vital aspect of the human experience. It's a travesty that so many children in this country are being raised by parents who couldn't even put together a good casserole if their life depended on it.

Read the original article (The Huffington Post).

24 July 2008

iPhone Game Delisted Due To Security Concerns

"...because it's pretty much unfeasible to test each application to make sure they're not sending out your private data."

How exactly is it unfeasible for a company like apple to test the functionality of software written for their proprietary device in a proprietary development environment? They control the horizontal and they control the vertical. They chose to make themselves responsible when they decided to make the app store the only way to legitimately ship iPhone software and they screwed up letting this slip through.

Read the original article on Gizmodo.

Honest Music Consumers Get Screwed Again (and Again)

And the RIAA wonders why people steal music. From the YAHOO! email:

After September 30, 2008, you will not be able to transfer songs to unauthorized computers or re-license these songs after changing operating systems. Please note that your purchased tracks will generally continue to play on your existing authorized computers unless there is a change to the computer's operating system.

(Via Read Write Web)