Monday, August 13, 2007

Google starts to sell additional space for Gmail users


Google now offers a way to purchase more storage space to use with some Google services (currently Gmail and Picasa Web Albums). This extra storage acts as overflow when you run out of free storage space in either service. If you've filled your free storage (2.8 GB and counting for Gmail or 1 GB for Picasa Web Albums), you'll automatically use your purchased space to store more pictures and messages up to your new storage limit.

Your shared storage space will be used by whatever service needs it. Picasa's free storage is for photos only, and Gmail's is just for Gmail messages, but the shared storage can be all photos, all messages or a mix of both. You can't set aside shared storage space for one service - it will be used by any service that's over its free storage quota on a first-come, first-served basis.

To purchase more storage, visit https://www.google.com/accounts/PurchaseStorage.

To see how much storage you're using, visit https://www.google.com/accounts/ManageStorage.

Sunday, August 12, 2007

How to paste good formatted php source code on blogger?

Several days ago, I just wanted to paste some php codes on this blog. But the codes I pasted was ugly. Then I decided to write something to format the looking. It is finished today.

The formatted codes:

<?php

//creates a unique id with the 'about' prefix
$a uniqid(about);
echo 
$a;
echo 
"<br>";

//creates a longer unique id with the 'about' prefix
$b uniqid (abouttrue);
echo 
$b;
echo 
"<br>";

//creates a unique ID with a random number as a prefix - more secure than a static prefix 
$c uniqid (rand(), true);
echo 
$c;
echo 
"<br>";

//this md5 encrypts the username from above, so its ready to be stored in your database
$md5c md5($c);
echo 
$md5c;
echo 
"<br>";

?>


Two steps to paste your nice looking php code on your blog.

1. Visit http://phpgoogle.awardspace.com.

2. Submit your code.

3. Copy and paste the HTML source code to your blog.

Yeah, it's very easy.

And the mechanism is very easy too. I just use PHP's Built-in Source Highlighter - highlight_string(). You can read more about it on clicking the link.

I make the online demo to make the thing easy and convenient. Hope it will be useful for you.

Saturday, August 04, 2007

Four ways to generate unique id by PHP

1. Using uniqid() function

<?php

//creates a unique id with the 'about' prefix
$a uniqid(about);
echo 
$a;
echo 
"<br>";

//creates a longer unique id with the 'about' prefix
$b uniqid (abouttrue);
echo 
$b;
echo 
"<br>";

//creates a unique ID with a random number as a prefix - more secure than a static prefix 
$c uniqid (rand(), true);
echo 
$c;
echo 
"<br>";

//this md5 encrypts the username from above, so its ready to be stored in your database
$md5c md5($c);
echo 
$md5c;
echo 
"<br>";

?>

2. Using current time + IP style

<?php

//You can also use $stamp = strtotime ("now"); But I think date("Ymdhis") is easier to understand.
$stamp date("Ymdhis");
$ip $_SERVER['REMOTE_ADDR'];
$orderid "$stamp-$ip";
$orderid str_replace(".""""$orderid");
echo(
$orderid);
echo 
"<br>";

?>

3. Generate custom length unique id

<?php

//set the random id length 
$random_id_length 10

//generate a random id encrypt it and store it in $rnd_id 
$rnd_id crypt(uniqid(rand(),1)); 

//to remove any slashes that might have come 
$rnd_id strip_tags(stripslashes($rnd_id)); 

//Removing any . or / and reversing the string 
$rnd_id str_replace(".","",$rnd_id); 
$rnd_id strrev(str_replace("/","",$rnd_id)); 

//finally I take the first 10 characters from the $rnd_id 
$rnd_id substr($rnd_id,0,$random_id_length); 

echo 
"Random Id: $rnd_id" ;
echo 
"<br>";

?>

4. Generate XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX style unique id, (8 letters)-(4 letters)-(4 letters)-(4 letters)-(12 letters)

<?php

// Generate Guid 
function NewGuid() { 
    
$s strtoupper(md5(uniqid(rand(),true))); 
    
$guidText 
        
substr($s,0,8) . '-' 
        
substr($s,8,4) . '-' 
        
substr($s,12,4). '-' 
        
substr($s,16,4). '-' 
        
substr($s,20); 
    return 
$guidText;
}
// End Generate Guid 

$Guid NewGuid();
echo 
$Guid;
echo 
"<br>";

?>

Friday, August 03, 2007

reach out to sb...

reach out to sb (mainly US) = to try to communicate with a person or a group of people, usually in order to help or involve them eg The new mayor is reaching out to the local community to involve them in his plans for the city.

Wednesday, August 01, 2007

Do you need a beautiful email icon?


While I am surfing on the web today, I found a site can easily generate Email icon according to your Email service provider. Very funny...
They accept almost every commonly used email service provider. What make me astonished is that QQ.com is listed. It's an IM that very commonly used in China. Almost everyone that surfs the web has a QQ number.
You can have your own email icon put on your blogs or your own websites.
Have fun...