Code Talking

  • Tracking with Google Analytics

    I recently signed up for Google Analytics to see what sort of web site tracking they offered. I like the idea of easily-accessible data, and Google has typically been very good at providing just what I need. Since the service has apparently received overwhelming response, Google has turned…

  • PHP Image Rotation

    While trying to hastily assemble a Javascript image rotation script, it occured to me that you could probably do the same thing with PHP – and it would not only be easier, but more reliable, since PHP happens on the server-side, independent of the browser someone is using….

  • MySQL Search and Replace

    I really, really wanted to do a search and replace in MySQL, but I just couldn't find it. Then I did. update tablename set field = replace(field,'search','replace');…

  • Date Displays with PHP

    Just a few minutes ago, a friend asked about displaying a future date on his web site. In this particular example, he wanted the name of the next month. In other words, he'd like the word "October" displayed, since it is currently September. Next month it should change…

  • Splitting Large Files Carefully

    There comes a time every now and then where you need to split up large files. If you have the luxury of those files being split anywhere, you can use something like WinRAR, which will split it up into whatever size you like. If it's good enough for…

  • Little URLs and Parameters

    In the course of working with a project today, I came across some useful information. First, the use of command-line parameters in Perl. All you really have to do is add a space between the program name and the first, and then the first and the second, and…

  • Random Rows in SQL

    At least in MySQL, all you have to do to return random data from your query is add ORDER BY RAND() to your query, for instance: SELECT * FROM table ORDER BY RAND() LIMIT 1…

  • A Plethora of Programming

    This week I've been rather busy working on a number of projects – mostly in languages that I don't typically use (notably Javascript). As such, I found myself digging around for information more than is typical, and came across some gems that helped me out when I was…

  • MT-Moderate and SimpleComments

    A number of you have mentioned that you would like to use MT-Moderate, specifically to moderate trackbacks, but are unable to do so because you also use SimpleComments. Because of the way in which I'm making trackbacks moderated, they will still appear in SimpleComments lists of trackbacks. Now,…

  • Recursively CHMOD Files

    I was moving a bunch of files from one location to another, and it ended up that a ton of those files had the wrong permissions. Now permissions of 755 will generally work for serving an HTML file, but it should probably be served as 644, and since…