function luhn_check($number)
{
/* Luhn algorithm number checker - (c) 2005-2008 - planzero.org *
* This code has been released into the public domain, however please *
* give credit to the original author where possible. */
// Strip any non-digits (useful for credit card numbers with spaces and hyphens)
$number=preg_replace('/\D/', '', $number);
// Set the string length and parity
$number_length=strlen($number);
$parity=$number_length % 2;
// Loop through each digit and do the maths
$total=0;
for ($i=0; $i<$number_length; $i++) {
$digit=$number[$i];
// Multiply alternate digits by two
if ($i % 2 == $parity) {
$digit*=2;
// If the sum is two digits, add them together (in effect)
if ($digit > 9) {
$digit-=9;
}
}
// Total up the digits
$total+=$digit;
}
// If the total mod 10 equals 0, the number is valid
return ($total % 10 == 0) ? TRUE : FALSE;
}
[ view entry ] ( 2115 views ) | print article
This tutorial shows how to get basic information(such as network number and first IP address) given an IP/subnet-mask address.
See related link or go to:
http://www.angelcool.net/tutorials/cisc ... d_Mask.pdf
[ view entry ] ( 1915 views ) | print article | related link
Interview question. For this we need the modulus operator: %
In computing, the modulo operation finds the remainder of division of one number by another.
//Remainder of $a divided by $b
//$a % $b
//echo (5 % 3)."\n"; // prints 2
So,
//main logic
if($number % 3 ==0)
//No remainder(nothing left after division).Number is multiple of 3.
[ view entry ] ( 1544 views ) | print article
//Interview question
#input:
num1=50;
num2=100;
#core logic
num1 = num1 + num2;
num2 = num1 - num2;
num1 = num1 - num2;
#output
num1 is 100
num2 is 50
[ view entry ] ( 1542 views ) | print article
802.11b (wireless)
802.11g (wireless)
802.11a (wireless)
802.1i (WPA2)
802.1q (trunk protocol)
802.1d (STP protocol)
802.1w (RSTP protocol)
802.1s (MIST|MST|MSTP. Feature that creates an instace of RSTP (802.1w) for each VLAN)
802.3ab (1000BASE-T)
802.3z (1000BASE over fiber optic)
802.3af (PoE)
802.1p (layer 2 QoS)
802.1x (switch port-based authentication, AAA, radius)
[ view entry ] ( 1689 views ) | print article
My To Do list:
Short term goals:
- Electronics and Computer Engineering Technology A.S.
- Master CCNP routing/switching (CCIE ?)
- English vocabulary section (blog)
- Keep on updating tutorial section
Long term goals:
- CCDA (CCDP ? CCDE ?)
- CCNA Wireless (CCNP ?)
- CCNA Voice (CCNP ?)
- Computer Science/Software Engineer B.S.
- Renew real estate license (for site below ;).
- paylesstosell.com
- asp.net/C#/mono
- APIs: ebay,facebook,amazon,google, etc.
..maybe more
[ view entry ] ( 2151 views ) | print article
http://www.gnu.org/manual/manual.html
Useful link to see what GNU apps are available.
[ view entry ] ( 1587 views ) | print article
Find me in Facebook.
http://www.facebook.com/angelestebancool
[ view entry ] ( 1790 views ) | print article
This tutorial connects two layer-2 switches through a wireless link. Excellent setup when needing to connect a remote location and cabling is not an option.
See related link to open PDF, or go to:
http://www.angelcool.net/tutorials/cisc ... _Setup.pdf
[ view entry ] ( 1646 views ) | print article | related link
foreach ($array as $key => $value)
{
//code block statements that run inside foreach loop
}
[ view entry ] ( 1621 views ) | print article
<<First <Back | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Next> Last>>