Is Twitter a Waste of Time?

Twitter! What is it?

Internet world has one thumb rule these days, If you don't know any thing then there is only one god GOOGLE, so just ask Google. People ask almost everything to Google :). Believe it see the following example.

Take a look at this funny image, I took this screenshot on Google search page with keyword Twitter is a
If you look at the first suggestion it says "Twitter is a waste of time". that's so funny. It means people use to search this phrase so many times that Google suggest is giving importance to this keyword more than other keywords. :)



 Lots of friends of mine are not actually using twitter but everyone of them says twitter is just a waste of time. What I think is they just don't know how to use it. Twitter is a invention of micro blogging, and its just cool tool , use it in a right way.


CSS1 vs CSS2 & SEO

This post will help you to understand the primary features in CSS2 which are not there in CSS1 and how CSS2 techniques are going to help you in SEO. CSS1 is published in 1996 and CSS2 is published in year 1998. All major browsers supports practically 99.9% of CSS2. I was googlin for the difference between CSS1 and CSS2 and landed on a very good website and found really dam important information about new tags introduced in CSS2. You can check all of them on this website > http://xahlee.org/js/css2.html.

Google bot and other search engines does consider uncompressed HTML size of your webpage, so even if we are using gzip compression techniques, we have to think about the uncompressed HTML size. One of my website's home page is of size 59.23 kb. The which I used to test my site have suggested CSS2 based layout and its new techniques which really helps a lot to reduce your page size. I am working on some of the new tags implementations which will help me to reduce the size of CSS file as well as my HTML page size.

There are few more CSS techniques which helps us to increase the speed of our website. One of the very popular technique is "CSS Sprites". CSS Sprites is basically a technique which combines all small images on your web page in to one big image. In this case we have to just load a single image instead of loading lots of small images separately, this saves a lot of browsers time to make n no of http requests to server so increases speed of your website.

php best practices 1 - Handle unexpected conditions

Are you handling all the possible conditions under which your programs will run?

For instance, do you always have a "default" case in you "switch" statements?

switch($some_value)
{
case 1:
$another_value = 1;
break;
case 2:
$another_value = 4;
break;
}
return(1 / $another_value);

What if $some_value is not 1 nor 2?

Notice: Undefined variable: another_value

Warning: Division by zero

What about "if" conditions? Do you have an "else" code section to all important "if" statements?

If your program is not expecting certain conditions but those conditions are not impossible to occur, having simple calls to error_log may help you to be aware of the problems under unexpected situations.

switch($some_value)
{
case 1:
$another_value = 1;
break;
case 2:
$another_value = 4;
break;
default:
error_log('unexpected some_value '.$some_value.' found ');
exit;
}

php framework comparison - performance comparisons

I am writing this post regarding PHP framework performance comparisons. There are lots of PHP frameworks available and every framework has its own advantages and disadvantages. As all frameworks are based on MVC and thus adopting any of them for product development is not that difficult. Normally developers check for no of libraries load time and some important features like ORM. Also you can check that which framework supports which php version.

Here is a simple chart which programmers can use while choosing the suitable framework for their projects.



phpframeworks[.]com also have explained this thing in detail. You can check that also.

Jquery plugin to read query string - how to

If you are looking for some jQuery plugin to read the query string parameters then you are on right page. Here is a simple function which will help you to understand how to detect/read the values of query string parameters.

Jquery Plugin

$.queryParam = function(name){

var answer = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);

if (!answer)
{
return 0;
}
return answer[1] || 0;
}


How to use
var paramValue = $.queryParam('paramName');

get X days back date from current date

How to get 7(X) days back date from current date?

PHP is very strong server side programming language which simplifies lots of small small tasks like converting date formats etc.

I was working on some task, where I was suppose to get 7 days back date from current date. Actually the task is very simple, I am sharing the code here. Have a look at it and let me know if any one can find better way than this.


$format = 'YmdhIS'; // YOU CAN USE ANY FORMAT WHICH YOU WANT

$date = date ( $format );

// - 7 days from today
$prevDate = date ( $format, strtotime ( '-7 day' . $date ) );

Note: If you want to get yesterdays date then simply do -1 instead of -7.

How to get 7(X) months back month from current month?

// - 7 months from today
$prevDate = date ( $format, strtotime ( '-7 month' . $date ) );

Its so simple.

Problems in enum data type mysql

MySQL ENUM data type looks like a Hot SPOT among all developers n database designers. We all know about ENUM data type, but do we really know disadvantages or lets say problems of using ENUM data type while designing tables.

I was wondering what could be the reason that most of geeks don't want to use this data type, I just googled out some info about it and came across some very serious issues, so sharing on my blog.


1. Changing the member list of ENUM columns is very expensive.

    If your table has more than millions records and you are trying to change any thing in the column which has data type ENUM, then mysql rebuild complete table and look in to every row in that table. This may take lots of time may be hours and thus downtime.  So lets create equation

Server Downtime = MySQL table with ENUM data type + millions of records. Lol.

2. ENUM has limited portability with other databases.
    ENUM is not a standard SQL and lots of other databases doesn't have native support for ENUM.


Well there are lots of more issues with ENUM data type, I would like to share some links which may help you to take decision while using ENUM in your database. Check these links for sure , great information shared on it.

Link 1
Link 2

Share this post with your friends