Proofreading Your Code Comments before Posting Them Online
You already spell check the text on your website(s)…right? Well, what about those code comments? Although few people are likely to ever see the comments, it's worth keeping this topic in mind in case you ever decide to publicize your code. Or if you share code samples with potential employers. [Continue reading]
Sorting Complicated Lists with PHP When A Database Isn’t Necessary
Websites commonly have content that's sorted in some fashion. For larger projects, utilizing a database may be optimal. But what about those smaller projects? When displaying a short list of advisory board members, for example, I typically go straight to HTML and my grand knowledge of the ABCs. That may work in the short run, but eventually mistakes happen. We can minimize the risk by leveraging PHP for sorting complicated lists. [Continue reading]
Making It Easy to Locate and Remove Test Code
When troubleshooting, sometimes it's necessary to add code to test various features. The problem is that the code may accidentally be left in when going live. Removing the extra code as you go may work in most situations. Or maybe you just know where the test code is located and removing it doesn't seem like a problem. However, what happens if you're pulled away from the task by some other emergency or deadline? Over time, the test code you were so familiar with may not be as obvious. Instead of depending on memory, here are some options for making test code stand out. [Continue reading]
Calculating the Distance between Zip Codes Using the Google Maps API – Part 2
Last week, we went over the basics for accessing the Google Maps API and calculating mileage between zip codes with Google's Distance Matrix service. The problem is that the service only lets us work with 25 origin and 25 destination points at a time. A custom solution is needed to go beyond that. [Continue reading]
Calculating the Distance between Zip Codes Using the Google Maps API – Part 1
A request came in recently to develop a feature for getting a list of organizations near a zip code provided by the user. They're looking for something very similar to a jobs website where you can narrow the search results to show only the ones within a 50 or 100 mile radius. The Google Maps API and Google's Distance Matrix service seem like great solutions for the problem. [Continue reading]
Formatting Dates within the MySQL Query
Before displaying dates from a MySQL database, do you change the format? If so, how are you formatting those dates? For me, I typically went straight to PHP for the answer. That is until it was brought to my attention that MySQL has a built in function for formatting dates. Let's talk about the date_format() function. [Continue reading]
Troubleshooting with var_dump()
When code doesn't perform properly, checking that the variables contain what you expect is an important step in solving the problem. Was the value ever assigned to the variable? Does the variable still contain the value? Is the value formatted for the given the scenario? Let's look at some options for finding out. [Continue reading]
Sending E-mails in the Future with Outlook’s Delay Delivery Feature
Have you needed to remind someone about a topic at a later date? If so, do you typically need someone to remind you to send the reminder? Instead of assuming that you'll remember or adding another sticky note to your monitor, let's look at utilizing Outlook's Delay Delivery feature. [Continue reading]
Simple Bar Graphs Made Dynamic with PHP
The simple bar graph shown last week could be utilized to generate charts on the fly. This is great for showing responses from an online survey and other data collection methods. All that's needed is a scripting language such as PHP and direct access to the data. [Continue reading]
Creating Simple Bar Graphs with HTML
Looking for a quick and dirty way to make bar charts? While digging through old code, I stumbled across some simple HTML code for generating bar charts. I'm sure there are better ways to make fancier graphs, but I thought it would be fun to share this old-school technique. [Continue reading]