Wednesday, 24 February 2016

Telephone Local Loop

What is a 'Local Loop'?

The Local Loop in a telephone network (sometimes referred to as the "last mile" of the network) is
the bit that connects your home to your local telephone exchange. It refers literally to the copper
cables that run from your home to the telephone exchange.

Tuesday, 23 February 2016

Dynamic Array in PHP

     The array is a collection of similar data types which occupies continuous location in memory. There are two types of array static and dynamic. In dynamic array size can be decreased and increase as requirement which best uses of memory utilization on the other hand static array is fixed in nature you cannot increase and decrease array capacity when require so it’s not popular in PHP. We deal with mostly dynamic array in PHP.

Dynamic Array example code :

<?php

$ar=array("Red","Green","Blue");
for($i=0;$i<count($ar);$i++)
{
echo  "<br>" . ($i+1) . "'st element value " . $ar[$i];
}
?>

Example 2:

$ar[]="";
for ($i = 0; $i <$10; $i++)
{
array_push($ar,$i);
}

for($i=0;$i<count($ar);$i++)
echo "<h2>" . $ar[$i] . "</h2>";

Monday, 22 February 2016

Thrashing

     If the number of frames allocated to a low-priority process falls below the minimum number required by the computer architecture, we must suspend that process's execution. We should then page out its remaining pages, freeing all its allocated frames. This provision introduces a swap-in, swap-out level of intermediate CPU scheduling.

     In fact, look at any process that does not have "enough" frames. If the process does not have the number of frames it needs to support pages in active use, it will quickly page-fault. At this point, it must replace some page. However, since all its pages are in active use, it must replace a page that will be needed again right away. Consequently, it quickly faults again, and again, and again, replacing pages that it must bring back in immediately.

     This high paging activity is called thrashing.A process is thrashing if it is spending more time paging than executing.

Reason of Thrashing

     Thrashing results in severe performance problems. Consider the following scenario, which is based on the actual behavior of early paging systems.

SHA1 PHP encryption function

SHA1 accept a string as a key and return hash string which is encrypted. For decryption key is required, which is used in the encryption.

Syntax

string sha1 ( string $str [, bool $raw_output = false ] )

If the optional raw_output is set to TRUE, then the sha1 digest is instead returned in raw binary format with a length of 20, otherwise the returned value is a 40-character hexadecimal number.