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 is_ancestor_of?(other_page) | |
other_page.is_descendant_of? self | |
end |
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
<html> | |
<head> | |
<title> ¡Hola! </title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var server = io.connect('http://localhost:8080'); | |
document.onkeypress = manda; | |
function manda(event) { |
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
/* Este factorial es recursivo, pero operamos de alguna forma la | |
* llamada recursiva (la multiplicamos por n). | |
*/ | |
long factorial(long n) { | |
if (n == 0) { | |
return 1; | |
} | |
else { | |
return n * factorial(n-1); |
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
-- http://www.jasq.org/2/post/2012/05/inverse-fizzbuzz.html | |
import Control.Applicative -- para <*> | |
import Data.List -- para sortBy | |
import qualified Data.Map as M | |
divides m n = n `mod` m == 0 | |
fizzbuzzTest n = [divides 3, divides 5] <*> [n] |
NewerOlder