• Proximity (or “So Close, But So Far Away”)

    I recently had a problem with my Mac.  A sector on the hard drive went bad, and killed one of the files for Salling Clicker.  It’s a great program that allows you to run scripts when you go away from your computer and return, using bluetooth to determine if you’re in rance of your computer.  It also allows you to control applications on your computer via your mobile phone.  Quite a cool app, but the only part I used was the proximity part.

    So after reinstalling OSX (which seemed to be my only recourse to get the abd sector problem resolved), I decided to look and see if there is something like Salling Clicker that only does the proximity part (which is all that I used).  I found the aptly named Proximity and it perfectly fits the bill.

    Unfortunately the Proximity website doesn’t have any applescripts for you to use, so I had to write my own, and I thought I’d write them down here for you lovely readers to use.  I found some part of these at the Technocrat blog.

    In Range Script:
    -- iTunes
    --
    tell application "iTunes"
    play
    end tell
    -- Adium
    --
    tell application "Adium"
    go available with message ""
    end tell
    -- Sync the phone (if not synced in the last 60 minutes)
    --
    tell application "iSync"
    if last sync is less than ((current date) - 3600) then synchronize
    end if
    end tell
    tell application "System Events" to set visible of process "iSync" to false

    Out of Range Script:
    -- iTunes
    --

    tell application “iTunes”
    if player state is playing then
    pause
    end if
    end tell

    – Adium

    tell application “Adium”
    go away with message “I’m not near my computer”
    end tell

  • Firefox 3 Smart Bookmarks (or “Find Your Place”)

    Firefox 3 includes an interesting concept called places.  The idea is that all history and bookmarks are stored in a SQLite database, and the browser exposes an API to interact with the data.  You’ll see it in action in the “Smart Bookmarks” button in the Bookmarks Toolbar — these are dynamic queries against the database to find places you have visited the most, visited recently, etc.

    I became interested in this because I started to write an extension for Firefox 2 to display all of the websites I work on that are in development — the overhead was far too much for the return, so I stopped working on it.

    Luckily, with Firefox 3, the places infrastructure allows me to do this very easily.  For instance this bookmark will list out all of the items in your history, sorted recently visited first, that contain the text ’staging’.  Quite handy.

    I’m sure there is a better way to do this.  I tried the uri parameter, but it kept crashing Firefox.  In any case, it’s a nice addition, and another testament to SQLite’s applicability to many areas of web and application development.

  • Distration, Depression and Focus in a Shiny New World (or “There and Back to Your Old Thing Again”)

    There is a phenomenon that I have experienced, but never really thought much about the effects. Programmers are an interesting bunch that thrive on new things, new challenges, new languages, new everything. We like new things, some may say we need new things to keep us going.

    I’m sure every programmer can identify with this story:

    Bob, a programmer at SuperCorp has been working on an application (SuperWidget) for a month. He likes the application. It’s interesting to him, and he can pound out code on it for hours on end. It’s challenging work, and he’s thriving.

    One day, on the other side of the planet, some ingenious programmer creates a new language (let’s call it Z++#) and releases it to the world. Geeks all around rejoice — it’s exactly what they’ve been wanting for years, and it’s new. Bob finds out about it while reading through some chat rooms one night and starts reading documentation. He gets excited. It’s something new. It’s interesting. It’s challenging. Bob writes his first “Hello World” program in Z++# and is entertained at how quickly and efficiently he picked up the language. He loves it. He’s distracted by it.

    Bob returns to work the next day. He opens up his IDE and looks at his task list. He starts to write some code for SuperWidget’s account management. He gets frustrated at the steps he has to take to get a simple function to work how he wants. He keeps thinking about Z++# and how this would have worked in the new shiny language. He becomes disheartened and even more distracted. He finishes the function frustrated. SuperWidget, the application that was his baby and that he loved, is now his nemesis. He becomes depressed about the state of his software, which up until last night was the best thing since sliced bread in his opinion.

    Bob can no longer focus on his work without thinking about the new shiny language. It’s all he thinks about, and he work begins to suffer. His deadline looms, and coding is going very slowly. Bob stays late a few night to hit his deadline, but when it gets sent to QA, loads of bugs appear. Bob rarely had bugs of any magnitude, and now his programming prowess has suffered. All because some guy on the other side of the world came up with “a better way”.

    I’m sure this exact scenario has happened to many people. This type of distraction seems to happen frequently to the type of personality that programmers typically are. It’s a vicious cycle: new thing = distraction = loss of quality = depression = more distraction.

    The solution that I have found, which may not work for everyone and doesn’t always work for me, is to use the “new thing syndrome” to your advantage. Find a new thing in the environment that you were originally working in. This might be a new API, framework, or design pattern that applies to the language or environment that you’re working in. Sometimes taking a paradigm that was in the new shiny thing, and find a way to apply that to your own SuperWidget. Doing so makes your old thing the new thing, and can break the cycle.

    Focusing on the positive, or bringing the positive back into your life is the solution. It breaks the depression/distraction cycle and allows you to become productive again. After you’ve refocused on your project by making it the new thing, you may find your productivity drops off again, simply because your brain is still thinking about Z++# and hasn’t embraced your old project being the new thing. Unfortunately in this case there is one more step that must be done to keep the productivity up — you have to abandon the new shiny thing altogether. Don’t look at Z++# again until your project is complete. Some people may not need this additional step, and to some people it might be more of a detriment.

    Your mileage may vary.

  • Naive Programmers (or “Why Programmers are Like Children”)

    There are some programmers out there that are naive, or even ignorant to the world around them. These programmers do not think of the full spectrum of the impact of the things they create, nor do they think of the users that actually use them. The simply come across as negative, and complaining. They only think of how things would be better if…

    … all browsers were compliant
    … they would just do X this way
    … they would take X off their site it would work better

    These types of comments infuriate me to no end. Whether the client knows of the ramifications or not, they obviously have a reason for doing things the way they do. Creating an application based on a client’s current process is the best way to make a client happy. Changing their internal procedures is rarely the way to go, unless the client already recognizes that change is needed.

    In The Bolero of trolls Mark discusses this phenomenon in relation to Fixing HTML, a rant about what is wrong with HTML and why it needs to be fixed.

    The truth is I doubt there would be many web people out there that would deny that HTML could be better, I for one sure do. But the fact is that we’re not working in a bubble, and this is not a utopia. We’re working with other constraints, such as backwards compatibility, and billions or trillions of existing content out there.

    It’s very naive to think that we can just go out and change something like that without thinking of the ramifications throughout the system. Maybe Douglas Crockford had thought of that, and he simply didn’t want to deal with that part in his writings. That’s perfectly fine, but maybe it is a point that needs to be discussed more in depth.

    Programmers with this viewpoint do come across, as Mark Pilgrim said, as very naive and 5-year old like. They simply don’t understand that there are more things to take into account than the simple “rightness” of how something should be done.

    What we as programmers need to do when creating systems is to think of the user’s experience first, and implementation second. You’re not going to make clients happy otherwise.