Archive for December, 2004

Friday the 13th asteroid will miss the Earth

A couple of days ago I wrote about an asteroid that had about a 2 percent chance of impacting the Earth on April the 13, 2029; a Friday. New observations now rule out a possible collision.
Using pictures from last March, the Near Earth Object Program stated that the asteroid no longer poses [...]

PHP: A function to return the first n words from a string

Do you ever find yourself needing to shorten a string in PHP? Maybe return the first 25 words of a long story? Give this routine a try. It will return the first n words from a string, or the entire string if it is less than n words long.

Multiple cases for switch construct

Looking at the PHP documentation, it is not clear how to add multiple values for the same case in a switch construct. It seems that you should be able to do
PLAIN TEXT
PHP:

case ("whatever" || "something"):

//Do something;

break;

But, you can't. I tried, and it didn't work. Fortunately, after much searching, I found a [...]

13 million downloads for FireFox since November

Open-source FireFox is putting pressure on Microsoft's dominance of the browser market with over 13 million downloads since November. A companion email program, Thunderbird, was released earlier this month.

Talk about an unlucky Friday the 13th

An asteroid has been rated as a level four threat to the Earth on a scale out of 10. This marks the first time that an asteroid has been rated higher than 1. Currently, there is a 1 in 45 chance that this asteroid will collide with the Earth on Friday, April 13th, [...]

A quick PHP function to get Post, Get, or Session variables; and Cookies too

It should be pretty easy to get $_GET, $_POST, $_SESSION, or $_COOKIE variables in PHP code. The problem is that just entering $_GET['variable'] causes an error if the variable does not exist. What's needed is a way to open the variable, and get a blank string if the variable is not defined. [...]

America tops the list of top spammers

Sophos, a UK based research group, recently released statistics putting Ameria square at the top of the list of spamming countries at 42.1%. South Korea is in second place with 13.4%; with China, Canada, and Brazil filling out the top 5.
Source: TechWeb.com - U.S. Spews More Spam Than Any Other Country

Tips to keep your email address away from spammers

If you have a online presence, whether it's personal or business, you most likely are looking for input back from your visitors. But, be careful if you put your email address in a simple mailto: link. You will get spam, accept it.
But, there are a few tricks you can use to [...]

America Online sees a decrease in spam this year

America Online may not be winning the war against spam, but it they may at least be making a run at it. AOL is claiming a dramatic decline in spam volume for the first time in 5 years.

Syntax highlighting code in WordPress blogs

Since several of my posts have source code in them, I needed a way to syntax highlight. I found a pretty good one for PHP code, but it didn't do anything else.
While working on an article for a JavaScript function, I needed a highlighter. So, out searching I went.