chris barr


A New Blog!

Well, I’ve been a pretty awful blogger in the past considering that my last post was well over a year and a half ago. In my free time for a few months now I’ve been working on this new site design and teaching myself how to use (read: “fight with”) WordPress (read: “PHP”).  Finally this at a place where I’m happy with how it looks and works, so check everything out! I’m glad to finally have a place on the internet to show off some of my paid photography gigs that isn’t a social network.

So what does the future hold for this blog?  My goal at this point is to try and write write write. I don’t love my writing style, so the only way to get better is to do it more and this is the perfect outlet. I aspire to write at least one post per week, most likely about some interesting bit of code that I’ve run across.

Welp, here we go…

New Year’s Resolutions

It’s a new year, and a new decade. I know 2010 will be a great year for me, and I’m going to do my best to make sure of that by setting a few new years resolutions for myself.

  • Take 1 photo a day and blog it to force myself to get more creative – I’m keeping it in a tumblr blog you can follow here:
  • Lose 10 pounds
  • Make a short film about my trip to Togo, Africa in July
  • Try to get a photo published somewhere or in a local gallery

So most of these are photography related, but I think these all revolve around my trip to Africa later this year. This is more than likely a once in a lifetime trip, and I really want to make sure that I take some amazing photos and videos to remember it by.

Comparing jQuery objects

Just wanted to post a quick blog update with a cool jQuery trick I’ve been using recently. Every now and then I need to compare one jQuery object to another but a simple $(this) == someObject doesn’t do anything. As it turns out jQuery objects are actually stored internally as an array and you can’t just directly compare arrays.

So with that in mind, the easiest and quickest solution is to just access the items in the array and compare those instead. Luckily the very first item in the jQuery array is all we need here, so to access it you simply need to put in square brackets the array item number you want like so: $(this)[0]. So check out the code example below.

<div id="nav">
    <a href="#">link 1</a>
    <a href="#">link 2</a>
    <a href="#">link 3</a>
    <a href="#">link 4</a>

<script type="text'javascript">
    allItems = $("#nav a");
    secondItem = $("#nav a:nth-child(2)");

    //loop through each item in this jQuery collection
        //Compare the current jQuery object with the saved jQuery object
        //by accessing the first item in the array of each object.
        if($(this)[0] == secondItem[0]){
            //we are on the second item! Give it a red background


MIXed up in Las Vegas

Once a year my company, AppRiver, allows me to attend one work related conference and my for first year working here I’ll be attending MIX ‘09 in Las Vegas!  Until recently, this wasn’t even a conference I’ve heard of, so don’t worry if you haven’t heard of it before either.  Mix is an annual conference for web designers and developers with a heavy focus on Microsoft technologies (also sponsored by Microsoft).

So, I’m headed out to Vegas on Monday the 16th and expect to learn a lot and have a blast doing so for about a week.  I’m scheduled for a few different sessions that I’m excited about attending, and there’s tons and tons of sessions to attend. Need I even mention this all takes place in Las Vegas?  I took a trip out there about 3 years ago with my dad and had a blast, so I fully expect to have a great time when I’m not doing web related stuff.  I know the grand canyon and the Hoover Dam are fairly close, and it would just be a dream come true to see either one of these (or both!).

I’ll hopefully be fully armed with my laptop and camera where ever I go, and a goal I’m going to try and set for myself is to do a daily photo-blog of what’s going on at the conference and anything else I can take pictures of.  It’s my first conference and I’m usually pretty trigger happy, so expect lots of photos.

More info about Mix here: