Sunday, 25 November 2012

GIT INTRODUCTION AND INSTALLATION





Git is a distributed revision control and source code management (SCM) system with an emphasis on speed. The major difference between Git and any other VCS is the way Git thinks about its data. Conceptually, most other systems store information as a list of file-based changes. These systems (CVS, Subversion, Perforce, Bazaar, and so on) think of the information they keep as a set of files and the changes made to each file over time.

 Git thinks of its data more like a set of snapshots of a mini filesystem. Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn't store the file again, just a link to the previous identical file it has already stored. Git stores data as snapshots of the project over time as shown in the figure below:




Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database. Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

Three main sections of a Git project:




The working directory is a single checkout of one version of the project. These files are pilled out of the compressed database in the Git directory and placed on disk for you to use or modify.

The Git directory is where Git stores the metadata and object database for our project. This is what is copied when you clone a repository from another computer.

The staging area is a simple file, generally contained in your Git directory, that stores information about what will go into your next commit. 

Git Installation

Windows

First, download msisgit. This download is a single executable which installs the entire git system. While going through the installer, you will want to check the options to add Windows Explorer integration when you right click on a folder.


Because we will be using PuTTY as our SSH client, choose Use PLink and fill in the path to the downloaded plink.exe executable.



Continue clicking Next until the installation is complete.

Linux

On Fedora, you can use yum to install Git:
$ yum install git-core 
On Debian-based like Ubuntu, try apt-get:
$ apt-get install git-core 
Mac

Two easy ways to install Git on a Mac:
(1) Graphical Git Installer:
$ http://code.google.com/p/git-osx-installer 
(2) Install Git via MacPorts: 
Install MacPorts and then install Git via
$ sudo port install git-core +svn +doc +bash_completion +gitweb
Git Setup

Set your user name and e-mail address. Every Git commit uses this information while commits:
$ git config --global user.name "Python Hunter"
$ git config --global user.email pythonhunter@example.com
For special projects, to use different name or e-mail address, you can run the command without the -- global
$ git config user.name "Python Hunter"
$ git config user.email pythonhunter@example.com
Configure Tools

If you want to use different text editor such as Emacs:
$ git config --global core.editor emacs
If you want to configure diff tool to use to resolve merge conflicts such as gvimdiff:
$ $ git config --global merge.tool gvimdiff
Check your Settings

Check your git setting using the command:
$ git config --list
Git Help

To get help on Git, type the command given below along with your verb
$ git help <verb>
Example: $ git help config


[Expecting Your Valuable Comments]
Thank You

Saturday, 24 November 2012

PHOTO EDITOR



To download my Photo Editor, Click here



Click upload button and select a photo to upload and edit.


By clicking the '+' and '-' button, change the value corresponding to Brightness, sharpness, Color and Contrast.

Before

After

Enter the hex color code for your selected color and click Classic button.

Before
After

Enter the hex color code and contrast and click Paint button.

Before
After

Enter the Left, Top coordinate(LFT, TOP) values and Right, Bottom coordinate(RGT, BTM) values and click Crop button.
Before
After

In order to crop the border of a photo, click Cropborder button.

Before

After

To get the invert of your image, click Invert button.

Before
After 

Select your photo and click Rgba button.

Before
After
Select your image and enter Cmyk button.

Before
After
Select you image and click Sepia button.

Before
After
Select your image and click Rotate button.

Before

After
Select your image and click Resize button.

Before
After

Select your image and click FBcover button.

Before
After
Invert & Rgba combined effect.

Before
After(Invert & Rgba)
After(Invert & Cmyk)

Click save button and select the folder to save.




[Expecting Your Valuable Comments]
Thank You

LISP INTERPRETER IN JAVASCRIPT






For the construction of an interpreter we are considering two main parts parsing and execution. Parsing is implemented using the function parse and execution is done using the function eval

First we define the function Env():

1.This function is defined to find the right environment for a variable.
2.This process of looking variables first in inner environments and then in outer ones is called 
   Lexical Scoping

Consider this scheme example:
(define make-account(lambda (balance)(lambda (amt)(begin (set! balance (+ balance amt)) balance))))

Their environment structure will be: 

State 1:  (define make-account 
State 2:                      (lambda (balance) 
State 3:                                         (lambda (amt) 
State 4:                                                    (begin (set! balance (+ balance amt)) balance))))

In State 4, the variables amt and balance are used. The variable defined in the inner environment(Stage 3) is amt. And the variable balance is defined in the outer environment(Stage 2).
But '+' sign in the Stage 4 is not defined in both environment. So we need to define a global environment .

So we define the function add_globals() :

1. This function is to define the global environment.
2. Many functions for mathematical operators are  defined.
3. Many built-in procedures are accessed by importing modules.

The methods in the list Method are built-in functions and can be used by importing the module Math.

Method = ['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'random', 'round', 'sin', 'sqrt', 'tan']

Where as other methods like addition, subtraction,multiplication, division, modulus and comparison operators and defined and added to the module.

Then we define the function eval():

1. Function for execution part of an Interpreter.
2. Here we evaluates the expression in an environment.
3. Special forms or syntactic constructor are defined.

For eg :-  In case of scheme (if test conseq alt), if the expression test is true, then returns 
                conseq,  else returns alt.

Now we define the function parse():

1. We defines the four other functions tokenize(), read_from(), read() and atom()

2. Inputs are scanned and made a list of strings in expressions.

tokenize() :- This function takes the input expression and replaces '(' by ' ( ' and ')' by ' ) ' and 

                    then  removes the spaces at the beginning and end of the expression using 
                    built-in function trim() and splits the input based on the single space ' ' using 
                    built-in function split(' ').

read_from() :- This function takes the list returned by the tokenize() function and it removes '(' and ')'.

                       Thus we gets the list of expression elements in its order without parenthesis.

read()  :-      This function returns the read_from(tokenize(input))

   
atom() :-      This function converts string of integers to numbers and returns.

These all are the main functions used in my javascript code to make Lisp Interpreter.


Download my Javascript Lisp Interpreter code here :                



[Expecting Your Valuable Comments]
Thank You