Tuesday, January 4, 2011

Disadvantages of Creating Many Tables in the Same Database

If we have many MyISAM tables in the same database directory, open, close, and create operations are slow. If we execute SELECT statements on many different tables, there is a little overhead when the table cache is full, because for every table that has to be opened, another must be closed. We can reduce this overhead by increasing the number of entries permitted in the table cache.

We can set the table_cache value in the my.cnf file by
set-variable = table_cache=8
Or
If we have the SUPER privilege then, use
set GLOBAL table_cache=8;

since the Variable 'table_cache' is a GLOBAL variable it should be set with SET GLOBAL

Thursday, May 20, 2010

How to add a "Share on Facebook" button to a webpage?

Copy the script for the style you'd like:


Copy and paste the following code blocks into your site and replace '<url>' with the link you want to Share.

Text link:

<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>

Small icon and text:

<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }</style><a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()" target="_blank" class="fb_share_link">Share on Facebook</a>

Icon only:

<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; text-decoration:none; } </style> <a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a>
Sources: http://www.facebook.com/share_partners.php

Tuesday, April 20, 2010

How To Add Or Insert Orkut Post Share Button In Blogs

Orkut allows a share button feature with which website owners can extend the functionality of sharing their content with visitor friends using Orkut. It is not difficult at all to add the share button. Just follow the following guidelines and you are done. Orkut Post Share Button.

Implenting Share Button In any Blog

There will be a header file or any common file in your application and you need to paste the following code

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
      google.load('orkut.share', '1');
      google.setOnLoadCallback(function() {
        var params = {};
        params[google.orkut.share.Field.TITLE] = 'Site title here';
        params[google.orkut.share.Field.DESTINATION_URL] = 'www.scriptscart.com';
        var connection = new google.orkut.share.Connection(params);
        document.getElementById('orkut-share').onclick =
          function(e) { connection.send('orkut.com', {}); };
      }, true);
    </script>


Now save the file and go to any other file or wherever you want to put this button and paste the following code there.

<span id="orkut-share" style="cursor:pointer; border:0px solid black">
<img src="http://3.bp.blogspot.com/_eEuHGVw5WLg/SwpFfy4rMqI/AAAAAAAAAAk/jdm-zBiDdv8/s320/share.gif" alt="Share Orkut" />
</span>

Save the file and you are ready for using the Share Button feature of ORKUT API.