Sunday, 28 December 2014

Multiplexing and De-Multiplexing by Transport Layer

Multiplexing and De-multiplexing are the two very important functions that are performed by Transport Layer.


Transport layer at the sender side receives data from different Applications ,
encapsulates every packet with a Transport Layer header and pass it on to the underlying
This job of transport layer is known as Multiplexing.

At the receiver's side, the transport gathers the data, examines it socket and passes the
data to the correct Application.

This is known as De-Multiplexing.

Sockets are the door between Transport and Application Layer.
 If you want to read about socket, visit this.Socket.  Let us take a very simple example that
will make you clear with all these terms.

Suppose that there are two houses. One is in India and Other is in America. In the house in India,
 lives a person James along with his 5 children. And in the house in America, lives a person Steve
along with his 4 children.
Now all 5 children of James write a letter to every children of Steve on every Sunday.
Therefore total number of letters will be 20. Thus, all the children writes the letter , put them
in envelopes and hand over it to James.
Then James write source house address and the destination house address on the envelope
and give it to the postal service of India. Now the postal service of India puts some other
addresses corresponding to the country and delivers it to the America postal Service.
The American Postal sees the destination address on the envelopes and will deliver those
20 letters to the Steve House. Steve collects the letter from the postman and after considering
the name of his respective children on the envelopes, he gives the letter to each of them.

In this example we have processes and the layers. Let me explain.

Processes = children

Application Layer messages = envelopes

Hosts = The two Houses

Transport Layer Protocol = James and Steve

Network Layer protocol = Postal Service


When James collects all the letters from his children, he multiplexes all and
encapsulates them with the respective children name on the letter and  house address 
and give it to the Indian postal service.

On the receiving side, Steve collects all the letters from postal service
of America andde-multiplexes them to see , which letter is for which child and
 delivers it respectively.

multiplexing and demultiplexing in transport layer, socket programming in tcp, processes in application




Now  you must be clear with the Multiplexing and De-Multiplexing
procedures of Transport Layer.

Now you must be thinking that how the Transport layer come to know, to which socket ,
the packet has to be passed. So, I should help you with this confusion also.
This job is done by the Source Port Number and the Destination Port Number.
 As every Application has been given a particular port number.

Port Numbers are 16-bit numbers. Therefore, there can be total 2^16 i.e. 65535 port numbers , starting
from 0. The first 0 to 1023 port numbers are reserved for certain dedicated Applications such as HTTP,
FTP , E-mail etc. If you develop a new Application, then you must necessarily provide it with a
post number.

                                                      
                                                 Thank you for reading this article.


Saturday, 13 September 2014

HTML Tip:

Centering Images Is Harder Than You Think

  
 
We frequently get questions from subscribers who are having problems centering images - particularly when they're mixing the ALIGN attribute with style sheet properties. There are two main causes: HTML rules and browser compatibility issues.
Some Elements Center, Others Don't!
First, remember that the ALIGN attribute is a deprecated HTML attribute, meaning it's marked for deletion in future versions. Of course, deprecated doesn't mean that it will stop working tomorrow or even next year. But it does mean that you should be alert to display issues in current and future browser versions.
Since ALIGN may not behave as you expect, how should you center an image?
Your first thought is probably to include the align="center" property/value pair to your image tag. After all, it works for paragraphs, tables, and other elements:
<p align="center">paragraph content here</p>
<table align="center">table content here</table>
<div align="center">div content here</div>
<h2 align="center">header content here</h2>
The content inside those tags centers reliably across browsers because they're block-level tags. But the IMG tag is an inline element, so it displays relative to the content around it. That's why the only supported ALIGN values are those that indicate how text and other page elements should display in relation to the image.
You can move an image to the left or right on the Web page or control its vertical placement with the ALIGN property, but you can't center it using the ALIGN attribute. align="center" isn't valid HTML. All browsers ignore align="center" when it's part of an IMG tag.
Learn more about valid ALIGN values in a previous Webmaster Tip:Wrapping Text Around Images.
Deprecated Alignment Strategies
The simplest way to center an image is to place it inside opening and closing CENTER tags:
<center><img src="imgName.gif" alt="image description" height="100" width="100"></center>
Unfortunately, the CENTER tag is also deprecated and becoming somewhat unreliable in the most recent browser versions.
Another simple solution is to enclose the image inside a page element that CAN be aligned to the center - such as a paragraph or a DIV tag:
<p align="center"><img src="imgName.gif" alt="image description" height="100" width="100"></p>

<div align="center"><img src="imgName.gif" alt="image description" height="100" width="100"></div>
That solution works in all browsers, but you'll have to contend with the extra spaces that browsers automatically place above and below block-level tags. You'll have less control over page layout and display with this method. And remember that both rely on a deprecated HTML tag or attribute.
But a more pressing problem is that once an element or attribute is deprecated there are no firm rules governing how browsers should display it. Most browsers continue to recognize the tag or attribute, but you'll probably encounter display differences between browsers and browser versions.
Cascading Style Sheets (CSS) offer more alternatives, but also have their own set of browser display problems.
Aligning Images With CSS
The most obvious CSS solution is to use the text-align property to center the image. Unfortunately, that has the same effect as adding align="center" to the image tag: browsers ignore it entirely!
Instead, you'll have to apply the text-align property to the container element (the paragraph, DIV, or other block-level element that contains the image).
Create a style class and add it to the HEAD section of your page. Even better, add it to your external style sheet and use it on every page!
<style type="text/css">
  .centeredImage
    {
    text-align:center;
    margin-top:0px;
    margin-bottom:0px;
    padding:0px;
    }
</style>
Then, apply the class to the container element:
<p class="centeredImage"><img src="imgName.gif" alt="image description" height="100" width="100"></p>
That's slightly more trouble than just applying align="center" to the paragraph tag, but it has the added benefit of giving you more control over the spacing around the image. Note that in our example, we set the margin and padding values to zero pixels to avoid extra spacing that may push important content farther down the page.
Browser Display Issues And ALIGN
Of course, if you're moderately familiar with CSS, you may have already asked yourself this question:
"Why not just control the inline element problem by converting the problem image from an inline to a block-level tag?"
Yes, it seems simple. Just add this class:
<style type="text/css">
  .centeredImage
    {
    text-align:center;
    display:block;
    }
</style>
and apply it to the IMG you want to center:
<img src="imgName.gif" class="centeredImage" alt="image description" height="100" width="100">
That eliminates the extra code needed for the container tag.
That is (or seems to be) the easiest and most elegant solution. And it is - for Explorer browsers. Other browsers follow W3C standards more strictly than Explorer (even Explorer 6.x) and don't allow you to convert images from inline to block. Just to make it even more confusing though, some of those browsers do allow you to convert other inline elements to block-level!
Carefully check for display problems if you apply styles to any page element that also uses the ALIGN attribute. Some browsers may ignore the deprecated ALIGN attribute value. This is a particular problem in tables.
Always remember to check for coding errors and browser display problems whenever you make changes to your HTML code or your CSS specifications. Verify changes quickly and easily using HTML Toolbox and Browser Photo.
Toolbox scans your page for HTML coding errors and alerts you if you've used browser-specific code. Browser Photo shows you actual screen shots of your page in 16 different browsers, browser versions, and operating system combinations.

Monday, 8 September 2014

Microsoft Excel shortcut keys

Below is a listing of all the major shortcut keys in Microsoft Excel.    
Shortcut
Description
F2
Edit the selected cell.
F3
After a name has been created F3 will paste names.
F4
Repeat last action. For example, if you changed the color of text in another cell pressing F4 will change the text in cell to the same color.
F5
Go to a specific cell. For example, C6.
F7
Spell check selected text or document.
F11
Create chart from selected data.
Ctrl + Shift + ;
Enter the current time.
Ctrl + ;
Enter the current date.
Alt + Shift + F1
Insert New Worksheet.
Alt + Enter
While typing text in a cell pressing Alt + Enter will move to the next line allowing for multiple lines of text in one cell.
Shift + F3
Open the Excel formula window.
Shift + F5
Bring up search box.
Ctrl + 1
Open the Format Cells window.
Ctrl + A
Select all contents of the worksheet.
Ctrl + B
Bold highlighted selection.
Ctrl + I
Italic highlighted selection.
Ctrl + K
Insert link.
Ctrl + S
Save the open worksheet.
Ctrl + U
Underline highlighted selection.
Ctrl + 1
Change the format of selected cells.
Ctrl + 5
Strikethrough highlighted selection.
Ctrl + P
Bring up the print dialog box to begin printing.
Ctrl + Z
Undo last action.
Ctrl + F3
Open Excel Name Manager.
Ctrl + F9
Minimize current window.
Ctrl + F10
Maximize currently selected window.
Ctrl + F6
Switch between open workbooks or windows.
Ctrl + Page up
Move between Excel work sheets in the same Excel document.
Ctrl + Page down
Move between Excel work sheets in the same Excel document.
Ctrl + Tab
Move between Two or more open Excel files.
Alt + =
Create a formula to sum all of the above cells
Ctrl + '
Insert the value of the above cell into cell currently selected.
Ctrl + Shift + !
Format number in comma format.
Ctrl + Shift + $
Format number in currency format.
Ctrl + Shift + #
Format number in date format.
Ctrl + Shift + %
Format number in percentage format.
Ctrl + Shift + ^
Format number in scientific format.
Ctrl + Shift + @
Format number in time format.
Ctrl + Arrow key
Move to next section of text.
Ctrl + Space
Select entire column.
Shift + Space
Select entire row.
Ctrl + -
Delete the selected column or row.
Ctrl + Shift + =
Insert a new column or row.
Ctrl + Home
Move to cell A1.
Ctrl + ~
Switch between showing Excel formulas or their values in cells.


Monday, 12 May 2014

Differences Between Data and Information


difference between data and informationThe terms “data” and “information” are sometimes thought to be synonyms and might be used interchangeably because they both bestow some kind of knowledge upon the person on the receiving end. This is incorrect in that, while interrelated and similar in meaning, each word means actually something very specific and quite different. Not only do they have real world differences, they also play different but similar roles in the world of computing, which you can learn more about in this course about the Zen of Data. We will discuss how these two terms differ conceptually in both the everyday world as well as the world of technology.

Data Vs. Information

While this may sound like the most boring fight ever, possibly involving pocket protectors as weapons, these two concepts are basically two sides of the same coin and, in a way, two integral parts of the learning process. Here we will break down what each term means and how they relate to one another.
Data 
Data, which is the plural of the word “datum”, are basically just facts. These facts have not been processed or dealt with and are in their rawest form. Because of this raw and possibly unorganized form, data may sometimes appear random, overly simple, or abstract. Think of data as the individual pieces of a jigsaw puzzle. While you may not know exactly what you’re looking at (assuming you didn’t already look at the box the puzzle came in), you at least have an idea of what this one little part may be. Data alone and without context, like a solitary puzzle piece, is practically worthless.
Data can be further broken down into both qualitative or quantitative. Qualitative data can be observed but not measured, and deals with aspects that may be observed by the senses, i.e. color, texture, smell, taste, appearance, etc. Quantitative data is data that deals with numbers and can be measured. Criteria such as length, height, area, volume, weight, time, temperature, speed, cost, age, etc. are all considered quantitative in nature. Take, for example, a cup of coffee. The qualitative data is medium roast, strong aroma, nutty flavor, hot to the touch. The quantitative data would include its cost ($1.00), its volume (25 oz.), and its temperature (100 degrees).
In the world of computing, the concept of data is ubiquitous. It can be represented in many different ways, including tables, data trees, and graphs, among others. Data is the information that is input into the computer as quantities, characters, and symbols, then operations are performed on these data and stored as electrical signals then recorded on magnetic, optical, or mechanical recording media. A computer program’s component parts are just sets of data that are made up of coded software instructions that control the operations of a computer.This analytics course will help you work with data better as well as perform analytics better.
Information
Information is knowledge that has used and processed certain data and has rendered it useful. Using the analogy begun in the section above, information is the whole completed puzzle that the little data puzzle pieces helped you to put together. Without data there is no information – you can’t put the puzzle together if there are no pieces, or if some of the pieces are missing.
Another difference between information and data is that information is a snapshot of certain data at a single point. Data will always change as there is always more coming in. Also, data is always correct – it is a tidbit of truth, a thing that has happened. However, information can be wrong.
Information, like data, is a term that has applications when dealing with computers. If data are the tidbits that are put into the computer, it’s information that comes out as a result. If a company’s marketing department inputs data culled from their customers, their program is able to give them pertinent information based on the data it was given.This data-driven marketing course will show you how to integrate marketing with data extraction.
Knowledge
The concepts of data and information and how they relate to each other would be incomplete without mentioning the concept of knowledge. Data becomes information, which in turn is processed as knowledge, then finally manifested in a physical way as decisions and actions. Sometimes when data are missing and the information is incomplete, a person may make an assumption, where basically they fill in the blanks of the missing data. Each of these concepts are integral to the other two and without one, the others would cease to exist. This flow chart will help you visualize the processing of data.

Examples

Here are a few real world examples that illustrate the difference between data and information.
1. Data: Every few years, the government takes a census, gathering information from citizens such as yearly income, age, race, and location, among many other criteria.
Information: Alone, these bits of data are practically meaningless: 2376 San Carlos Ave., $47,000 a year, Caucasian. However, when processing this data into valuable information, the government is able to figure out pertinent statistics such as unemployment rates, average income for different parts of the state or city and other important things that have real world applications.
2. Data: A student is applying to college and she gives the college’s admissions office many pieces of info: name, address, grades, absences, letters of recommendation, etc.
Information: While the admissions office may be impressed by one A+ the student receive on a Biology project, it means nothing on its own. The student may have cheated on that project and have terrible grades otherwise. They would never be accepted to a school based on one piece of data. The school must assess ALL of the student’s data, including teachers’ opinions of them, how much school they missed, GPA, etc. Then the school is able to process the disparate data and make a decision based on this information.
So that’s data and information in a nutshell. Surely you can see why the two may get mixed up and are erroneously used as synonyms for each other, but hopefully you now know the difference between the two and will use them correctly. As important is data may be, it means nothing when not analyzed and processed into information and later a decision. Conversely, information means zilch when not backed up with data. Now go out into the world with this data, analyze it, and make good decisions based on this information!

Sunday, 9 February 2014

Who decides which child will live: God or a mother?


“A mother, desperate to escape Somalia's famine, alternated carrying each of her two children until they all became so weak that she could only carry one.
“She looked down at her two children and said a prayer – then, she made the excruciating decision to leave one of them behind so she could save the other.” [USAID Administrator, Rajiv Shah]
“Were they somehow lesser than our sons and daughters? Did their father love them less? Did their mother? Did God?” Shah asked more than 3,000 guests from 100 nations at the National Prayers Breakfast in Washington on Feb. 6. Nobody had an answer.

2011 East Africa drought
Somalia, Djibouti, Ethiopia, Kenya, Uganda
Total deaths: 50,000 to 260,000
Many refugees from southern Somalia fled to neighboring Kenya and Ethiopia, where crowded, unsanitary conditions together with severe malnutrition led to a large number of deaths.

Two women came to King Solomon with an infant. One claimed that the other, after accidentally smothering her own son, had exchanged the two children to make it appear that the living child was hers. The other woman denied this and said she was the real mother.
Asked to decide the dispute, Solomon unsheathed a sword and said: “Divide the child in two, and give half to the one, and half to the other.”
One woman cried out: “Oh, my lord, do not slay the child. Give it to her.”
The other said: “It shall be neither mine nor yours; divide it.”
The king watched both and declared: “Give the child to the first woman. She is the real mother.”
And all of Israel heard of the judgment; they feared the king and praised God.
The Somali children were not so lucky. They were two but had only one mother, emaciated by days of hunger, thirst and fatigue. Habiba was already weak when she left home for a camp built for the refugees of the 2011 famine in East Africa. She had some food and water but she knew this was not enough for this long journey. Yet, it was better than staying at home and waiting for death. So she decided to take the chance.
She walked through a parched land. For miles, there was no water. There were some clouds in the sky but they were useless. They offered no shelter against the scorching sun and never brought rains.
Habiba walked slowly, holding one son in each arm. Her arms – just bone and skin – were like the dried branches of a palm tree. Although her babies were as emaciated as their mother, they weighed heavily on her weak body.
But this was a labour of love. So Habiba carried them, with tired limbs but a strong heart. When exhausted, she would stop, take a sip – yes, just one sip – from the bottle she was carrying, and start walking again. A drop of water and a tiny piece of stale bread is all they could afford.
At each stop, Habiba first fed her babies and then took her share, just enough to continue the journey. Food, they had little but the babies received plenty of hugs and kisses at each stop.
Once a baby slipped from her arms and fell on the sand, which was hot but soft. Habiba fell on her knees, picked up the baby and broke down. She could hear herself cry but felt no tears. She did not have enough water in her to bring out tears.
Habiba rested a while. Then held the two babies tightly and started walking again. Hunger, fatigue and thirst slowed her pace. What started as a walk; became a crawl. But she did not stop.
She knew the desert was cruel and the sun unrelenting. And the two together could dry the life out even from a well-fed – and well-watered – person. She and her children had had very little to eat or drink. Hunger kills too, as did thirst, probably faster.
So Habiba could not stop or relax. She kept pressing on. But exhaustion forced her – more often than she would have liked to – to rest. Yet, she compelled herself to get up and move on.
Habiba had no strength left but still had a strong desire to make it to the refugee camp. Not because she was afraid of death. Although she was still in her 20s, she had seen enough deaths to know that those born on the other side of the rich-poor divide often die young.
But Habiba knew that her babies were still too young to die. She wanted to give them another chance to live, to go to a better place where they could at least get one meal a day and enough water to quench their thirst. She did not desire more.
So Habiba did not stop. She walked and crawled and fell on the sand, but never let her babies slip out of her arms. “No, no, no. No harm should come to them,” she said to herself. “They must live.”
But the babies fell from her arms again. First the one in the left arm slipped. Then, the one in the right. She picked both and resumed the journey. But they fell again.
Habiba stopped. Took a few sips from the water bottle. Chewed a few pieces of bread. Actually, this time she allowed herself to take a larger share than she gave her babies. She knew she needed some strength, for their sake.
This gave her enough energy to walk another 100 yards or so. But she had to stop again.
Habiba got up, walked and fell. Paused. Walked. And fell again. It became a pattern: Pause, walk, fall.
Once Habiba felt that she did not have her babies in her arms. She looked back and saw them lying at a distance. Suddenly, she had a surge of strength. She ran back, picked them up and broke down.
Habiba tried to walk but the babies slipped out of her arms again.
She realised that this journey could not continue like this. All three would not make it to the camp. If she insisted on doing so, all three would perish. Now, she could only carry one baby with her, not two.
Habiba had to stop being a mother and take a decision only God should: who will live, who will die. She looked down at her two children and said a prayer.
But a mother can only be a mother, not God. So she collapsed before she could decide.
She is at a refugee camp now, with only one child. Who decided then which child would live: God or a mother?