Tips

Best Searchengines for Source Code

Are you wandering for source codes?

Did’nt get this yet?

Try in these search engines below.

We have listed the top searchengines which will provide you the exact code you are searching for.

We have listed the searchengines with respect to the traffic in Alexa.

Google Code Search
Dzone
Koders
O’reilly Code Search
Snipplr
Codase
Bytemycode
Krugle
Code Fetch

Tags: ,

Wednesday, May 13th, 2009 Tips No Comments

Google Favicon

A favicon is a tiny icon that is usually accustomed to imitate the uniqueness of a web site. You can come across it in the address bar, in your browser’s tabs, in the bookmarks list or in some feed readers like Bloglines, dig, furl etc.

Google’s favicon is introduced in 2008. It is an edition of the lowercase “g” from its authorized logo. Google has a new favicon now. The new favicon is a fraction of a bigger set of icons developed for improved scalability on mobile devices.

Google’s favicon is hosted at google.com/favicon.ico.It is a 16×16 pixels image which is a usual size for favicons. . In this, the new icon is the depiction of a multi-colored lowercase “g”, highlighted with the colors of Google namely red, green, blue and yellow.Google swap the upper-case “G” in blue border, green and red borders with a lower-case purple “g” in a rounded corner rectangle.

Tags: ,

Tuesday, January 13th, 2009 Social networking, Tips No Comments

What is the difference between cgi and perl?

Most of the programmers were having confusion with .cgi and .pl.
Since the file with .cgi extension is using the perl code and it is running fine.
But the file with .pl extension which contains the perl code does not run.

Here is the answer for you

File extensions are generally meaningless. Windows preserves a map between programs and the file extensions which should be accustomed to open them. Apache, a web server which performs something similar like windows. CGI is an interface approved upon by rfc 3875 which is mainly used for passing information from web requests to executables. CGI has capable of bypassing data to several types of executable which can recognize it. Your .cgi files are possibly parsed for #! line which is responsible for mapping your exact .cgi file to be executed by Perl. Briefly, file extensions are virtually meaningless.

The extension simply notifies the server about how to handle it. cgi extensions tell it to run the script with whatsoever program is programmed at the top #! line. If the server is not notified to do the same with .pl files in that case it will not know what to do with it.

If you are lying on an apache server, adding up this line to the .htaccess file will make it parse .pl files through CGI
AddHandler cgi-script .pl

Tags:

Saturday, November 8th, 2008 Programming, Tips No Comments

php code optimization tips

Do you know the ways to optimize your php code. Here we have some tips for you.

  • If a method can be static, declare it as static. It will improve the Speed by a factor of 4.
  • You should use echo as it is faster than print.
  • If you have to concat string, Use echo’s multiple parameters.
  • Set the value of how many times it should be iterated before the loop. Do not assign the value in the loop.
  • When a variable is no longer useful, unset those variables which will free memory.
  • Use absolute urls in includes and requires.
  • To get the time of when the script started its execution, you must prefer $_SERVER [‘REQUEST_TIME’] than time ()
  • Str_replace is faster than preg_replace
  • It is much better to utilize switch statements than multi if, else if statements.
  • Every time close your database connections when you got all the datas from DB
  • Always use $row [‘name’] to get data from DB.Because it is 7 times faster than $row [name]
  • Don’t use functions inside of for loop, such as for ($y=1; $y <= main ($arr); $y) the main () function gets called each time.
  • If you declare a global variable and you are not using it in any function will slow down the performance because will check if the global exists or not.
  • Methods should be in derived classes. This will run faster than the method which was defined in the base class.
  • Surrounding your string by single quote (‘) instead of double quotes (“) will be little faster as php looks for variables inside “” but not inside ”.
  • A PHP script will be at least 2-10 times slower than a static HTML page by Apache. So it is better to use lot of static HTML pages with less scripts.
  • You must install a PHP caching product to naturally boost the performance by 25-100% by eliminating compile times. Your PHP scripts will be recompiled each time if the scripts are not cached.
  • Do not use OOP concepts too much because each method and object call consumes a lot of memory.
  • Split methods that has the code you will really re-use too much.Do not split all the functions.

Tags:

Wednesday, October 29th, 2008 Tips No Comments
Request a Free SEO Quote