Installing PostgreSQL 8 on Centos 5

I've had to do this a few times and each time I have to dig around to get this just right so this time I decided to install and document what I did.  I'm doing this install on Centos 5.2 64bit that is running in a VM (VMware Fusion) on my Mac Book Pro.  This Centos install is also running a version of ColdFusion and Apache.  I have two reasons for doing this install.  One is so I can practice the upgrade from 8.1 to 8.3.  There are some SQL functions in 8.3 I want to get into that lets you return ranks with your query.  See this. And the next was so I could document this process so I don't have to search the net to find how to do it and then figure out how I need to do it.  Since I maintain my own servers I tend to have to research this sort of thing a few times a year.  I'm also planning to purchase a new to me server with much more power to run my production PostgreSQL DB and I figure I should have this part sorted out by the time I decide to spend the money on the machine.

So step one after figuring out the VM stuff (running VMware is new to me) is to install PostgreSQL.  When I did my first PostgreSQL install ages ago I downloaded the source and ran a bunch of commands something along the lines of .configure --some-options; make; make install; and some other stuff.  Now that I'm using Centos I figured why the heck do ALL of that when there is YUM!  So I did yum:

[More]

Recursion Fun

I just came across a fun little blog post about benchmarking the new version of Ruby by doing a Fibonacci sequence.  I hadn't thought about playing with Fibonacci sequences in a long time and since several others did it already I didn't really try.  I just ran one of the CF code examples someone posted on my MacBook Pro.  I blinked and missed the execution of it. Meh, fast enough.  

Like I said I hadn't thought about Fibonacci or other such algorithms in a long time.  At least not much since college when we all learned such things along with various sorting algorithms (who can forget the bubble sort?).  Why did we learn those when today we just write something like sort(blah) and never think about how it gets done.  I remember working on analyzing sorting algorithms to see which was the fastest and most memory efficient.  Memory efficient?  That is a novel concept these days.

However, a while back I did a recursion experiment in ColdFusion by doing a Factorial function which in college is one of the classic programming examples used to teach recursion.

I'm not even sure where you would use recursion these days, except in programming classes.  I have not run across the need for it in ages, but for some reason I was compelled to try this little experiment.

Is there really a need for recursion these days, or are we overlooking a power tool?

view plain print about
1<cffunction name="factorial" access="public" returntype="numeric" output="yes">
2    <cfargument name="end_value" required="Yes" type="numeric">
3    <cfif end_value lte 1>
4        <cfreturn 1>
5    <cfelse>
6        Calling myself with #arguments.end_value-1#<br>
7        <cfreturn end_value * factorial(arguments.end_value-1)>
8    </cfif>
9</cffunction>
10<cfoutput>#factorial(100)#</cfoutput>