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
| ################ Scheme Interpreter in Python | |
| ## (c) Peter Norvig, 2010; See http://norvig.com/lispy2.html | |
| ################ Symbol, Procedure, classes | |
| from __future__ import division | |
| import re, sys, StringIO | |
| class Symbol(str): pass |
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://redd.it/2zna5q | |
| * Fibonacci example: | |
| * (1) (2) + | |
| * 0:0 | |
| * 1:1 | |
| * 20 | |
| */ | |
| #define _BSD_SOURCE // MAP_ANONYMOUS | |
| #include <stdio.h> | |
| #include <stdlib.h> |
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://redd.it/2z68di */ | |
| #define _BSD_SOURCE // MAP_ANONYMOUS | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <sys/mman.h> | |
| #define PAGE_SIZE 4096 |
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
| #!/usr/bin/python3 | |
| # By Steve Hanov, 2011. Released to the public domain. | |
| # Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article. | |
| # | |
| # Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata." | |
| # Computational linguistics 26.1 (2000): 3-16. | |
| # | |
| # Updated 2014 to use DAWG as a mapping; see | |
| # Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies", | |
| # Software-Practice and Experience 1993 |
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 bicgstabell(K::KrylovSubspace; tol::Real, l::Int=1) | |
| k=-l | |
| initrand!(K) | |
| #XXX Choose r̃[0] | |
| r[0]=b-nextvec(K) | |
| u[-1]=0 | |
| x[0]=K.v0 | |
| ρ₀=1 | |
| α=0 | |
| ω=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
| // Answer to https://github.com/ry/http-parser/issues/#issue/1 | |
| // UNTESTED | |
| struct line { | |
| char *field; | |
| size_t field_len; | |
| char *value; | |
| size_t value_len; | |
| }; |