Thursday, 18 October 2012

Resume-Template

It is very easy and interesting to create the resume using latex documentary language.
Download the files from

http://satvirkaur.github.com/Resume-Template

Make changes into the resume.tex file means write your contents and run the command. You have a pdf of your resume.

Latex

LaTeX is a document preparation system for high-quality typesetting. It is most often used for medium to large technical or scientific documents but it can be used for almost any form of publishing.
LaTeX is not a word processor! Instead, LaTeX encourages authors not to worry too much about the appearance of their documents but to concentrate on getting the right content. Install LaTeX into Ubuntu. To install LaTeX on Linux do following steps:
$ sudo apt-get install texlive
The above command will install a basic subset of TEX Live's functionality. To install all the packages in the LaTeX distribution, you have to run the following command:
$ sudo apt-get install texlive-full

Sitting Plan Project

We are developing a project named "Sitting Plan". Tools being used are C++, MySql database,  make file, CGI to get the information from the browser.
Purpose: Its main purpose to minimize the cheating in the exams. There are 3 strategies(Methods by which students of different groups are sitting). 
Source Code:
The code of our project is at:

Download the code and run it by using following procedure:
1.) Extract the project folder.
2.) Open the terminal
3.) Enter into the project directory
4.) run command make
The provide the appropriate information and get sitting plan for your examination.
Enjoy it :)

Friday, 20 July 2012

CGI Scripts execution from user directries

We can run the scripts which resides in our home directories on browser. It is not a difficult job just need to change some files of the server. In case of Apache server follow these steps:

Step 1:  Activate the User's public_html Directory with userdir
             Create a directory(folder) called public_html in your home directory. For this command is:
           
             $ mkdir public_html
             make sure you are not using sudo as a starting word of command.
             set the permissions of this folder to  
             $ chmod 755 -R public_html
          

Step 2:  There are only two commands we need to enter to activate the User directory feature and then
             one command to reload the configuration files. commands are

             cd /etc/apache2/mods-enabled/
             $ sudo ln -s ../mods-available/userdir.load
             $ sudo ln -s ../mods-available/userdir.conf
             $ sudo /etc/init.d/apache2 restart

             The last command includes an absolute path, so it doesn't matter where you execute it from.   
             The second and third two "ln" commands assume we are in the directory /etc/apache2/mods-         
             enabled. What we need to do is create two symbolic links (soft links, symlinks) in the stated 
             directory pointing to the corresponding module in /etc/apache2/mods-available. 

             On your home system, restarting apache will give you a warning "apache2: Could not reliably 
             determine the server's fully qualified domain name, using 127.0.1.1 for ServerName" simply
             because you are at home and don't have a fully qualified domain name. No problem.

Step 3:  Open up a browser and type http://localhost/~USER_NAME, where "USER_NAME" is your
             actual username. for example the output would be like


           
Step 4:  Now change the httpd.conf file of apcahe server to run the CGI scripts from user directory.
             open terminal and type command:
           
              $ cd public_html
              $ mkdir cgi-bin
              $ chmod 755 cgi-bin


             The above first command is being used to go in public_html folder(directory) and second
             is being used for creating a new directory called cgi-bin which would contain the cgi scripts.
             Last one  is used to set permissions. Now, Open the configuration file of apache server using
             below command.
                        
             $ sudo  gedit /etc/apache2/httpd.conf
             
             and add below code in it, then save the file.
        
              ScriptAlias /cgi-bin/ /home/toor/public_html/cgi-bin/
              <Directory /home/toor/public_html/cgi-bin/>
              AllowOverride None
              Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
              SetHandler cgi-script
              Order allow,deny
              Allow from all
              </Directory>

               toor is USER_NAME and cgi-bin is directory in the public_html folder that would contain the              
               CGI scripts. Now, restart the server as

               $ sudo /etc/init.d/apache2 restart

               I hope you will able to run the cgi-scripts through browser :) :D
               
   



            

Sunday, 24 June 2012

A Rememberable Trip

We had a wonderful trip under the provision of our Respected Sir H.S.Rai at Rajgarh in Himachal Pardesh. I got a chance to see the nature <3  having peace , clam, beautiful surrounding and peach valley. Something was different and more than our expectations. Their was a lot of fun on the way. Firstly we visited Pinjore Garden and captured those moments as well as gorgeous scenes of that lovely :) place into our cameras. After that we started toward our destination and got camping site few away from Rajgarh. It was mind blowing place and did trekking over there. Everyone was looking happy, spend some time together and enjoyed with songs. Second place that i oftentimes see through Internet was Baru sahib Gurudwara and Akal Academy of the world. I was thinking "kaash! Rabb G meri schooling v iss academy di hundi ". It seems that  they struggled and worked hard a lot to establish entire campus. These places give us relief from crowded world.I feel, if u get a chance to see such places never miss that and look the nature from closest I am sure you will be feel the original fragrance of the God gifted nature. At last i want to say thanks Sir, for giving us these remember-able moments :).

Wednesday, 6 June 2012

Pyrheology Web-Application

It is a  django-application is and can be used to perform various user-definable simulations of one-dimensional rheological rheological (viscoelastic) constitutive models.
Using this django application you will be able to compute the response of one-dimensional viscoelastic materials for which the constitutive (rate-dependent) relationship can be expressed in terms of a first order ordinary differential equation of the following form:                  
 A(θ) ε  + B(θ) ε'  = C(θ) σ    + D(θ) σ' + α θ'

1. A,B,C and D are user definable prefactors.
2. ε ,σ and θ are strain,stress and temperature.
3. Super imposed dot denotes the time-derivative.

Installation of Application:
It requires the Django which one can install using above given procedure. We also need the following python-libraries in your python path:

Functions of Libraries                                               Library Name
Plotting                                                                     python_matplotlib
Parsing Strings into callable Functions                    python-scitools
Algebraic Tools                                                        python-numpy
Optimization Tools                                                   python-scipy
and of course                                                           python-django

Now. install these libraries using below command:

sudo apt-get install python-django python-scitools python-numpy python-matplotlib python-scipy

Before proceeding, We should check the working installation. Type the following commands into a command line interpreter and see if they invoke errors.
python
>>>import django
>>>import matplotlib
>>>import numpy
>>>import scipy 
>>>import scitools.StringFunction
>>>print matplotlib.__version__
If no errors are invoked, you are good to perform the next step

Download the source code from here:

If downloaded code is a zip-file, extract it. Change to the newly created directory with an arbitary command line interpreter and type 

python manage.py syncdb

In order to synchronize our database.This command will create a couple of new tables in sqlite3 database.
Furthermore, it will ask to create superuser.Do that.

In the same directory type
python manage.py runserver

in order to start the localhost server. In most cases, the default IP and port will be 127.0.0.1:8000. In this case point your browser to 127.0.0.1:8000/admin to start working with the application. Otherwise customize the ip as promted in the shell
Now. We are able to log-in with the super-user that we defined and see the admin-frontend:




Django Installation

Django is high-level Python Web Framework encourages rapid development and clean pragmatic design.

Installation of Django:
One can download the django versions from the official website of django

https://www.djangoproject.com/ .
Now, following steps to insatll:

step 1: tar xzvf Django-1.4.tar.gz      
        
step2: cd Django-1.4

step3: sudo python setup.py insatll

Verification of Django installation:
To verify that the django can be seen by python. Type python from the terminal. Then at the python prompt, try to import the Django

>>> import django
>>> print django.get_version()
1.4 
 

Monday, 28 May 2012

Python and c++

Python is also a powerful language having features of c, c++ and java. The following table shows how python is different from c++.



Sr. No
Python
C++
1.
Main function and header files are not mandatory part of a program.
Header files and main functions are essential part of every program.
2.
Line termination semi-colon(;) is not required at the end of every line to indicate the end of a line when each line of code starts in new line. But if we want to write two or more lines of code in one line then semi-colon requires.
Semi-colon is necessary to terminate the line.
3.
Python uses indentation(4 spaces or one tab) to indicate code blocks.
It uses curly braces to indicate code blocks.
4.
It takes advantage of modules(the python script with variable, functions can be imported in another script).
C++ takes advantage of header files and libraries to make code sharable and reusable.
5.
We can start it from shell prompt by typing python and able to type python expression directly without making files. But we can also write the python script into files.
Statements are saved into files then that are executed.
6.
While assigning values to variables data types are not written at that time. Default user inputs are taken as strings and converted to other types by python itself.
While declaring and assigning values to variables programmer needs to write data types as essential part.
7.
No increment and decrement operators in python.
Increment and decrement operators are available.
8.
Allow to import packages for example math package.
Built-in functions are imported through header files.
9.
It uses Dictionaries type which acts as structures in c++ and lists same as array in c++
It uses structure type which is collection of elements of different types and array collection of same type of data elements.
10.
Python accepts single('), double(“) and triple(''' or '''''') quotes to denote string literal and string should start and end with same type.
C++ supports string literal encoded in double(“) quotes.
11.
Every line should be proceeded with hash(#) symbol to make that comment.
We can use single line and multi-line comments.
12.
We can use OS (operating system) module to perform directories operations.
Standard c++ don't have a library for directries.
13.
It provides smtplib module to send email to any other Internet machine.
It does not provides direct methods to send mails to other Internet machines.





1.
To print hello.
print 'hello'


#include<iostream>
using namespace std;
main()
{
cout<<"hello";
}
2.
To add two numbers and to display a string.
a=raw_input("Enter value of A")
b=raw_input("Enter value of B")
c=int(a)+int(b)
print c
name="satvir"
print name
#include<iostream>
using namespace std;
int main()
{
using std::cin;
using std::cout;
int a,b,c;
cout<<"enter value of a";
cin>>a;
cout<<"enter value of b";
cin>>b;
c=a+b;
cout<<"Addition of two numbers :\t"<<c<<"\n";
string str="Satvir kaur";
cout<<str<<"\n";
return(0);
}
3.
To import package like math.
from math import *
print pi , e
print sqrt(64)
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
using std::cout;
using std::cin;
cout<<"square roort of 64 is: "<<sqrt(64);
return(0);
}

Installation of TCC software application

          In this manual replace the user name with the user name of your systemBefore     reading further, ensure your system has LAMP(Linux,Apache, Mysql and PHP), and Django installed.
 
1.     Download TCC Software of automation from the  http://sarovar.org/frs/download.php /1327/TCC.tar.bz2 .Then, extract it and place the  extracted folder in the home folder. One thing that should be kept in mind is that the name of the folder that was extract is same as the name used in the files contained by the folder.



2.    Run the following commands:
sudo apt-get install apache2 libapache2-mod-wsgi   
(this command is to run the software on localhost)
 sudo apt-get install python-mysqldb





3.  Open the extracted folder suppose the name of the folder is TCC11_12. Open  the            TCC11_12  folder and make the changes in the apache folder and settings.py 
In apache folder there is a “django.wsgi” file which contains sys.path.append (‘/home/user name/’), in this give your system's user name.
In settings.py file,where there is a user name and password, give the user name and the password of your phpmyadmin. Also make following changes:
  
 LOCAL_URL='http://192.168.2.178/'    to      LOCAL_URL='http://localhost/'
 and
 
 MEDIA_URL='http://192.168.2.178/media/'   to     MEDIA_URL='http://localhost/media/' 

Give the path in TEMPLATE_DIRS = (“/home/username/“) in settings.py file of your      templates  of TCC application as:
 
TEMPLATE_DIRS=(“/home/USER_NAME/TCC11_12/templates”
 
replace the USER_NAME with the user name of your system.
Create a database of the same name as given in the settings.py file



4.     Run the following command in terminal to go into the TCC project

cd TCC11_12

The following command in order to create the tables in the database 

python manage.py syncdb




5.   Then, go to phpmyadmin and in the above database from the tables created above we       have to drop two tables: automation_teachers and automation_variables. The procedure to drop the tables is : Select the tables that are to be dropped and at the end there is “with selected” click on this and select “drop” and then at the end on the right side there is “go”, click on “go”.After click on “go”,your selected tables was dropped.



6.    Now, we have to import the dropped tables: automation_teachers and automation_variable. And the procedure is : When you go to the phpmyadmin and open the database of the TCC project, at the top, click on the import.
Then, in order to import the tables browse the “tcc11_12.sql” file.The ”tcc11_12.sql” file is given below and you have to first copy it on the desktop first and then browse it in the import portion of the phpmyadmin .Then, at the end there is “go”. Click on “go”.
 http://202.164.53.122/~sandy/tcc.sql
This will import the tables in your database.



7.  Save following text in a file ( say /home/username/httpTCC.txt ). Change the path of media folder to your own path that you follow instead of the path given.(instead of toor give your own user name) 

 
WSGIScriptAlias /tcc11_12 /home/toor/TCC11_12/apache/django.wsgi
<Directory /home/toor/TCC11_12/apache/>
Order allow,deny
Allow from all
</Directory>

Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/
<Directory /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/>
Options Indexes
Order deny,allow
Allow from all
</Directory>






8.   Issue following command:
sudo gedit /etc/apache2/httpd.conf
Copy the contents of httpTCC.txt file into the opened file and save it.




9.    One most important thing that must be done is to copy the media file and replace it on the   media path i.e /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media.Given link is the link of the media.tar.gz , compressed file of the media file, you will have to first save, extract it and then copy it and replace it on the above path of the media file.
 http://202.164.53.122/~sandy/media.tar.gz




10.   Give the permissions 755 to TCC11_12 folder (project) by using the following command:

 sudo chmod 755 -R /home/username/TCC11_12

 In the command written above give the path of your own TCC11_12 folder.


Then, at last final step is go into the browser and type - http:// localhost/tcc11_12/. (here, instead of tcc you will have to give the name of your project or folder ). This will open the TCC software in the browser.

When you installed the software completely if there is problem in opening the “credit and feedback” link in running software make the following changes in /home/toor/TCC11_12/contact/views.py:
from TCC.contact.forms import *
to
from TCC11_12.contact.forms import *