Evaluating new technologies (well at least new to me).

I have been learning more about different frameworks out there. Since throwing live http://www.dating2p0.com as a collector for email addresses for our beta program I have been charged with the task of building the full fledged website. Back end/Front end and everything else in between. So far I have been evaluating Kohana and have found both 2.3.x and 3.x exceptional builds. My main concern is the internal struggle between 3.x and 2.x chains. It seems they want to put the clamp on 2.x and go with 3.x full time. My problem with this is the lack of API documentation and the "look at source code" mandate when you ask a question. Another framework I have been looking at is Zend Framework.

Once again a perfectionist looking for clear concise documentation I was disappointed with the way Zend Framework is documented in regards to the References examples. Some reference examples are great and some are left yearning for more. In the quest for more knowledge I have been look around at various user groups and other forms of communication (irc.freenode.net/#phpc) and stumbled upon the awesome Ray Allen. A.k.a akrabat he helped me get started with: http://akrabat.com/zend-framework-tutorial/. A must read for anyone looking to get into Zend Framework.

On top of evaluating various PHP frameworks I have been reading High Performance MySQL (http://oreilly.com/catalog/9780596003067). This book is awesome and also a must read. I have learned so much and am only on chapter four.

A quick look at bubble sort.

I was just recently playing around and got to thinking I coded a bubble sort algorithm in everything from C to Scheme but not in PHP. So I took a good college try at it and this is what I came up with:

/*
Author: Anthony Wlodarski
Created On: 1/18/10
Bubble Sort Function
*/

// Pre: valid array
// Post: returns an array sorted with the bubble sort algorithm
function bubble_sort($values = array())
{
if(count($values) < 2)
{
return $values;
}

// we have an array with at least two items to sort
$total_number_of_values = count($values);

// for each element we must loop through the loop
for($i = 0; $i < $total_number_of_values-1; $i++)
{
// inside each loop we must iterate through the entire array to "bubble"
// our elements
for($j = 0; $j < $total_number_of_values-1; $j++)
{
if($values[$j] > $values[$j+1])
{
$temp = $values[$j];
$values[$j] = $values[$j+1];
$values[$j+1] = $temp;
}
}
}

return $values;
}

$elements = array();
$total_elements = rand(0, 256);
for($a = 0; $a < $total_elements; $a++)
{
$elements[$a] = rand(0, PHP_INT_MAX);
}


$sorted_elements = bubble_sort($elements);

You can take a look at the algorithm in action here: http://hash.anthonyw.net/tests/bubblesort.php

 1

About

User