How-To: Tutorials and Walkthroughs

How To Drop All Tables From A MySQL Database

If you are doing much testing of content management systems, you end up needing to clear your database. If you don't want to set permissions up repeatedly, you end up wanting some way to clear all the tables from a database so you can set it up again. I found a way to do this (by googling of course, because I am lazy and do not want to think) that does not require dropping and recreating the database with its attendant permissions.

Firefox Configuration Tweaks

Most of us can agree that Firefox is pretty much the hottest browser around. It has excellent standards compliance (bested only by Opera) and the richest collection of extensions around. In addition, it provides a level of configurability that we normally only get to dream about; through the page "about:config" you can tweak the behavior of practically everything in the browser. Sometimes programs appear that perform the same sort of task, for example fasterfox whose only purpose is to tweak some of these settings for you.

Crystal Reports: Functions for Aristocrat OASIS

Due to the abject uselessness of Aristocrat's website, there is no way to just look up the information in the tutorial documentation (or anything else.) Thus, I have created this document to list formulas useful in crystal reports for processing OASIS data.

Even if this information were copied verbatim from the tutorial document and placed on the web, it would still contain errors. (See the first example in the Advanced Crystal Reports guidebook from 10/17/02 on page 12.)

Crystal Reports: Gnome Sort

Crystal Reports 9 provides no way to sort an array. If you want to calculate the median value for an array, it must be sorted. On the other hand, it does provide comparisons that work properly based on data type, so that for example ( "Alice" < "Bethany" ) will evaluate true. The following examples are designed to sort numerical arrays but they can as easily sort strings or any other data types in Crystal.

Crystal Reports: Cocktail Sort

Among the many pieces of obvious functionality missing from Crystal is a median function that will operate on an array. The median is not horribly difficult to calculate, but in order to do so you need a sorted list of values. Another obvious thing Crystal is missing is an array sort function. The median of a list is its middle value by position such that of the set (1, 3, 3, 4, 6) the median is 3 while the average is 3.4. While it does not look very useful with a short set of only five elements, it is often useful when you have one or two hundred of them. It is often much more useful than an average when you have a lot of redundancy in your set.

Crystal Reports: Making Sense of Time

Converting a bunch of Seconds to something Useful

A lot of databases store time elapsed as a number of seconds. This is sufficiently granular for most purposes and it is programatically a lot easier than storing day, hour, minute, second and so on values.

When it comes time to introduce a human to that data, the big number of seconds isn't going to mean diddly. Enter the following formula:


Subscribe to RSS - howto