• code

    Object-Oriented JavaScript

    First a caveat: JavaScript is a prototype-based language, not an object-oriented language.  Now that we have an understanding of that very important fact, let’s learn how to use JavaScript as if it were object-oriented. A few weeks ago, I was asked to teach a couple of my colleagues how to code with JavaScript.  We’re building…
    Read More

    Oct
    27

    No Really, You Shouldn’t Have

    Best Buy Promotion

    My birthday is in a couple of weeks.  We have a tradition in my family where you’re not allowed to buy yourself anything during the month leading up to a birthday, so I’ve been hurriedly adding things to my Amazon.com wish list for most of this month.  The last time I broke that rule, my brothers swore they’d never buy me anything again (apparently they’d already picked up and wrapped a CD I bought myself the weekend before my 18th birthday).

    Luckily, this family rule also helps me avoid a lot of promotional advertising leading up to my birthday.  Different restaurants I frequent will send me gift vouchers – my favorite pub (sadly, it’s now closed) used to send me a certificate for a free drink.  I get cards from financial advisors, courtesy phone calls from the guy who changes my oil, and once even a thank you note and Starbucks gift card from a client.

    Everyone seems to know when my birthday is coming, and everyone who likes me to spend money hopes to earn my business by being extra nice and offering me a special, timely discount.

    Today, though, a particular company did the exact opposite.  In my inbox was an advertisement from Best Buy.  You know, the big-box electronics retailer that I don’t buy big ticket items from because their service department kinda sucks?  Yeah, them.  Apparently my one or two DVD purchases last year has kept me high enough on their radar to warrant a special offer.

    They’re inviting me to give them money to celebrate my birthday!

    Exciting, huh?  Not a discount.  Not a freebie.  Not even a personalized birthday card.  But an invitation to spend more money in exchange for triple to quadruple points on whatever I buy.

    For the record – you normally get 1 point for every $1 you spend.  And since it takes 250 points to get a $5 coupon back, I need to spend between … $62 to $80 just to save $5.

    Not so enticing a deal when you put it that way, is it?

    If I were in the market for a new LCD display, a new printer, or a new PC this might seem like a stellar deal.  But since I never buy anything that expensive the few weeks leading up to my birthday, it’s not likely.

    Here’s the thing.  Best Buy is trying to appeal to my spoiled sense of self-importance.  They’re sending me an email to wish me a happy birthday and offer me a special deal to convince me that I stick out from the crowd.  They know I use reward points because they track my purchasing behavior through my rewards card.

    But then they fall short.

    Rewards cards, club cards, priority cards.  They exist to give the vendor a better idea of who you are.  It’s a decentralized, corporate model for relationship building – by tracking my purchases, the company can better predict what I’ll purchase in the future, when I’ll spend a lot of money, and to which advertisements I’ll be likely to respond.

    Obviously, Best Buy isn’t using their cards this way.  No personalized shopping recommendations accompanied the email.  No personalized notes.  No we-know-you-and-earnestly-want-to-celebrate-your-birthday sentiment.

    The entire email reads as yet another corporate attempt to trick me into shelling out my hard-earned cash for something I don’t actually need.  Which is a bit sad, really.

    I thought marketing and consumer relations had come a bit farther than this …

    Oct
    08

    WordPress Weekly

    Last night, I had the opportunity to talk with Jeff Chandler on the weekly podcast WordPress Weekly.  We talked about a lot of things: should automatic WordPress updates be opt-in or opt out? Will/should Automattic ever be acquired by another organization?  Does it matter how many plugins your site runs?

    It was a fun chat, and I hope to call in to the show sometime again soon.  For now, you can listen to the show yourself:

    Or you can download the show from iTunes.

    Oct
    07

    It’s Not My Job

    It’s Always Your Job

    One of the coolest eras of my life was when I worked for the Boy Scouts.  I took 6-8 weeks every summer and lived out of a tent in the middle of nowhere.  No electricity.  No Internet.  No cell phones.  No television.

    It was heavenly.

    Working for the Scouts also taught me some great work ethics.  The first rule has defined my attitude towards work ever since:

    Work until you think you can’t.  Then keep working until someone tells you to stop.

    Having that voice in my head helps me work all night to close out client projects, fight to finish difficult – sometimes messy – cleanup jobs, and run long distances despite being tired.  It’s a rare sentiment among many people in my age group, and rarer still among those in my industry.

    The second rule we learned was that everything is your job.  At camp, we used outhouses.  They’d frequently run out of supplies or get … um … messy and a Scout or Scouter would come and ask for help from the staff.  The one thing you were never to say is “it’s not my job.”

    Everyone, from the trainees to the area directors to the business manager to the camp cook was expected to immediately stop whatever they were doing and help whenever a Scout asked a question.  If you were on your way to take a break, you’d detour to stock the TP or hose out a mess.  It didn’t matter who you were, what your jot title was, or how much you were paid.  It was never not your job.

    As a result, we built an incredibly coherent unit.  I’m still close friends with many of the staff, and we’ll be trekking back up to camp in two weeks to labor away in the mud and rain (that’s what we do for fun, after all).  We haven’t worked together as a camp staff in over 6 years, but there’s still a deep meaning to what it means to be a “Cooper Staffer.”

    Every organization has a brand, and it is the responsibility of each and every person in that company to live up to the brand.  The intern should be encouraged to learn the jobs of the people above him.  The CEO should be willing to offer her time to customer support when call loads are high.  Every member of the brand has a hand in shaping it – no matter what their job title might be.

    WPMU.org … A Great Bad Example

    Yesterday, I was alerted to a blog post on WPMU.org about plugin localization.  I don’t normally read that site, but figured it was worth a look based on who’d sent out the link via Twitter.  Frankly, I wasn’t happy. [Read more...]

    Oct
    05

    The “Great” Recession

    I hate to say it, but I told you so.

    In June of 2008, I told everyone that we were well on our way to a new depression in the market.  At the time, I called it a market malestrom, and yesterday I heard it referred to as “the great recession.”

    Despite the horrific downturn in the economy over the past few years, reports today indicate that we’re about to dip even further into the recession.

    I listen to the doomsayers on TV, I read the negative reports in the newspaper, and I hear people talking about “tough times” every day.  But the other day, something my brother said made me stop and reflect on the prediction I made 3 years ago.

    “I’m so glad I didn’t take that job. Look at their stock prices!” [Read more...]

    Oct
    04

    Live Blogging – AJAX Polling

    Gizmodo's AJAX polling method results in repeated 404 Not Found errors.

    I’m in the midst of developing a real-time publishing system, and I wanted to give an example of what it is and why I want to do it.

    Gizmodo’s live blog

    Today, Apple is promoting a live press event, and Gizmodo is live blogging their coverage on http://live.gizmodo.com/.  It’s a really basic page, but it updates automatically as new changes are available.  Their update engine is also pretty basic, but illustrates exactly what I want to do … just in a very inefficient fashion.

    The core of their code (I’m summarizing it) is written in JavaScript

    function update( version ) {
      var entries = jQuery('#entries .entry');
      var lastPostId = entries.size() ? parseInt( jQuery('#entries .entry').eq(0).attr( 'id' ).substr( 6 ), 10 ) : 0;

        if ( typeof lastPostId == 'number' && !isNaN( lastPostId ) ) {
          jQuery.get( version + 'update_' + lastPostId + '.html', function( data ) {

            if ( typeof data != 'undefined' && data != '' ) {

            // Process data

            clearTimeout( timeoutId );
            timeoutId = setTimeout( function() { update() }, 10 );

          }

        } );
      }
      timeoutId = setTimeout( function() { update() }, 10000 );
    }

    How this works

    Essentially, this script will automatically fetch “update_XXX.htm” from the server every so often. XXX in this case is the update number (they were on update 408 at the time of this writing). [Read more...]

    Sep
    30

    Installing a New Engine – Nginx

    Nginix Home

    I originally started blogging with WordPress via the one-click installer that came standard with a basic Network Solutions website.  It’s been several years since then, and I definitely advise against getting started that way.  There are better hosts out there, and better server systems.  Take your pick.

    For the past year, I’ve been running my blogs on a VPS that I manage myself.  I got started with the basic LAMP (Linux-Apache-MySql-PHP) stack that just about everyone else has.  And it worked … for the most part.

    Unfortunately, Apache is a bit slow on the VPS I have.  And to handle some more experimental projects I’m working on, I felt the need to upgrade from the standard to something a bit beefier.

    Some developers recommended Nginx.  It’s an event-driven web server that can handle several concurrent connections, has a might lighter footprint than Apache, and can handle the new HTML5 websockets that I plan to play with.

    I was sold!

    Except for one tiny detail.  All of the “how to install WordPress” tutorials out there detail installation with Apache … not with Nginx.  So I was mostly on my own, but if you’re reading this, it means I managed to pull it off! [Read more...]