Month: February 2014

HTML Table Example

Posted on Updated on

Table Examples
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body>
<table align=”center” border=”1″  style=”width: 80%”>
<tr>
<td align=”center” style=”width:250px” >
</td>
<td style=”width:250px”>
Namee</td>
<td style=”width:250px”>
<input id=”Text1″ type=”text” /></td>
</tr>
<tr>

<td style=”width:250px”>
Address</td>
<td style=”width:250px”>
<input id=”Text2″ type=”text” /></td>
<td>
</td>
</tr>
<tr>

<td style=”width:250px”>
</td>
<td align=”center” style=”width:250px”>
<input id=”Button2″ type=”button” value=”Save” /></td>
<td>
</td>
</tr>
</table>
</body>
</html>

Table Row Vertical Align
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table border=”1″ style=”height:200px”>
<tr valign=”middle”>
<th>Month</th>
<th>Savings</th>
</tr>
<tr valign=”bottom”>
<td>January</td>
<td>$100</td>
</tr>
</table>
</body>
</html>

Table Cell Align – Center

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table border=”1″ style=”width: 100%;”>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>

<tr>
<td style=”height:107px”>

</td>
<td align=”center” valign=”top” style=”height:107px”>
<input id=”Submit1″ type=”submit” value=”submit” />
</td>
<td style=”height:107px”>
</td>
</tr>
<tr>
<td> &nbsp;</td>
<td> &nbsp;</td>
<td> &nbsp;</td>
</tr>
</table>
</body>
</html>

Table Background Image

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”#ccffff”>
<table background=”http://www.tizag.com/pics/htmlT/background.jpg&#8221;
style=”width: 80%; height: 192px;”>
<tr>
<td>   </td>
<td>   </td>
<td>   </td>
</tr>
<tr>
<td>    </td>
<td>    </td>
<td>    </td>
</tr>
<tr>
<td>
</td>
<td align=”center”>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>

Column Spanning in multiple Cells in Table

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body>

<table border=”1″ style=”width:75%;”>
<tr>
<td>               </td>
<td style=”width:250px”>
<input id=”Text2″ type=”text” /></td>
<td>
</td>
</tr>
<tr>
<td>                </td>
<td style=”width:250px”>
<input id=”Text1″ type=”text” /></td>
<td>
</td>
</tr>
<tr>
<td>                </td>
<td align=”center” colspan=”2″>
<input id=”Submit1″ type=”submit” value=”submit” /></td>
</tr>
</table>

</body>
</html>

HTML Example Body Color of a web page

Posted on

Body Color of a web page
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<title></title>
</head>
<body bgcolor=”silver” style=”font-family:arial;color:red;font-size:20px;” text=”Red”>
<p>
This is to test the properties of body
</p>
</body>
</html>

DERIVATIVE FORMULAS

Posted on

DERIVATIVE FORMULAS

Posted  by Vissicomp Technology Pvt Ltd

http://www.vissicomp.com

DERIVATIVE FORMULAS
DERIVATIVE FORMULAS

INTEGRATION FORMULAS

Posted on

Integration Formulas

Posted by Vissicomp technolgy Pvt Ltd

http://www.vissicomp.com

Probability problems

Posted on

Steps to solve pr0bability problems

  1. Identify events for which probability is to be determined asked in the question.
  2. Calculate total number of possible outcomes (items)
  3. Calculate probability of each event
  4. Add probability of each event (if it is required)

 

Example

A box is filled with cubes of different colors. There are 40 White cubes, 24 Green, 12 Red, 24 Golden, and 20 Blue cubes. If you have to select a cube without looking into the box, what is the Probability that you will pick a White or a Blue cube?

Solution

Step 1                    See that you have to determine probability of 2 events

(a) Picking a White cube
(b) Picking a Blue cube

Step 2                       2 total numbers of cubes

Step 3                     Find the probability of picking a White

Find the probability of picking a White

Step 4                   Now add the two probabilities together

Thus probability that you will pick a White or a Blue cube is 1/2

 

Posted by Vissicomp Technology Pvt Ltd.

http://www.vissicomp.com

Program to convert infix to postfix expression

Posted on

Data Structure

Infix to postfix

Program to convert infix to postfix expression

#include<stdio.h>

#include<conio.h>

#include<alloc.h>

char inf[40],post[40];

int top=0,st[20];

void postfix();

void push(int);

char pop();

void main()

{

clrscr();

printf(“Enter the infix expression\n\n”);

scanf(“%s”,inf);

postfix();

getch();

}

void postfix()

{

int i,j=0;

for(i=0;inf[i]!=”;i++)

{

switch(inf[i])

{

case ‘+’:while(st[top]>=1)

post[j++]=pop();

push(1);

break;

case ‘-‘:while(st[top]>=1)

post[j++]=pop();

push(2);

break;

case ‘*’:while(st[top]>=1)

post[j++]=pop();

push(3);

break;

case ‘/’:while(st[top]>=1)

post[j++]=pop();

push(4);

break;

case ‘^’:while(st[top]>=1)

post[j++]=pop();

push(5);

break;

case ‘(‘:push(0);

break;

case ‘)’:while(st[top]!=0)

post[j++]=pop();

top–;

break;

default:post[j++]=inf[i];

}

}

while(top>0)

post[j++]=pop();

printf(“postfix expression is \n\n %s”,post);

}

void push(int ele)

{

top++;

st[top]=ele;

}

char pop()

{

int el;

char e;

el=st[top];

top–;

switch(el)

{

case 1:e=’+’;

break;

case 2:e=’-‘;

break;

case 3:e=’*’;

break;

case 4:e=’/’;

break;

case 5:e=’^’;

break;

}

return e;

}

Output

 

Posted by Vissicomp Technology Pvt Ltd

http://www.vissicomp.com

Transmisssion Control Protocol (TCP)

Posted on

Transmisssion Control Protocol (TCP)

Transmission Media

  2.) Unguided Media: WIRELESS

Unguided media transport electromagnetic waves without using a physical conductor.

This type of communication is often referred to as wireless communication. Signals are normally broadcast through free space and thus are available to anyone who has a device capable of receiving them. Figure below shows the part of the electromagnetic spectrum, ranging from 3 kHz to   900 THz, used for wireless communication.


Unguided signals can travel from the source to destination in several ways: ground propagation, sky propagation, and line-of-sight propagation. We can divide wireless transmission into three broad groups: radio waves, microwaves, and infrared waves.

 

Radio Waves

  • Radio waves are used for multicast communications, such as radio and television, and paging systems. They can penetrate through walls.
  • Highly regulated.
  • Use omni directional antennas

 

Applications

The omnidirectional characteristics of radio waves make them useful for multicasting, in which there is one sender but many receivers. AM and FM radio, television, maritime radio, cordless phones, and paging are examples of multicasting.

 

Microwaves

  • Microwaves are used for unicast communication such as cellular telephones, satellite networks, and wireless LANs.
  •  Higher frequency ranges cannot penetrate walls.
  •  Use directional antennas – point to point line of sight communications.

 

Applications

Microwaves, due to their unidirectional properties, are very useful when unicast

(one-to-one) communication is needed between the sender and the receiver. They are

used in cellular phones , satellite networks ,and wireless LANs.

 

Infrared

  • Infrared signals can be used for short-range communication in a closed area using line-of-sight propagation.
  • Transceivers must be within line of sight of each other (directly or via reflection ).
  • Infrared does not penetrate walls.

Posted by Vissicomp Technology

http://www.vissicomp.com

 

Nagle’s Algorithm & Silly Window Syndrome

Posted on

a) What is Nagle’s Algorithm.

b) What is Silly window syndrome. Explain Clark’s solution to the Silly window      syndrome.

Solution :

a) The main purpose of Nagle’s algorithm is to avoid inefficient use of bandwidth. When data come into the sender one byte at a time, just send the first byte and buffer all the rest until the outstanding byte is acknowledged. Then send all the buffered characters in the TCP segment and start buffering again until they are all acknowledged. If the user is typing quickly and the network is slow, a substantial number of characters may go in each segment, greatly reducing the bandwidth used.

The algorithm additionally allows a new packet to be sent if enough data have trickled in to fill half the window or a maximum segment.

b) Silly window syndrome is a problem that can degrade TCP performance.

This problem occurs when data are passed to the sending TCP entity in large blocks, but an interactive application on the receiving side reads data 1 byte at a time.

Clark’s solution is to prevent the receiver from sending a window update for 1 byte.

Instead it is forced to wait until it has a decent amount of space available and advertise that instead. Specifically, the receiver should not send a window update until it can handle the maximum segment size it advertised when the connection was established or until its buffer is half empty, whichever is smaller.

The sender can also help by not sending tiny segments. Instead, it should wait until it has accumulated enough space in the window to send a full segment or at least one containing half of the receiver’s buffer size.

Nagle’s algorithm and Clark’s solution to the silly window syndrome are complementary. Nagle’s algorithm tries to solve the problem caused by the sending application delivering data to TCP a byte at a time. Clark’s solution tries to solve the problem of the receiving application sucking the data up from TCP a byte at a time.

Both solutions can work together. The goal is for the sender not to send small segments and the receiver not to ask for them.

Posted by Vissicomp Technology Pvt Ltd.

http://www.vissicomp.com

SQL JOIN TYPES

Posted on

SQL JOIN TYPES:

  • INNER JOIN: returns rows when there is a match in both tables.

The INNER JOIN creates a new result table by combining column values of two tables (table1 and table2) based upon the join-predicate. The query compares each row of table1 with each row of table2 to find all pairs of rows which satisfy the join-predicate. When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.

SELECT table1.column1, table2.column2...FROM table1
INNER JOIN table2 ON table1.common_field = table2.common_field;

 

  • LEFT JOIN: returns all rows from the left table, even if there are no matches in the right table. The SQL LEFT JOIN returns all rows from the left table, even if there are no matches in the right table. This means that if the ON clause matches 0 (zero) records in right table, the join will still return a row in the result, but with NULL in each column from right table.

This means that a left join returns all the values from the left table, plus matched values from the right table or NULL in case of no matching join predicate.

SELECT table1.column1, table2.column2...FROM table1 
LEFT JOIN table2 ON table1.common_field = table2.common_field;

 

  • RIGHT JOIN: returns all rows from the right table, even if there are no matches in the left table. The SQL RIGHT JOIN returns all rows from the right table, even if there are no matches in the left table. This means that if the ON clause matches 0 (zero) records in left table, the join will still return a row in the result, but with NULL in each column from left table. This means that a right join returns all the values from the right table, plus matched values from the left table or NULL in case of no matching join predicate.
SELECT table1.column1, table2.column2...FROM table1
RIGHT JOIN table2 ON table1.common_field = table2.common_field;

 

  • FULL JOIN: returns rows when there is a match in one of the tables. The SQL FULL JOIN combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side.
SELECT table1.column1, table2.column2...FROM table1
FULL JOIN table2 ON table1.common_field = table2.common_field;

 

  • SELF JOIN: is used to join a table to it as if the table were two tables, temporarily renaming at least one table in the SQL statement. The SQL SELF JOIN is used to join a table to it as if the table were two tables, temporarily renaming at least one table in the SQL statement.
SELECT a.column_name, b.column_name... FROM table1 a, table1 b
WHERE a.common_field = b.common_field;

 

  • CARTESIAN JOIN: returns the Cartesian product of the sets of records from the two or more joined tables. The CARTESIAN JOIN or CROSS JOIN returns the Cartesian product of the sets of records from the two or more joined tables. Thus, it equates to an inner join where the join-condition always evaluates to True or where the join-condition is absent from the statement.
SELECT table1.column1, table2.column2...
FROM  table1, table2 [, table3 ]

Posted by Vissicomp Technology Pvt Ltd
www.vissicomp.com

ASP.Net Page Life Cycle Events

Posted on

ASP.Net Page Life Cycle Events:

Following are the page life cycle events:

  • PreInit: PreInit is the first event in page life cycle. It checks the IsPostBack property and determines whether the page is a postback. It sets the themes and master pages, creates dynamic controls and gets and sets profile property values. This event can be handled by overloading the OnPreInit method or creating a Page_PreInit handler.
  • Init: Init event initializes the control property and the control tree is built. This event can be handled by overloading the OnInit method or creating a Page_Init handler.
  • InitComplete: InitComplete event allows tracking of view state. All the controls turn on view-state tracking.
  • LoadViewState: LoadViewState event allows loading view state information into the controls.
  • LoadPostData: During this phase, the contents of all the input fields defined with the <form> tag are processed.
  • PreLoad:PreLoad occurs before the post back data is loaded in the controls. This event can be handled by overloading the OnPreLoad method or creating a Page_PreLoad handler.
  • Load:  the Load event is raised for the page first and then recursively for all child controls. The controls in the control tree are created. This event can be handled by overloading the OnLoad method or creating a Page_Load handler.
  • LoadComplete: the loading process is completed, control event handlers are run and page validation takes place. This event can be handled by overloading the OnLoadComplete method or creating a Page_LoadComplete handler.
  • PreRender: The PreRender event occurs just before the output is rendered. By handling this event, pages and controls can perform any updates before the output is rendered.
  • PreRenderComplete: as the PreRender event is recursively fired for all child controls, this event ensures the completion of the pre-rendering phase.
  • SaveStateComplete: state of control on the page is saved. Personalization, control state and view state information is saved. The HTML markup is generated. This stage can be handled by overriding the Render method or creating a Page_Render handler.
  • UnLoad : The UnLoad phase is the last phase of the page life cycle. It raises the UnLoad event for all controls recursively and lastly for the page itself. Final cleanup is done and all resources and references, such as database connections, are freed. This event can be handled by modifying the OnUnLoad method or creating a Page_UnLoad handler.