Programming in almost language

This is the site where you may share your knowledge and experience to eachother..

  • Categories

  • LinkedIn

  • Tweet Me

  • My footsteps

django-debug-toolbar

Posted by Praveen Kumar on August 9, 2010

you need to do 3 things to get the django-debug-toolbar working:

1. add debug_toolbar.middleware.DebugToolbarMiddleware to you MIDDLEWARE_CLASSES list (after any other middleware that encodes response content, so last is good),

2. add debug_toolbar to your INSTALLED_APPS list,

3. specify the ip address(es) of machine(s) you want to see the toolbar using INTERNAL_IPS, eg INTERNAL_IPS = (‘192.x.x.x’)

Advertisements

Posted in django-debug-toolbar | Tagged: | Leave a Comment »

Search a word or phrase in file(s) in Windows

Posted by Praveen Kumar on December 31, 2009

ack is a tool like grep (command for Unix ), designed for programmers with large trees of heterogeneous source code.

ack is written purely in Perl, and takes advantage of the power of Perl’s regular expressions.

To install the ack

Step 1 – click on http://betterthangrep.com/ack-standalone

Step 2- Copy whole content and save the file lets say ack-standalone.pl

Step3 – we need to run this file with perl. If perl is not install on your system

Stpe -4 Install Strawberry-perl

http://damienlearnsperl.blogspot.com/2009/01/install-strawberry-perl-your-windows.html

Step -5 After installing perl compile your ack-standalone.pl with perl

perl c:\Bin\ack-standalone.pl %1 %2 %3 %4 %5

which will create command script in same directory

Step -6 Set the environment path of that command script

Now you are ready to find a word or phrase

C:\> ack —python class or you may use

C:\>ack classpython

class is the word which you are searching in all python file(s) in that directory.

see the File types that ack understands

if your file type is different you may set the type. lets say we want to find a word from kid template file.

create a file with name .ackrc and save it with ackrc extension and type

–type-set=kid=.kid

Now you may find your word/phrase by using

C:\>ack html –kid

Reference sites

http://betterthangrep.com/

http://strawberryperl.com/

Posted in Did U know | Tagged: | Leave a Comment »