Archive for the ‘PHP’ Category

amfm.cc Updates

Friday, February 9th, 2007

At long last, after over a year and a half of relative inactivity, I have made a significant update to amfm.cc! At it’s original inception, the only search term I could accept was a zip code. That’s all well and good so long as you know what zip code you happen to be and that I can keep that information up-to-date (it is was already a few years out of date when I got it).

Today I am pleased to announce that search terms are now wide open to be street names, cities, states, anything you wish to indicate where to search from. I give all thanks to Google’s Geocoding API. This essentially allows me to accept any term that Google Maps accepts to pinpoint a location.

In the future I may implement their maps API and display all results in a map interface in addition to the current listing. But for right now, I’m doing good to get this much done.

Oh, and this update applies to the mobile edition of the site as well. Happy radio surfing!

Trouble With Textile

Saturday, April 5th, 2003

As I was writing that last entry (about the Hannibal Trilogy) I was having some trouble with the way Textile was handling URL catching. The issue was that whenever I wanted to use an address with numbers at the end, those trailing numbers would not be included as part of the address. Here is the original code for cathing the URLs:


'/

# 1 optional space or brackets before
([\s[{(]|[[:punct:]])?

#   starting "
"

# 2 text of link
([^"\(]+)

#   opt space
\s?

# 3 opt title attribute in parenths
(?:\(([^\(]*)\))?

#   dividing ":
":

# 4 suppose this is the url
(\S+)

# 5 opt trailing slash
(\/?)

# 6 opt punctuation after the url
([^[:alnum:]\/;]|[1-9^]*)

# 7 either white space or end of string
(\s|$)

/xU'

After playing around with various things, I narrowed the problem down to item 6. I got it down to a form that now seems to work:


([^[:alnum:]\/;]?)

This change does not appear to affect the normal usage so I’m guessing its a safe change. However I’m no wiz when it comes to regular expressions so I’m not sure how this might affect future functionality. I’ll keep an eye on it.

Some PHP Humor

Tuesday, April 1st, 2003

I was looking up some info on my PHP server and noticed a little easter egg in honor of April Fools Day. It seems they change their logo for this momentus occasion. Below are the logos for PHP 4.2.3 and 4.3.0 respectively:

April Fools!! from PHP 4.2.3 April Fools!! from PHP 4.3.0

PHP5 Intro

Monday, March 24th, 2003

Via Simon, Sterling Hughes has posted his slides (apparently it is for Mozilla browsers only) for an upcoming PHP 5 presentation in New York tomorrow. Simon likes the class autoloading. I like the Exceptions handling.


<?php
define('NUM', 10);
try {
    if (NUM < 20) {
        throw new Exception(
            NUM . " is too small!"
        );
    }
} catch (Exception $e) {
    echo $e->getMessage();
    echo "\n<br />\n";
}
?>

Could prove very useful for debugging purposes.

I for one can’t wait for PHP5 to come out. I just hope PHPWebHosting.com isn’t slow to upgrade.

PHPComplete.com Redesign

Thursday, March 20th, 2003

I haven’t been to PHPComplete.com in a very long time. Now that I re-visited I am treated to a new, table-less, CSS rich, standards compliant design. The other thing that I find new is that Jason has tured the site into a blog rather than a news roll. He still focuses on PHP and thats fine. Jason has a great set of resources pertaining to that fine scripting language.

Simon On Spell Checking

Wednesday, March 19th, 2003

Simon as been working a spellchecking implementation that uses PHP and JavaScript. I tried it out and it seems very functional and looks to degrade nicely if JavaScript is disabled in a users browser. I am deffinetly going to keep an eye on this and perhaps implement it if and when it becomes a “stable solution”. Thumbs up to Simon.

Interesting Links

Sunday, March 16th, 2003

Simon has posted a number of interesting links. More to help cure his tag-itis syndrom going on in Phoenix than anything else. I noticed a few links there that I might like to check out some time. The are some great PHP, XHTML, and other web related links.