This file contains 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 gcd_recursive($a, $b){ | |
/* computes and returns the greatest common divisor between a and b */ | |
/* | |
* Binary GCD Algorithm, according to Wikipedia "binary GCD can be about 60% | |
* more efficient (in terms of the number of bit operations) on average than the Euclidean algorithm". | |
* More about the Binary GCD Algorithm: http://en.wikipedia.org/wiki/Binary_GCD_algorithm | |
* Java Implementation: http://introcs.cs.princeton.edu/java/23recursion/BinaryGCD.java.html | |
* C++ Implementation: https://gist.github.com/cslarsen/1635213 |
This file contains 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 binary_gcd($a, $b){ | |
/* computes and returns the greatest common divisor between a and b */ | |
/* | |
* Binary GCD Algorithm, according to Wikipedia "binary GCD can be about 60% | |
* more efficient (in terms of the number of bit operations) on average than the Euclidean algorithm". | |
* More about the Binary GCD Algorithm: http://en.wikipedia.org/wiki/Binary_GCD_algorithm | |
* Java Implementation: http://introcs.cs.princeton.edu/java/23recursion/BinaryGCD.java.html | |
* C++ Implementation: https://gist.github.com/cslarsen/1635213 |
This file contains 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 get_User($url){ | |
/***************************************************************** | |
* Retrieves the user from a paste | |
* -> This function is a bit hacky and doesn't have the best design | |
******************************************************************/ | |
$str = file_get_contents($url); | |
if(strlen($str) > 0){ | |
preg_match('/\<div class="paste_box_line2"\>(.*)\<\/div\>/', $str, $user); | |
$pieces = explode(' ', $user[1]); | |
if ($pieces[2]!='guest'){ |
NewerOlder