How to flip a mattress

Number on Matress

Most mattress manufacturers recommend that you rotate your mattress to allow it to wear evenly and prolong its lifetime. This is especially important if you have a partner that you share your bed with. If you and your partner are different heights and weights, then you will need to rotate it to prevent it from getting too worn in some areas, but not others. The concept is not unlike rotating the tires on your car, allowing them to wear evenly as well.

So how do you flip a mattress? Do you flip it the long way, or the short way? What way did you rotate your mattress last time? This past weekend, I came up with an easy system that is pretty straight forward and will help you remember when and how to flip your mattress.

Read More →

Django Upgraded

I finally took the time to upgrade to Django 1.0.2 and migrate my blog to the new release this weekend. Django 1.0 has a lot of improved features, including an upgraded comment system which has allowed me to re-enable comments on my blog.

There was a few speedbumps while upgrading, but everything is well documented at djangoproject.org so it wasn’t too bad.

Geoff and Ali’s Wedding Photos

Geoff was my classmate in university and we were roommates for our final semester at Waterloo. This past Sunday, after 4 years of courting, he married Ali Palmer (now Ali Wheeler) at the Mill Lofts in Guelph. I had the pleasure of doing their wedding photos for them.

This is a very short slideshow of some of the photos I took for them, although, more photos can be found in the Flickr Set for this occasion.

Congratulations Geoff and Ali and all the best for your future together!

Photos for Agave Grill

I recently visited Agave Grill in Ottawa. After hearing good things about this restaurant, I looked it up online and realized they didn’t have any photos in their “gallery” on their site. During dinner that night, I introduced myself to the owner and offered up my services as a photographer.

The following short slideshow is a showcase of some of the photos that I did for Agave.

DIY Super Clamp

super clamp

Recently I was looking on eBay for a Super Clamp. A Super Clamp is a small device that can me used to attach your camera flash to surfaces in a room to provide light from different angles. It’s way smaller than carrying around a separate tripod or stand for your flash and this small device costs about $40. That price is about $35 more than I am willing to spend. Here’s how I made my own Super Clamp for about $5 to fit my Nikon SB-800 camera flash.

Read More →

Instance Arrays in Flash

One thing that I thought wasn’t planned very well in Flash 9 and AS3 is having a bunch of instances on your stage, and then having to declare each one in your ActionScript files. Up until now, I have been naming all my objects something like “obj0”, “obj1”, “obj2”, etc and then in my constructor, adding each of those objects manually to an array one at a time. The problem with this, obviously, as it doesn’t cater well to expansion or large numbers of objects. If I added more objects to the stage, I’d have to update the code.

Here’s code I came up with today:

public class RollingNumberDisplay extends MovieClip {

    protected var digits:Array;

    /**
      * Constructor
     */
    public function RollingNumberDisplay() {
        super();
        var counter:uint;

        digits = new Array();

        counter = 0;
        while(this.hasOwnProperty("digit" + counter)) {
            digits.push(this["digit" + counter]);
            counter++;
        }

        trace("length=" + digits.length);
    }

}

Creating CSS layouts with the 960 Grid System

Put up your hand if you like spending hours creating CSS layouts. Or not…

There are not many aspects of web design that take more time and involve so many frustratingly small calculations than getting everything pixel-perfect in a CSS-based layout. Starting right at the sketches of a design on paper or in Photoshop, there are decisions that have to be made that can affect the CSS code you’ll have to write later. A new system called the 960 Grid System is here to help.

I just stumbled upon the 960 site while looking through del.icio.us/popular one day, and noticed something that jumped out at me right away:

All modern monitors support at least 1024 × 768 pixel resolution. 960 is divisible by 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 20, 24, 30, 32, 40, 48, 60, 64, 80, 96, 120, 160, 192, 240, 320 and 480. This makes it a highly flexible base number to work with.

I recently started a couple designs, including this blog, which were designed for 1024 x 768 resolution, however at the time, I arbitrarily chose to have a width of 900 for my design. I wish now, that I had read about the 960 Grid System beforehand. Tonight I downloaded the zip file and opened it up to see what it was all about.

There are 2 variants of the 960 Grid System: A 12-column layout and a 16-column layout. Each variant starts by dividing 960 pixels into either 12 or 16 columns with exactly 10 pixels of padding in between each column. After dividing into small columns, you can then arrange boxes that are multiples of the column widths. It’s sort of hard to explain in words so take a look at the demo page that is set up at 960.gs.

The 960 package includes everything you need to get you started. Begin with a printable PDF that you can use to sketch out your design by hand, divided into either 12 or 16 columns. Once you’ve sketched out your design on paper, you can use a template designed for Photoshop, Fireworks, OmniGraffle or Visio to create your digital design. Finally, once you’ve sliced up your image, you can use the pre-made CSS styles to create your layouts. In your HTML, all you have to do is create a container div and assign a class of either “container_12” or “container_16”. Then you simply use the numbered grid elements along with clearing divs to make layouts. The whole system is pretty simple, and it makes a lot of sense.

Note: I’m not a big fan of the underscores used in the class names, however these days, it’ll be a rare occurrence if a browser chokes on the underscores. For me, it’s just a matter of good code.

I’m very glad to have found this system. I will definitely be using it in the future. I believe that it will be a huge aid for designing layouts and then converting to CSS. No more arbitrary column widths or painful margin, padding and width calculations in CSS. Hoorah!