Saturday, August 16, 2008

ucsentence: Using PHP to Capitalize Sentences, Paragraphs, Text

Most PHP developers are familiar with the "ucfirst()" and "ucwords()" capitalization functions. The ucfirst() function accepts a string as an argument, returning the string with the first character capitalized. The ucwords() function accepts a string as an argument, returning the string with the first letter of each word capitalized. These are very useful functions, but what if you have a string that contains several sentences, or a paragraph, and you want to properly capitalize the first letter of each sentence? This is where ucsentence() comes in.

This PHP function accepts a string of text that contains one or more sentences, each ending in one of the following ., !, or ? returning properly capitalize text. It is extremely handy when you have a lot of text that is either all lowercase or all uppercase that needs normalizing.

function ucsentence($string)
{
if(strlen($string) < 3)
return $string;

$string = strtolower($string);
foreach(array('.', '?', '!') AS $punct)
{
$string = explode($punct, $string);
$count = count ($string);
for($i = 0; $i < $count; $i++)
{
$string[$i] = ucfirst (trim ($string[$i]));
if($i > 0)
{
if((ord($string[$i]{0}) < 48) || (ord($string[$i]{0}) > 57))
$string[$i] = ' '.$string[$i];
}
}
$string = implode($punct, $string);
}
return $string;
}

USAGE:
$paragraph = "THIS IS ANNOYING TEXT. someone doesn't know how to punctuate.";
print ussentence($paragraph);

This function is an enhanced version of one found in the ucwords() section of the PHP documentation comments, extended to test for multiple punctuation types.

Sunday, November 11, 2007

A "Themed Resume" Could Help You Land Your Next Job


Resumes haven't changed much in the past century, but Resumega.com is out to change that. According to Joseph M. Albanese, founder and Chief Software Architect of Resumega.com, "Resumes aren't just for physical consumption anymore. More professionals than ever before are posting their resumes online for public consumption. With this in mind, why limit a resume to the black and white. In addition to adding color, we have added Themes to our resumes--to help our customers' resumes stand out from the crowd."

The latest release of Resumega.com allows users to select from a number of colorful layouts that now included University logos and colors. "One of the most difficult problems job-seekers face is getting the attention of prospective employer when literally hundreds of applicants are vying for the position," added Albanese.

The University of North Carlina, North Carolina State University, Brown University, and Virginia Tech are just a few of the featured Themes already available at Resumega, and more are being added daily. Kick your resume up a notch with Resumega's "Themed Resumes!"

Resumega is operating as a public service. There is no charge for the service.

Thursday, November 1, 2007

Nationwide Shortage of Computer Science IT Professionals, Jobs Plentiful

Since the turn of the millennium, undergraduate enrollment in many of the Nation's leading computer science programs has been declining precipitously. While employers are finding it increasingly difficult to find qualified applicants to fill available IT positions, computer science graduates are pleasantly greeted with numerous job offers.

According to Dr. Robert Fornaro, Dean of Computer Science at NC State University, "We are in the throes of a nationwide decline in computer science undergraduate enrollment. Four years ago we had 1200+ undergraduate majors. Today we barely crack 600. I'm sure this will turn around, although it it not yet clear that we have hit bottom. On the other hand, jobs for computer science majors are currently plentiful."

Barton Miller, a professor in the University of Wisconsin-Madison Computer Science Department and chairman of the Industrial Affiliates Program, added "We're fighting a terrible perception in computer science that there is some notion that the IT industry, since the bubble burst, is in the doldrums. But from what I've seen, there is a very vigorous hiring market going on out there."

Although times are less than favorable for companies looking for IT professionals, but it is a great time to be looking for a job. In the midst of the current technology boom, demand for computer science graduates--and salaries--continues to increase.

Get unlimited FREE resumes now at www.resumega.com

Sunday, October 28, 2007

What happened to StumbleUpon.com?

For the past 24 hours, www.stumbleupon.com's website has been inaccessible through my ISP, being Comcast.net. Has anyone else been having this problem, or is it just me? Something is apparently amiss, but I can't find any information on the Web about the outage. If anyone has official word, please post it here.