Recent Blog Posts
Blogs » Archive for May 11th, 2004
Validation with CType
What happens when you take you eye off the ball? The CType extension becomes a default part of PHP!
Have to confess I’ve never touched them until recently and was stuck in a “validation = regular expressions” mindset. What puzzles me is I haven’t seen anyone else using them either – most libraries doing some validation, including QuickForm and Validate all use regular expressions. Anyone know why? It’s not hard to use them but fall back to regular expressions for older PHP versions.
The CType functions are wrappers for ctype.h, a standard part of C, so are, effectively, very well tested.
The point is, for validating certain basic types of data, they do a better job than regular expressions, being both faster and supporting international character sets. The also make your code more “declarative” in nature – it’s pretty clear what ctype_digit() does while ‘/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/’ is less obvious.
For example say you have a field in your form for “First Name”. Using regular expressions, you’d probably validate it something like;
if ( !preg_match(’/^[a-zA-Z]*$/’, $first_name) ) {
die (’Alpha characters only please!’);
}
Now that’s fine if your name is Joe but what if your name is Håvard?
By using …
Extending Red Hat 7 – 9 with Progeny
While many Red Hat users progressed from Red Hat’s versions 7 through 9 into Fedora or Enterprise Linux, some individuals and firms may have been too highly leveraged with production servers to just drop everything and migrate to new operating system installs.
With support now sunset for version 7 through 9, concerns over maintaining these legacy systems have now risen to the surface. If you are in that group, there are some lifelines left to assist in your transition that will give you some breathing room.
Of course one method is to manually monitor Linux OS and application advisories and track to find updates for your systems, however, this may be too labor intensive for many. One alternative is Progeny. Founded by Debian Linux-maker Ian Murdock, the company offers a wide array of Linux-based services.
More importantly, they offer a Red Hat support system that tracks and provides rpm updates to Red Hat Linux servers running versions 7 through 9. They guarantee this service through December 2005, which should give most firms the time needed to evaluate, select and deploy a replacement Linux OS for their servers.
The company states on their FAQ that they may go beyond …
How to Ceate a Referral-Only Web Design Business (Part 3)
Today’s blog is the third in a series about referrals. Part One talked about getting referrals from clients by including a discussion about referrals up front in your contract with them. Part Two explained the most effective way to ask for referrals from clients.
This final part describes some strategies to go after referrals from your “sphere of influence,” or network, so that they think of you first when the need for a web designer comes up with someone they know. If you follow these strategies effectively, you won’t have to worry about traditional marketing.
1. Compile a list of your current network. Most people know 100-250 other professionals. However, you need tools to remember who those people are. Go through your local phone book and write down the people you know in each profession. Write down the names of your neighbors, friends, family members, former professors, classmates and alumni, fellow volunteers and community leaders, and so on.
2. Create a list of people you don’t know, but who are influential in your target market: lawyers, accountants, other IT professionals, bankers, ministers, non-profit board members, association leaders, politicians, and active members in your community.
3. Prioritize the above lists to focus on people who …
ActionScript 2.0 Class Locations
I was recently working on a project that required me to upgrade a whole bunch of code from AS1.0 to AS2.0, and whilst the task was simple enough it involved several class files and hundreds of properties, methods and subclasses.
There was also a requirement to alter the functionality of some of the functions, so I set about creating the external class files, and overhauling the code, popped the class files in the Flash MX 2004 ‘/Classes/ folder and set about making the alterations.
As there were many alterations, I needed to test the SWF from time to time, but the code changes in the class files were not propagating through to the compiled SWF. Very strange, so I restarted Flash MX 2004, recompiled the SWF, and the changes appeared.
Even stranger was the fact that if you deleted the .as files from the ‘/Classes/’ folder of the installation directory the SWF still compiled! I thought there was some pretty heavy caching going on here, so searched for copies of the .as files I had just deleted, and sure enough there was a copy in another directory. I made some simple alterations to the .as files and hey presto, I could make changes …
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.