Tuesday, August 14, 2012

Do you Live/Breathe/Eat/Drink/Sleep Technology?

barcamp san francisco


Back in 2005, a bunch of geeks started something amazing in San Jose. They got together with the sole purpose of promoting collective learning within the tech community. They called it Barcamp. Since then, Barcamps have popped up all over the United States. One of the most active is back in my hometown of Philadelphia (www.barcampphilly.org).

If you've ever been to a Barcamp, you know what a truly awesome and amazing experience it can be. Barcamps are a haven for those who have a lust for learning technology and a place where geeks can be free to discuss topics that interest them most. You can imagine my shock shortly after moving to the East Bay when I found out that Barcamp San Francisco hasn't really existed since 2006. With your help I would love to change that post haste.

If you live/breathe/eat/drink/sleep technology and want to be part of something truly awesome, contact me and let's make this happen! I would love nothing more than to show my fellow geeks in Philadelphia how inspiring they have been to me by helping to share their enthusiasm with the geeks in San Francisco.

NOTE: This will require time you to give up some of your personal time at night and on the weekends. Please only contact me if you're willing to give up that time. Trust me, it'll DEFINITELY be worth it!

Friday, August 3, 2012

The arguments.callee Debate

OK, I'll admit I can sometimes be "late to the game" on some things.  Specifically, I realize that the whole arguments.callee/singleton design pattern/deprecation in Javascript debate is about two years old.  However, I think this is one of those things that generally is worth mentioning (and consequently giving more fuel  and attention to).


As many of you know, I started a new gig at VEVO this past June as a web developer.  In other words, I'm moving away from Actionscript and more towards Javascript.  Don't get me wrong; I'm still true to my AS3/PHP/OOP roots but JS is where it's at right now so I needed to make a change.  One of the things I needed to figure out first is how to convert my design patterns over to JS, specifically the infamous Singleton.  Given the fact that JS is a loosely typed language, this wasn't going to be easy.
After much research, I created the following example:

function SingletonClass(nme,clr){
 if (arguments.callee.instance){return arguments.callee.instance;}
 arguments.callee.instance = this;
 this.name = nme;
 this.color = clr;
}

SingletonClass.prototype.setColor = function(clr){
 this.color = clr;
}

SingletonClass.prototype.setName = function(nme){
 this.name = nme;
}

var singleton1 = new SingletonClass('firstSingleton','black');
console.log('(singleton1): My name is ' + singleton1.name + ' and my color is ' + singleton1.color + '.');

var singleton2 = new SingletonClass('secondSingleton','green');
console.log('(singleton2): My name is ' + singleton2.name + ' and my color is ' + singleton2.color + '.');

singleton2.setColor('blue');
singleton2.setName('Matt');

console.log('(singleton1): My name is ' + singleton1.name + ' and my color is ' + singleton1.color + '.');

This works beautifully, with one small exception; arguments.callee has been deprecated.  If you're like me, you're immediately thinking, "WHAT?????" right about now.  After a bit of research, I found the following bug reports:
However, this doesn't solve the problem.  The fact is, currently this is deprecated so if you want to create a true Singleton, a bit of adjustment is necessary.  Given that, I came up with the following:

var SingletonInstance;

function SingletonClass(nme,clr){
 if(SingletonInstance){return SingletonInstance;}
 SingletonInstance = this;

 this.name = nme;
 this.color = clr;
}

SingletonClass.prototype.setColor = function(clr){
 this.color = clr;
}

SingletonClass.prototype.setName = function(nme){
 this.name = nme;
}

var singleton1 = new SingletonClass('firstSingleton','black');
console.log('(singleton1): My name is ' + singleton1.name + ' and my color is ' + singleton1.color + '.');

var singleton2 = new SingletonClass('secondSingleton','green');
console.log('(singleton2): My name is ' + singleton2.name + ' and my color is ' + singleton2.color + '.');

singleton2.setColor('blue');
singleton2.setName('Matt');

console.log('(singleton1): My name is ' + singleton1.name + ' and my color is ' + singleton1.color + '.');

Yes, this is not necessarily the same thing but if you run it, you'll see that it does indeed accomplish the same goal.  I wanted to share this so that others who are looking for a Javascript Singleton pattern "starter kit" can hopefully use my work as a launch pad.

Sunday, June 3, 2012

Handy Number Formatting Function for JavaScript

If you ever had the experience of writing JavaScript, needing a simple function to quickly format a number but weren't interested in importing an entire library just for one small use, I may have an answer for you.  While working on a side project, I wrote this:


function formatNumber(rawNumber){
    var sourceString = rawNumber.toString();
    var sourceStringLength = sourceString.length;
    var targetString = '';
    var charCounter = 1;
   
    for(var i = sourceStringLength; i >= 0; i--){
        if(charCounter == 3){
            targetString = ',' + sourceString.charAt(i-1) + targetString;
            charCounter = 1;
        }
        else{
            targetString = sourceString.charAt(i-1) + targetString;
            charCounter++;
        }
    }
   
    if(targetString.charAt(0) == ","){
        targetString = targetString.substring(1,targetString.length);
    }
    alert("the final answer is " + targetString);
}


formatNumber(12345678);

Please feel free to comment and suggest changes.  From the testing I've done, it appears to work rather nicely.

Sunday, March 18, 2012

REVIEW: Self Timer 3.0


Price: $0.99
Rating: • • •
Url: http://itunes.apple.com/us/app/self-timer/id346475986
Special thanks to my
model, Aleksandra Torbin

There are certain app genres that tend to have a larger population on iTunes than others; games is a great example.  This is definitely the case for photography apps as well and I suspect that that the same can be said for other app stores for camera-equipped devices.  While this is a good thing for the consumer, this makes standing out very difficult for developers of these apps.  In order for an app to really be noticed, it has to go above and beyond just doing one thing well.
If you've ever had to take a self portrait or a photo with a loved one and didn't want to use the "extended arm/birds eye" shot or the "this is me in my bathroom, please excuse the dirty laundry and/or child in the background" shot, then this is a nice app to have.  Self Timer is a very well designed app which does exactly what the title implies.  Self Timer gives you the option of setting a timer for three, five, ten or fifteen seconds.  You also have the option of having one to four photos taken (just in case you accidentally close your eyes for one shot).  You can start the timer by clicking the increase volume button as well as the camera icon in the center of the screen.  When you start the timer, you hear a single beep each second to alert you to the countdown and then you hear a double beep to let you know the photo is about to be taken.  

The interface is mostly well thought out and the use was obviously tested thoroughly, though you will notice that when you turn on all of the features the screen gets a wee bit crowded. 
Nothing here tells me that the third
one in from the left keeps the flash
on all the time.
When you first launch the app, the four options that are default area clearly understandable as to what they do.  However, the four flash options are not easily recognizable as to what each one does.  I would have preferred to see some hover text or help system as to what each item was.

Self Timer also gives you a couple nice features you can turn on, some of which are more useful than others.  The sight and the guides are very useful and something that is becoming standard in camera apps.  There is also a "fun mode" which changes the standard beeping to a set of more silly sounds.  I can see where this might be fun if I was younger or had children, but I think users who are teens and older probably would want to use the regular beep sounds.

Another set of features that is becoming standard in camera apps is sharing and Self Timer includes these as well.  In the camera roll view, you can choose to email, print or send to your Facebook, Twiiter or Flickr account.  The one thing that did irk me a bit about the camera roll view is the lack of "next/previous" swipe functionality.  After shooting several photos of my wife, I would have liked to be able to swipe to the next photo but that wasn't available.

Just because Self Timer
offers all these features
doesn't mean you should
use them all at once.
All in all, this is a nice app and well developed.  I struggled with how I was going to rate this because by itself, it easily deserves four out of five.  There are a few minor things that I would like to see improved upon but those are minor.  The problem comes down to features versus price in comparison with what else is on iTunes now.  A quick search of top Photo & Video apps that have a timer reveals a ton to pick from.  Granted, they may not all work as well as Self Timer but that's still a lot of competition.  Given the fact that most of the more extensive camera apps are also priced at around $0.99 (or have had recent sales) and offer many more features than Self Timer, I had to give it three and half out of five.  If you want an app that does a photo self timer well, then I'd suggest getting this app.  However, if you're not interested in owning a ton of specialized apps and would rather just have one or two that handle all of your camera needs, then you might want to think twice.


Thursday, March 8, 2012

Intro to Programming / Web Architecture Class

If you missed the first Intro to Programming / Web Architecture class, here is your chance to take it again.  This is a FREE CLASS offered by GirlDevelopIt: http://www.meetup.com/Girl-Develop-It-Philadelphia/events/55584882/

Thursday, March 1, 2012

REVIEW: Photoshop Touch for iPad2

Price: $9.99
Rating: • • • •
Url: http://itunes.apple.com/us/app/adobe-photoshop-touch/id495716481

If you work as a graphic designer or a web developer, you don't need me to sing to you the merits of Photoshop. Everyone in the industry knows how valuable the software is and why it's considered a standard. It's for these reasons that I was very excited when I first read about Photoshop Touch for the iPad2 earlier this year and even more so when I got to download it this week. Right off the bat, I'll tell you that this is not just another photo editor. This is very much Photoshop for the iPad which is a really great resource for traveling bloggers, designers and developers. No matter how much you love your Mac/PC, it's nice to know that you can travel lightly with just your iPad2 and still able to work.

Opening screen of
Photoshop Touch
When you first open Photoshop Touch, you are presented with two options, tutorials or intro. I wanted to have a personal tour so I chose the tutorials route. Immediately I noticed one thing that will make or break your Photoshop Touch experience: if you have (to borrow a phrase from Seinfield) "man hands", get a good stylus. I personally suggest the Wacom Bamboo but any good stylus will work. Without a stylus, you may find that your view of the cursor is somewhat obstructed. The tutorials do a great job of walking you through simple graphic editing tasks which help to illustrate what is possible. At this point my kinetic side took over and I decided to go rogue and just play. I was easily able to add and delete layers, use blends and create simple effects that I was already familiar with from the desktop version. Many of the tools that you are used to using are here, including the lasso, magic wand and clone tools. I really like the fact that I can create new layers and blend them as I would on the desktop version.  There are also preset effects that you can use to quickly spice up any image.

Photoshop Touch offers many
familiar tools to choose from.
Of course, nothing is ever perfect and PSTouch is no exception. Throughout my experience, I did notice a few bugs, some were more annoying then others. There were times when the app seemed to drag when I was drawing a selection that was particularly complex. Other times it seemed that if certain features were used in a particular order, some of the functionality would break without any type of user warning or message. There is a limit on file dimensions at 1600px square, but I don't think this is as big an issue as some people are making it out to be. After all, this software is best suited for web designers/developers on the go, not photographers and if you need to work on such large images, you shouldn't be doing it in an iPad2. Speaking of which, you'll notice that I'm calling out the version of the iPad throughout this blog. This app requires the iPad2 running iOS 5 or later. I'm sure there are very good technical reasons why, but it would have been nice to see this made available (or some version) for the iPad1. I personally do not like to add to our already growing mentality of being a "throw away" society.

You can easily get great results
in a very short time.
In the end, Adobe has created a great solution for those on the go who need some functionality, but not the full suite available in CS. There are some more than minor bugs and you really need a stylus (or boney fingers) to make full use of this app which is why I rated it a four instead of a five, but I know that Adobe will fix that so patience is key. In the meantime, we now have a functional photo editor for the iPad2 which makes owning one that much cooler and makes me that much more productive.

Two Classes Every JWPlayer AS3 Plugin Developer Should Use

I wanted to share two classes that are part of the JWPlayer package that I strongly recommend every JWPlayer AS3 plugin developer at least try. Hopefully you will find them as helpful as I did:

LOGGER (com.longtailvideo.jwplayer.utils.Logger):
If you're looking for a robust tool to help debug your plugins, I can't think of anything easier than Arthropod. When you use the Flash debugger player, you get a new menu item (added by the JWPlayer) which allows you to export your logs to a choice of options: arthropod, console or trace. Enabling this on it's own will provide a nice bit of feedback but wouldn't it be great to have your own custom methods pass debugger information? You can with Logger.

Logger takes two parameters, the value you want to expose and an identifier (such as the class or method you're calling from). If you leave the second parameter out, Logger simply uses LOG instead. Here's how I set up a custom method to call Logger within my own plugin:

public function debug(debugMessage:String, debugType:String=null):void{
    if(debugType == null){
        Logger.log(debugMessage);
    }
    else{
        Logger.log(debugMessage, debugType);
    }
}

ROOTREFERENCE (com.longtailvideo.jwplayer.utils.RootReference):
This one is pretty self explanatory. If you need a reference to the root object to set event listeners, instead of trying to reverse engineer the logic and find just the right object, simply import this class and reference RootReference. Bam, done; it's that simple. Here's how I implemented it:

RootReference.stage.addEventListener(KeyboardEvent.KEY_DOWN, function(e:KeyboardEvent):void{
    if(e.keyCode == 32){
        //the space bar was pressed
    }
});


I hope this helps!