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 ikr = { | |
partFactorial: function (self) { | |
return (function (n) { | |
return ( | |
(0 === n)? 1 : (n * (self(self))(n - 1)) | |
); | |
}); | |
}, | |
factorial: function (n) { |
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 identity = function (x) { | |
return x; | |
}; | |
var almost_factorial = function (f) { | |
return function (n) { | |
return ( | |
(0 === n)? | |
1 : | |
(n * f(n - 1))); |
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 (f) { | |
return function (self) { | |
return function (x) { | |
return f(self(self))(x); | |
}; | |
}( | |
function (self) { | |
return function (x) { | |
return f(self(self))(x); | |
}; |
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 factorial = function (n) { | |
return (n? n * factorial(n - 1) : 1); | |
}; | |
var originalFactorial = factorial; | |
factorial = function() { return 0; }; | |
print(originalFactorial(5)); // 0 |
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 factorial = function f(n) { | |
return (n? n * f(n - 1) : 1); | |
}; | |
var originalFactorial = factorial; | |
factorial = function() { return 0; }; | |
print(originalFactorial(5)); // 120 |
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
#!/bin/sh | |
for f in $(find -type f .) | |
do | |
echo "" > $f | |
done |
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 undefined = 1; | |
(function (undefined) { | |
print(undefined); // really undefined, not 1 | |
}()); |
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
export PS1="\[\033[38m\]\u@\h\[\033[01;34m\] \W \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[00m\]$\[\033[00m\] " |
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
sudo dseditgroup -o edit -a ikr -t user _www |
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
typedef struct { | |
item_type q[PQ_SIZE+1]; /* body of queue */ | |
int n; /* number of queue elements */ | |
} priority_queue; | |
pq_parent(int n) { | |
if (n == 1) return(-1); | |
else return((int) n/2); | |
} |
OlderNewer