Lets Rejoice in the Beautiful Game

by Noman Muhammad

The greatest show on earth (FIFA World Cup 2010) is knocking at the door. Yesterday I hear the theme song for this world cup though it was announced may be on the November' 09. Hearing the song I just feel the emotion of supporting my team again. Lyrics of that song is simply awesome. Here is the lyrics:

---------------------------------------------
Ooooooh Wooooooh

Give me freedom, give me fire, give me reason, take me higher
See the champions, take the field now, you define us, make us feel proud
In the streets are, exaliftin , as we lose our inhabition,
Celebration its around us, every nation, all around us

Singin forever young, singin songs underneath that sun
Lets rejoice in the beautiful game.
And together at the end of the day.

WE ALL SAY

When I get older I will be stronger
They'll call me freedom Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes back

When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes

Oooooooooooooh woooooooooohh hohoho

Give you freedom, give you fire, give you reason, take you higher
See the champions, take the field now, you define us, make us feel proud
In the streets are, exaliftin, every loser in ambition,
Celebration, its around us, every nations, all around us

Singin forever young, singin songs underneath that sun
Lets rejoice in the beautiful game.
And together at the end of the day.

WE ALL SAY

When I get older, I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes back

When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes

Wooooooooo Ohohohoooooooo ! OOOoooooh Wooooooooo

WE ALL SAY !
When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes back

When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes

Wooo hooooo hohohohoooooo

And everybody will be singinit
Wooooooooo ohohohoooooo
And we are all singinit

---------------------------------------------

The song is really inspirational. I don't know whether it enriches the spirit of the players but it really inspires supporters to support their team. So, best wishes to my favorite team Argentina :)

Hope to see smiling Messi with the cup @ 11 July' 10.

Import Blog Post as Notes in Facebook

by Noman Muhammad

First click on the "Account" button. Now Select "Application Settings".




















Then from the page click on 'Profile' next to the 'Notes'



After the page opens, click on 'Go to Application'



When the page opens, click on 'Import a blog'



Then on the Web URL text box type your blog address and the press 'Start Importing' ...



After importing confirm it. All the blog posts will be saved as notes.

!!! Enjoy :)

Two Articles that Inspire Me to Live more Meaningfully

by Noman Muhammad

I sometimes characterize me as an Escapist. But sometimes try to be responsible in some issues. For that I often read many articles on life. I find two articles that visualize life more meaningful then I thought. Basically one of the two articles is a speech delivered by Steve Jobs, CEO of Apple computer and another is a blog post by Stephen Downes.
The speech by Steve Jobs, CEO of Apple computer was delivered at Stanford University. I got this text from this link. The title says "You have got to find what you love, Jobs says". This attracts me very much and I read the text very quickly. It was simply amazing story. I was very much inspired by this

... you can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something ...
.
This is quite inhaling to love work more meaningfully.

I get the second article here. Its a large post and I read the whole post within a short time. But it really create impacts on my mind for long. Some lines of this post is really matter of deep thinking
What is worth doing? That is up to you to decide. I have chosen to dedicate my life to helping people obtain an education. Others seek to cure diseases, to explore space, to worship God, to raise a family, to design cars, or to attain enlightenment. If you don't decide what is worth doing, someone will decide for you, and at some point in your life you will realize that you haven't done what is worth doing at all. So spend some time, today, thinking about what is worth doing. You can change your mind tomorrow. But begin, at least, to guide yourself somewhere.


I really love the sentence from the Steve Jobs' speech "Stay Hungry, Stay Foolish"

Dynamically detect Language and add CSS accordingly

by Noman Muhammad

In blog sites the blog owner allows visitors to comment on his blog post. If the site is local or regional like Somewherein, Amar Blog some visitors have tendency to put comment in their native language, on the other hand some visitors always put comments in english. There is a small problem when displaying the comments on the site. If the blog owner has a class for the div where all the comments will be displayed and define font-family for english language then bangla comments will be very difficult to see and vice-versa. So if we can dynamically detect the language of each comments and define separate classes for different language we can show the comments in appropriate way. Google Code provides an API to detect the language of content. We can use this for our purpose. Here i'll show a simple implementation to assign different DIV class for different Languages.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://www.google.com/jsapi?key=API_KEY"></script>
<script type="text/javascript">

google.load("language", "1");

function initialize() {
var text = document.getElementById("text").innerHTML;

// Detect the language of the text.
google.language.detect(text, function(result) {
var detected = document.getElementById("detected");
// If there wasn't an error in the request
if (!result.error) {
var langCode = result.language;
var langName;

// Loop through the languages enum so that we can find the actual name of the language.
// Learn about the languages enum here:
// http://code.google.com/apis/ajaxlanguage/documentation/reference.html#LangNameArray
for (var i in google.language.Languages) {
var thisLangCode = google.language.Languages[i];
if (thisLangCode == langCode) {
// If we find the language code, store the language name.
langName = i;
break;
}
}

// Se the detected language.
if(langName == "BENGALI")
{
document.getElementById("text").setAttribute("class", "bn");
}
else
{
document.getElementById("text").setAttribute("class", "en");
}
}
});
}
google.setOnLoadCallback(initialize);

</script>
</head>
<body>
<div id="content">
<div id="text">share-facts.blogspot.com</div>
<div id="detected"/>
</div>
</body>
</html>


Here content of the DIV with id="text" will be examined then the class of that DIV will added accordingly.

Note: on line 5 API_KEY will be replaced by a valid API key.

Simple cURL example using PHP

by Noman Muhammad

cURL library allows us to connect to different servers using a variety of protocols. This is used for transferring files with URL syntax. In most of the cases we use cURL to display a specific portion of another site in our site. By using cURL at first we retrieve the contents of the site that we targeted and then parse the retrieved contents to show the specific portion using preg_match(). Here I'll show a simple example to retrieve and show the stock market price in my site from Yahoo!. At first I have to open Yahoo! in my browser. Then view the source of the page and identify that the stock market price is shown in between <dl class="markets clearfix strong small"> and </dl>. So this is my targeted portion. I'll use this tag to excerpt my targeted portion from the total contents. Full code is as follows:


<html>
<head>
<title>cURL Example</title>
</head>
<body>
<div style="margin-left:30px">
<?php
//URL of targeted site
$url = "http://m.www.yahoo.com/";
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// grab URL and pass it to the browser

$output = curl_exec($ch);

//Regular expression to excerpt the targeted portion
preg_match('/<dl class="markets clearfix strong small">(.*)<\/dl>/is', $output, $matches);
echo $matches[0];

// close curl resource, and free up system resources
curl_close($ch);
?>
</div>
</body>
</html>


Very simple, isn't it? Now by using our own css we can show the data in our own way.

Fixing Transparent Image in IE6

by Noman Muhammad

IE6 doesn't support transparent image. There are many ways to use transparent image in IE6. Here is a way that I use to show the transparent image in IE6 using CSS. CSS part for it is as bellows.


#header
{
background:url(logo.png) no-repeat;
height:109px;
width:507px;
}

*html #header
{
background-image:none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="logo.png");
}


this "*html #header" part is only for IE6 i.e only IE6 will recognize this portion. One drawback of using this is we have to use absolute url to the image (i.e if logo.png is in the images folder(not in the css folder) of the site we have to write absolute url to that image. like: http://www.mysitename.com/images/logo.png).
Another drawback is links (i.e <a></a>) somwtimes become unclickable and forms become unfocusable. To get rid of it we have use postion:relative for a tag. i.e

a
{
postion:relative;
}

Bangla Typing using Google Transliteration

by Noman Muhammad

We can use Google Transliteration to type in Bengali on any web-site. It converts English characters to the characters used in Bengali. It offers us to type Bengali words phonetically in English script and then have them appear in Bengali. Its not translation, it does not change meaning rather it simply converts the sound of the word from English alphabet to Bengali alphabet. For example, typing "Bangladesh" transliterates into Bengali as বাংলাদেশ.
Its a small piece of code that stores on our browser(s). Visit this link to know how to enable this option to the various browsers.