- In Synchronous Transmission data is transferred in the form of frames on the other hand in Asynchronous Transmission data is transmitted 1 byte at a time.
- Synchronous Transmission requires a clock signal between the sender and receiver so as to inform the receiver about the new byte. Whereas, in Asynchronous Transmission sender and receiver does not require a clock signal as the data sent here has a parity bit attached to it which indicates the start of the new byte.
- Data transfer rate of Asynchronous Transmission is slower than that of Synchronous Transmission.
- Asynchronous Transmission is simple and economic whereas, Synchronous Transmission is complex and expensive.
- Synchronous Transmission is efficient and has lower overhead as compared to the Asynchronous Transmission.
Thursday, 12 January 2017
Differences Between Synchronous and Asynchronous Transmission
Monday, 10 December 2012
Wednesday, 11 April 2012
Zend Setup through Command Line
1. You need zf.bat and zf.php files and Zend folder.
2. Create and folder with any name. Inside that folder create two folders (bin & library).
3. Put zf.bat and zf.php file inside the bin folder and put Zend folder inside library folder.
4. Open CMD and go to your php directory under xampp folder.
5. Run the following command, path to 'zf.bat file' create project 'path where you want to create your project'.
6. Your project is ready to use.
2. Create and folder with any name. Inside that folder create two folders (bin & library).
3. Put zf.bat and zf.php file inside the bin folder and put Zend folder inside library folder.
4. Open CMD and go to your php directory under xampp folder.
5. Run the following command, path to 'zf.bat file' create project 'path where you want to create your project'.
6. Your project is ready to use.
Thursday, 24 November 2011
Get the number of days between two dates.
$date1 = date('2011-11-01');
$date2 = date('2011-11-09');
echo (strtotime($date2) - strtotime($date1))/(60*60*24);
8 would be answer
$date2 = date('2011-11-09');
echo (strtotime($date2) - strtotime($date1))/(60*60*24);
8 would be answer
Tuesday, 6 September 2011
Monday, 13 June 2011
Run PHTML file as HTML in Dreamweaver
Go to the folder where the dreamweaver is installed...... (Try to install some other drive where the windows is not installed... due to admin permission problem)
Open Adobe dreamweaver CS3 (or whatever you installed).... and paste crack file (dreamweaver) here (overwrite the older one).
Go to configuration folder....
Then DocumentTypes...... Open MMDocumentTypes file .......... find php5 (it would be on two places).....
Just write ,phtml after php5 in both of the places........
Now you can check.... it will work fine.... :)
Open Adobe dreamweaver CS3 (or whatever you installed).... and paste crack file (dreamweaver) here (overwrite the older one).
Go to configuration folder....
Then DocumentTypes...... Open MMDocumentTypes file .......... find php5 (it would be on two places).....
Just write ,phtml after php5 in both of the places........
Now you can check.... it will work fine.... :)
Wednesday, 1 June 2011
Check all checkboxes through JQuery on a Checkbox event
//chkAllSub function calls on sub checkboxes click
//chkAll function calls on main checkbox
//.sub_chk is the class of sub checkboxes
//master is the ID of main checkbox
function chkAllSub()
{
$(".sub_chk").each(function(){
var chkboxLength = $("input.sub_chk").length;
if($("input.sub_chk:checked").length >= chkboxLength)
{
$("#master").attr('checked',true);
}
else
{
$("#master").attr('checked',false);
}
})
}
function chkAll()
{
if($("#master").is(':checked',true))
{
$(".sub_chk").attr('checked',true);
}
else
{
$(".sub_chk").attr('checked',false);
}
}
//chkAll function calls on main checkbox
//.sub_chk is the class of sub checkboxes
//master is the ID of main checkbox
function chkAllSub()
{
$(".sub_chk").each(function(){
var chkboxLength = $("input.sub_chk").length;
if($("input.sub_chk:checked").length >= chkboxLength)
{
$("#master").attr('checked',true);
}
else
{
$("#master").attr('checked',false);
}
})
}
function chkAll()
{
if($("#master").is(':checked',true))
{
$(".sub_chk").attr('checked',true);
}
else
{
$(".sub_chk").attr('checked',false);
}
}
Monday, 9 May 2011
Check all checkboxes through JQuery
$(document).ready(function(){
$(".checkall").click( function() {
$("input[type='checkbox']:not([disabled='disabled'])").attr('checked', true);
})
})
$(".checkall").click( function() {
$("input[type='checkbox']:not([disabled='disabled'])").attr('checked', true);
})
})
Find any part of string in another string & manipulate accordingly
<?php
$string = 'www.google.com';//string
$ss = strpos($string,'http://');//cheking whether the part of string exist in full string or not
if($ss!==false)//if exists
{
$string = $string;
}
else
{
$string = 'http://'.$string;
}
echo $string;//final string.
?>
$string = 'www.google.com';//string
$ss = strpos($string,'http://');//cheking whether the part of string exist in full string or not
if($ss!==false)//if exists
{
$string = $string;
}
else
{
$string = 'http://'.$string;
}
echo $string;//final string.
?>
Friday, 6 May 2011
Regular Expression in MySQL
WHERE phone REGEXP '[(]435[)]';
would return only phone numbers with (435), such as "1(435)555-5555".
would return only phone numbers with (435), such as "1(435)555-5555".
GroupConcat in MySql directly gives the output in required format as string
Language is column name and CountryLanguage is table name EnglishHindiPunjabiChineseSELECT GROUP_CONCAT(Language) As Languages FROM CountryLanguage;Output will be: English,Hindi,Punjabi,ChineseSELECT GROUP_CONCAT(Language SEPARATOR '-') As Languages FROM CountryLanguage; Output will be:
English-Hindi-Punjabi-ChineseWednesday, 4 May 2011
Get data through JSON
//Javascript Code
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("#sample").click(function(){
$.ajax({
type:'GET',
url :'testAjax.php',
success:function(msg)
{
var jvar = eval('(' + msg + ')');
alert(jvar.a);
alert(jvar.b);
}
})
})
})
</script>
//Sample Div
<div id="sample" style="cursor:pointer;>here</div>
//PHP request page
<?php
$arr = array('a'=>5,'b'=>8);
$encodedVal = json_encode($arr);
echo $encodedVal;
?>
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("#sample").click(function(){
$.ajax({
type:'GET',
url :'testAjax.php',
success:function(msg)
{
var jvar = eval('(' + msg + ')');
alert(jvar.a);
alert(jvar.b);
}
})
})
})
</script>
//Sample Div
<div id="sample" style="cursor:pointer;>here</div>
//PHP request page
<?php
$arr = array('a'=>5,'b'=>8);
$encodedVal = json_encode($arr);
echo $encodedVal;
?>
Fibonacci series in PHP
<?php
$first = 0;
$second = 1;
$n = 20; // number of times you want to print the value
print $first.'<br>'; // print the first value
for($i=1;$i<$n;$i++)
{
$final = $first + $second;
$first = $second;
$second = $final;
print $final.'<br>';
}
?>
$first = 0;
$second = 1;
$n = 20; // number of times you want to print the value
print $first.'<br>'; // print the first value
for($i=1;$i<$n;$i++)
{
$final = $first + $second;
$first = $second;
$second = $final;
print $final.'<br>';
}
?>
Sunday, 1 May 2011
To get the file extension
$filename = Name of the file
function findfileextension($filename)
{
if(strpos(strrev($filename), ".")===false)
{
return "";
}
else
{
$ipos = strpos(strrev($filename), ".");
$ext = substr($filename, -1*$ipos);
return $ext;
}
}
function findfileextension($filename)
{
if(strpos(strrev($filename), ".")===false)
{
return "";
}
else
{
$ipos = strpos(strrev($filename), ".");
$ext = substr($filename, -1*$ipos);
return $ext;
}
}
Thursday, 28 April 2011
Extract only numeric value from a string through Regular Expression
$TextVariable = 'Dummy54Da69ta';
$NumericVal = preg_replace("/[^0-9]+/","",$TextVariable);
echo $NumericVal;
$NumericVal = preg_replace("/[^0-9]+/","",$TextVariable);
echo $NumericVal;
Wednesday, 27 April 2011
Disable right click option
<!-- Include JQuery latest file -->
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});
</script>
Extract image from string
<?php
$contents = 'This is test content and an image tage after that. <img title="Dummy Image" src="http://www.warepin.com/wp-content/uploads/2010/03/sample-proposals-for-computer-hardware.jpg" alt="DummyImage" />
You will get the image from the string';
$pos = stripos($contents,'<img');
$posimg = stripos($contents, ">", $pos);
$final = substr($contents, $posimg+1);
echo $final; // Total content
$len = strlen($final);
$img = substr($contents, 0, -$len);
echo $img; // The image
?>
$contents = 'This is test content and an image tage after that. <img title="Dummy Image" src="http://www.warepin.com/wp-content/uploads/2010/03/sample-proposals-for-computer-hardware.jpg" alt="DummyImage" />
You will get the image from the string';
$pos = stripos($contents,'<img');
$posimg = stripos($contents, ">", $pos);
$final = substr($contents, $posimg+1);
echo $final; // Total content
$len = strlen($final);
$img = substr($contents, 0, -$len);
echo $img; // The image
?>
Break a long string containing no space
$text is a long string.
$text = "45353453453erfgdvdfbfgbfgbfgb";
$newtext = wordwrap($text, 8, "\n", true);
echo $newtext;
$text = "45353453453erfgdvdfbfgbfgbfgb";
$newtext = wordwrap($text, 8, "\n", true);
echo $newtext;
Subscribe to:
Posts (Atom)