This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getTrilateration(position1, position2, position3) { | |
| var xa = position1.x; | |
| var ya = position1.y; | |
| var xb = position2.x; | |
| var yb = position2.y; | |
| var xc = position3.x; | |
| var yc = position3.y; | |
| var ra = position1.distance; | |
| var rb = position2.distance; | |
| var rc = position3.distance; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function random_text( $type = 'alnum', $length = 8 ) | |
| { | |
| switch ( $type ) { | |
| case 'alnum': | |
| $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| break; | |
| case 'alpha': | |
| $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| break; | |
| case 'hexdec': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def datetime2stamp(year, month, day, hour, minute, second): | |
| timestamp = 0 | |
| for y in range(year - 1, 1969, -1): | |
| if is_leap_year(y): | |
| day += 366 | |
| else: | |
| day += 365 | |
| month_day = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334] |
NewerOlder