Hub Of Geekz

  • Home
  • About Me
  • Contact Us
  • Home
  • Languages
    • C++
    • Java
    • Perl
    • Prolog
    • Bootstrap
  • Database
    • SQL
    • PL/SQL
  • Study
    • Java
      • Java Collection
      • Java Concurrency
      • Java Interview Questions
      • Java Networking
    • Number System
  • Kavita
  • Entertainment
    • Hinglish Cafe
    • Videos
    • Jokes
  • Windows Tricks
  • How To

Saturday, 28 February 2015

Different formats in Perl

 Earthcare Foundation NGO     01:57     Perl     No comments   

Formats  are defined by using a keyword format and ended by a dot(.) and to write using that format we have to assign this value to system variable $~.
Below are some examples of formats:

Program Code:
#! /Perl/bin/perl



$~ ="MYFORMATHEADER";
write;



format MYFORMATHEADER=
===========================================
This line contains special character @
"<"
===========================================
.




Output:



Program Code:
#! /Perl/bin/perl

print("Enter a string\n");
@input=<STDIN>;

$str=join("",@input);


$~ ="MYFORMATHEADER";
write;



format MYFORMATHEADER=
======================================================
The input is
 @*
$str
======================================================
.




Output:

Program Code:
#! /Perl/bin/perl

print("Enter a string to write it into a file\n");
@input=<STDIN>;
$str=join("",@input);

open(FILE,">abhi1.txt");
select(FILE);

&write_output;

select(STDOUT);
&write_output;

sub write_output{
$~ = "FORMAT1";
write;
}




format  FORMAT1=
======================================================
The input is following:
 @*
$str

Above lines are written in file named abhi1.txt
======================================================
.




Output:

Program Code:
Output:
Program Code:
Output:
Program Code:
Output:
Program Code:
Output:
Program Code:
Output:
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Format Headers in Perl

 Earthcare Foundation NGO     01:50     Perl     No comments   

Program Code:
#! /Perl/bin/perl

print("Enter a sentence\n");

open(FILE,">abhi1.txt");
select(FILE);
$~ = STDOUT1;
$^=STDOUT1_TOP;
$= =65;

$line=<STDIN>;
write;

close(FILE);



format STDOUT1_TOP=


Page @<<
$%
======================================================
.


format STDOUT1=
======================================================
Hi this is page content
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$line
======================================================

.
Output:

The file abhi1.txt


Program Code:
#! /Perl/bin/perl


$~=STDOUT1;
$^=STDOUT1_TOP;
write;




format STDOUT1_TOP=
======================================================
This is the header of the page.
Page  number is  @<
$%
======================================================
.


format STDOUT1=

Hi this is page content


.
Output:

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

File handling in Perl

 Earthcare Foundation NGO     01:44     Perl     No comments   

1)Checking the file existence:
Program Code:
#! /Perl/bin/perl

unless(open(IN, "abhi3.txt")) {
  if(-e "abhi3.txt")
{
die ("file can't be opened");
}
else
{
die("File doesn't exist");
}
}

print("File Exist!!!!!!!!!!!");

Output:

2)File Reading:
Program Code:
#! /Perl/bin/perl


if(open(FILE,"abhi.txt"))
{
$line=<FILE>;
while($line ne "")
{
print($line);
$line=<FILE>;
}
}
else
{
print("Can't open the specified file");

}
Output:

3)File Reading using Array
Program Code:
#! /Perl/bin/perl

unless (open(FILE, "abhi.txt")) {
 die ("cannot open input file\n");
 }

@array=<FILE>;

print("@array");

Output:

4)File Writing:In this program i am reading the contents from file abhi and writing that content to another file abhi1.

Program Code:
#! /Perl/bin/perl

unless (open(IN, "abhi.txt")) {
 die ("cannot open input file\n");
 }
unless (open(OUT, ">abhi1.txt")) {
 die ("cannot open output file\n");
 }

$line=<IN>;
while($line ne "")
{
print OUT ($line);
$line=<IN>;
}
print("Written Successfully");



Output:

5)File Merging:Int this program i have read the contents of abhi and abhi1 file and then merged it.
Program Code:
#! /Perl/bin/perl

unless (open(IN, "abhi.txt")) {
 die ("cannot open input file\n");
 }
unless (open(IN1, "abhi1.txt")) {
 die ("cannot open output file\n");
 }
$line=<IN>;
$line1=<IN1>;
while($line ne " " || $line1 ne " ")
{
if($line ne " ")
{
print ($line);
$line=<IN>;
}

if($line1 ne " ")
{
print ($line1);
$line1=<IN1>;
}
}



Output:

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

List count in Perl

 Earthcare Foundation NGO     01:29     Perl     No comments   

Method 1:
Program Code:
#! /Perl/bin/perl

print ("Enter the start number:\n");
$start = <STDIN>;
chop ($start);
print ("Enter the end number:\n");
$end = <STDIN>;
chop ($end);
@list=($start..$end);
$count=0;
print("Here is the list \n");
while ($list[$count] != 0 || $list[$count-1] == -1 || $list[$count+1] == 1) {
print ("$list[$count]\n");
$count++;

}
Output:


Method 2:
Program Code:
#! /Perl/bin/perl

print ("Enter the start number:\n");
$start = <STDIN>;
chop ($start);
print ("Enter the end number:\n");
$end = <STDIN>;
chop ($end);
@list=($start..$end);
$len=1;
$count=@list;
print("Elements of list are\n");
while($len<=$count){
print("$list[$len-1]\n");
$len++;

}
Output:

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

List all files in a directory using Perl

 Earthcare Foundation NGO     01:24     Perl     No comments   

To read files from any directory first we have to access that directory. We have used opendir() to get that directory.Now to get all the files we have used readdir() so that all the files are listed in that directory.At last we have closed the directory.


Program Code:
# !/Perl/bin/perl

opendir (DIR,"C:/Perl64") ||die("Can't open the  specified directory");

while($file=readdir (DIR)){

print("$file \n");
}


closedir (DIR);

Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Pattern matching in Perl

 Earthcare Foundation NGO     00:51     Perl     No comments   

Program Code:
#!/Perl/bin/perl

print("Enter the question you want to ask \n");
$input=<STDIN>;
if($input =~ /please/)
{
print("You are good in nature.My name is Abhishek \n");
}
else
{
print("First use word please");

}

Output:

Program Code:
#!/Perl/bin/perl

print("We are searching a pattern which ends with letter a in word pragma\n");
print("Patterns we found in this word are\n");
while("pragma" =~ /.a/g)
{
$match=$&;
print("$match \n");

}

Output:

Program Code:
#!/Perl/bin/perl

$string="hi this is abhishek\n my name is abhishek";
print("We are searching a pattern with comparison in multiple lines\n");
print("Patterns we found in this word are\n");
$string =~ /^hi/m;
$match=$&;
print("$match \n");


Output:

Program Code:
#!/Perl/bin/perl

print("Enter the sentences \n");
$input=<STDIN>;
while($input ne " ")
{
chop($input);
@words=split(/ +/,$input);

$count+=@words;
print("Total number of words till now are $count \n");
$input=<STDIN>;


}

Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Rand() function in Perl

 Earthcare Foundation NGO     00:39     Perl     No comments   

rand() function is used to generate a random number.
First it will generate a random number between 0 and 1 and then it will multiply it with the number which is passed as argument in rand() function.So whatever is the argument the number generated will be always less than that number.

Random Numbers less than 5
Program Code:
#! /Perl/bin/perl

$count= 1;
while($count<=20){
$randnum=int(rand(5))+1;
print(int(rand(5)));
print("\n");
$randtotal[$randnum]+=1;
$count++;


}

Output:


Random Numbers less than 10
Program Code:
#! /Perl/bin/perl

$count= 1;
while($count<=20){
$randnum=int(rand(10))+1;
print(int(rand(10)));
print("\n");
$randtotal[$randnum]+=1;
$count++;

}

Output:

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

sleep in Perl

 Earthcare Foundation NGO     00:29     Perl     No comments   

Sleep is used to stop Perl interpreter executing the next statement for the specified time
In following example the next statement will be executed after 60 seconds.

Program Code:
# !/Perl/bin/perl


print("This is a demo of sleep function\n");
print("After this line program wil sleep for 1 minutes\n");
sleep(60);

print("Hey i am ready now");

  
Output:


After 60 seconds 



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Various string operations in Perl

 Earthcare Foundation NGO     00:20     Perl     No comments   


Program Code:
#! /Perl/bin/perl

$var=1234;
$var="This is the number with value $var \n";
print($var);


$var=12;
print("This is a number with value $var \n");


# \L is used to convert the letters to lower case and \E is used to disable the effect of \L
$var = "T\LHIS IS A \ESTRING \n"; # same as "This is a STRING"
print($var);

#If you want to print the $ or " or \ use escape character \ to print all this
$var=12;
print("This is a number with value of \$var is $var \n");


# ascii value of any character in octal using /nnn notation where nnn is an octal number
$var="\120";
print($var);
print("\n");


# ascii value of any character in hexadecimal using /xnn notation where nnn is an octal number
$var="\x56";
print($var);



Output:

Program Code:
#! /Perl/bin/perl

print("Enter a line \n ");

$input=<STDIN>;

print("UpperCase: \U$input\n");

print("LowerCase: \L$input\n");


#\u forces to print first letter in capital letter
print("A sentence: \L\u$input\n");


$text = 'This string contains \', a quote character';
print($text,"\n");

$text = 'This is two lines of text';
print($text);

Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Subroutines in Perl

 Earthcare Foundation NGO     00:12     Perl     No comments   

Subroutines are like functions in C language.We can define a subroutine by writing sub and then variable name.
For example:
sub read{
$line=<STDIN>;
}
Above is a subroutine which is used to read input from Standard Input Device (such as Keyboard).
When we have to call the subroutine we add & before that subroutine name.
For Example:
           &read;


Program Code:
#!/Perl/bin/perl

print("Enter a sentence\n");

while(1)
{
&read;
last if($line eq "");
print($line);
}
sub read{
$line=<STDIN>;
}
print("done");



Output:

2)Local Variables in Subroutine:


Program Code:
#! /Perl/bin/perl

print("I have declared a local variable and it can't be accessed from outside the subroutine\n");


$calc=&addition;
print("The value returned by subroutine is  $calc \n");
print("The value of local variable outside the subroutine is $total \n Since we are accessing it from outside the subroutine\n");

sub addition
{
my($total)=50;
return $total;
}


Output:

3)Subroutine with Arguments:
A subroutine can have arguments as well.We can accept arguments in subroutine by using the following statement:
my($num1,$num2)=@_;
where num1 and num2 are local variables for this subroutine.@_ is the placeholder.

Program Code:
#! /Perl/bin/perl

print("Enter first number\n");
$first=<STDIN>;

print("Enter second number\n");
$second=<STDIN>;

$calc=&addition($first,$second);
print("The sum of numbers is  $calc \n");

sub addition
{
my($num1,$num2)=@_;
$total=$num1+$num2;
}


Output:

4)Subroutine Forward Reference:
If we will declare the subroutine before calling it then there is no need to & at the time of subroutine calling.

Program Code:
#! /Perl/bin/perl

print("Enter a sentence\n");

sub read;  #forward reference
while(1)
{
#now there is no need to use & before subroutine name but sometimes it doesn't work
&read;
last if($line eq "");
print($line);
}
sub read{
$line=<STDIN>;
}

print("done");

Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Friday, 27 February 2015

Upper case to Lower Case In Perl

 Earthcare Foundation NGO     23:53     Perl     No comments   

Program Code:

#!/Perl/bin/perl

print("Enter a sentence to convert into lower form\n");
while($input=<STDIN>)
{
$input=~ tr/A-Z/a-z/;
print($input);
}




Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Variable Validation in Perl

 Earthcare Foundation NGO     23:49     Perl     No comments   

Program Code:

#!/Perl/bin/perl

print("Enter the variable name \n");
$input=<STDIN>;
chop($input);

if($input =~ /^\$[A-Za-z][_0-9a-zA-Z]*/)
{
print("$input is a valid scalar variable name in perl \n");
}

elsif($input =~ /^\@[A-Za-z][_0-9a-zA-Z]*/)
{
print("$input is a valid array variable name in perl \n");
}

else
{
print("$input is not valid \n");

}


Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Warn in Perl

 Earthcare Foundation NGO     23:46     Perl     No comments   

Program Code:

# !/Perl/bin/perl

print ("Enter 0 or 1\n");
$input=<STDIN>;
if($input==0){

warn("Hi This is a warning\n");
}
else{

warn("Hi This is a warning with info about the program");
}


print("\nActually i was just giving u warning");

print("\n I have no privilege to terminate your program");


Output:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

die in perl

 Earthcare Foundation NGO     23:38     Perl     No comments   

When we want to abort the program then we can use die.If we will use "\n" at the end then it will not explain the line number where it has aborted and other info. If you will not use "\n" at end then it will give the info.


Program Code:

# !/Perl/bin/perl

print ("Enter 0 or 1\n");
$input=<STDIN>;
if($input==0){

die("Hi i am about to die\n");
}
else{

die("Hi i am about to die with info about the program");
}


Output:


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Sub Routines in Perl

 Earthcare Foundation NGO     23:32     Perl     No comments   

In this post i will explain some subroutine in Perl.

1)AUTOLOAD subroutine: 

In perl , if this subroutine is defined in the package, then if any undefined subroutine in that package is called then then the statements of this AUTOLOAD subroutine are executed.
For example in below example i have called a subroutine
&subroutine_not_present(12,23,"hi");
which is not present.When this program is executed and perl will not found the called subroutine it will call the AUTOLOAD subroutine which is present in the program.



Program Code:
#! /Perl/bin/perl

&subroutine_not_present(12,23,"hi");

AUTOLOAD
{
print("Can't find $AUTOLOAD subroutine\n");
print("Argumens to that subroutine are @_");
}


Output:




2)BEGIN Subroutine:

If the program contains any subroutine named as BEGIN then that subroutine will be executed first before executing any other statement of that program.A program can have more than one BEGIN subroutine.If this is the case then these are executed on the basis of order in which they have defined.

Program Code:
#! /Perl/bin/perl

BEGIN{

print("I am printing from BEGIN subroutine\n");
print("And interesting thing is that \nwe don't need to call this routine\n");
print("It is automatically called\n");
}

BEGIN{
print("And another interesting fact about this is that there can be\n");
print("more than one BEGIN routines in a single program.\n");
print("They are called in the order in which they are specified in the program.");
}

Output:



3)END Subroutine:

This subroutine is called after the last statement of the program has been executed.A program can contain more than one END subroutine.If this is the case then these are executed in the reverse order.

Program Code:
#! /Perl/bin/perl
END{
print("And another interesting fact about this is that there can be\n");
print("more than one END routines in a single program.\n");
print("They are called in the opposite order in which they are specified in the program."); 
}
END{
print("I am printing from END subroutine\n");
print("And interesting thing is that \nwe don't need to call this routine\n");
print("It is automatically called\n");
}


Output:




Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Array Sorting in Perl

 Earthcare Foundation NGO     23:10     Perl     No comments   

In this post i have written a code to sort an array.


Program Code:

#! /Perl/bin/perl

print("Enter elemnets of array to be sorted\n Enter an empty line to quit\n");
$count=1;
$inputline=<STDIN>;
chop($inputline);
while($inputline ne "")
{
@array[$count-1]=$inputline;
$count++;
$inputline=<STDIN>;
chop($inputline);
}
$count=1;
while($count<@array)
{
$x=1;
while($x<@array)
{
if($array[$x-1] gt $array[$x])
{
@array[$x-1,$x]=@array[$x,$x-1];
}
$x++;
}
$count++;
}

print("@array\n");


Ouput:



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Array in perl

 Earthcare Foundation NGO     23:03     Perl     No comments   

1)Length of Array:

To find  the length of any given array just use a scalar variable and do the following:

$len=@array;

where len is a scalar variable and array is an array variable




Program Code:
#! /Perl/bin/perl

@array=(1,2,3,4,5,6);
$len=@array;

print("Length of array is $len");

Output:
Length of array is 6
2)Array Modification:

We can modify array elements after defining an array.We can add more elements in the array by using following statement :
@array[3..6]=(6,7,8,9);


Program Code:
#! /Perl/bin/perl

@array=(1,2,3);
print("Original Array \n@array\n");
@array[3..6]=(6,7,8,9);
print("Array after modification \n@array");

Output:

Original Array
1 2 3
Array after modification

1 2 3 6 7 8 9


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Array Functions in Perl

 Earthcare Foundation NGO     22:51     Perl     No comments   

1)join():

This function is used to join the elements using some specific character which has been passed as argument in this function. So the first character is used to join the elements and then after that we can pass as many arguments as possible.These arguments can be either strings,numbers  or array.

#! /Perl/bin/perl
@array=(I,am,a,good,boy);
$str=join(":",@array,1,2,"no","its");
print($str);


Output:


         I:am:a:good:boy:1:2:no:its
2)split():

This function is used to split an string on the basis of some character which is passed as the first argument in this method.

#! /Perl/bin/perl
$str="I:am:good";
@array=split(":",$str);
print("@array");

Output:


I am good

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Array Functions in Perl:Chop()

 Earthcare Foundation NGO     22:35     Perl     No comments   

chop():

The chop function is used to remove the last character of any element.
I have taken the example of array and then applied the chop() function on it.

 #! /Perl/bin/perl
@array=(aa,bb,cc,dd,ee,fd,gf,hg,sd);
print("Array before chopping\n");
print("@array\n");
chop(@array);
print("\nArray after chopping");
print("\n@array");

@array=(aas,bbsd,ccdsf,dddff,eefd,fdg,gfg,hggjh,sdhh);
print("\nArray before chopping\n");
print("@array\n");
chop(@array);
print("\nArray after chopping");
print("\n@array");

Output:


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Array Functions in Perl:Sort()

 Earthcare Foundation NGO     22:22     Perl     No comments   

In this post i will explain the functions that can be used with array in Perl.

sort():

This function is used to sort the elements of an array. This function is specially used to sort elements of type string.


#! /Perl/bin/perl

print("Enter elements(only 0-9) of array to be sorted\n Enter Ctrl+Z to quit on windows\n");
@array=<STDIN>;
print("The elements of array before sorting are ");
print("@array\n");
@array=sort(@array);
print("The elements of sorted array are ");
print("@array");

Output:




We can also use this method to sort integers but their range should be between 0-9. Since this method will compare the first character of elements first and after that if they are equal then it check for second character. It compares in this way because this method is used to sort strings. I have supplied input between 0-9 and the output is given below 


But if we will give input beyond this range then the output will not be correct.
See below output screen 



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Array Alias in Perl

 Earthcare Foundation NGO     21:55     Perl     No comments   

In this post i will explain about aliases in array
In the program first we have defined one scalar variable and an array variable with same name, We printed the value of variable which is 100.After that we have called a subroutine with argument. In this subroutine the values of array will be printed.After that i have changed the value of scalar variable which will also change the value of  global variable.

#! /Perl/bin/perl

print("In this program we will see the effect of alias in array and scalar variable");

$var=100;
@var=(1,2,3,4);

print("\n\nThe value of \$var before subroutine call is $var\n");

&test_alias_sub(*var);

print("The value of \$var after subroutine call  is  $var\n");

sub test_alias_sub{
local(*array)=@_;
foreach $element(@array){
print("$element\n");
}
$array=200;
}

Output:




Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Arrays in Perl

 Earthcare Foundation NGO     21:44     Perl     No comments   

In this post i will explain about the arrays in Perl.
When we want to declare an array variable we will use @ symbol so that perl can know that it is an array variable.
for ex
           @array=(1,2,3);

Suppose we  have  the following statement:
        @array=(1,    2    ,    3 );
Then
      print(@array,"\n");
What will be printed?
Elements of array will be printed without any spaces in between them

123

Now
   print("@array\n");
What will be printed?
Elements of array will be printed with proper spacing

1 2 3

So if we will use @array  in quotes ("") then proper spacing will be done by Perl regardless of the spaces in between elements. But if we will not use quotes then no spacing will be provided by Perl(As in case 1)


Program Code

#! /Perl/bin/perl

@array=(1,    2    ,    3 );
print(@array,"\n");
print("@array\n");






Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Arithmetic Operations in Perl

 Earthcare Foundation NGO     21:26     Perl     No comments   

Program Code

#!/Perl/bin/perl

$var=2;
print("The value assigned to variable initially is ".$var."\n After Multiplication ");
$var=$var*2;
print($var,"\n After Addition and subtraction ");
$var=3+45-23;
print($var);


Output


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Pagination using Bootstrap

 Earthcare Foundation NGO     21:20     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">

</head>
<body>
<h3 class="head">This page contains an example of pagination.
</h3>
<nav>
  <ul class="pagination">
    <li>
      <a href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    <li><a href="#">1</a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
    <li><a href="#">5</a></li>
    <li>
      <a href="#" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>
<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
 
</body>
</html>

style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Link Alerts using Bootstrap

 Earthcare Foundation NGO     21:17     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">

</head>
<body>
<h3 class="head">This page contains an example alerts.
</h3>
<div class="alert alert-success" role="alert">
Hi <a href="http://www.google.com" class="alert-link">Click Here</a> to go to google home page.
</div>

<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
 
</body>
</html>



style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Dismissable alert using Bootstrrap

 Earthcare Foundation NGO     21:13     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">

</head>
<body>
<h3 class="head">This page contains an example alerts.
</h3>
<div class="alert alert-success dismissable-alert" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
Hi this is a dismissable alert message for success
</div>

<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
 
</body>
</html>


style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Different types of Alerts in Bootstrap

 Earthcare Foundation NGO     21:10     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">

</head>
<body>
<h3 class="head">This page contains an example alerts.
</h3>
<div class="alert alert-success" role="alert">
Hi this is a alert message for success
</div>
<div class="alert alert-info" role="alert">
Hi this is a alert message for information
</div>
<div class="alert alert-warning" role="alert">
Hi this is a alert message for warning
</div>
<div class="alert alert-danger" role="alert">
Hi this is a alert message for danger
</div>
<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
 
</body>
</html>



style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}




Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Saturday, 21 February 2015

Wells in Bootstrap

 Earthcare Foundation NGO     01:40     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
</head>
<body>
<h3 class="head">This page contains an example of wells which are used to wrap a content within a rounded box.This can be used for notes and for any other inportant points.
</h3>
<div class="well">
<p>Hi I am learning bootstrap and i am just preparing some important points which will be beneficial for others who want to learn bootstrap.</p>
</div>
<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
</body>
</html>


style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thumbnail in Bootstrap

 Earthcare Foundation NGO     01:39     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
</head>
<body>
<h3 class="head">This page contains an example of media objects which are used to display some media such as audio or video along with some textual information.
</h3>
<div class="row">
<div class="col-sm-6">
<a href="#" class="thumbnail">
<img src="css/a.png" alt="image">
</a>
<div class="caption">
<h2>Beautiful Image</h2>
</div>
</div>
<div class="col-sm-6">
<a href="#" class="thumbnail">
<img src="css/ab.png" alt="image">
</a>
<div class="caption">
<h2>Awesome Image</h2>
</div>
</div>
</div>
<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
</body>
</html>


style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tab links in Bootstrap

 Earthcare Foundation NGO     01:38     Bootstrap     No comments   

<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/style.css" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>My First Bootstrap Application</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
</head>
<body>
<h3 class="head">This page contains an example of tab like links.By default home page is active.
</h3>
<ul class="nav nav-tabs">
<li class="active"> <a href="#">Home</a></li>
<li ><a href="#">Jokes</a></li>
<li><a href="#">Help</a></li>
<li><a href="#">About Us</a></li>
</ul>

<script src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
</body>
</html>



style.css

.col1{
background: red;
}
.col2{
background: green;
}
.col3{
background: yellow;
}
.col4{
background: blue;
}
.head{
background: yellow;
}






Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Ad


Jobsmag.inIndian Education BlogThingsGuide

Subscribe

Do you want fresh and hot updates about us? Then subscribe to our Feeds.

Total Pageviews

Popular Posts

  • Write a program in PL/SQL to print the factorial of a number.
    In this post I will explain how to get the factorial of any given number. For that first you need to know what is the procedure to find ...
  • To find the GCD of two numbers in PROLOG.
    gcd(X,Y):-X=Y,write('GCD of two numbers is '),write(X); X=0,write('GCD of two numbers is '),write(Y); Y=0,write('G...
  • Write a PL/SQL code to get the Fibonacci Sequence
    First, I will explain what is Fibonacci Sequence and how to get this series. So, Fibonacci Sequence is a series of numbers 0,1,1,2,3,5,8,1...

Label

All Articles Best Resources Blogging Boost Traffic Bootstrap C Plus Plus Collection Comedy Comedy Posts Comedy Videos Concurrency creative commons website Education Employee Entertainment Fibonacci Sequence free images GirlFriend Hinglish Cafe How To Image Websites Inspirational Java Java Interview Questions Java Networking Kavita Sangrah Life Lock Sreen Love Number System Patterns Perl Picture PL/SQL Plastic Engineering Programming Prolog public domain SEO Servlet Short Story Shortcut Keys Social Media Social Services SQL SuVichar Thread Traffic True Events Ultimate Guide Windows Tricks Windows8.1 WordPress

Blog Archive

  • ►  2020 (43)
    • ►  September (41)
    • ►  August (2)
  • ►  2019 (1)
    • ►  July (1)
  • ►  2018 (9)
    • ►  September (7)
    • ►  July (1)
    • ►  May (1)
  • ►  2017 (8)
    • ►  June (3)
    • ►  May (3)
    • ►  March (1)
    • ►  January (1)
  • ►  2016 (2)
    • ►  September (1)
    • ►  January (1)
  • ▼  2015 (91)
    • ►  December (1)
    • ►  November (1)
    • ►  October (6)
    • ►  May (10)
    • ►  March (20)
    • ▼  February (50)
      • Different formats in Perl
      • Format Headers in Perl
      • File handling in Perl
      • List count in Perl
      • List all files in a directory using Perl
      • Pattern matching in Perl
      • Rand() function in Perl
      • sleep in Perl
      • Various string operations in Perl
      • Subroutines in Perl
      • Upper case to Lower Case In Perl
      • Variable Validation in Perl
      • Warn in Perl
      • die in perl
      • Sub Routines in Perl
      • Array Sorting in Perl
      • Array in perl
      • Array Functions in Perl
      • Array Functions in Perl:Chop()
      • Array Functions in Perl:Sort()
      • Array Alias in Perl
      • Arrays in Perl
      • Arithmetic Operations in Perl
      • Pagination using Bootstrap
      • Link Alerts using Bootstrap
      • Dismissable alert using Bootstrrap
      • Different types of Alerts in Bootstrap
      • Wells in Bootstrap
      • Thumbnail in Bootstrap
      • Tab links in Bootstrap
      • Push and pull in Bootstrap
      • Pill links in Bootstrap
      • Panels in Bootstrap
      • Offset in Bootstrap
      • Nested columns in Bootstrap
      • Navbars in Bootstrap
      • Media Objects in Bootstrap
      • List Groups in Bootstrap
      • Labels in Bootstrap
      • Inline forms in Bootstrap
      • Horizontal forms in Bootstrap
      • Various validation state in Bootstrap
      • Disable input in Bootstrap
      • Headers using Bootstrap
      • Glyphicons in Bootstrap
      • Dynamic layout in Bootstrap
      • Buttons in Bootstrap
      • Simple form using Bootstrap
      • Badges in Bootstrap
      • Grid Layout in Bootstrap
    • ►  January (3)
  • ►  2014 (339)
    • ►  December (1)
    • ►  October (55)
    • ►  September (58)
    • ►  August (94)
    • ►  July (64)
    • ►  June (67)
  • ►  2013 (34)
    • ►  August (5)
    • ►  April (29)
  • ►  2012 (20)
    • ►  November (1)
    • ►  October (15)
    • ►  September (4)

Author

  • Earthcare Foundation NGO
  • Kavita house
  • Unknown
  • Unknown

Info

Copyright © Hub Of Geekz | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates