 					destination.push(source[i]);
 			return destination;
 		}
-		
-		/**
-		 * This will take an Array of Arrays of String items and produce a single list of String-joined items.
-		 * @param arrayOfArrays An Array of Arrays of String items.
-		 * @param separator The separator String used between joined items.
-		 * @param includeEmptyItems Set this to true to include empty-strings and undefined items in the nested Arrays.
-		 * @return An Array of String-joined items in the same order they appear in the nested Arrays.
-		 */
-		public static function joinItems(arrayOfArrays:Array, separator:String, includeEmptyItems:Boolean):Array
-		{
-			var maxLength:int = 0;
-			var itemList:Array;
-			for each (itemList in arrayOfArrays)
-				maxLength = Math.max(maxLength, itemList.length);
-			
-			var result:Array = [];
-			for (var itemIndex:int = 0; itemIndex < maxLength; itemIndex++)
-			{
-				var joinedItem:Array = [];
-				for (var listIndex:int = 0; listIndex < arrayOfArrays.length; listIndex++)
-				{
-					itemList = arrayOfArrays[listIndex] as Array;
-					var item:String = '';
-					if (itemList && itemIndex < itemList.length)
-						item = itemList[itemIndex] || '';
-					if (item || includeEmptyItems)
-						joinedItem.push(item);
-				}
-				result.push(joinedItem.join(separator));
-			}
-			return result;
+		
+		/**
+		 * This will take an Array of Arrays of String items and produce a single list of String-joined items.
+		 * @param arrayOfArrays An Array of Arrays of String items.
+		 * @param separator The separator String used between joined items.
+		 * @param includeEmptyItems Set this to true to include empty-strings and undefined items in the nested Arrays.
+		 * @return An Array of String-joined items in the same order they appear in the nested Arrays.
+		 */
+		public static function joinItems(arrayOfArrays:Array, separator:String, includeEmptyItems:Boolean):Array
+		{
+			var maxLength:int = 0;
+			var itemList:Array;
+			for each (itemList in arrayOfArrays)
+				maxLength = Math.max(maxLength, itemList.length);
+			
+			var result:Array = [];
+			for (var itemIndex:int = 0; itemIndex < maxLength; itemIndex++)
+			{
+				var joinedItem:Array = [];
+				for (var listIndex:int = 0; listIndex < arrayOfArrays.length; listIndex++)
+				{
+					itemList = arrayOfArrays[listIndex] as Array;
+					var item:String = '';
+					if (itemList && itemIndex < itemList.length)
+						item = itemList[itemIndex] || '';
+					if (item || includeEmptyItems)
+						joinedItem.push(item);
+				}
+				result.push(joinedItem.join(separator));
+			}
+			return result;
 		}
 	}
 }

			var right:int = (lastIndex >= 0) ? (lastIndex) : (list.length - 1);
			if (left >= right)
				return left;
			var k:int = (left + right) / 2;
			var pivotIndex:int;
			while (true)
			{
				pivotIndex = (left + right) / 2; 
				// pivotIndex could be random, if desired
				//pivotIndex = left + Math.random() * right - left;
				pivotIndex = partition(list, left, right, pivotIndex, compareFunction);
				if (k == pivotIndex)
					return k;
				if (k < pivotIndex)
					right = pivotIndex - 1;
				else
					left = pivotIndex + 1;

/*
    Weave (Web-based Analysis and Visualization Environment)
    Copyright (C) 2008-2011 University of Massachusetts Lowell

    This file is a part of Weave.

    Weave is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License, Version 3,
    as published by the Free Software Foundation.

    Weave 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 Weave.  If not, see <http://www.gnu.org/licenses/>.
*/

package weave.utils
