Archive for September 5th, 2008

Updated JavaScript UUID Generator v.0.3

Friday, September 5th, 2008

The JavaScript UUID Generator class has been refreshed again and is even more efficient than the 0.2 version due largely in part to heavier reliance on built in JavaScript functions. It’s still not a “REAL” UUID, but it’s good enough for most projects. The changes are as follows:

  • A leaner and more efficient returnBase(val, base) method for conversion to base16 strings. The original version from irt.org has been replaced with built in JavaScript methods. Some testing for your target platforms should be performed to ensure compatibility with your engine.
  • The change from randrange(min, max) in v.0.1 to rand(max) in 0.2 introduced a bug where the maximum value provided would never be matched. This has been fixed to correct for that issue.

Special thanks go out to Robert Kieffer for pointing out these issues and providing the updated code for the base 16 conversion.

Download the latest version.

View Code JAVASCRIPT
/*
uuid.js - Version 0.3
JavaScript Class to create a UUID like identifier
 
Copyright (C) 2006-2008, Erik Giberti (AF-Design), All rights reserved.
 
This program is free software; you can redistribute it and/or modify it under 
the terms of the GNU General Public License as published by the Free Software 
Foundation; either version 2 of the License, or (at your option) any later 
version.
 
This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License along with 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
Place, Suite 330, Boston, MA 02111-1307 USA
 
The latest version of this file can be downloaded from
http://www.af-design.com/resources/javascript_uuid.php
 
HISTORY:
6/5/06 	- Initial Release
5/22/08 - Updated code to run faster, removed randrange(min,max) in favor of
          a simpler rand(max) function. Reduced overhead by using getTime() 
          method of date class (suggestion by James Hall).
9/5/08	- Fixed a bug with rand(max) and additional efficiencies pointed out 
	  by Robert Kieffer http://broofa.com/
 
KNOWN ISSUES:
- Still no way to get MAC address in JavaScript
- Research into other versions of UUID show promising possibilities 
  (more research needed)
- Documentation needs improvement
 
*/
 
// On creation of a UUID object, set it's initial value
function UUID(){
	this.id = this.createUUID();
}
 
// When asked what this Object is, lie and return it's value
UUID.prototype.valueOf = function(){ return this.id; }
UUID.prototype.toString = function(){ return this.id; }
 
//
// INSTANCE SPECIFIC METHODS
//
 
UUID.prototype.createUUID = function(){
	//
	// Loose interpretation of the specification DCE 1.1: Remote Procedure Call
	// described at http://www.opengroup.org/onlinepubs/009629399/apdxa.htm#tagtcjh_37
	// since JavaScript doesn't allow access to internal systems, the last 48 bits 
	// of the node section is made up using a series of random numbers (6 octets long).
	//  
	var dg = new Date(1582, 10, 15, 0, 0, 0, 0);
	var dc = new Date();
	var t = dc.getTime() - dg.getTime();
	var h = '-';
	var tl = UUID.getIntegerBits(t,0,31);
	var tm = UUID.getIntegerBits(t,32,47);
	var thv = UUID.getIntegerBits(t,48,59) + '1'; // version 1, security version is 2
	var csar = UUID.getIntegerBits(UUID.rand(4095),0,7);
	var csl = UUID.getIntegerBits(UUID.rand(4095),0,7);
 
	// since detection of anything about the machine/browser is far to buggy, 
	// include some more random numbers here
	// if NIC or an IP can be obtained reliably, that should be put in
	// here instead.
	var n = UUID.getIntegerBits(UUID.rand(8191),0,7) + 
			UUID.getIntegerBits(UUID.rand(8191),8,15) + 
			UUID.getIntegerBits(UUID.rand(8191),0,7) + 
			UUID.getIntegerBits(UUID.rand(8191),8,15) + 
			UUID.getIntegerBits(UUID.rand(8191),0,15); // this last number is two octets long
	return tl + h + tm + h + thv + h + csar + csl + h + n; 
}
 
 
//
// GENERAL METHODS (Not instance specific)
//
 
 
// Pull out only certain bits from a very large integer, used to get the time
// code information for the first part of a UUID. Will return zero's if there 
// aren't enough bits to shift where it needs to.
UUID.getIntegerBits = function(val,start,end){
	var base16 = UUID.returnBase(val,16);
	var quadArray = new Array();
	var quadString = '';
	var i = 0;
	for(i=0;i<base16.length;i++){
		quadArray.push(base16.substring(i,i+1));	
	}
	for(i=Math.floor(start/4);i<=Math.floor(end/4);i++){
		if(!quadArray[i] || quadArray[i] == '') quadString += '0';
		else quadString += quadArray[i];
	}
	return quadString;
}
 
// Replaced from the original function to leverage the built in methods in
// JavaScript. Thanks to Robert Kieffer for pointing this one out
UUID.returnBase = function(number, base){
	return (number).toString(base).toUpperCase();
}
 
// pick a random number within a range of numbers
// int b rand(int a); where 0 <= b <= a
UUID.rand = function(max){
	return Math.floor(Math.random() * (max + 1));
}
 
// end of UUID class file

Shift Needed Measuring Application Success on Social Networks

Friday, September 5th, 2008

Mobsters, Likeness, Top Friends, Super Wall, Own Your Friends, Bumper Stickers, Movies and Poker - this is just a sampling of the highest engagement applications on Facebook and MySpace. What these applications all have in common is a mass market appeal. They are general enough that just about everyone can find something cute or fun about these applications for at least a day or two. The applications measure success in installs, page views and virility. However, another classification of application, specific to much smaller audiences, is emerging as a stronger player in the application space which requires a different measurement separate than the categorical classification that application developers can choose to place themselves in.

The goal of these other applications is not monetize via CPC, CPM or CPI advertising, nor to be bought by the large application shops RockYou, Slide, Zynga or SGN. Instead, these applications exist primarily to provide a service to their users. These applications will fail when measured using the traditional methods of installs, daily active users and day over day growth. The audiences are much too small. They require a new metric to measure their success. Success within this category isn’t reaching 22%1 of Facebook’s user base. Success for these applications is defined as increased affinity for a product, service or company. It needs to be measured and reported differently.

This might be measurable through acquisitions, loyalty, usage or retention. Using Twitter as an example, it’s certainly capable of becoming a mainstream product, but hasn’t reached mainstream adoption - at least not yet. Twitter currently reaches an estimated 2.2 million users a month2. It’s regarded by some as having moved beyond the early adopters3 and easing into the early majority on the technology adoption lifecycle. The Twitter application launched May 25th along with the Facebook platform. It currently boasts 64.5K monthly users of which is hardly chart topping - in fact, it’s really quite dismal - it’s not even one of the top 500 applications. What the application does though is provide enhanced user experience by integrating status updates between the two sites.

The Twitter application is valued by Adonomics at approximately $105K. However, this number means nothing! The goal of the application isn’t to sell it or even monetize the traffic. Even the overall ranking of the application is irrelevant. A better way to measure the ROI of the application is to measure the interaction and retention. This metric that can accurately quantified by answering a series of questions.

  1. Does the application impact the retention and interaction of users for Twitter?
  2. Does the application increase usage of Twitter?
  3. What overlap in the userbase exists between Facebook and Twitter?

Lacking quantitative data from Facebook and Twitter, you’ll have to settle for my observations.

Does the application impact the retention and interaction of users for Twitter? Yes. I suspect if we could peek into Twitter’s database, we’d see that interactions for users continue for longer periods if they’ve installed the Facebook application. Why do I think this? Read on…

Does the application increase usage of Twitter? Yes. I know from personal experience that I’ve continued using Twitter longer than I had expected to because of the integration. At times I’ve used it only as a status update tool. Sending a SMS or using a phone specific tool is easier than the mobile facebook application available for my phone. Other times I use it as a conversational tool. The main point here - I continue to use it.

What overlap in the user base exists between Facebook and Twitter? Again, this is an estimate but nearly 100%4 of the people I follow on Twitter have Facebook accounts. However, only about 20% of my friends on Facebook have (or use) a Twitter account. While Twitter clearly has the potential to be a mainstream tool, it doesn’t have the presence that a MySpace or Facebook does.

The Twitter application likely has positive reprecusions for Facebook as well. By integrating the status update directly from Twitter, Facebook continues to get more content contributing to the “virtuous cycle of sharing” Mark Zuckerberg spoke about at F8 ‘08. Wouldn’t this classify the application as a success? As of this writting, Twitter doesn’t have an official application for MySpace. I expect we’ll see if MySpace allows applications to update the users status.

The question remains, how can we take these difficult to obtain numbers such as audience overlap and integrate it with the more available metrics? We need a metric that holistically evaluates an application. Measuring mass alone is no longer sufficient to define success. I propose they’re measured by interactions, retention and perception. Mix into that formula monthly reach and install and we’ll be able to arrive at a value that more accurately ranks and sorts applications on the whole.


1 Slide FunSpace reached 22.3 million Facebook users according to the monthly active user count on September 5, 2008

2 Compete reports 2,218,330 visitors to Twitter.com in July of 2008.

3 Robert Scoble stated April 9, 2008, “Anyone who joins Twitter after today is not an early adopter. So, not interesting for me to follow.”

4 Conducted using PollDaddy and an analysis of people I follow.

© 1998-2008 AF-Design, All rights reserved.