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
var sys = require('sys'); | |
var Euler1 = function() { | |
var useNumber = function(num) { | |
if((num % 3)==0) return true; | |
if((num % 5)==0) return true; | |
return false; | |
} | |
var getResult = function() { |
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
var sys = require('sys'); | |
var Euler2 = function() { | |
var isEven = function(num) { | |
if((num % 2)==0) return true; | |
return false; | |
} | |
var calcEvenFibonacci = function(max) { | |
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
var sys = require('sys'); | |
var Euler3 = function() { | |
var isPrimeNumber = function(num) { | |
//1 is NOT a prime number | |
if(num == 1) return false; | |
//2 is a prime number. | |
if(num == 2) return true; | |
//Exit early for even numbers (except 2 which is the only equal prime number). |
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
var sys = require('sys'); | |
var Euler4 = function() { | |
var isPalindromicNumber = function(num) { | |
var digitString = num.toString(); | |
var reverseString = digitString.split('').reverse().join(''); | |
return (digitString==reverseString); | |
} |
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
cd /the/git/repo/directory | |
svn export svn+ssh://[email protected]/repo/dir . --force | |
git add * | |
git commit -m "Initial import from subversion" | |
git push |
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
var sys = require('sys'); | |
var Euler5 = function() { | |
var factorial = function(num) { | |
var res = 1; | |
for(var i=num;i>1;i--) { | |
res = i*res; | |
} | |
return res; | |
} |
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
Search | |
(.)*(".*")(,)(".*")((ht|f)tp:\/\/w{0,3}[a-zA-Z0-9_\-.:#/~}]+)(",")((ht|f)tp:\/\/w{0,3}[a-zA-Z0-9_\-.:#/~}]+)(.)*([0-9]{8}) | |
Replace | |
mkdir $11\ncd $11\nwget $5\nwget $8\ncd .. |
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
public function testGetRomanNumeral() | |
{ | |
$this->assertEquals('M', $this->object->getRomanNumeral(1000)); | |
$this->assertEquals('C', $this->object->getRomanNumeral(100)); | |
$this->assertEquals('X', $this->object->getRomanNumeral(10)); | |
$this->assertEquals('I', $this->object->getRomanNumeral(1)); | |
$this->assertEquals('D', $this->object->getRomanNumeral(500)); | |
$this->assertEquals('L', $this->object->getRomanNumeral(50)); | |
$this->assertEquals('V', $this->object->getRomanNumeral(5)); |
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
public function testGetNumber() | |
{ | |
$this->assertEquals(1000, $this->object->getNumber('M')); | |
$this->assertEquals(100, $this->object->getNumber('C')); | |
$this->assertEquals(10, $this->object->getNumber('X')); | |
$this->assertEquals(1, $this->object->getNumber('I')); | |
$this->assertEquals(500, $this->object->getNumber('D')); | |
$this->assertEquals(50, $this->object->getNumber('L')); | |
$this->assertEquals(5, $this->object->getNumber('V')); | |
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
using terms from application "Quicksilver" | |
on open thefiles | |
repeat with afile in thefiles | |
set afile to afile as text | |
tell application "VLC" | |
activate | |
OpenURL afile | |
play | |
fullscreen | |
end tell |
OlderNewer