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
| const char main[] = { | |
| 232, 0, 0, 0, 0, 89, 131, 193, | |
| 14, 186, 28, 0, 0, 0, 141, 65, | |
| 29, 255, 224, 109, 97, 105, 110, | |
| 32, 105, 115, 32, 117, 115, 117, | |
| 97, 108, 108, 121, 32, 97, 32, | |
| 102, 117, 110, 99, 116, 105, 111, | |
| 110, 46, 10, 195, 184, 4, 0, 0, 0, | |
| 187, 1, 0, 0, 0, 205, 128, 184, 1, | |
| 0, 0, 0, 187, 42, 0, 0, 0, 205, 128, |
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
| import Data.Map (Map, lookup, fromList) | |
| import Data.Maybe | |
| import Prelude hiding (lookup) | |
| type ParserState s = [s] -- Stack | |
| type ParserStateTransformer s = ParserState s -> ParserState s | |
| type ParsingTable s = Map (s, s) (ParserStateTransformer s) | |
| type ParsingError = String | |
| data Parser s = MakeParser (ParsingTable s) (ParserState s) |
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
| type CasoDePrueba = (String,Bool) | |
| type ListaDePruebas = [CasoDePrueba] | |
| type SuiteDePruebas = [(String, ListaDePruebas)] | |
| imprimirListaDePruebas :: ListaDePruebas -> (Integer, Integer) -> IO (Integer, Integer) | |
| imprimirListaDePruebas [] (total, pass) = do | |
| return (total, pass) | |
| imprimirListaDePruebas (t : ts) (total, passed) = do | |
| n <- imprimirCasoDePrueba t | |
| imprimirListaDePruebas ts (total+1, passed+n) -- querías contadores? tomá! |
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
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <cmath> | |
| #define forn(i, n) for(int i = 0; i < (n); ++i) | |
| #define FUNC(i) (*(dispatch[funcs[i]])) | |
| #define MFUNC(o) ([](double a, double b) { return a o b; }) | |
| using namespace std; |
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
| bool dbresult, loggerresult; | |
| if (!send(database, request)) dbresult = true; | |
| if (!send(logger, request)) loggerresult = true; | |
| if (dbresult || loggerresult) return -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
| from sage.combinat.sf.sfa import SFAElementary | |
| from sage.rings.all import PolynomialRing | |
| from sage.misc.misc import prod | |
| def is_symmetric(p): | |
| vars = p.variables() | |
| if len(vars) == 1: return True | |
| permutation = {} | |
| for i in range(len(vars)-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
| is_color(red). | |
| is_color(blue). | |
| is_color(yellow). | |
| is_color(ivory). | |
| is_color(green). | |
| is_person(englishman). | |
| is_person(spaniard). | |
| is_person(norwegian). | |
| is_person(japanese). |
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
| 2 | |
| 2 4 | |
| -A -B | |
| +A +B | |
| +A -B | |
| +B -A | |
| 3 6 | |
| +A -B |
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
| #include <list> | |
| #include <vector> | |
| #include <queue> | |
| #include <iostream> | |
| using namespace std; | |
| typedef unsigned int uint; | |
| typedef vector<list<uint>> adj_list; | |
| typedef vector<int> vint; |
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
| (function() { | |
| function GameOfLife(config) { | |
| this.width = Number(config.width || 400); | |
| this.height = Number(config.height || 300); | |
| this.rows = Number(config.rows || 80); | |
| this.cols = Number(config.cols || 120); | |
| this.cellHeight = this.height / this.rows; | |
| this.cellWidth = (this.width-1) / this.cols; |