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 primeFactors(numberToFactor) { | |
var factors = [], | |
divisor = 2, | |
remainder = numberToFactor; | |
while (remainder >= 2) { | |
if (remainder % divisor === 0) { | |
factors.push(divisor); | |
remainder = remainder / divisor; | |
} |
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 primeFactors(n){ | |
var f = [], i = 0, d = 2; | |
for (i = 0; n >= 2; ) { | |
if(n % d == 0){ | |
f[i++]=(d); | |
n /= d; | |
} | |
else{ | |
d++; |
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 processBatch(bool $useLogin, bool $deleteEntries, bool $beforeToday ){ | |
/... | |
} |
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
<? | |
final class SocialNetworkProfile { | |
private $userName; | |
private $friends; // friends is a reference to a large collection | |
private $feed; // feed references the whole user feed | |
public __construct($userName , $friends, UserFeed $feed) { | |
$this->assertUsernameIsValid($userName); |