Photos from Europe

Photography

I recently spent six months traveling and studying in Europe and these are a few of my favorite photographs I took during my time there. These photos are from London, Amsterdam, Edinburgh, Paris, Madrid, Tenerife, Rome and Florence.

Or you can check out some more photos (and in larger sizes) on my photostream on flickr.

.htaccess and 301 Redirects in Drupal

Drupal

After updating/upgrading your website it is often necessary to define some 301 redirects to make sure end users don't come across a broken link or a file not found error. While defining a 301 redirect in your .htaccess file or through the cPanel of your webhost is not hard to do, it is easier just to download and enable the Path Redirect module. Drupal relies heavily on mod_rewrite and has a lot of rewriting rules defined so it is easy to get an infinite loop redirect when trying to edit the .htaccess file directly.

.htaccess, mod_rewrite and PHP include()

HTML

When creating a website with only a handful of pages, a full-blown CMS (such as Drupal, Joomla! or Wordpress) can be more work to set up and maintain than is necessary. In this case, simple, static HTML makes more sense to use. Here are two tips to keep in mind while making static HTML websites.

Updating Themes to Drupal 7

Drupal

I am in the process of upgrading my Drupal 6 theme into a fully functioning Drupal 7 theme and came across some issues that I wanted to document here as a reference to those in a similar situation. I followed my instructions here to create a local copy of my website and then I went through the typical upgrade procedure as outlined by the UPGRADE.txt file supplied by Drupal. There were a couple hiccups in the upgrade process, but a few simple Google searches led me to the answers to fully migrate my installation to Drupal 7.

I am planning on updating this page as my process continues and I find more changes.

Parsing XML Data to Lists in Python 3

Python

For one of my recent 3D animation projects, I wanted to take data that was exported out to an XML file and parse the nodes' values to lists. I found a really simple way to search for and store all values from an XML file using The ElementTree XML API. These few lines of code open and parse the given XML file, then iterate over all the children under the root node and search for the children named 'Time' and 'Name' and then append them to separate lists. These lists can then be iterated over to utilize the values that were taken from the XML.

Mac OS X Title Bar Icon Tips

Macbook Pro

In document based applications, the Mac OS X Title Bar Icon is more functional than it appears. You can right click on the icon to view the directory structure the document is located in, which gives you quick access to its location in Finder. Or you can simply drag the icon to manipulate the file. You can drag it to your desktop (to make an alias), drag into an email (to add an attachment) or drag and drop it into a Terminal window (to add the full file name).

Ambient Occlusion and Render Passes in Maya 2011

Maya

Here is a simple way to set up render passes to separate out different passes of your 3D image for use in compositing and post processing. Maya 2011 has this process more or less built in to be able to render out a multi layered photoshop file or a set of tiff or iff files that can be imported into Photoshop, After Effects or another compositing program.

UPDATE - If you're looking to just render an Ambient Occlusion image by itself, check out this blog post.

Don't Forget to Print the $closure Variable on Custom Theme Pages

Drupal

If you have any modules that add external JavaScript to your pages (like Google Analytics), make sure you have the line <?php print $closure; ?> in your .tpl.php files right before the end </body> tag. If you don't have this line the external scripts will not be loaded and will not be added to your pages.

This should be the first thing you should check if Google Analytics is configured correctly on your site, but is not showing any data in the Google Analytics reports.

Custom Maintenance Theme Pages for Drupal 6

Drupal

Recently, I wanted to change the default "Site Offline" page that Drupal provides to a design that was less generic and more fitting with the style of the website. I needed to have the site in offline mode for a longer period of time while I was overhauling the content of the website. I developed a simple HTML placeholder page and by changing a couple lines of code in settings.php and adding a new function in template.php I was able to redirect the users to this static HTML page while the site was offline.