OpenFrameworks – Where are the XCode projects???


I’ve been toying with Kinect hacks lately which led to my exploring OpenFrameworks. I had a copy on my hard drive from last year when I initially started toying, so today I thought I’d try to pull the latest from git and tinker a bit. I was surprised to learn that there where no Xcode projects for any of the example apps. After stumbling around a bit I found a post in the forum that reveals how you have to build and run the _DeployExamples located at: apps/devApps/_DeployExamples/deployExamples.xcodeproj. If you’re as surprised as I was then hopefully this will clear things for you. Also, note that the default scheme in the Xcode projects happens to be the library. This means that simply pressing the run button won’t do much aside from building the library. You have to manually select the “.app” scheme from the scheme selection drop down if you want any of the projects to do anything. My first attempt at running the “_DeployExamples” app left me puzzled for this very reason. After selecting the application scheme from the scheme selector THEN pressing the run button, I was able to see the app running.

Fetch Keychain credentials from Ant


It’s been sooo long since I’ve done any serious Java coding. I thought I would never be back in the doc pages for Ant and Ivy. Alas, here I am, revisiting topics of yesteryear. I was stubbing my toe this morning on our artifact repository which requires manual entry of LDAP credentials and it was hurting a lot! The problem is how our custom version of Ivy does multiple authentication retries when it gets an error which effectively locks you out of the system for 30 minutes the 1st time you enter your password incorrectly. This was as unacceptable as my tacky solution of storing my credentials in a plain-text file on my hard drive. I thought it was high time I did something about my pain.

I thought to myself, “Self…”, (I always refers to myself in the 2nd person speaking on behalf of an undefined third person but using a capital “Self” as the proper noun.) “how come every other application on your Mac is smart enough to use keychain whenever you need to lookup your LDAP credentials? Surely there has to be a modern solute for your problem these days.” A quick Bing search revealed a shell command that I could execute on the command line and output either my user name or my password. The commands were slightly different but sufficient for the Ant exec task after a little massaging. The hardest part was, as always, escaping the quotes and special characters in the command. Here’s my working target which accepts a domain parameter to authenticate against:

    <target name="keychain-credentials">
        <property name="domain" value="mydomain.com"/>
        <property name="uid.cmd">-c 'security find-internet-password -s ${domain} | grep acct | cut -d "\"" -f 4'</property>
        <property name="pwd.cmd"><![CDATA[-c 'security 2>&1 >/dev/null find-internet-password -gs ${domain} | cut -d "\"" -f 2']]></property>

        <exec executable="sh" osfamily="mac" outputproperty="uid" errorproperty="uid.error" failonerror="false" failifexecutionfails="false">
            <arg line="${uid.cmd}"/>
        </exec>
        <exec executable="sh" osfamily="mac" outputproperty="pwd" errorproperty="pwd.error" failonerror="false" failifexecutionfails="false">
            <arg line="${pwd.cmd}"/>
        </exec>
        <condition property="my.userid" value="${uid}">
            <not><equals arg1="${pwd}" arg2="password:" trim="true"/></not>
        </condition>
        <condition property="my.password" value="${pwd}">
            <not><equals arg1="${pwd}" arg2="password:" trim="true"/></not>
        </condition>
    </target>

Homecoming


I fired up InetlliJ in my first serious full time effort to develop Java code in several years. I now have a warm, familiar homecoming feeling. You know that feeling you get when returning to your parents house after graduating college or serving time in the military. Things are familiar but foreign. Your room has been converted into a guest room, toys are missing or misplaced, and things that used to seem so big and threatening (your mother for instance) no longer look like such a big deal. You have an overall idea how to get what you want, like dinner, but are intimidated or too ashamed/polite to go for it because it no longer feels like your home. You ask permission for silly things, like lemonade where you used to just barge in the house and yolk the refrigerator door practically off the hinges claw past the milk, grab the juice and guzzle directly from the container after a game of basketball. You ask because the rules may have changed or maybe the lemonade goes with a new medication that your parents are taking or whatever. Everything is off by one, the coffee table never used to sit against the wall that way. The loose door knob that used to jiggle when you turned it is now replaced with a fancy handle opener. The mess behind the shed has been cleaned up. That feeling. Now what happened to “AngryFruitSalad” color scheme?

Beware of iPhoto and Adobe Elements Organizer


It’s Wednesday and Finder reports you only have 13GB available on your 512GB SSD. You’ve been installing apps and crap all month in an attempt to ramp up on some new technologies because your role is changing. You also started playing with Photoshop Elements because you fancy yourself a designer in your free time. Hi, I’m Cliff. You’re here because you’re looking for a way to offload a quick 20-40GB worth of video you’d been shooting and saving from your iPhone. I’m here to warn you of a problem you didn’t know you had.

Let’s start with Adobe, because I’m seriously angry with them! If you use any Adobe software regularly then you’ll understand what I mean when I say Adobe has made it their personal mission to inconvenience us all in any and everyday they can possibly imagine! Earlier today I was nagged to upgrade my Flash for the ninety-hundredth-twoth time with a promise that the upgrade will take less than a minute on broadband and that no restart was required. I reluctantly clicked away and agreed to release control of my Mac to the Adobe engineering staff believing the promise that I would once again regain control in under a minute without losing state in my web browsing session. A “.pkg” file downloaded while the upgrade process began. launching the “.pkg” ran an installer that stopped and told me right away that I must close Safari before it could continue. Let down and lied to, I closed Safari thanked my lucky stars that I am running Lion and all my state is automatically saved these days. I digress

What I really wanted to warn you about was Adobe’s Photoshop Elements Organizer. I made the mistake of importing my iPhotos Library thinking that in this day and age Adobe’s engineers would know enough that it’s not polite to clone the contents of a +50GB photo library. Even if the price of hard disk space is near single digit dollar amounts capacity typically tops off in the .5-1TB range and SSD is becoming popular resetting these limits to their early 2000 ranges. Also, some folks like to split their hard drive in half running two operating systems side by side. Finally, it’s just not a nice thing to do without at least warning your user, “Hey are you sure you want to clone 50GB worth of data just so you can use our software extension which doesn’t do half the work already available in your OS’ pre bundled photo viewer?” “Import…” should at least be properly re-labeled “Copy files in from…” I kind of figured the software was too dumb to use pointers or symbolic links and copy on demand but some part of me just held out hope that things have matured further in 2012.

On a slightly related note, I was looking to move a bunch of videos of my daughter playing Basketball I’d been filming over the last few months to a backup drive to free up drive space (claimed impolitely by Adobe). That’s when I remembered how Apple loves to mutate its popular software titles like iPhoto by constantly tucking familiar options away in new and exciting places. Looking for “Right-click and Reveal in Finder”? Surprise! It’s now in the File menu! Don’t try looking in the more logical info view that we trained you to resort to when you want to find the actual file path. We know you’re too smart for us so now we’ve changed it again! I also learned today that the contents of your photo library are not indexed by spotlight! That means the only way to locate the basketball movie from 3 months ago that is so adequately named “IMG_0081.mov” is to bring up the info view in iPhoto, pencil the name down on a piece of scrap paper, then manually drill into your photo library in Finder diving in and out of each folder until you stumble across something that looks close enough. Copy/paste this file to a backup drive and repeat the process for the seven hundred ninety two remaining files you wish to backup. Finally realize several years later that you copied “IMG_0018.mov” and deleted “IMG_0081.mov”!

I’m just utterly irritated with software in general. There was a time when I used to marvel at computers and programs and programming computers. Now after working in a couple of big name companies and seeing how things are actually cooked up I get depressed. I completely understand how these magical collections of ones and zeroes come into existence and why certain compromises are made leading to issues like what I am facing. I thought I was going somewhere with today’s post but I think I spiraled off somewhere partway in. If you write software for a living then you deserved to be punched in the arm today. If you know someone who writes software for a living, punch them in the arm because… well just because Spotlight can’t find my movie files. I also hold every software engineer personally responsible for Adobe’s everyday upgrade prompts that are now promising not to disturb your work but bringing your systems down anyway. It’s your fault, with your passion for automatic upgrades that magically pull down your corrections from the cloud and constantly disturb end users! If you can understand what’s written in my header f… my banner picture above then I break-wind in your general direction.