Wednesday, 14 May 2014

SQL INTRO

SQL stands for Structured Query Language. As you Know,we are just consulting with DBMS(Database Management System). As the name suggests that DBMS is to manage the data in somewhat manner so that the End or other users can have easily access to each and every information of data of entire database.
How is it all done?
SQL
SQL tells about how to create ,delete ,modify,concatenation ,division ,altering, manipulating the database.
Let's illustrate the all the commands  one by one in detail in coming posts.

Therefore to know about all commands and reading material, Just go to the page:

SQL COMPLETE REFERENCE 

Go To Home: Home

Tuesday, 6 May 2014

Excel Comparison Dashboard

Excel Comparison Dashboard:

This dashboard for made to compare between two countries with respective to their continent wise and also give you to the flexibility to choose indicator of your wish and compare them.
Tell about also which country is leading or which one is slumping with respective to chosen Indicator name.


Excel Sheet given in my Previous Post
For further information :
gaurav_pundir@outlook.com

Excel Dashboard-4

Excel Dashboard:

Here I giving you to a link of my excel sheet.Download it try to analyses what i have done ..how i am going to reference the data into the dashboard from the raw data.

 Download Excel Sheet From Given Link:

Click on Download:     Download

Please Give your feedback in comment section.
If you have any problem or making any other excel project you can contact to me:

gaurav_pundir@outlook.com or ranagrv@gmail.com
  


Excel Dashboard-3

Excel Dashboard:

As you have seen my dashboard in my previous posts.Now i have completed my project ..and i going to upload that...before uploading i am telling what the major things i have done in my project.

1) Filtering: As i told to you that my project ,contains RAW data of various indicators of different countries with respective to their  years(200-2012) . Therefore,I have divided my data into various fields,firstly countries are divided into continent wise such as Asia, Europe, Africa, Australia, America. The buttons are provided on the above of the dashboard you can go specific continent and choose the country that comes under into the respective continent. Data will fetched automatically from reference sheet and all the previously data will be eliminate and new data will insert into the dashboard and various charts will be created.



2) Prediction: So prediction has been done through the various formulas.As i have given with only data till 2012.So i going to calculate for 3 upcoming years. Lets see how did I calculated this:

let I have two values of last two years of any indicator.
Let In 2011--value1      and      2012--value2
 so value in  2013=((((value2-value1) /value1)*value2)+value2)
Similarly, for next coming two years same formula will be applied .....and .....value will be calculated.


  
3) Profit Calculations: For example, GDP is most important component of every country and is refleted by some factors like services ,industry import and export of goods .So which is better of a country is calculated.
As you can see in above picture, we are in Australia continent and in Turkey country,through calculations we have figure out that in Turkey services gives the maximum GDP.

For Download this file go to my next POST: check out MS-Excel categories.
For any Excel project Contact: gaurav_pundir@outlook.com

Excel DashBoard-2

Excel Dashboard:

I have done a Excel project Topic Name: Analysis of various Indicators of Various countries as i told to you in previous post and i have told to you how to make the dashboards in excel Its so easy!!!!

So let's get started!! I had allocated a project "Analysis of various Indicators of Various countries" .
In the raw of my project contains country name ,Indicators names such as: Population ,Population growth(%),GDP(Gross Domestic Product) and the sub-Indicators which reflect the GDP of country Such as Agriculture,Services,Industry,Import and Export of goods and lot more...and their values with respective to the years for each country.

  
I have arranged the data and filtered out and Make reference sheets for the making of my dashboard.


For getting This Sheet just mail to me :
gaurav_pundir@outlook.com or ranagrv@gmail.com
OR
it will uploaded shortly!!!!
To get More information Please check out my Next Post!!!


Excel DashBoard

Excel Dashboard :

Dashboard is something which contains lot things provides various fields to choose and perform act on same.It contains series of things that are interconnected , whenever you make some changes in any thing of your dashboard ,the entire dashboards reflects old values/calculations are eliminated and new ones added according to user needs.

Making dashboard in Excel is Just Simple thing!! You just have need to know of lots of functions used on excel calculations such as Look-UP functions,Indexing,Matching,Percentage calculations etc.Charts Knowledge in needed..how to choose select data and play with them and arrange the data row and column wise properly.

Therefore, Combine the Functions, Calculations and Charts so that if you change in one thing, It reflects On all things and makes changes dynamically.\

My Dashboard Preview:
 Topic: Analysis of various Indicators of Different Countries.


For Getting more details about Dashboard making go for the next post in MS-Excel Categories.
OR mail to me for making any Dashboard/Excel Project just mail to me:
gaurav_pundir@outlook.com or ranagrv@gmail.com

Thursday, 27 March 2014

Arithmetic Mean In Excel

Arithmetic Mean is calculating of mean of the series of numbers.You have to add all the numbers and then divide the obtained sum by the total no.of the given series.
It is very common to measure the central tendency in Excel.

OR simply get the average of the series that is find out the average through AVERAGE function.
Through AVERAGE FUNCTION:


Through SUM FUNCTION:

To get more detail about Excel functions: Refer to Excel Categories.


Tuesday, 18 March 2014

Mouse handling

This program tells about how to use action Listener methods and its methods along with how to handle the mouse events.whenever you perform such type of functions such as :click,released,drag,move,enter or exit from the window then it reflects your output as by the repaint method:

To Know more about the mouse event functions and its calculations check out the Java Label:

NewClass.java:

import java.awt.event.*;
import java.applet.*;
import java.awt.*;
/*
<applet code="NewClass" width=300 height=100>
</applet>
*/

public class NewClass extends Applet implements MouseListener, MouseMotionListener
{
    String msg=" ";
    int mouseX=0,mouseY=0;
    public void init()
    {
        addMouseListener(this);
        addMouseMotionListener(this);
       
    }
    public void mouseClicked(MouseEvent me)
    {
        mouseX= 0;
        mouseY=10;
        msg="mouse clicked at:"+me.getX()+" ' "+me.getY();
        repaint();
       
    }
    public void mouseEntered(MouseEvent me)
    {
        mouseX=0;
        mouseY=10;
        msg="mouse entered";
        repaint();
       
    }
    public void mouseExited(MouseEvent me)
    { mouseX=0;
        mouseY=10;
        msg="mouse Exited";
        repaint();
       
    }
    public void mousePressed(MouseEvent me)
    {
         mouseX=me.getX();
        mouseY=me.getY();
        msg="Mouse Pressed";
        repaint();
    }
    public void mouseReleased(MouseEvent me)
    {
         mouseX=0;
        mouseY=10;
        msg="mouse Realeased";
        repaint();
    }
    public void mouseDragged(MouseEvent me)
    {
         mouseX=me.getX();
        mouseY=me.getY();
        msg="***";
        showStatus("Dragging mouse at "+ mouseX +" ,"+ mouseY);
        repaint();
    }
    public void mouseMoved(MouseEvent me)
    {
         showStatus("moving mouse at"+ me.getX() + ","+ me.getY());
    }
    public void paint(Graphics g)
    {
        g.drawString(msg,mouseX,mouseY);
    }
}

output:







Optimal Page Replacement C program

OPTIMAL PAGE REPLACEMENT ALGORITHM

Program Description: Optimal Page Replacement refers to the removal of the page that will not be used in the future, for the longest period of time.

Program Code:

#include<stdio.h>
int main()
{
int n,pg[30],fr[10];
int count[10],i,j,k,fault,f,flag,temp,current,c,dist,max,m,cnt,p,x;
fault=0;
dist=0;
k=0;
printf("Enter the total no pages:\t");
scanf("%d",&n);
printf("Enter the sequence:");
for(i=0;i<n;i++)
scanf("%d",&pg[i]);
printf("\nEnter frame size:");
scanf("%d",&f);

for(i=0;i<f;i++)
{
count[i]=0;
fr[i]=-1;
}
for(i=0;i<n;i++)
{
flag=0;
temp=pg[i];
for(j=0;j<f;j++)
{
if(temp==fr[j])
{
flag=1;
break;
}
}
if((flag==0)&&(k<f))
{
fault++;
fr[k]=temp;
k++;
}
else if((flag==0)&&(k==f))
{
fault++;
for(cnt=0;cnt<f;cnt++)
{
current=fr[cnt];
for(c=i;c<n;c++)
{
if(current!=pg[c])
count[cnt]++;
else
break;
}
}
max=0;
for(m=0;m<f;m++)
{
if(count[m]>max)
{
max=count[m];
p=m;
}
}
fr[p]=temp;
}
printf("\npage  %d  frame\t",pg[i]);
for(x=0;x<f;x++)
{
printf("%d\t",fr[x]);
}
}
printf("\nTotal number of faults=%d",fault);
return 0;
}

Output:

Java First Applet Program

This given program demonstrate how the Applet works.How the Function get performed?
To run applet Program First we need to initialize the variables,befor that extends the applet class.

First.java:(Created in NET BEANS IDE )
import java.applet.*;
import java.awt.*;

public class First extends Applet
{
    public void init()
    {
       
    }
    public void start()
    {
       
    }
    public void stop()
    {
       
    }
    public void destroy()
    {
       
    }
    public void paint(Graphics g)
    {
        showStatus("applet Started");
    }
 }

To run this program:
$javac First.java
$appletviewer First

OutPut:
 
To get more details follow Java Label....

Applet StartUP

To use Applet in java program or execution can done by only two ways, Before that, Applet are not Stand-alone program.they run either a web browser or an applet viewer provided by JDK (Java Development Kit).

Applet Program does not begin with main() function.It has its own functions such as:
1.void init( ) 
2.Void start( )
3. void stop( )
4. void showStatus( )
5. void destroy( )
6. void paint(Graphics g) defined in AWT component class, where applet will override it.

In Contrast, Swing Applet has different mechanism to execute their program.

To get more details more about java functions : Refer Java Category 


Java Applet

Applet provides more compatibility with Graphical User Interface. You can Add-on more features such as buttons,menu-bars,frames, can be useful to develop different application like games, any software etc.

There are two types of applet in java:
1.Simple applet based on Applet Class ,use the abstract window toolkit(AWT) to provide the graphical user interface.

2. Swing Class Applet "JApplet". It provides the same features as we used in AWT along with some richer function and additional functionality to the AWT function and more compatible with graphics functions.
JApplet inherits Applet .


HTML APPLET Tag

Applet can run on the browser window through <applet> tag and you can get the output as you get in your appletviewer.
The one restriction with appletviewer is it executes only one java program at one time,In Contrast, browser can consists of more than one applet Contains.Let's have a look at how to enroll the applet tag in browser window.
Applet tag with their some alternatives:
<applet
code="name_of_java_class_name"
width=pixels
height=pixels
align=alignment
vspace=vertical_space_pixels
hspace=horizontal_space_pixels

</applet>

To get details about the attributes of applet tag : click on Java Label.


Tuesday, 11 March 2014

HTML and JavaScript

HTML and JavaScript works together.JavaScript is a Scripting language. That is, the code is not
compiled but instead it appears as ASCII text in an HTMLfile.

JavaScript is used,when you have Scenario such as you have created a website in which you want to give many options to the users and if user chose any option out of them then what action to be performed at that instant, That's where JavaScript matters.

For integrating it into the HTML code, you have three possibilities:

1. Inclusion in header part:

    ==> Incapacitate into header part:   


<html>

<head>

<title>

My Page

</title>

<script language="javascript">

/*

write your code here

functions and methods

*/

</script>

The Tag <script language="JavaScript"> introduces the JavaScript source code, the tag
</script> ends it.

For Second incorporation of JavaScript into html code ,Click Here 

For Further details about JavaScript go to "JavaScript" Label.


First Java Script Program

This is first JavaScript program."alert( )" function used to pop-up the some message.It will display the content written before the script programming than the script will be available with pop-up box.

Program:


<html>
<head>
<title> MY first Javascript Page </title>
</head>
<body>
<h3>
My first javaScript Page
</h3>
<script>
alert("Hello My Page");
</script>
My Second-Half of JavaScript Page
<script>
alert("Hello my Second Half");
</script>
</body>
</html>

Output will Display Like this on Your Browser:




 










Look At the other Programs in JavaScript Label. 

HTML and JavaScript Incorporation

In First Incorporation we have how to include JavaScript in HTML header part.

For Second Possibilities of inclusion of JavaScript in Html Code is you code part.It's just depend on your code to carry out any functionality or any reaction,change in something like to over the mouse of any particular thing then what action has been specified.

In this,When the Web Page loads there is a pop-up alert open and give some reaction tell us something through display message.

<body onload="hello()">
Hello function is to be performed whenever page loads.


For Complete program refer this Link:  Incorporation Program

Third Incorporation of HTML and Java.

Further Fuctionality and programs of JavaScript and HTML refer Divisions.

Tuesday, 4 February 2014

Lex Analyzer for Windows

Lex Analyzer for Windows:


 It's very complex to run operating system environment into one system and no one wants to use of Linux for ever for the Lex Analyzer.so Here is a tool Which will work same as Lex Analyzer.
Download this from Link Below:

   1.Flex
    2.Bason




How To Compile the Lex Programs

1. Firstly, make the lex file according to the given format and then save the file with extension ".l" such as: "file_name.l".
2. Lex files can be compiled using any Lex Analyzers like 'flex' Analyzer for Windows.
3.Use the lex program to turn into a C language program. The resulting program is in the lex.yy.c file.
4. Use the C compiler with the -ll flag to compile and link the program with a library of lex subroutines. The resulting executable program is in the a.out file.

For Example,

$$ lex file_name.l
$$ gcc lex.yy.c -ll
$$ ./a.out 

                                       OR
  
$$ lex -t file_name.l > file_name.c 
$$ cc -o file_name file_name.c -ll
 

Lex program to convert lowercase to uppercase

Lex program to convert lowercase to uppercase:
This program takes a string from the text file and convert every letter into the reverse case of it and display every character.

Program:
lower [a-z]
upper [ A-Z]
%%

{lower} { printf(" % c",yytext[0]-32);
{upper} {printf("%c",yytext[0]+32);
[\t\n]+  echo;
. echo;

%%
main( )
{
yylex();
}

Output: 
$ lex ex1.l
$ gcc ex1.c -ll
$ ./a.out<untitled.txt
mY NAME IS kHAN
gaurav singh pundir
$

and the untitled.txt file contains:
My name is Khan
GAURAV SINGH PUNDIR

 
 
 
 

LEX Program to count the number of vowels and consonants in a given string

LEX Program to count the number of vowels and consonants in a given string:

%{
int vow_count=0;
int const_count =0;
%}

%%

[aeiouAEIOU] {vow_count++;}
[a-zA-Z] {const_count++;}
%%

main()
{
printf("Enter the string of vowels and consonents:");
yylex();
printf("The number of vowels are:  %d\n",vow);
printf("The number of consonants are:  %d\n",cons);
return 0;
}


Output:
$$ lex kk.l
$$ gcc kk.c -ll
$$ ./a.out
Enter the string of vowels and consonents
My name is Khan
The number of vowels are: 4
The number of consonants are: 8
^D
$$

Lex Program to Identify the Keywords of C Language

Lex Program to Identify the Keywords of C Language:

%{
int count;
/* -----you can write any comments here-------
*  program to recognize the keywords
*/
%}

%%
 [%\t ] +         /* "+" indicates zero or more and this pattern use for ignoring the whitespaces*/

auto|
double|
if|
static|
break|
else|
int|
struct|
case|
enum|
long|
switch|
char|
extern|
near|
typedef|
const|
float|
continue|
register|

union|
unsigned|
void|
while|
default|
do|
goto|
signed|
while|signed|unsigned  {printf("C keyWord(%d) :\t %s",count,yytext);
[a-zA-Z]+ { printf("%s: is not the Keyword\n", yytext);
 %%
 main( )
{
yylex();
}

Output:

$$ lex example.l
$$ gcc example.c -ll
$$ ./a.out
while asd goto char for
C keyWord(1):        while
asd: is not the keyword
C keyWord(2):       goto
C keyWord(3):      char
C keyWord(4):       for
auto
C keyWord(5):        auto
^D
$$ 

 
 

First Lex Program

First Lex Program

%{ 
/*     */
%}
%%
is printf(" 'is' has entered");
%%

OutPut:
$$ lex first.l        
$$ gcc 1ex.yy.c -11
$$ ./a.out
is
'is' has entered
^D
$$

Explanation: whenever you will enter the is keyword it automatically display the line written into the printf statement i.e. 'is' has entered

Program Structure in Lex Analyzer

Program Structure in Lex Analyzer:

To write a program in lexical analyzer we need to aware of program structure:

%{
/* definition Section */
%}
%%
/*Rules section : Pattern and Action
%%
main( )
{
/* your program*/
}

Let's go into Detail :

Definition Section: This is especially important when we  have header files that must be included for code later in the file to work.You can include the header files and can initialize the variables that can use in any section of the entire program.

e.g.   #include<stdio.h>  /*you can include stdio.h header file for the further use.*/

Rules section : Each rule is made up of two parts: a pattern and an action, separated by whitespace. The lexer that lex generates will execute the action when it recognizes the pattern which are made up regular expressions.

e.g.  @|#|$|%   printf("Special character occured %s",yytext);

 If any special character you write at the time of execution then it will print the statement written into the printf statement and value or that character will be store in the predefined yytext variable via yylex.

User Subroutine Section: It can consist of any Legal C code. Lex copies it to the C file after the end of the lex generated code.
%%
main ( )
{
yylex();
}
The lexer produced by lex is a C routine called yylex(). Unless the actions contain explicit return statements, yylex() won't return until it has processed the entire input.