Archive for October 14th, 2009

The life of a programmer

October 14th, 2009

A pro­gram­mer was cross­ing a road one day when a frog called out to him and said, “If you kiss me, I’ll turn into a beau­ti­ful princess.” He bent over, picked up the frog and put it in his pocket. The frog spoke up again and said, “If you kiss me and turn me back into a beau­ti­ful princess, I will stay with you for one week.”

The pro­gram­mer took the frog out of his pocket, smiled at it and returned it to the pocket. The frog then cried out, “If you kiss me and turn me back into a princess, I’ll stay with you and do any­thing you want.” Again the pro­gram­mer took the frog out, smiled at it and put it back into his pocket.

Finally, the frog asked, “What is the mat­ter? I’ve told you I’m a beau­ti­ful princess that I’ll stay with you for a week and do any­thing you want. Why won’t you kiss me?” The pro­gram­mer said, “Look, I’m a pro­gram­mer. I don’t have time for a girl­friend — but a talk­ing frog, now that’s cool.”

Applause For Fin­land: First Coun­try To Make Broad­band Access A Legal Right

October 14th, 2009

Kudos to the Finnish gov­ern­ment, which has just intro­duced laws guar­an­tee­ing broad­band access to every per­son liv­ing in Fin­land (5.5 mil­lion peo­ple, give or take).

This is report­edly a first worldwide.

Start­ing July 2010, every per­son in Fin­land will have the right to a one-megabit broad­band con­nec­tion as an inter­me­di­ate step, says the Min­istry of Trans­port and Com­mu­ni­ca­tions. By the end of 2015, the legal right will be extended to an impres­sive 100 Mb broad­band con­nec­tion for everyone.

Accord­ing to Wikipedia, approx­i­mately 79 per­cent of the Finnish pop­u­la­tion use the Inter­net. Fin­land had around 1.52 mil­lion broad­band Inter­net con­nec­tions by the end of June 2007 or around 287 per 1,000 inhabitants.

Full story at: http://www.techcrunch.com/

PHP smtp authen­ti­ca­tion mail script using the PEAR Mail package

October 14th, 2009
require_once "Mail.php";

$from = "Sandra Sender ";
$to = "Ramona Recipient ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";

$headers = array ('From' => $from,
  'To' => $to,
  'Subject' => $subject);
$smtp = Mail::factory('smtp',
  array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
  echo("

" . $mail->getMessage() . "

");
 } else {
  echo("

Message successfully sent!

");
 }