Archive for the 'PHP' Category

Guess a Number Between 1 and 100 in 7 or Fewer Tries

Friday, February 2nd, 2007

A number is randomly chosen between 1 and 100. The “guesser” is told at each guess whether their guess is correct, too high, or too low. Four methods tested with the sequence used to successfully guess the number “1.” Random Starts with a random number and draws a random guess from the range implied by the results [...]

Multiple Transparent Borders

Thursday, February 1st, 2007

When drawing a text string that has multiple text borders like, for example, the family reunion t-shirt design here, you have unique issues building the multiple layers of borders. Depending on how you draw multiple borders you can get many different effects: What’s the difference between these different approaches? Answers In option C, each letter is individually drawn starting [...]

301 Redirects With a Custom 404 Page

Friday, November 24th, 2006

For anyone who cares about search engine rankings and has had to move a page or domain from one location to another, the handling of redirects is very important. The wrong type of redirect and any links pointing to the old location don’t count towards the contents new location. If you read most work on “How [...]

Wordpress mod_rewrite Still Allows Old URL String

Friday, October 27th, 2006

If you migrated a Wordpress blog from the old style URLs using the built-in permalink options, you may be surprised that all the old URLs are still accessible. This causes a problem with search engines which have already indexed those old URLs as they will look at the new URLs as duplicate content. /blog/?p=123 The “quick fix” [...]