September 2006 Archives

2006 Sep 22

google_adsense_logo.jpg

I thought it was just a hearsay until i saw it at the neopets website. Just keep on refreshing the page until the google ad displays. Take a look at the source code and you will see the google_hint option on google ad script. it looked something like this:

google_hints = "microsoft instant messenger pizza hut virgin mobile doughnut disney world fruit snacks";

Definitely its going to help you display targeted ads to your site specially if its not displaying any relevant ads. The only problem i could see here is that it might be abused just like what happened to the meta keywords which was called keyword stuffing. The main reason why the search engines are nowadays ignoring them. However, you will need to contact google before you can use the code. I dont really know the process and i haven't tested it yet. Total number of characters on google_hints should not exceed by 1024 characters.

2006 Sep 21

Getting the a website title and description is easy. Using the PHP's builtin file_get_contents command together with a regex pattern allows us to capture and get any website title and description without any complex methods that is if the site has a title or a description. In case a site has no description a simple excerpt function is also provided.

Getting the site title:

function getMetaTitle($content){
$pattern = "|<[\s]*title[\s]*>([^<]+)<[\s]*/[\s]*title[\s]*>|Ui";
if(preg_match($pattern, $content, $match))
return $match[1];
else
return false;
}

The code above returns the title of the site enclosed by the tags <title> and </title>. The function would return a boolean false in case there was none.

Getting the meta description:

function getMetaDescription($content) {
$metaDescription = false;
$metaDescriptionPatterns = array("/]*>/Ui", "/]*>/Ui");
foreach ($metaDescriptionPatterns as $pattern) {
if (preg_match($pattern, $content, $match))
$metaDescription = $match[1];
break;
}
return $metaDescription;
}

The code above returns the meta description of the site enclosed with single quotes or double quotes. It will return a boolean false it there wasn't any. If this would happen we could get an excerpt of maybe the first website sentence to serve as our website description instead, however getting an excerpt would not be very efficient and i had some trouble with my code. Please fell free to make a comment to optimize it.

Getting the first website sentence:

function getExcerpt($content) {
$text = html_entity_decode($content);
$excerpt = array();
//match all tags
preg_match_all("|<[^>]+>(.*)]+>|", $text, $p, PREG_PATTERN_ORDER);
for ($x = 0; $x < sizeof($p[0]); $x++) {
if (preg_match('< p >i', $p[0][$x])) {
$strip = strip_tags($p[0][$x]);
if (preg_match("/\./", $strip))
$excerpt[] = $strip;
}
if (isset($excerpt[0])){
preg_match("/([^.]+.)/", $strip,$matches);
return $matches[1];
}
}
return false;
}

The code above reads the entire page and looks for the <p> tag, then returns the first phrase that ends with a period and stripping all the html code inside.

Here's a sample code to test our script:

$url = 'http://www.tildemark.com/';
$content = file_get_contents($url);
$title = getMetaTitle($content);
$description = getMetaDescription($content);
$excerpt = getExcerpt($content);
print "title: $title ";
print "< br />";
print "description: $description ";
print "< br />";
print "excerpt: $excerpt";
?>

You may download a working copy of the title and description scraper script.

Thank you for the comment:
Yes, indeed. We could use the builtin get_meta_tags function to get the website description without any knowledge on regular expressions. here's how:

<?php $meta_data= get_meta_tags('http://www.tildemark.com/'); echo $meta_data['description']; ?>

Aside from getting the description, you could also get Author, Keyword and GeoPosition meta data using the function get_meta_data().

2006 Sep 19

What color is an octopus? I really do not know the right answer to this question. The octopus skin contains chromatophore cells which allows them to mimic almost anything in the coral reef. There skin contains the color black, brown, red, orange and yellow, combining these hues gives an infinite pattern to match just any object under the sea.

So, what color is an octopus again?

2006 Sep 13

Spam is a problem, posting entries to blogs with email address should be avoided. There are lots of automated programs used to collect email addresses; other than spam, bandwidth may also be an issue for these programs reads your entire website. If you only have a small bandwidth allocated to your site then you will be seeing that Bandwidth Limit Error in due time.

What I did? Blocking all unwanted robots out of my site using mod_rewrite by apache. First, you need to examine your access log file ang try to google on the robots that has visited your site if they are safe or just they are just scrapers. Just be carefull not to block those major search engine spiders like googlebot, inktomi slurp, msnbot or ask jeeves. Unless you don't want them crawl your website.

You need to modify your .htaccess file to block unwanted robots from scraping your website by:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Siphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^Link[Ww]alker [OR]
RewriteRule ^.* - [F]
</IfModule mod_rewrite.c>

The above code tells the spiders Siphon and LinkWalker that they are not allowed on our website by returning a 403 Forbidden Error.

There are also good robots, most of them are used for link checking, so redirecting them to the proper areas would be a better solution.

<IfModule mod_rewrite.c>
RewriteCond %{HTTP_USER_AGENT} reciprocalman [OR]
RewriteCond %{HTTP_USER_AGENT} LinksManager.com_bot
RewriteRule ^$ /resources/
</IfModule mod_rewrite.c>

The code above tells the reciprocalman and the LinksManager.com_bot to go directly to the resources directory.

2006 Sep 9

Notpron contains 139 levels: 82 are positive, 45 are negative, and 12 are Greek. Each level may be solved using the clues given either via images or text hints and some times requires you to read the page source code. Level 1 to 82 is free up to negative level 34, beyond that requires a payment. This is the most hardest puzzle i came across. If you have so much free time, then this is for you. Ill try to answer this puzzle in intervals of five, that is if im not busy. And please note that the game password changes, so probably my answers here may not be the ones on the site right now. I would rather recommend that you would solve the puzzle yourself.

SPOILER WARNING! Below are solutions to the actual puzzle.

the puzzle web address is at Not Pr0n, but you will then be redirected to deathball.net website.

Level 1:
Title bar: Welcome
URL: http://deathball.net/notpron/levelone.htm
Clues:
1. Text on the image says: Enter the door!

level1.jpg
Solution: Click on the door

Level 2:
Title bar: something was in his way
URL: http://deathball.net/notpron/not/level2.htm
Clues:
1. a hand icon on top left of the image pointing up
2. when you move your mouse over the door knob, a popup window will appear with the message: The door is closed. Trick it or reach LEVEL 3 in a different way! (address?)
Hints:
1. Try all (except cheating) to get to the next screen, no matter what. It's no point and click thing!

level2.jpg


Solution:
1. Change the number on the url to 3 from 2, making it like this: http://deathball.net/notpron/not/level3.htm
2. Press Enter

Level 3:
Title bar: Turn me ON!
URL: http://www.deathball.net/notpron/false/gototheothersite.htm
Clues:
1. a message occasionally appear on the image saying: stop being so negative!
Hints:
1. Try all to get to the next screen, no matter what. It's no point and click thing! Just don't look for cheats!

level3.jpg


Solution:
1. Change the word on the url "false" to "true" making it like this: http://www.deathball.net/notpron/true/gototheothersite.htm
2. Press Enter

Level 4:
Title bar: Look in the dark...
URL: http://www.deathball.net/notpron/true/gototheothersite.htm
Clues:
1. A messge at the dark side of the table. Its morse code.
2. Login title: LightThisPlace
Hints:
About all passworded riddles:
- No spaces
- No capital letters
- You don't need to register anywhere- You will find the username and password written somewhere in the riddle in a hidden way (very different in every level)- No guessing! You will know when you have the answer. No need to enter random words that you find somewhere.- A slow internet connection can cause a correct password combination to be refused. When you KNOW that you have the right one and it's not working, try it again until it works.
Other:
- don't hesitate to use external programs to solve riddles, some even require it (all you need can be legally downloaded somewhere)
- the only rule is NOT to search for solutions on the web, but google gets you other useful hints if you look for the right things

level4.jpg


Solution:
1. Translate the message using morse code table below:

A.-- B-... C-.-. D-.. E. F..-. G--. H.... I..
J.--- K-.- L.-.. M-- N-. O--- P.--. Q--.- R.-.
S... T- U..- V...- W.-- X-..- Y-.-- Z--.. 0-----
1.---- 2..--- 3...-- 4....- 5..... 6-.... 7--... 8---.. 9----.

Therefore :.
v = ...-
o = ---
d = -..
p = .--.
w = .--
e = .
r = .-.
2. Click on the round image beside the pillow.
3. Use voodoo as the username, power as the password

Level 5:
Title bar: Light your torch...
URL: http://deathball.net/notpron/google/shestheoneforme.htm
Clues:
1. Title of the book on table: BiG BAD VOODOO DADDY
2. Grayed text: eyes like an angel smiles like a devil
3. White text: What is the name of this song again?
4. Login title: live
Hints:
About all passworded riddles:
- no spaces
- no capital letters
- You will never find a password/username written in an obvious way
- You will mostly get username and password both at the same time.- No guessing! You will know when you have the answer. No need to enter random words that you find somewhere.- A slow internet connection can cause a correct password combination to be refused. When you KNOW that you have the right one and it's not working, try it again until it works.


Solution:
1. Search Google using the phrase, use exact match: "eyes like an angel smiles like a devil"
2. The phrase is a line on the song by the artist big bad voodoo daddy
3. The title of the song is Simple Songs
4. Use simple as the username and songs as the password


2006 Sep 8
42.jpg dont-panic.jpg
When you were just a kid, have you ever asked your father why the sky is blue? why the earth is round? etc. We even sent an space shuttle just to look for clues, spent millions on fossil studies. Now that the Internet is here and almost all topic could be seached via google; then, have you tried searching for the ultimate question about the answer to life, the universe and everything ? Try it with google and i hope you'll not be disapointed with the result.

Here's the result to the query: the answer to life, the universe and everything using google. To search on how did google came to the answer, read it at wikipedia, but before that, watch the movie Hitchhiker's Guide to the Galaxy.

2006 Sep 7

Bandwidth is precious, and seeing a bandwidth limit exceeded on your website is just so frustrating. Blocking unwanted referrers from your site may be your best option. If you are using apache as your webserver then you can take advantage of its mod_rewrite module to block unwanted referrers.

You need to modify your .htaccess file to block access to large files such as, images, mpeg, avi, etc. :

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?domain\.com [NC]
RewriteRule .*\.(jpg|gif|avi|wmv|mpg|mpeg)$ http://www.domain.com/nohotlink.jpg [R,NC,L]
</ifModule>

2006 Sep 6
firefox-startup-circle.jpg


I assume you have already seen this small icon in firefox startup page. It lets you invite another friend to download Firefox. When Firefox 2 is released, both of your names will be posted on the Firefox Wall. Your friend should download firefox on or before September 15, 2006 to be included in the list. In any case, you wish to remove your name on the list, just visit world of firefox day website and click on the remove your name link.


2006 Sep 5

It's been a long time since I last played table tennis, to be specific, eleven years. That was after I graduated from high school. Back then, I was a varsity player of our school. I started in this playing when I was still 14 years old.I became interested because it is played indoors, and it will not darken my skin color.

So, I asked my friend, Annabelle, on how to play table tennis. Then taught me how to hold the racket, how to control my movements and etc... She brought me to their place in Carmen, Cagayan de Oro everyday for that special training and later on I was introduced to many good players of this event. When they found out how interested I am to know, each one of them taught me with the different strokes namely: the backhand, forehand, spin, chop, drive etc. Then I learned!

I was taught about the rules of this game by our school coach. I reserved a special place in my brain in which I can't forget everything I learned about table tennis.

I was surprised when I watched the game during my alma matter intramurals days ago. The scoring system and the service system has changed. What i had learned is that a player should have a score of 21 in order to win or at least more than 2 scores than the other player and each player is entitled to have five services before the service will change. Here are the new rules of table tennis.

2006 Sep 4

So says Jamie Lee Curtis, according to this celebrity plastic surgery Blog, Jamie's no longer doing any changes whatsoever on her body. She's comfy as she is.

I go with Jamie, she's beautiful without plastic surgery. Besides, anybody who overdoes it might end up looking like Michael J.

2006 Sep 4
hotchick.jpg


Just couldn't help sharing this. I'm a fan of exotic cars and dropping by this site: http://www.ssip.net/ just hits my sweet spot. I suggest you go to the convertibles section, the pictures are simply amazing.


2006 Sep 4

For those of you who are looking for qualified Plastic Surgeons, this site is a very excellent guide: http://www.plastic-surgeon-directory.com/. Site features surgeons with different cosmetic surgery expertise for each area. Why don't you drop by and check it out.

2006 Sep 4

I came across this myspace profile and I'm not sure if the guy's familiar or what but I took notice of his hair. It loooks very grunge. Looks rough but not too dirty either. Hmmm, what should I call his cut, Neil Crespi Myspace? Nah, I think grunge will do.

2006 Sep 4

Hey, I found a good New York hair transplant guide at this site: http://www.foundhair.com. For those nearby who are considering having a transplant, this might be for you.

2006 Sep 4

I got this from a mail, although most of them are stupid questions, i had a great time reading them all.

  • Are you telling the truth when you lie in bed?
  • Can a blind person feel blue?
  • Can fat people go skinny-dipping?
  • Can vegetarians eat animal crackers?
  • Despite the cost of living, why does it remain so popular?
  • Do tea makers have coffee breaks?
  • Do you find it unnerving that what doctors do is called 'practice'?
  • Do you need a silencer when you shoot a mime?
  • Doesn't expecting the unexpected make the unexpected expected?
  • How can a house burn up when it burns down?
  • How can batteries die?
  • How do you know when a Smurf suffocates?
  • How does skating on thin ice get you into hot water?
  • How is it one careless match can start a forest fire, but it takes a whole box to start a campfire?
  • If a guy walks up to you and tells you every thing he tells you is a lie... is he telling the truth or is he lying?
  • If a turtle doesn't have a shell is it homeless or naked?
  • If a word in a dictionary is misspelled, how would you know?
  • If Barbie is so popular, why do you need to buy her friends?
  • If it's zero degrees tonight, and tomorrow it's meant to be twice as cold, how cold would it be?
  • If nothing sticks to Teflon, (the stuff that's on non- stick pans) then how do they get the Teflon to stick to the pan?
  • If physics can predict lottery numbers, why are they still working?
  • If pizza is round, why is the box square?
  • If the #2 pencils the most popular, why is it still #2?
  • If the homosapiens are indeed homos', is that the reason why they became extinct?
  • If there's Life after Death, what's the point in living?
  • If vegetable oil is made of vegetables, what's baby oil made of?
  • If work is so terrific how come they have to pay you to do it?
  • If you run backwards will you gain weight?
  • If you spin an oriental man around does he become disoriented?
  • If you try to fail and succeed, what have you done?
  • If your vacuum cleaner really sucks, is it a bad thing?
  • In Chinese why are the words for crisis and opportunity the same?
  • Is it possible to have a civil-war?
  • Should crematoriums give discounts for those who died in fires?
  • What happens when you get scared half-to-death twice?
  • What's the speed of dark?
  • When cheese gets its picture taken what does it say?
  • Whose cruel idea was it to put a 'S' in 'lisp'?
  • Why are a wise-man and a wise-guy opposites?
  • Why are buildings called buildings when there finished? Shouldn't they be called builds?
  • Why are they called non-stick pans? Is there a law saying you're not allowed to put sticks in them?
  • Why are they called stands when there made for sitting?
  • Why did kamikaze pilots wear helmets?
  • Why do doctors sterilize a lethal injection?
  • Why do they announce power shortages on TV?
  • Why do they call things you send by ship "cargo" and things you send by cars "shipments"?
  • Why do they sterilize needles for lethal injections?
  • Why do we drive on parkways and park in driveways?
  • Why do you press harder on the remote-control when you know the battery is dead?
  • Why is abbreviated such a long word?
  • Why is it called a "Drive through" when you are going around the building?
  • Why is it that when you tell a man there are 400 billion stars he will believe you, but when you tell him there's wet paint he has to touch it?
  • Why is the alphabet in that order?
  • Why is the time when the traffic is slowest called rush-hour?
  • Would a fly without wings be called a walk?
2006 Sep 3

If anyone of you tried the arithmetrick problem you'd be surprised to know that both add up to the same - 1,038,676,269.

About this Archive

This page is an archive of entries from September 2006 listed from newest to oldest.

August 2006 is the previous archive.

October 2006 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Recent Activity

Today

  • tildemark tweeted, "im so sleepy. Zzzzzzzz"

Sunday

  • tildemark tweeted, "some of my scipts are not working with godaddy. but works fine on the others. not mention their poorly coded admin page"

Thursday

  • tildemark tweeted, "so many pending tasks i need to finish. need more coffee !!!"
  • tildemark tweeted, "@gmtristan i dont think that is true."

Thursday

  • tildemark tweeted, "how does godaddy subdomain behaves? i have some problems with it on my scripts. it does not seem to accept query strings.."

Monday

  • tildemark tweeted, "i had a hard time removing the error messages generated by surf side kick. i ended up uninstalling most of my applications."

Sunday

  • tildemark tweeted, "i got hit by surf side kick and im getting numerous error messages on my screen. tskkkkk"

Saturday

  • tildemark tweeted, "check boxes, i didn't know they can also be complex"
  • tildemark tweeted, "this smart bro internet speed is depressing, i thinking of filling a complaint to the DTI next week."

Today

  • tildemark tweeted, "the seminar turned out to be leadership training. it was fun, learned alot. i have already attended numerous seminars but this is different."