Aaron Gadberry

Help – v. helped, help·ing, helps

Was this site helpful?
My Amazon.com Wishlist

Archive for January, 2006

How To: Run a Perl script from PHP

23rd January 2006 - By Aaron

While you may be dreading this part of your project, this task is surprisingly easy for non-major implementations.

The example I’m going to use for this is implementing a perl calendar into a php web page.

First off, you need to have your web server correctly serving the perl as is. In other words, call the perl you will want from a web browser. If http://www.yoursite.com/cgi-bin/helloworld.pl works right, then you’re set. If it doesn’t, you need to troubleshoot why your perl isn’t being executed correctly.

Next you need to use a simple include-style command called virtual.

Here’s an example of this in use.

Read the rest of this entry »

Posted in Computers, Programming | 5 Comments »

Iconbuffet – Free icons for all!

19th January 2006 - By Aaron

Iconbuffet is giving away their icons! They send you one pack every month, and not all subscribers get the same pack. So I just got the Taipei Night Market set. Once you get your set, you can send it to up to five people. So I’m open to trading icons with anyone who signs up and doesn’t get the taipei night market set.

Send me an [email protected] if you want to trade!

Posted in Miscellaneous | No Comments »

Sorting: Driver Program for Sorts

13th January 2006 - By Paradochs

Description

This code implements and runs the sort algorithm code in other sort articles found here.

Read the rest of this entry »

Posted in Computers, Programming | No Comments »

Sorting: Quick Sort

13th January 2006 - By Paradochs

Information

  • Order: O(n²)
  • Best Case: O(nlog(n))
  • Average: O(nlog(n))
  • Memory Usage: O(log(n))
  • Stable: No
  • Comparison Based: Yes

Description (from wikipedia)

Quicksort is a well-known sorting algorithm developed by C. A. R. Hoare that, on average, makes O(n log n) comparisons to sort n items. However, in the worst case, it makes O(n²) comparisons. Typically, quicksort is significantly faster in practice than other O(n log n) algorithms, because its inner loop can be efficiently implemented on most architectures, and in most real-world data it is possible to make design choices which minimize the possibility of requiring quadratic time. Quicksort is a comparison sort.
Quicksort sorts by employing a divide and conquer strategy to divide a list into two sub-lists.

The steps are:

  1. Pick an element, called a pivot, from the list.
  2. Reorder the list so that all elements which are less than the pivot come before the pivot and so that all elements greater than the pivot come after it (equal values can go either way). After this partitioning, the pivot is in its final position. This is called the partition operation.
  3. Recursively sort the sub-list of lesser elements and the sub-list of greater elements.

The base case of the recursion are lists of size zero or one, which are always sorted. The algorithm always terminates because it puts at least one element in its final place on each iteration.

Read the rest of this entry »

Posted in Computers, Programming | No Comments »

Sorting: Merge Sort

13th January 2006 - By Paradochs

Information

  • Order: O(nlog(n))
  • Best Case: O(nlog(n))
  • Average: O(nlog(n))
  • Memory Usage: O(n)
  • Stable: Yes
  • Comparison Based: Yes

Description (from wikipedia)

Conceptually, merge sort works as follows:

  1. Divide the unsorted list into two sublists of about half the size
  2. Sort each of the two sublists
  3. Merge the two sorted sublists back into one sorted list.

The algorithm was invented by John von Neumann in 1945.

Read the rest of this entry »

Posted in Computers, Programming | No Comments »