Sunday, February 15, 2009
Amazing Catch on the boundry line by Adam Voges
In the Twenty20 International played on 15th February 2009 between Australia and New Zealand, Adam Voges (Aus) pulled of this amazing catch to dismiss Brendan McCullum at a crucial stage of the game.
Sunday, February 1, 2009
Carry on Ponting ...
Tuesday, January 27, 2009
Django documentation search bookmarklet
Here is a simple bookmarklet to search the Django documentation. To use it, simply drag this bookmark - Search Django Docs- to your browser's toolbar.
Click on the bookmark, enter a search term and you will be taken to the Django documentation search page with search results for your search term.
Disclaimer / Terms of Use
Obviously, this is not an official Django Search bookmarklet. I had created it for my own use and sharing it with you. The search bar bookmarklet is totally innocuous, but nevertheless by installing it you agree I am not liable for anything, period, the end.
Inspired by the Prototype API Search bookmarklet from http://prototypejs.org/api.
p=prompt('Search Django Documentation');
if(p) {
p=p.replace(/\./g, '/');
// Location is the search query appended to the Django custom search URL
loc='http://docs.djangoproject.com/en/dev/search/?cx=009763561546736975936:e88ek0eurf4&cof=FORID:11&ie=UTF-8&hl=&sa=Search&q='+p.toLowerCase();
window.open(loc); // Open in new window
};
return false; // Inform the browser that the action of opening a URL, should not evaluate
Tuesday, January 13, 2009
Tuesday, May 6, 2008
Great strip from XKCD
This comic is really good, if you like this sort of thing.
Permanent link to this comic: http://xkcd.com/416/
Wednesday, April 23, 2008
Leap of faith
The woods are lovely,
dark and deep,
Inviting me to take a peek
Keeping faith I take the leap
I break some promises,
satisfaction I reap
Wednesday, April 16, 2008
A script to remove spaces from a file name
I face a lot of problem while dealing with files with spaces in their names on the Unix platform. I wrote a script yesterday to change the spaces in a file name to undescores.
It is very useful for changing the names of all files in a directory along with directory names.
Save the script to your home directory or to /usr/bin or some such directory,
Go to the directory in which you want to effect the name change and run
# find . -depth -exec ~/rename.sh {} \;
This will rename all files in the directory so that the spaces in filenames are changed to underscores.
The script is as follows:
#!/bin/bash
#
# Writen by Mayuresh Phadke (mayuresh at gmail.com)# To change the names of all files in a directory including directory names
# run the command
#
# find . -depth -exec ~/rename.sh {} ;
#
# This command is pretty useful if you have a collection of songs or pictures transferred
# from your windows machine and you are finding it difficult to handle the
# spaces in the filenames on UNIX
#
#set -x
progname=`basename $0`
if [ $# != 1 ]
then
echo "Usage: $progname \"file name with spaces\""
echo
echo "This utility is useful for renaming files with spaces in the filename. Spaces in the filename are replaced with _"
echo "\"file name with spaces\" will be renamed to \"file_name_with_spaces\""
echo
exit 1
fi
old_name=$1
dir=`dirname "$1"`
file=`basename "$1"`
new_file=`echo $file|sed "s/ /_/g"`
new_name=$dir"/"$new_file
if [ "$old_name" != "$new_name" ]
then
mv "$old_name" "$new_name"
fi
exit 0
Please let me know if you find this useful/useless or if you have any other comments about it.