Posts

Simplest way to remove trailing zeros of decimal numbers

This is a simple method I found to remove or strip trailing zeros of a decimal number. The function accepts the decimal number and return the trimmed value back. It removes all the redundant zeros in the number after the decimal point and if no number othe …

Print Array in PHP

There are various methods and commands used in PHP to print an array of elements. They are different in the way they print the array elements. I will cover three main ones I usually use. Lets assume an array as follows to explain the various types of print …

Check if a table exists in MySQL from PHP

Sometimes its necessary to execute a query or execute some code if a table exists or not. So a bit of searching got me to the conclusion that mysql doesn’t have a direct query or method for it from php. So there are two methods to do it. Use the mysql c …

Fix link issue in Twitter client of Fusion theme

When I tried out the Twitter client in fusion theme I noticed that the urls are wrong in that client. The URL in my client were like http://blog.sriunplugged.com/”http://search.twitter.com/search?q=%23Home” . So after a bit of digging into I found that the …

Important MySQL DBA Interview Questions

Here are a few sets of interview questions expected for MySQL DBA position.These are compilation of the usual questions from various DBA texts: What is Log Switch? – The point at which ORACLE ends writing to one online redo log file and begins writing to …

Find Invisible Users In Gmail

Finding who is invisible is something that I always wanted to do.It’s always fun to ping a person who feels none can see him/her online. While studying XMPP protocol I found out that even when the person is offline the chat client knows that person is onli …

Auto Backup using Dropbox in Linux/Mac

I had some folders on my disk which I wanted to keep a copy online as a backup and for viewing from other places. Its not always possible to save all the essentials in the drop box folder itself to be auto backed up. Thus I wrote a very small script which  …

Installing Django on Dreamhost

Installing Django in Dreamhost and getting it to run wasn’t straight forward at-least to me. There was lot of issues such as python bin directory not accessible as its shared and so. So the initial step in this to setup python yourself so that you can use …

Download PHD Comics,XKCD and DogHouseDiaries for Offline Viewing (E-book Reader)

If you are like me who wants to read comics on kindle then this is the script for you. You can download all the comics to read it in a kindle. So here is how you do you do it. Download all the comics into 3 different folder s for each comic set by running …