Friday, March 30, 2012

Directory navigation in command line: Tips and Tricks

 Well it may be absurd for someone who is not so used to with all the command line stuff that one has to undergo, but for the geeks, its the things that keeps using computing enjoyable and something Geekyy!!
  Some people really do not know and may be perhaps do not care for the command line interface commands.
  That's why I have wriiten this piece of information for all those who wanna keep the geeky thing up in themselves
1> To move to the next directory we use
2> To move to long  destination you can also type:
3> To get into a diferent folder at the same root level
     eg: pics and movs at c:\de\film
     and you are at 
      c:\de\film\mov  and you want to navigate to pics
   then type:
4> To move back one step up to the parent folder 
5> To move directly to the root folder
        cd /d drive_letter:\
6> To change drive cd /d drive_letter:\

  Hope it helps!
Adios amigos  

Django: A setup tutorial guide from A-Z

Django is one of the most commonly used frameworks for web development today. It can be used in multi functional large scale database driven web application. Though it was created mainly for the means of rapid development of web application, it has well proven on its account for reliability and scalability. So here I am going to share some of my experience during the set up process which many of us find awkward. Hope this simplified version makes it easy for you all.
                Download Django from the latest and fail not to check out          which version of python it supports)
                Download Python- and this should be the one supported by the version which you     downloaded        
 >Install python in your  machine 
 >Extract the tar file of Django you have downloaded
 >cd to the the folder you extracted and type the following:
    python install
    This will install all the required files in
Now that Django is installed in your system, You can start creating projects.But before   that lets put the in the path environment variable of the system. 
So go to>MyComputer>Properties>Advanced System Settings>Environment

   Then go to down slab for system path and 
            click Path double times. This will pop up edit window and do the following there:
             >add a semi colon(;) and paste the following:
            >to extpath add .PY
 and then hit ok button couple of times and close all the command window  

Project Creation: 
To create a project, create a folder say Djang in C:\ as 
     C:\ startproject project_name

********If it does not work here, checkout the following:*********
>Type regedit in run window
>Goto HKEY_CLASSES_ROOT>py_auto_file>command
   and change the current value to 
Now type ""C:\Python27\python.exe" "%1"%*" instead of the current value
and there you go...
   After that cd to the foldr of your project and 
         python runserver
 Check out the result by typing localhost:8000 in your browser. You should be getting  the same  as given below

Happy Coding!

Tuesday, March 27, 2012

Today,Tomorrow and Forever...

We humans,are the weakest and I would also say the wicked form of species of this great planet...
Filled with greed and everlasting hunger for selfish gains.
One thing I would like to share of what I have experienced  conversely is that there is also plenty of love around. May be that's why we still have families around. Surely without love being inherited , we would not have known how to give it to others.  And that is why we know love and how to give love. Though people term it as emotion, it is love and its commonness amongst all of us that make us able to thrive together.
Now, I had begun this post writing about greed and arguably decried the general conscience of our human mentality pointing towards greed. And yes this is true! we have love in all of us, yet greed seems to overtake our mindset as we continually try to adjust to the current economic scenario.
Recessions, job losses, rising food prices and all that modern corporate fallouts have indeed succeeded in making us rigid in our thoughts and actions setting up the greediest phase of this civilization.

The reason that I see for this is not that all of us had really liked to be in this  way. May be its our ambition and all those pressures we  conjure that makes us do so.
I think that greed is highly localised, got to do with situations that arises! 'coz a person may be corrupt for someone but may be a hero for someone else.

Generally speaking, when one confronts with a situation that softens our stand for justice, we tend to lose our grip over our emotions which tends to make us commit all those things.
 When things get limited, everyone goes for their own run, which is the major cause of greed and corruption today. In every situation this is the main cause for all the corruptive activities and greedy politics. One country is in race of getting what other country holds. And so is the same at every level of societal functionaries.

But like this great saying" The world has enough for everyone's needs but not enough for everyone's greed " , I think this is a workable thing which can be applied for all of irrespective of what we do and  how much we earn.
Needs based maintenance of our daily policy will greatly help to heal the problem we are facing.
And why not, we can do it, nothing is impossible!  

Thursday, March 15, 2012

Procedure, and the objective experience of Python

Assignment Operation( Its totally fun programming!)
                                           One more thing in python that fascinates us is its ability to hold the values of the variable even after assignment operation.
Like say:
This is bound to keep the values of both a,b intact without any change.
 so doing things like:
                                print a,b
                gives #a=2,b=2
           One more important thing to remember is sequential assignment: what I mean is assignment is sequential in its nature.
 So if we have things like:
 then the actual assignment format takes place. The result will be
Procedures: The sword of every programming language
                Yes! its function in c and c++ , method in Java which are used for modular construction and abstraction of every program. In Python, functions or the procedures form the basis of writing  module. Lets take a look at  the module writing techniques . 
                          def function_name():
                   #code lines
                  The novice awkwardness of python is its indentation of code blocks and absence of curly braces->{}. However with time  as one goes down the road, it can be said that it becomes fun and enjoyable with it.
Object Orientation......The face of higher language programming
                            Yes, now we are coming  to the point. It always begins with the already known Class thing. It is done in this way:
                              class class_name:
                      def function_name(self):   
                                                #code block
Hold your breathe!, the self here is a way of providing access to objects form the methods.Without it,none of the methods will have access to the object itself, the object whose attributes  they are supposed to manipulate.
  As reminded from the past, we have Private and Public things to maintain. 
Private variables can be declared using, 
                                                  __(2 underscores) before function_name
                                   eg. def __inaccessible(self):
Objects can be created in the obvious manner:
                 class class_name():
 and it can refer to any function as:
So this was just a brief intro from the many features of Python.
                                                                                      More to follow...

Saturday, March 10, 2012

List:The technical beauty of python long
Data organization and structure is one of the main concern of every programming language. The early languages for example C, C++ laid emphasis on using the primitive data structures such as array to store the grouped data. It had one more thing to remember, and that it was being strongly typed.
  With the evolution of modern higher level language we could make the earlier so called 'typed structures' to a  more friendly and indeed beautiful implementation which could be made  to be more comprehensive as well.
Python...its beauty
 Higher programming language such as python gives us more power in making such things. Its feature of list makes it so easy for many a things that one can make use of. It makes it easy of doing all the things of doing the  functionality of an array and other related operations such as sorting, deleting , indexing,slicing , and  many others.
With these rich features provided, we can make use it many tricky situations of doing the things we like.
using the features it has we find its use in all of the major implementations of the python such as the web crawler which is used in search engines, and all other important procedures of the Python framework.
The part of type checking is once removed being in the Python fold and so we can do many things using it.
Stack Features..
 One more important thing is that like its C++ counterpart, it provides stack operations like the POP, PUSH and APPEND functions which comes in handy for many procedural applications in many functions.
Though by default, it treats all its elements as under one type, we can however make use of the type checking facility to make sure that we have used the correct input.  
 This is a little basic of the part of  its many good feature we all use. Hopefully to be followed soon with other uses. Adieu!