Saturday 31 January 2015

Drop Down Menu using CSS



Click here to watch video!!!

DropDown.aspx File:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DropDown.aspx.cs" Inherits="DropDownMenuDemo.DropDown" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Drop Down Menu Demo</title>
    <link href="menu.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">

        <div id="menu">
            <ul>
                <li>
                    <a href="#">Home1</a>
                    <ul>
                        <li><a href="#">Page 1</a></li>
                        <li><a href="#">Page 2</a></li>
                        <li><a href="#">Page 3</a></li>
                    </ul>
                </li>

                <li>
                    <a href="#">Home2</a>
                    <ul>
                        <li><a href="#">Page 1</a></li>
                        <li><a href="#">Page 2</a></li>
                        <li><a href="#">Page 3</a></li>
                    </ul>
                </li>

                <li>
                    <a href="#">Home</a>                
                </li>
            </ul>

        </div>
    </form>
</body>
</html>



menu.css File:


        #menu{
            width:450px;
            margin-left:auto;
            margin-right:auto;
        }
        #menu ul{
            margin:0px;
            padding:0px;
            list-style-type:none;
        }

        #menu ul li{
            background-color:blue;
            position:relative;
            float:left;
        }
        #menu ul li ul li{
            background-color:black;
        }
        #menu ul li a{
            text-decoration:none;
            display:block;
            width:150px;
            height:30px;
            line-height:30px;
            text-align:center;
            color:cornsilk;
        }
        #menu ul li ul li a{
            width:200px;
        }
        #menu ul ul{
            position:absolute;
            visibility:hidden;
        }
        #menu ul li:hover ul{
            visibility:visible;
        }

        #menu ul li:hover{
            background-color:black;
        }

        #menu ul li ul li a:hover{
            background-color:yellow;
            color:black;
            border:1px solid black;
            margin-left:-1px;
        }



Thursday 29 January 2015

Regular expression for validating 10 digit mobile number

Regular expression for validating 10 digit mobile number is:


Confirmation before deleting in ASP.NET


To ask for confirmation before deleting in ASP.NET when a user clicks a button use the following code:

<asp:Button ID="btnDel" runat="server"  OnClientClick="return confirm('Are you sure to delete?')" Text="Delete"  />


Selecting the text in textbox when user clicks it


To select the all text you can use the following javascript snippet:

onClick="this.select();"

But it doesn't work on mobile Safari. In those cases you can use:


onClick="this.setSelectionRange(0, this.value.length);"

Regular expression for validating Emails

Regular expression for validating Emails is:


Regular Expression for validating Dates

Regular expression for validating dates is:


Tuesday 27 January 2015

Cloud Computing PPT 1

Artificial Intelligence Notes- Set 5



To Download as .ZIP file click the following link:


Click here to download


Artificial Intelligence Notes- Set 4



To Download as .ZIP file click the following link:


Click here to download


Artificial Intelligence Notes- Set 3



To Download as .ZIP file click the following link:


Click here to download


Artificial Intelligence Notes- Set 2




To Download as .ZIP file click the following link:


Click here to download

Artificial Intelligence Notes- Set 1




To Download as .ZIP file click the following link:


Click here to download


Saturday 24 January 2015

How to set minimum length of a textbox in ASP.NET?


Firstly add following script in head section:

<script type="text/javascript">

function MinLength(sender, args) {

args.IsValid = (args.Value.length == 10);

}

</script>

This script is for setting minimum length to 10

Now add custom validator as:

<asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="txtMobile" CssClass="error" ErrorMessage="Invalid" ClientValidationFunction="MinLength"></asp:CustomValidator>

 

How to send mail from any gmail account in ASP.NET?


To send mail use the following code:

Firstly add the following namespace:
using System.Net.Mail;

Then write the following code:

//Create a Client
 
 
SmtpClient client = new SmtpClient("smtp.gmail.com");

client.EnableSsl = true;

client.Port = 587;

client.Credentials = new System.Net.NetworkCredential("xyz@gmail.com", "password");

MailMessage mail = new MailMessage("From@gmail.com", "To@gmail.com", "Subject", "Body");

client.Send(mail);

Thursday 22 January 2015

Styled Textbox using CSS


The following CSS will style the textbox.

.styled-textbox{
    border:1px solid #d1c7ac;
    width: 200px;
    height:30px;
    padding:5px;
    background: -moz-linear-gradient(center top , #FFF, #EEE 1px, #FFF 25px) repeat scroll 0% 0% transparent;
}
.styled-textbox:hover{
    border:1px solid #25A6E1;
}
.styled-textbox:focus{
box-shadow: 0px 0px 5px #00AFC7;
 border:1px solid #25A6E1;
}

Preview:



Now to style any textbox as above add above css class(.styled-textbox) to it .For example:

In HTML:
<input type="text" id="textbox1" placeholder="Type Here" class="styled-textbox" />

In ASP.NET:
<asp:Textbox ID="Button1" runat="server" placeholder="Type Here" CssClass="styled-textbox" />

Styled button using CSS


The following css class will style the button.


.styled-button-green {
    background:#5CCD00;
    padding:10px 15px;
    color:#fff;
    font-family:'Helvetica Neue',sans-serif;
    font-size:16px;
    border-radius:5px;
    border:1px solid #459A00
}


  

Preview:



Now to style any button, assign the above css class(styled-button-green) to the button. For example:

In HTML:
<input type="button" id="Button1" class="styled-button-green" />

In ASP.NET:
<asp:Button ID="Button1" runat="server" CssClass="styled-button-green" />

Lengths and percentages in CSS


There are many property specific units for values used in CSS, but there are some general units that are used in a number of properties.

em
em is unit for the calculated size of a font. For example:
font-size:2em;
Here 2em, is two times the current font size.

px
px is unit for pixels. For example:
font-size:20px; 

pt
pt is unit for points. For example:
font-size:20pt; 

%
% is unit for percentage. For example:
font-size:20%;

Other units include pc(picas), cm(centimetres), mm(millimetres) and in(inches).

When a value is zero, you need not to state a unit.

It is generally accepted that 'em' or '%' are the best units to use for font-sizes, rather than 'px', which leads to non-resizable text in most browsers.

CSS Selectors, Properties, and Values


Selectors


Whereas HTML has tags, CSS has selectors. Selectors are the names given to styles in internal and external style sheets.

Tag Selector

We can use HTML tags as CSS selectors. For example:

p{
color: blue;
}

Here all HTML 'p' tags are referenced. It will make the font-color of each p tag as blue

Another example inculde:

body{
backround-color:blue;
}


ID selector

We can assign a HTML tag a ID and then can use it as a selector. For example:

<P id="Para1">This is a paragraph</P>

then we can use it as:

#Para1{
color:blue;
}

# is necessary. ID should be unique, i.e. no two tags can have same ID


Class Selector

We can assign a class to HTML tags and then can use it as a selector. For example:

<P class="P1">Paragraph1</P>
<P class="P1">Paragraph2</P>
<P>Paragraph3</P>

then we can use it as:

.P1{
color:blue;
}

It will be as:

Paragraph1
Paragraph2
Paragraph3


Properties

For each selector there are properties inside curly brackets, which simply take the form of words such as color,background-color, font-size etc.

These are the properties of HTML tags which can be changed. For example, to change the color of text use 'color' , to change the size of text use 'font-size' , to change the background color use 'background-color' and many more.



Values

A value is given to the properties following a colon, and semicolon seperates the properties. For example:

body{
font-size:0.8em;
color:blue;
}


Syntax of CSS

Syntax of css is:

selector{
property1:value;
property2:value;
..
..
propertyN:value;
}

CSS syntax includes the following things:
  • Selector
  • Property
  • Value

What is Selector, Property, Value?

Wednesday 21 January 2015

Programming Quiz-80


If a program file sample.c is compiled on Linux/Unix platform what will be default name of executable file?

a) sample.exe
b) a.out
c) sample.bin
d) sample.obj

Answer: B

Programming Quiz-79


Testing of a program is done to ensure that it

a) should not contain any syntax error
b) performs its intended task
c) compiles successfully
d) should not run infinitely

Answer: B

Programming Quiz-78


The term bug refers to

a) Syntax Error
b) Logical Error
c) Runtime Error
d) All of above

Answer: D

Programming Quiz-77

Find the odd term

a) Source Code
b) Object Code
c) Executable Code
d) ASCII Code

Answer: D

Programming Quiz-76

The Acronym ANSI stands for _______________

a) American National Standards International
b) American National Software Incorporation
c) American National Standards Institute
d) American National Standards Instructions

Answer: C

Monday 19 January 2015

What is External Style Sheet?


Click here to watch video now!!!

An external style sheet is a text document (file) containing the style definition. External Style sheets are used to control the style for entire website.
For example:

----external.html----

<HTML>
<HEAD>
<TITLE>External Style Sheet</TITLE>
<LINK href="style.css" rel="Stylesheet"></LINK>
</HEAD>
<BODY>
<P>This is Paragraph 1</P>
<P>This is Paragraph 1</P>
<P>This is Paragraph 1</P>
</BODY>
</HTML>


---style.css---

p{
color:blue;
}



What is Embedded or Internal Style Sheet?


Click here to watch video now!!!

Embedded or internal style is applied to the entire HTML file. It is used when you need to modify all instances of a particular element in a web page.
For example:


<HTML>
<HEAD>
<TITLE>Internal Style Sheet</TITLE>
<STYLE type="Text/CSS">
p{
 Color: blue;
}
</STYLE>
</HEAD>
<BODY>
<P >This paragraph 1</P>
<P >This paragraph 1</P>
<P >This paragraph 1</P>
</BODY>
</HTML>


What is Inline Style Sheet?


Click here to watch Video now!!!

Inline Style Sheet is the most basic style sheets used, which can be applied to individual elements in the web page. Inline styles are implemented by using style attribute with HTML tags. Inline styles are used when you just need to format just a single section in a web page.
For example:

<HTML>
<HEAD>
<TITLE>Inline Style Sheet</TITLE>
</HEAD>
<BODY>
<P >This is simple paragraph.</P>
<P style="color:Blue">This is paragraph with inline style.</P>
</BODY>
</HTML>



Types of stylesheets

What is Cascading Style Sheets (CSS)?




A Style Sheet Language, or style language, is a computer language that expresses the presentation of structured documents. One attractive feature of structured documents is that the content can be reused in many contexts and presented in various ways. Different style sheets can be attached to the logical structure to produce different presentations.

Style Sheets enforce standards and uniformity throughout a website. 

Style Sheets are said to cascade when they combine to specify the appearance of a page.

Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language. While most often used to change the style of web pages and user interfaces written in HTML and XHTML, the language can be applied to any kind of XML document, including plain XML, SVG and XUL. Along with HTML and JavaScript, CSS is a cornerstone technology used by most websites to create visually engaging webpages, user interfaces for web applications, and user interfaces for many mobile applications.


Friday 9 January 2015

Nextgen Media Player


Nextgen Media Player has following features:

  • Eye Catching user interface
  • Mini & Compact  player mode
  • Fast Searching of Files
  • Playlist & Library support
  • Edit music information

 https://www.youtube.com/watch?v=y093ZW5jeWU&feature=youtu.be

Watch the working of Encrypt Decrypt V1.0- Folder Locking


Watch the working of Encrypt Decrypt V1.0- Folder Locking


https://www.youtube.com/watch?v=UyuWAptYy6o&feature=youtu.be

Code names for Windows Phones


Code names for Windows Phones

Version Codename
Windows Phone 7 Photon
Windows Phone 7.5 Mango
Windows Phone 8 Apollo
Windows Phone 8.1 Blue

Tuesday 6 January 2015

Types of SQL keys


We have following types of keys in SQL which are used to fetch records from tables and to make relationship among tables or views.
  1. Super Key

    Super key is a set of one or more than one keys that can be used to identify a record uniquely in a table.Example :Primary key, Unique key, Alternate key are subset of Super Keys.

  2. Candidate Key

    A Candidate Key is a set of one or more fields/columns that can identify a record uniquely in a table. There can be multiple Candidate Keys in one table. Each Candidate Key can work as Primary Key.

  3. Primary Key

    Primary key is a set of one or more fields/columns of a table that uniquely identify a record in database table. It can not accept null, duplicate values. Only one Candidate Key can be Primary Key.

  4. Alternate key

    A Alternate key is a key that can be work as a primary key. Basically it is a candidate key that currently is not primary key.

  5. Composite/Compound Key

    Composite Key is a combination of more than one fields/columns of a table. It can be a Candidate key, Primary key.

  6. Unique Key

    Uniquekey is a set of one or more fields/columns of a table that uniquely identify a record in database table. It is like Primary key but it can accept only one null value and it can not have duplicate values.

  7. Foreign Key

    Foreign Key is a field in database table that is Primary key in another table. It can accept multiple null, duplicate values.

Necessary and Sufficient Conditions for a Deadlock


Coffman (1971) identified four (4) conditions that must hold simultaneously for there to be a deadlock.

1. Mutual Exclusion Condition
The resources involved are non-shareable.
Explanation: At least one resource (thread) must be held in a non-shareable mode, that is, only one process at a time claims exclusive control of the resource. If another process requests that resource, the requesting process must be delayed until the resource has been released.


2. Hold and Wait Condition
Requesting process hold already, resources while waiting for requested resources.
Explanation: There must exist a process that is holding a resource already allocated to it while  waiting for additional resource that are currently being held by other processes.

 
3. No-Preemptive Condition
Resources already allocated to a process cannot be preempted.
Explanation: Resources cannot be removed from the processes are used to completion or released voluntarily by the process holding it.
 
 
4. Circular Wait Condition
The processes in the system, form a circular list or chain where each process in the list is waiting for a resource held by the next process in the list.

Sunday 4 January 2015

Programming Quiz-74



main()
{
signed int bit=512, mBit;

{
mBit = ~bit;
bit = bit & ~bit ;

printf("%d %d", bit, mBit);
}
}

a. 0, 0
b. 0, 513
c. 512, 0
d. 0, -513 


Answer: D

Programming Quiz-73


main()
{
if ((1||0) && (0||1))
{
printf("OK I am done");
}
else
{
printf(“OK I am gone”); }
}

a. OK I am done
b. OK I am gone
c. compile error
d. none of the above 


Answer:  A

Programming Quiz-72



main()
{
if (!(1&&0))
{
printf("OK I am done.");
}
else
{
printf(“OK I am gone.”); }
}

a. OK I am done
b. OK I am gone
c. compile error
d. none of the above 


Answer: A

Programming Quiz-71



main()
{
signed int bit=512, i=5;

for(;i;i--)
{
printf("%d\n", bit >> (i - (i -1)));
}
}

a. 512, 256, 0, 0, 0
b. 256, 256, 0, 0, 0
c. 512, 512, 512, 512, 512
d. 256, 256, 256, 256, 256 


Answer: D

Programming Quiz-70



main()
{
signed int bit=512, i=5;

for(;i;i--)
{
printf("%d\n", bit = (bit >> (i - (i -1))));
}
}
 

a. 512, 256, 128, 64, 32
b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4
  

Answer: B

Programming Quiz-69



main()
   {
   int i;
   for(i=0;i<5;i++)
    {
    printf("%d\n", 1L << i);
   }
 }
 

a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16 


Answer: D

Programming Quiz-68



main()
{
  unsigned int bit=256;
  printf(“%d”, bit); }
   {
  unsigned int bit=512;
  printf(“%d”, bit); }
}

a. 256, 256
b. 512, 512
c. 256, 512
d. Compile error 


Answer: D

Programming Quiz-67



main()
  {
  int x=5;
  for(;x!=0;x--) {
  printf(“%d\n”, x--); }
  }
 

a. 5, 4, 3, 2,1
b. 4, 3, 2, 1, 0
c. 5, 3, 1
d. none of the above 


Answer: C

Programming Quiz-66



main()
  {
  int x=5;
  for(;x==0;x--) {
  printf(“x=%d\n”, x--); }
 }



 

a. 4, 3, 2, 1, 0
b. 1, 2, 3, 4, 5
c. 0, 1, 2, 3, 4
d. none of the above 


Answer: D

Programming Quiz-65


main()
  {
   int i =10, j = 20;
   printf("%d, %d\n", j-- , --i);
   printf("%d, %d\n", j++ , ++i);
  }

a. 20, 10, 20, 10
b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10 


Answer: C

Programming Quiz-64


void main ()
  {
  int x = 10;
  printf ("x = %d, y = %d", x,--x++);
 }

a. 10, 10
b. 10, 9
c. 10, 11
d. none of the above 


Answer: D

Programming Quiz-63


main()
  {
   char c;
   int i = 456;
   c = i;
   printf("%d", c);
 }

a. 456
b. -456
c. random number
d. none of the above 


Answer: C

Programming Quiz-62



main()
{
  int c = 5;
  printf("%d", main|c);
}

a. 1
b. 5
c. 0
d. none of the above 


Answer: D

Programming Quiz-61


void func1(int (*a)[10])
{
printf("Ok it works");
}

void func2(int a[][10])
{
  printf("Will this work?");
}

main()
{
  int a[10][10];
  func1(a);
  func2(a);
}

a. “Ok it works” 

b. “Will this work?” 
c. “Ok it works Will this work?” 
d. None of the above 

Answer : C

Programming Quiz-60


main()
{
  char *a = "Hello ";
  char *b = "World";
  printf("%s", strcpy(a,b));
}

a. “Hello” 

b. “Hello World” 
c. “HelloWorld” 
d. None of the above 

Answer: D

Programming Quiz-59


main()
{
 char *a = "Hello ";
 char *b = "World";
 printf("%s", strcat(a,b));
}

a. “Hello” 

b. “Hello World” 
c. “HelloWorld” 
d. None of the above

Answer: C