Tag Archives: free

jQuery Mix Photo Gallery

Recently I coded an interesting photo gallery using jQuery. I’ve named it “jQuery Mix Photo Gallery”. I’ve included the screen-shots here.

You may have a look at the live demo here. The photo gallery is free to download. Here is the download link. You may modify it according to your need and use it in your commercial projects. Please drop a comment if you like it and suggest me how can I make it much better.

Valid XHTML flash embed code

You’ll be disheartened for the first time when you attempt to validate your flash embedded html page on W3C. Here is the basic structure for valid swf embed code:

<object type="application/x-shockwave-flash" data="movie.swf" width="250" height="25">
	<param name="movie" value="movie.swf" />
</object>

It’s often a big pain after embedding YouTube (or any other) videos, cos your page will no longer be W3 valid! There are many free online tools to convert youtube embed code to valid xhtml format. You may try this one from tools4noobs. It works great.

Symbian has switched to Open-source version of Software

Symbian software is used on more than 330 million phones around the world. It powers the most smart phones in the world. It is facing new competition in the smart phone arena from Apple Inc.’s iPhone and Google Inc.’s Android system. Between these Android is freely available for anyone to use. Now, the Symbian Foundation planned to release, a large part of the software for free.

This open-source version of the software is known as Symbian 3, and supersedes Series 60. It has now completed the largest-ever conversion of proprietary software to “open source,” which means the source code, or blueprint for the software, is available to anyone.

Symbian foundation was set up in 2008 after Nokia Corp. Nokia decided to give the software away to make it more popular with other manufacturers, a move not uncommon in the technology world.

Analysts say Symbian, which has more than 10 years of development behind it, is starting to look outdated and has lagged in supporting must-have new features like touch screens. This version of software deletes incorrect reference to Series 40, which is still owned by Nokia.

New Phonetic keyboard in Gmail

Gmail is continuously surprising us with its out of the box features, enormous flexible options and outstanding super-simple user interface. Everyday so many users being fade up with yahoo are going towards gmail. Like Yahoo, Gmail also show ads but they are never that annoying as they’re just simple text ads, no funky flash or image ads, no forcing for being a paid subscriber (Gmail don’t have any paid subscription, it’s totally free! :P). All these simplicities are the main attraction of Gmail which are driving Yahoo users towards it. The recent update in Gmail themes is “Random Themes” option. It’s really boring when you have to read and reply hundreds of emails a day. The “random” gmail theme automatically rotates the eye-catching collection of themes after every 1-2h which makes “gmailing” fun! “Random theme” is my personal favorite.
The free Xoopit plugin added an extra gear to Gmail which is no more as Yahoo bought the service. Here we can feel the acute cold war between Gmail & Yahoo evidently. Yesterday I tried Google Wave and it certainly will re-shape the concept of classical email system.

Gmail Phonetic KeyboardTyping in Gmail's Phonetic Keyboard

This morning I was typing an email on gmail and found a new symbol on top left of the compose box editing panel (Rich formatting mode). I clicked it and saw a drop-down menu with 12 languages options including Bengali, Hindi, Arabic and so on. OMG! it’s phonetic keyboard! I tried some text with it, simply awesome!! I hope gmail will keep going on with its passion for the “ease of use”. Bravo! love you Gmail.

IE6 fix for select box over absolute positioned element

IE6 sux. General css/javascript hover drop-down menu uses a div or ul with position:absolute. No matter how much you increase the value of z-index the select box (windowed element) will always remain on top most – yes only on a special browser, Internet Explorer 6. The reason is IE6 considers select element as windowed element and keeps it always on top layer.

IE6 select box over div

Solution is using iframe on top of select element, as iframe is also a windowed element placing it on top of select box fix the problem.

IE6 select box over div prob fixed using iframe

Here is the typical HTML code for this drop-down menu:

<div class="top-menus" style="left: 221px; top: 127px;">
<iframe frameborder="0" scrolling="no" align="bottom" marginheight="0" marginwidth="0" src="javascript:'';" style="height: 200px;"></iframe>
    <ul>
      <li><a href="#">Bracelets</a></li>
      <li><a href="#">Rings</a></li>
      <li><a href="#">Earrings</a></li>
      <li><a href="#">Necklaces</a></li>
    </ul>
</div>

The inline css is calculated using jQuery offset() function. FYI, you can easily get the width,height,left,top position of any element using jQuery(“element”).offset(). Make sure the width and height of the iframe is exactly same of it’s overlying UL element. If you apply any border to the UL, you have to consider that during calculating the proper width/height of the iframe.

This is the sample jQuery code:

var timer = null; // global
$("#top-nav a").hover(function(){
	clearTimeout(timer);
	$("#top-nav a:not('.cur')").removeClass("selected");
	$(this).addClass("selected");

	var o = $(this).offset();
	var left = o.left + 1; // 1px extra for border
	var top = o.top + 32; // 32px for placing it just below the horizontal menu
	if($(".top-menus").length){
		if(left == $(".top-menus").offset().left)
			return;
		else $(".top-menus").remove();
	}

	$("body").prepend('<div style="left:'+left+'px;top:'+top+'px;" class="top-menus"><iframe src="javascript:\'\';" marginwidth="0" marginheight="0" align="bottom" scrolling="no" frameborder="0"></iframe><ul>'+html+'</ul></div>');
		$(".top-menus").find(".parent, .child").remove();
		var hi = $(".top-menus").find("ul").height();
		$("iframe").height(hi + 2); // extra 2px for border

}, function(){
	clearTimeout(timer);
	timer = setTimeout(function(){$("body").find("iframe,.top-menus").remove(); $("#top-nav a:not('.cur')").removeClass("selected");},300);
});

$(".top-menus").live("mouseover",function(){
	clearTimeout(timer);
}).live("mouseout",function(){
	clearTimeout(timer);
	timer = setTimeout(function(){$("body").find("iframe,.top-menus").remove(); $("#top-nav a:not('.cur')").removeClass("selected");},300);
});

I know this code won’t exactly fulfill your requirement, you can get the main idea from this and write your own code yourself. You can see it in action on www.trendtogo.com.

Get Google and Alexa rank of a domain using PHP

There are already a lot of ways to find gpr/alexa rank of a domain using php. But not all of them work on 64bit servers. Here is the code that I always use for finding the google page rank and alexa rank of a website.

Get Google Page rank

function google_page_rank($url) { // URL or domain name
    if (strlen(trim($url))>0) {
        $_url = eregi("http://",$url)? $url:"http://".$url;
        $pagerank = trim(GooglePageRank($_url));
        if (empty($pagerank)) $pagerank = 0;
        return (int)($pagerank);
    }
    return 0;
}

function GooglePageRank($url) {
    $fp = fsockopen("toolbarqueries.google.com", 80, $errno, $errstr, 30);
    if (!$fp) {
        echo "$errstr ($errno)<br />\n";
        } else {
        $out = "GET /search?client=navclient-auto&ch=".CheckHash(HashURL($url))."&features=Rank&q=info:".$url."&num=100&filter=0 HTTP/1.1\r\n";
        $out .= "Host: toolbarqueries.google.com\r\n";
        $out .= "User-Agent: Mozilla/4.0 (compatible; GoogleToolbar 2.0.114-big; Windows XP 5.1)\r\n";
        $out .= "Connection: Close\r\n\r\n";
        fwrite($fp, $out);

        while (!feof($fp)) {
            $data = fgets($fp, 128);
            $pos = strpos($data, "Rank_");
        if($pos === false){} else{
                $pagerank = substr($data, $pos + 9);
            }
        }
        fclose($fp);
        return $pagerank;
    }
}

function StrToNum($Str, $Check, $Magic) {
    $Int32Unit = 4294967296; // 2^32
    $length = strlen($Str);
    for ($i = 0; $i < $length; $i++) {
        $Check *= $Magic;
        if ($Check >= $Int32Unit) {
            $Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit));
            $Check = ($Check < -2147483648)? ($Check + $Int32Unit) : $Check;
        }
        $Check += ord($Str{$i});
    }
    return $Check;
}

function HashURL($String) {
    $Check1 = StrToNum($String, 0x1505, 0x21);
    $Check2 = StrToNum($String, 0, 0x1003F);
    $Check1 >>= 2;
    $Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);
    $Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);
    $Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);
    $T1 = (((($Check1 & 0x3C0) < < 4) | ($Check1 & 0x3C)) << 2 ) | ($Check2 & 0xF0F );
    $T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );
    return ($T1 | $T2);
}

function CheckHash($Hashnum) {
    $CheckByte = 0;
    $Flag = 0;
    $HashStr = sprintf('%u', $Hashnum) ;
    $length = strlen($HashStr);
    for ($i = $length - 1; $i >= 0; $i --) {
        $Re = $HashStr{$i};
        if (1 === ($Flag % 2)) {
            $Re += $Re;
            $Re = (int)($Re / 10) + ($Re % 10);
        }
        $CheckByte += $Re;
        $Flag ++;
    }
    $CheckByte %= 10;
    if (0!== $CheckByte) {
        $CheckByte = 10 - $CheckByte;
        if (1 === ($Flag % 2) ) {
            if (1 === ($CheckByte % 2)) {
                $CheckByte += 9;
            }
            $CheckByte >>= 1;
        }
    }
    return '7'.$CheckByte.$HashStr;
}

Find Alexa Rank

function alexaRank($domain){
    $remote_url = 'http://data.alexa.com/data?cli=10&dat=snbamz&url='.trim($domain);
    $search_for = '<POPULARITY URL';
    if ($handle = @fopen($remote_url, "r")) {
        while (!feof($handle)) {
            $part .= fread($handle, 100);
            $pos = strpos($part, $search_for);
            if ($pos === false)
            continue;
            else
            break;
        }
        $part .= fread($handle, 100);
        fclose($handle);
    }
    $str = explode($search_for, $part);
    $str = array_shift(explode('"/>', $str[1]));
    $str = explode('TEXT="', $str);

    return $str[1];
}

Hope this will help you. If you know any better(working) solution please let me know via comments.

Google Voice coming shortly

Google voice
Google is starting a new service “Google Voice” within a few weeks. This amazing new voice service will give the users a single phone number and all the calls to their existing phones will be diverted to this single number. It’ll have voice mail feature and users can access this service using any mobile phone or internet (browser). The voice messages will be converted to text and thus it’ll be easily searchable, free sms service, forward voice mails directly to email addresses, recording incoming calls only and listen / download them later from web and many more. The interface will be similar to gmail.
google voice mail
Google will certainly integrate it with android and it’ll support other platforms too. For details visit voice.google.com

iPorn for iPhone!

iPorn for iPhone Apple has released the new iPhone 3G S. It’s 2x faster and has live streaming video support. This feature of new iPhone is gonna be “utilized” in a different way. iPorn is providing free hard core videos for iPhone users. And the most interesting thing is there is rumor that apple is involved in this for the marketing of iPhone. On iPorn site they say -
Just type “iPorn” in your iPhone browser and you’ll be directed to our iPhone-formatted site. Your mobile phone number is your password
The rumor sounds a little true ;)
The site is optimized and user friendly for iPhone and iPod touch with touch navigation, rotate screen, watch, post & share videos/photos, send private messages to other members even create your own profile page and more…s