iPython is super sweet!

You were right Evan, I was lost but now I’m found:

http://ipython.scipy.org/moin/

HUGE improvement on the beautiful Python interpreter. Tab completion! Bash commands! Yes!

Posted in Musings | Leave a comment

As if I needed one more reason to hate Microsoft…

Microsoft has now made it impossible to test their stupid browsers with IE Application Compatibility VPC Images on anything but their crappy Virtual PC running on a Windows machine:

http://forums.virtualbox.org/viewtopic.php?f=2&t=21712

Ooooohhhh the hate. I hope Bill Gates gets the hugest hemroid in the world for this. I hope it explodes all over his wife’s face.

Posted in VirtualBox | Leave a comment

Something is wrong with my blog

It keeps deleting posts. I’ll figure it out tomorrow.

Posted in Musings | Leave a comment

Execute scripts from the Python interpreter


>>> execfile('myscript.py') # Execute 'myscript.py'

Posted in Python | Leave a comment

Change current working directory from inside the Python interpreter

This is comes in very handy when working in the Python interpreter:


>>> import os
>>> os.getcwd() # Returns the current working directory; usually the directory you were in when you started the interpreter
>>> os.chdir('/path/to/directory') # Change the current working directory to 'path/to/directory'. Also accepts bash commands like '..' and '/'

Posted in Python | 3 Comments

easy_install for Python 2.6 on Windows XP

Sometimes I am forced to use windows, and for some reason (although I can’t blame anyone not giving a crap) there is no easy_install for Python 2.6 on Windows.  So I followed these instructions from monkut on the Stack Overflow forum:

For installing setuptools for 2.6 download “ez_setup.py” from:

http://svn.python.org/projects/sandbox/branches/setuptools-0.6/#egg=setuptools-dev06

And run it [In the terminal, navigate to the folder where the ez_setup.py file downloaded to and type python ez_setup.py]. setuptools should be installed. This will place easy_install in your python26/Scripts directory, make sure this is in your PATH, and then you should be able to use easy_install.

This worked great. In order to add python26/Scripts to your Windows path:

  1. Right click on the ‘My Computer’ icon on your desktop and select ‘Properties’
  2. Select the ‘Advanced’ tab, and then select ‘Environment Variables’
  3. Under ‘System Variables’  select the variable ‘Path’ and click ‘Edit’
  4. At the end of the line in ‘Variable value:’ add a semicolon [;] and write ‘C:\python26\Scripts’
  5. Select ‘OK’  a couple times, restart terminal, and you should be able to type in ‘easy_install –help’ and receive a big ‘ol mess of help
Posted in Python | Leave a comment

Use touch to create empty files

I find myself needing this all the time, especially when I’m doing a tutorial on something nerdy.

Create an empty file in the current directory from the command line:

$ touch filename

Posted in Linux | Leave a comment

Portrait finishing in Gimp

I took some portraits of my co-workers in my DIY photography studio recently. I don’t have some essential equipment (like an external flash) so the shots were not as awesome as I knew they should be. Gimp to the rescue!

I found a brilliant tutorial on just this subject. Its written for Photoshop, but it translates to Gimp no prob. Here are the results:

rachel_original_cropped_600x400

rachel_913_cropped_600x400

angela_original_cropped_600x400

angela_858_cropped_600x400

heather_original_cropped_600x400

heather_846_cropped_600x400

Posted in Gimp | Leave a comment

Animated GIFs are the future

Its hard to be flashy on craigslist. Sure you can make your add one big image, but users need to cut and paste! So in the interest of usability and in the name of awesome, I give you the world’s sweetest animated GIF:

mm_32colors_600x300

That’s right, it just don’t stop. Ever. Not even if you want it to.

Process

This is the first animation I’ve ever done, so I really had no idea what I was getting myself into.  I mean, I don’t even draw things, really.  First I drew a story board of sorts in pencil on sketch paper and scanned it.  It was probably 15 frames at that point.  Then I imported the storyboard frames into Inkscape and drew over them using the bezier tool.

I decided early on that I would use a 2:1 aspect ratio, so the original frames were drawn in Inkscape at 800×600 pixels.  I also decided on a standard stroke width: 3.5px for thin lines (like outlines) and 10px for thick lines.

For color I used the “Tango icons” palette that comes default in Inkscape.  Its beautiful and it degraded well when I optimised the image down to 32 colors.

Screw it, I’m using Gimp

There were several options when it came to putting the animation together.  I tried the Gimp Animation Package but I just couldn’t figure it out.  Its really clunky and I lost patience.  Synfig looks promising, but I would have had to redraw all my storyboard frames, so no go.

In the end I went with good old Gimp.  I drew each frame in Inkscape and exported them as PNGs.  Because you can export just a selected area in Inkscape, I would have the whole scene laid out in one image, with all the frames right next to each other so I could easily reference where I was in the scene.

I imported the Inkscape-created PNGs as layers in Gimp (ctrl + alt + o).  I could check my work in Gimp with the the Playback filter (Filters -> Animation -> Playback…).

Gimp animates by displaying a layer for a set amount of time and then stacking the next layer on top of that layer for a set time, and so on.  The default framerate is 100ms per frame, which works pretty well.  If you want a frame to display for a longer time you can adjust the name of the layer like this:

Layername (1000ms)

That layer will be displayed for one second of your animation.

Finishing Work

Before saving your .xcf file as a .gif file, its important to optimize it for animation (Filters -> Animation -> Optimise (for GIF)). This ensures that new layers in the animation stack on top of the old layers (as opposed to replacing them), which makes the file much smaller (for some reason).

To turn a Gimp .xcf file into an animated .gif, you just have to save the image as, say “MyAnimation.gif” and choose the “Save as animation” and “Convert to inded using default settings” in the dialog that pops up.  I choose against interlacing because I liked my clean lines.

Setbacks

If I had to do it again, I would like some tweening.  Tweening fills in the gaps in your animation, so if you have a bird that flies across the screen, you only set the original place of the bird and the destination.  The computer generates all the frames in the middle so you don’t have to.  Would have saved me some time.

Unfortunately, tweening doesn’t help with articulation.  The most difficult part of the whole project was the 2 seconds at the very begining where the guys are walking down the stairs.  That took forever!  I completely understand now why 2D cartoons are often drawn in 3D programs (I think The Simpsons is done like that).  3D drawing programs like Blender allow you to place joints and muscles inside a character, so if you move a limb the skin conforms in a natural way.  Maybe next time.

Posted in Animation, Gimp, Inkscape | Leave a comment

My Current Local Developement Environment

Here’s my setup:

  • 13″ Macbook 2-1 with 4GB Ram and 2.16mhz Dual Core processor
  • 24″ Samsung HD flatscreen external monitor
  • Ubuntu Jaunty Jackalope 9.04
  • Firefox 3.x with Firebug, YSLow, and CodeBurner
  • XAMPP for PHP, MySQL, and Apache
  • VirtualBox with 4 virtual machines: Windows XP with IE 6, 7,  and 8, plus OSX running Safari
  • Gimp and Inkscape for graphics
  • Gedit with snippets enabled for code

I have to tell ya, I’m pretty happy with things right now.  Let today be known as the day I declared independence from OSX.

Posted in Developement Platform, Web Design | Leave a comment